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
Delete a PFS folder
function cot_pfs_deletefolder($userid, $folderid) { global $db, $db_pfs_folders, $db_pfs, $cfg; $sql = $db->query("SELECT pff_path FROM $db_pfs_folders WHERE pff_userid=".(int)$userid." AND pff_id=".(int)$folderid." LIMIT 1"); if($row = $sql->fetch()) { $fpath = $row['pff_path']; // Remove files $sql = $db->query("SELECT pfs_id FROM $db_pfs WHERE pfs_folderid IN (SELECT pff_id FROM $db_pfs_folders WHERE pff_path LIKE '".$fpath."%')"); while($row = $sql->fetch()) { cot_pfs_deletefile($row['pfs_id']); } $sql->closeCursor(); // Remove folders $sql = $db->query("SELECT pff_id, pff_path FROM $db_pfs_folders WHERE pff_path LIKE '".$fpath."%' ORDER BY CHAR_LENGTH(pff_path) DESC"); $count = $sql->rowCount(); while($row = $sql->fetch()) { if($cfg['pfs']['pfsuserfolder']) { @rmdir($pfs_dir_user.$row['pff_path']); @rmdir($thumbs_dir_user.$row['pff_path']); } $db->delete($db_pfs_folders, "pff_id='".(int)$row['pff_id']."'"); } $sql->closeCursor(); if($count > 0) { return TRUE; } else { return FALSE; } } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteFolder();", "public function deleteFolder(){\r\n\t\t$folder_key = $this->uri->segment(3);\r\n\r\n\t\t//Check if the folder exists\r\n\t\tif(!$this->DataModel->folderExists(array('public_key' => $folder_key), $this->authentication->uid) == TRUE){\r\n\t\t\t//Folder doesn't exist. Redirect to dashboard\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\t\t//Mark the folder as deleted\r\n\t\t$this->DataModel->updateFolder(array('public_key' => $folder_key), array('trash' => 1));\r\n\r\n\t\t//Redirect to the folders parent\r\n\t\t$folder = $this->DataModel->getFolderInfo(array('public_key' => $folder_key));\r\n\r\n\t\t$this->successMessage($this->lang->line('success_folder_deleted'));\r\n\r\n\t\tif($folder['parent'] == 0){\r\n\t\t\tredirect('/dashboard');\r\n\t\t}else{\r\n\t\t\t$parent = $this->DataModel->getFolderInfo(array('id' => $folder['parent']));\r\n\t\t\tredirect('folders/'.$parent['public_key']);\r\n\t\t}\r\n\r\n\t}", "public function deleteFolder() {\n $folder=SnippetFolder::get()->byID(intval(str_replace('folder-', '', $this->request->getVar('ID'))));\n if(empty($folder) || $folder===false || $folder->ID==0) {\n $this->response->setStatusCode(404, _t('CodeBank.FOLDER_NOT_FOUND', '_Folder could not be found'));\n return;\n }\n \n \n $folder->delete();\n \n return 'HELO';\n }", "function deleteFolder($folder)\r\n\t{\r\n\t\t$folder = sanitizePath($folder);\r\n\t\t$path = $this->library->getLibraryDirectory() . DIRECTORY_SEPARATOR . $folder;\r\n\t\r\n\t\tif (file_exists($path))\r\n\t\t\trmdir($path);\r\n\t\t$folder->delete();\r\n\t}", "function delete_folder($folder) {\n\t\t// init\n\t\t$url \t= '';\n\n\t\t// if passed a full absolute folder\n\t\tif(is_dir($folder)) {\n\t\t\t$url = $folder;\n\t\t}\n\t\t\n\t\t// add root to folder\n\t\tif(is_dir(WWW_ROOT.$folder)) {\n\t\t\t$url = WWW_ROOT.$folder;\n\t\t}\n\t\t\n\t\t// valid url\n\t\tif($url!='') {\n\t\t\t// get files in folder\n\t\t\t$files = @scandir($url);\n\t\t\t// loop and delete files\n\t\t\tforeach($files as $k=>$v) {\n\t\t\t\tif(($v!='.' || $v!='..') && file_exists($url.'/'.$v)) {\n\t\t\t\t\t@unlink($url.'/'.$v);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// delete folder\n\t\t\trmdir($url);\n\t\t}\n\t}", "public function destroyFolder()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'];\n if (!file_exists($file)) die('File not found '.$file);\n if (!is_dir($file)) die('Not a folder '.$file);\n $h=opendir($file);\n while($f=readdir($h)) {\n if ($f!='.' && $f!='..') die('Folder is not empty');\n }\n closedir($h);\n rmdir($file);\n }", "function fm_delete_folder($dir, $groupid) {\r\n\tglobal $CFG, $USER;\r\n\t\r\n\t// if the dir being deleted is a root dir (eg. has some dir's under it)\r\n\tif ($child = get_record('fmanager_folders', 'pathid', $dir->id)) {\r\n\t\tfm_delete_folder($child, $groupid);\r\n\t} \r\n\t// Deletes all files/url links under folder\r\n\tif ($allrecs = get_records('fmanager_link', 'folder', $dir->id)) {\r\n\t\tforeach ($allrecs as $ar) {\r\n\t\t\t// a file\r\n\t\t\tif ($ar->type == TYPE_FILE || $ar->type == TYPE_ZIP) {\r\n\t\t\t\tfm_remove_file($ar, $groupid);\r\n\t\t\t} \r\n\t\t\t// removes shared aspect\r\n\t\t\tdelete_records('fmanager_shared', 'sharedlink', $ar->id);\t\t\t\t\t\r\n\t\t\t// Delete link\r\n\t\t\tdelete_records('fmanager_link', 'id', $ar->id);\r\n\t\t}\r\n\t}\r\n\r\n\t// delete shared to folder\r\n\tdelete_records('fmanager_shared', 'sharedlink', $dir->id);\t\r\n\r\n\tif ($groupid == 0) {\r\n\t\tif (!@rmdir($CFG->dataroot.\"/file_manager/users/\".$USER->id.$dir->path.$dir->name.\"/\")) {\r\n\t\t\terror(get_string('errnodeletefolder', 'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\tif (!@rmdir($CFG->dataroot.\"/file_manager/groups/\".$groupid.$dir->path.$dir->name.\"/\")) {\r\n\t\t\terror(get_string('errnodeletefolder', 'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\tdelete_records('fmanager_folders', 'id', $dir->id);\r\n\t\r\n}", "public function delete()\n {\n $filesystem = $this->localFilesystem(dirname($this->path));\n\n method_exists($filesystem, 'deleteDir')\n ? $filesystem->deleteDir(basename($this->path))\n : $filesystem->deleteDirectory(basename($this->path));\n }", "public function remove_dir() {\n\n $path = $this->get_upload_pres_path();\n\n //append_debug_msg($path);\n\n if(!$path || !file_exists($path)){ return; }\n delete_dir($path);\n }", "public static function deleteFolder($path) {\r\r\n\t\t\r\r\n\t\tif(file_exists($path)) {\r\r\n\t\t\t\r\r\n\t\t\t$album = dir($path); \r\r\n\t\t\t\r\r\n\t\t\twhile($dir = $album->read()) { \r\r\n\t\t\t\r\r\n\t\t\t\tif ($dir!= \".\" && $dir!= \"..\") { \r\r\n\t\t\t\t\t\tunlink($path.'/'.$dir); \r\r\n\t\t\t\t\t} \r\r\n\t\t\t\t} \r\r\n\t\t\t\r\r\n\t\t\t$album->close(); \r\r\n\t\t\t\r\r\n\t\t\trmdir($path);\r\r\n\t\t\t\t\t\r\r\n\t\t}\r\r\n\t\t\r\r\n\t}", "private function _do_delete() {\n\t\tif (g($_POST, 'delete')) {\n\t\t\tif (g($this->conf, 'disable.delete')) die('Forbidden');\n\t\t\t\n $path = g($this->conf, 'path');\n if (g($_POST, 'path'))\n $path = \\Crypt::decrypt(g($_POST, 'path'));\n \n $this->_validPath($path);\n \n\t\t\t$parent = dirname($path);\n\t\t\t\n\t\t\tif ($path == g($this->conf, 'type')) {\n\t\t\t\t$this->_msg('Cannot delete root folder', 'error');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ($this->_delete($this->_path($path))) {\n\t\t\t\t$this->_msg('Success delete ['.$path.']');\n\t\t\t\theader('location:'.$this->_url(['path' => $parent]));\n\t\t\t\tdie();\n\t\t\t} else {\n\t\t\t\t$this->_msg('Failed delete ['.$path.'] : please call your administator', 'error');\n\t\t\t}\n\t\t}\n\t}", "public function destroy(Folder $folder)\n {\n //\n }", "public function destroy(Folder $folder)\n {\n //\n }", "public function delete($id)\n {\n return $this->_driver->delete(\"/security/folder/$id\");\n }", "function delete_folder($main_folder)\r\n{\r\n \r\n\t$dir = $main_folder;\r\n \tchmod($dir, 0755);\r\n \t$di = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);\r\n \t$ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);\r\n \tforeach ( $ri as $file ) \r\n \t{\r\n \t $file->isDir() ? rmdir($file) : unlink($file);\r\n \t}\r\n \trmdir($dir);\r\n\r\n}", "public static function deleteFromFolder($path) {\r\r\n\t\t\r\r\n\t\tif(file_exists($path)) {\r\r\n\t\t\t\r\r\n\t\t\t$album = dir($path); \r\r\n\t\t\t\r\r\n\t\t\twhile($dir = $album->read()) { \r\r\n\t\t\t\r\r\n\t\t\t\tif ($dir!= \".\" && $dir!= \"..\") {\r\r\n\t\t\t\t\t\tunlink($path.'/'.$dir); \r\r\n\t\t\t\t\t} \r\r\n\t\t\t\t} \r\r\n\t\t\t\r\r\n\t\t\t$album->close(); \r\r\n\t\t\t\t\t\r\r\n\t\t}\r\r\n\t\t\r\r\n\t}", "public static function deleteFolder($path) {\n if (is_dir($path)) {\n return rmdir($path);\n } else {\n throw new Visio\\Exception\\FolderNotFound('Folder \\'' . $path . '\\' not found!');\n }\n }", "function delete_folder($json_path,$folder){\n\tif($folder == ''){\n\t\t$dir = $json_path;\n\t} else {\n\t\t$dir = $json_path.$folder.'/';\n\t}\n\tif(!file_exists($dir)){\n\t\treturn 'no exist';\n\t} else {\n\t\tif($folder != ''){\n\t\t\t$json = json_decode(file_get_contents($json_path.'_info.json'));\n\t\t\tfor($i = 0; $i < count($json); $i++){\n\t\t\t\tif($json[$i]->name == $folder){\n\t\t\t\t\tarray_splice($json,$i,1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$open = fopen($json_path.'_info.json','w');\n\t\t\tfwrite($open,json_encode($json));\n\t\t\tfclose($open);\n\t\t}\n\t\treturn removeDirectory($dir);\n\t}\n}", "abstract function delete_dir($filepath);", "function deleteFolder($user_dir){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'.$user_dir; // '.' for current\r\n\r\n\t\t\t\t\t\r\n\t\t\t}", "public function removePageFolder($path);", "protected function deleteFolder($property) {\r\n\r\n\t\t$arrRes\t\t= array();\r\n\t\t$bool\t\t= false;\r\n\r\n\t\t$this->property['id']\t= isset($property['id']) ? intval($property['id']) : 0;\r\n\r\n\t\tif ($this->property['id']) {\r\n\r\n\t\t\t// map_folder_tag\r\n\t\t\t$modelMapFolderTag\t\t\t= new Model_Map_Base('Sofav_Map_Folder_Tag',\r\n\t\t\t\t\t\t\t\t\t$this->property['id'], 'folder_id', 'tag_id');\r\n\t\t\t$arrRes['map_folder_tag']['res']\t= $modelMapFolderTag->clear();\r\n\r\n\t\t\t// map_folder_item\r\n\t\t\t$modelMapFolderItem\t\t\t= new Model_Map_Base('Sofav_Map_Folder_Item',\r\n\t\t\t\t\t\t\t\t\t$this->property['id'], 'folder_id', 'item_id');\r\n\t\t\t$arrRes['map_folder_item']['res']\t= $modelMapFolderItem->clear();\r\n\r\n\t\t\t// map_tab_folder\r\n\t\t\t$modelMapTabFolder\t\t\t= new Model_Map_Base('Sofav_Map_Tab_Folder',\r\n\t\t\t\t\t\t\t\t\t$this->property['id'], 'folder_id', 'tab_id');\r\n\t\t\t$arrRes['map_tab_folder']['res']\t= $modelMapTabFolder->clear();\r\n\t\t}\r\n\r\n\t\treturn\t$arrRes;\r\n\t}", "public function delete_folder($song_id)\n\t{\n\t\t$this->load->helper(\"file\"); // load the helper\n\t\t$path = \"data/music/songs/$song_id\";\n\t\tif (is_dir($path) ) {\n\t\t\tdelete_files($path, true); // delete all files/folders\n\t\t\treturn rmdir($path); // delete directory\n\t\t}\n\t}", "protected function processActionDeleteFolder()\n\t{\n\t\t$securityContext = $this->getSecurityContextByObject($this->folder);\n\t\tif(!$this->folder->canDelete($securityContext))\n\t\t{\n\t\t\t$this->sendJsonAccessDeniedResponse(Loc::getMessage('DISK_VOLUME_ERROR_BAD_RIGHTS_FOLDER'));\n\t\t}\n\n\t\t$cleaner = new Volume\\Cleaner($this->getUser()->getId());\n\n\t\tif (!$cleaner->isAllowClearFolder($this->folder))\n\t\t{\n\t\t\t$this->sendJsonAccessDeniedResponse(Loc::getMessage('DISK_VOLUME_ERROR_BAD_RIGHTS_FOLDER'));\n\t\t}\n\n\t\t$cleaner->startTimer();\n\n\t\tif(!$cleaner->deleteFolder($this->folder))\n\t\t{\n\t\t\tif ($cleaner->hasErrors())\n\t\t\t{\n\t\t\t\t$this->errorCollection->add($cleaner->getErrors());\n\t\t\t\t$this->sendJsonErrorResponse();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($cleaner->hasTimeLimitReached())\n\t\t\t\t{\n\t\t\t\t\t$this->sendJsonSuccessResponse(array(\n\t\t\t\t\t\t'timeout' => 'Y',\n\t\t\t\t\t\t'dropped_file_count' => $cleaner->getDroppedFileCount(),\n\t\t\t\t\t\t'dropped_file_version_count' => $cleaner->getDroppedVersionCount(),\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->sendJsonSuccessResponse(array(\n\t\t\t'message' => Loc::getMessage('DISK_VOLUME_FOLDER_DELETE_OK'),\n\t\t));\n\t}", "public function deleteParentFolder($parentFolder)\r\n\t{\r\n $current_path=\"../img/product/\".$this->ezpk($parentFolder);\r\n rmdir($current_path);//delete the Directory\r\n\t}", "public function del(){\n $status = new StatusTYPE();\n\t\t$path = str_replace($this->id.'.'.$this->ext, '', $this->getFull_Filename());\n \tif ( cmsToolKit::rmDirDashR( $path ) )\n $status = parent::del();\n else\n $status->setFalse('could not delete folder'); \n \n return $status;\n }", "public function testDeleteFolder()\n {\n $remoteFolder = \"TestData/In\";\n\n $localName = \"Book1.xlsx\";\n $remoteName = \"Book1.xlsx\";\n\n CellsApiTestBase::ready( $this->instance,$localName ,$remoteFolder . \"/\" . $remoteName , \"\");\n \n $request = new DeleteFolderRequest();\n $request->setPath( \"OutResult/Create\");\n $request->setStorageName( \"\");\n $request->setRecursive( 'true');\n $this->instance->deleteFolder($request);\n }", "public function delete($folder)\n {\n Horde_Kolab_Storage_Exception_Pear::catchError(\n $this->getBackend()->deleteMailbox($this->encodePath($folder))\n );\n }", "function deleteFolder($store, $folderentryid, $entryidlist, $action){\n\t\t\t$binEntryIdList = Array();\n\t\t\t\n\t\t\tforeach($entryidlist as $key => $value){\n\t\t\t\t$binEntryIdList[] = hex2bin($entryidlist[$key][\"entryid\"]);\n\t\t\t}\n\t\t\t\n\t\t\t$sfolder = mapi_msgstore_openentry($store, $folderentryid);\n\n\t\t\tforeach ($binEntryIdList as $key=>$folderlist){\n\t\t\t\tmapi_folder_deletefolder($sfolder, $folderlist, DEL_FOLDERS | DEL_MESSAGES | DELETE_HARD_DELETE);\n\t\t\t\t$result = (mapi_last_hresult()==NOERROR);\n\t\t\t\tif(!$result){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $result;\n\t\t}", "public static function deleteDirectory ($path) {\n\t\t\\rmdir($path);\n\t}", "private function delete_folder( $path ) {\n\t\tif ( is_dir( $path ) === true ) {\n\t\t\t$files = array_diff( scandir( $path ), array('.', '..') );\n\t\t\tforeach ( $files as $file ) {\n\t\t\t\t$this->delete_folder( realpath( $path ) . '/' . $file );\n\t\t\t}\n\t\t\treturn rmdir( $path );\n\t\t} else if ( is_file( $path ) === true ) {\n\t\t\treturn unlink( $path );\n\t\t}\n\t\treturn false;\n\t}", "public function deleteFolderPerm(){\r\n\t\t//Get the folder key\r\n\t\t$folder_key = $this->uri->segment(3);\r\n\r\n\t\t//Check if the folder exists\r\n\t\tif(!$this->DataModel->folderExists(array('public_key' => $folder_key), $this->authentication->uid) == TRUE){\r\n\t\t\t//Folder doesn't exist. Redirect to dashboard\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\t\t//Get more information about the folder\r\n\t\t$folderDetails = $this->DataModel->getFolderInfo(array('public_key' => $folder_key), $this->authentication->uid);\r\n\r\n\t\t//Ok, let's start to delete the folder...\r\n\t\t//First we need to check if there is any content in it\r\n\r\n\t\t//Get all folders in that folder\r\n\t\t$folderContent = $this->DataModel->getContent($folderDetails['id'], $this->authentication->uid);\r\n\r\n\t\t//Check if the folder is empty\r\n\t\tif(empty($folderContent['files']) && empty($folderContent['folders'])){\r\n\t\t\t//Simply delete the folder and redirect to the parent of that folder\r\n\t\t\t$this->DataModel->deleteFolder($folder_key);\r\n\r\n\t\t\t$this->successMessage[] = 'The selected folder was deleted successfuly';\r\n\t\t\t$this->save_messages();\r\n\r\n\t\t\t//Get the parent of that folder\r\n\t\t\tredirect('trashcan');\r\n\r\n\t\t\t$parentDetails = $this->DataModel->getFolderInfo(array('id' => $folderDetails['parent']), $this->authentication->uid);\r\n\t\t\tredirect('folders/'.$parentDetails['public_key']);\r\n\t\t}\r\n\r\n\t\t//Ok there's still content in that folder. Loop through all subfolders and get the files\r\n\t\t$this->allFiles = array();\r\n\t\t$this->allFolders = [$folderDetails['id']];\r\n\t\t$this->allFiles = $folderContent['files'];\r\n\r\n\t\t$this->findAllFiles($folderContent['folders']);\r\n\r\n\r\n\t\t//Ok, now load every storage engine that we need\r\n\t\t$storage_engines = array();\r\n\t\tforeach($this->allFiles as $file){\r\n\r\n\t\t\t//Load the storage engine\r\n\t\t\tif(!isset($storage_engines[$file['storage_engine']])){\r\n\t\t\t\t$storage_engines[$file['storage_engine']] = array();\r\n\r\n\t\t\t\t$storageDetails = $this->DataModel->storageEngine($file['storage_engine']);\r\n\r\n\t\t\t\t//Try to load the storage engine\r\n\t\t\t\ttry {\r\n\t\t\t\t\trequire_once(APPPATH.'libraries/storage/'.$storageDetails['library_name'].'/init.php');\r\n\t\t\t\t\t$storage_engines[$file['storage_engine']] = new $storageDetails['library_name']();\r\n\t\t\t\t\t$storage_engines[$file['storage_engine']]->connect();\r\n\t\t\t\t} catch (Exception $e) {\r\n\t\t\t\t\t$this->errorMessage($this->lang->line('error_storage_generic'));\r\n\t\t\t\t\tredirect('trashcan');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//Delete the file from the storage engine\r\n\t\t\ttry {\r\n\t\t\t\t$storage_engines[$file['storage_engine']]->delete($file['storage_name']);\r\n\t\t\t\t$storage_engines[$file['storage_engine']]->delete('thumb_'.$file['storage_name']);\r\n\t\t\t}catch (Exception $e){}\r\n\t\t\t//Delete the files from the database\r\n\t\t\t$this->DataModel->delete($file['storage_name']);\r\n\t\t}\r\n\r\n\r\n\t\t//Delete all folders from the database\r\n\t\tforeach($this->allFolders as $f){\r\n\t\t\t$this->DataModel->deleteFolderSearch(array('id' => $f));\r\n\t\t}\r\n\r\n\t\t$this->successMessage($this->lang->line('success_folder_deleted_perm'));\r\n\r\n\t\t//Get the parent of that folder\r\n\t\tredirect('trashcan');\r\n\r\n\t}", "function delFolder($dir) {\n\t\tforeach (scandir($dir) as $item) {\n\t\t\tif ($item == '.' || $item == '..') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n \t\t\tunlink($dir.DIRECTORY_SEPARATOR.$item);\n\n\t\t\t}\n\t\tLogger(\"INFO\", \"Removed directory $dir\");\n\t\trmdir($dir);\n\t}", "function delete($path);", "function delete() {\n global $USER;\n if($this->Dir !== 0 && $this->mayI(DELETE)) {\n $this->loadStructure();\n foreach($this->files as $file) {\n $file->delete();\n }\n foreach($this->folders as $folder) {\n $folder->delete();\n }\n rmdir($this->path);\n parent::delete();\n }\n }", "public function testDeleteDirectory()\n {\n $this->createTestDirectories(\n array(\n '/artifacts/foo/12345',\n '/artifacts/foo/67890',\n )\n );\n\n $this->createTestFile( '/artifacts/foo/12345/bar.txt' );\n $this->createTestFile( '/artifacts/foo/67890/bar.txt' );\n $this->createTestFile( '/artifacts/foo/bar.txt' );\n $this->createTestFile( '/artifacts/bar.txt' );\n\n phpucFileUtil::deleteDirectory( PHPUC_TEST_DIR . '/artifacts' );\n\n $this->assertFileNotExists( PHPUC_TEST_DIR . '/artifacts' );\n }", "public function silo_delete($path)\n\t{\n\t}", "public function delete()\n\t{\n\t\t$this->tossIfException();\n\t\t\n\t\t$files = $this->scan();\n\t\t\n\t\tforeach ($files as $file) {\n\t\t\t$file->delete();\n\t\t}\n\t\t\n\t\t// Allow filesystem transactions\n\t\tif (fFilesystem::isInsideTransaction()) {\n\t\t\treturn fFilesystem::delete($this);\n\t\t}\n\t\t\n\t\trmdir($this->directory);\n\t\t\n\t\t$exception = new fProgrammerException(\n\t\t\t'The action requested can not be performed because the directory has been deleted'\n\t\t);\n\t\tfFilesystem::updateExceptionMap($this->directory, $exception);\n\t}", "public function delete($path);", "public function delete($path);", "public function deleteFolder($folderName, $parent)\n {\n // TODO: Implement deleteFolder() method.\n }", "public function silo_delete($path)\r\n\t{\r\n\t}", "public function on_delete() {\n $this->remove_dir();\n }", "function deleteFileFolder($dbHandler, $param, $logHandler){\n\n if(valid($_SESSION[\"documentsURL\"])){\n /*\n Check eerst of het een bestand is of een map\n */\n\n // NOTE: for some reason, moet het bestandspad naar kleine letters.. Hier moet nog even naar worden gekeken!\n\n if(is_dir(strtolower($_SESSION[\"documentsURL\"].$param))){\n\n $param = makeUTF8($param);\n /*\n Zoja, check of het bestand leeg is\n */\n if (is_dir_empty($_SESSION[\"documentsURL\"].$param)) {\n /*\n Het mapje is leeg.\n */\n rmdir($_SESSION[\"documentsURL\"].$param);\n\n $logHandler->addMessage(\"Map \\\"\".$param. \"\\\" succesvol verwijderd.\");\n\n } else {\n /*\n Het mapje is niet leeg, verwijder alle bestanden.\n */\n return \"not_empty\";\n }\n } else {\n /*\n Het is een bestand\n */\n if(file_exists(strtolower($_SESSION[\"documentsURL\"].$param))){\n unlink($_SESSION[\"documentsURL\"].$param);\n\n // log\n $logHandler->addMessage(\"Map \\\"\".$param. \"\\\" met inhoud succesvol verwijderd.\");\n } else {\n // Hmm, lijkt erop dat er iets mis gaat.\n }\n }\n\n }\n\n }", "function directoryRemove($option){\n\tglobal $mainframe, $jlistConfig;\n\n $marked_dir = JArrayHelper::getValue($_REQUEST, 'del_dir', array());\n\n // is value = root dir or false value - do nothing\n if ($marked_dir == '/'.$jlistConfig['files.uploaddir'].'/' || !stristr($marked_dir, '/'.$jlistConfig['files.uploaddir'].'/')) {\n $message = $del_dir.' '.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_ROOT_ERROR');\n \t$mainframe->redirect('index.php?option='.$option.'&task=directories.edit',$message);\n } else {\n // del marked dir complete\n $res = delete_dir_and_allfiles (JPATH_SITE.$marked_dir);\n\n switch ($res) {\n case 0:\n $message = $marked_dir.'<br />'.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_MESSAGE_OK');\n break;\n case -2:\n $message = $marked_dir.'<br />'.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_MESSAGE_ERROR');\n break;\n default:\n $message = $marked_dir.'<br />'.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_MESSAGE_ERROR_X');\n break;\n } \n\t $mainframe->redirect('index.php?option='.$option.'&task=directories.edit',$message);\n\t}\n}", "public function deleteDir($dirname)\n {\n }", "public function delete($path, $root = NULL) {\n\n if (is_null($root)) $root = $this->root;\n $response = $this->http_oauthed($this->api_url . 'fileops/delete', array('path' => $path, 'root' => $root));\n return json_decode($response);\n\n }", "public function deleteAction()\n {\n $user = $this->getConnectedUser();\n\n $em = $this->getDoctrine()->getManager();\n\n $currentFolderId = null;\n\n $request = $this->get('request');\n if ($request->getMethod() == 'POST') {\n $foldersId = $request->request->get('foldersId');\n $foldersId = json_decode($foldersId);\n $filesId = $request->request->get('filesId');\n $filesId = json_decode($filesId);\n $currentFolderId = $request->request->get('currentFolderId');\n $permanentDelete = $request->request->get('permanentDelete');\n $permanentDelete = ($permanentDelete == \"true\") ? true : false;\n\n if (!is_null($filesId) && sizeof($filesId)>0) {\n $filesToDelete = $em->getRepository('TimeBoxMainBundle:File')->findBy(array(\n 'id' => $filesId,\n 'user' => $user\n ));\n foreach ($filesToDelete as $file) {\n if ($permanentDelete) {\n $user->setStorage(max($user->getStorage() - $file->getTotalSize(), 0));\n $em->persist($user);\n $em->remove($file);\n }\n else {\n $file->setIsDeleted(true);\n $file->setFolder();\n }\n }\n $em->flush();\n }\n\n if (!is_null($foldersId) && sizeof($foldersId)>0) {\n $foldersToDelete = $em->getRepository('TimeBoxMainBundle:Folder')->findBy(array(\n 'id' => $foldersId,\n 'user' => $user\n ));\n foreach ($foldersToDelete as $folder) {\n if ($permanentDelete) {\n $em->remove($folder);\n }\n else {\n $folder->setParent();\n $this->manageFolderContent($folder, true);\n }\n }\n $em->flush();\n }\n }\n\n $url = $this->get('router')->generate('time_box_main_file_deleted', array(\n 'folderId' => $currentFolderId\n ));\n return new Response($url);\n }", "public function testDeleteDirectory()\n {\n mkdir(self::$temp.DS.'foo');\n file_put_contents(self::$temp.DS.'foo'.DS.'file.txt', 'Hello World');\n\n Storage::rmdir(self::$temp.DS.'foo');\n\n $this->assertTrue(! is_dir(self::$temp.DS.'foo'));\n $this->assertTrue(! is_file(self::$temp.DS.'foo'.DS.'file.txt'));\n }", "public function cleanUpFolder()\r\n {\r\n $fs = new Filesystem();\r\n\r\n foreach($this->file_list as $file) :\r\n if ( preg_match('#^'.$this->destination_dir.'/#', $file))\r\n $fs->remove($file);\r\n endforeach;\r\n }", "public function delete_folder($folder) {\n\n // mailbox esists?\n $mailbox_idnr = $this->get_mail_box_id($folder);\n if (!$mailbox_idnr) {\n // mailbox not found\n return FALSE;\n }\n\n // ACLs check ('delete' grant required )\n $ACLs = $this->_get_acl(NULL, $mailbox_idnr);\n if (!is_array($ACLs) || !in_array(self::ACL_DELETE_FLAG, $ACLs)) {\n // Unauthorized!\n return FALSE;\n }\n\n // init folders container\n $folders_list = array(\n $mailbox_idnr => $folder\n );\n\n // get mailbox sub folders\n $sub_folders_list = $this->get_sub_folders($folder);\n\n // merge sub folders with target folder\n if (is_array($sub_folders_list)) {\n\n // loop sub folders\n foreach ($sub_folders_list as $sub_folder_idnr => $sub_folder_name) {\n\n // ACLs check ('delete' grant required )\n $ACLs = $this->_get_acl(NULL, $sub_folder_idnr);\n\n if (!is_array($ACLs) || !in_array(self::ACL_DELETE_FLAG, $ACLs)) {\n // Unauthorized!\n return FALSE;\n }\n\n // add sub folder to folders list\n $folders_list[$sub_folder_idnr] = $sub_folder_name;\n }\n }\n\n // start transaction\n if (!$this->dbmail->startTransaction()) {\n return FALSE;\n }\n\n // delete folders \n foreach ($folders_list as $folder_idnr => $folder_name) {\n\n // delete messages\n if (!$this->clear_folder($folder_name)) {\n // rollbalk transaction\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n\n // delete folder\n $query = \"DELETE FROM dbmail_mailboxes \"\n . \" WHERE mailbox_idnr = {$this->dbmail->escape($folder_idnr)} \";\n\n if (!$this->dbmail->query($query)) {\n // rollbalk transaction\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n\n // unset temporary stored mailbox_id (if present)\n if (!$this->unset_temp_value(\"MBOX_ID_{$folder_name}_{$this->user_idnr}\")) {\n $this->dbmail->rollbackTransaction();\n return FALSE;\n }\n }\n\n return ($this->dbmail->endTransaction() ? TRUE : FALSE);\n }", "function remove_dir($path) {\n\t\tif (file_exists($path) && is_dir($path))\n\t\t\trmdir($path);\n\t}", "public function removeDir($p){\n //remove / from last character\n if( substr($p, strlen($p)-1, 1) == '/' ) $p = substr($p, 0, strlen($p)-1);\n\n //check is dir\n if( is_dir($p) ){\n $files = scandir($p);\n\n foreach($files as $file){\n if( $file != '..' && $file != '.' ){\n if( !is_dir($p . '/' . $file) ) unlink($p . '/' . $file); else $this->removeDir($p . '/' . $file);\n }\n }//end foreach\n\n rmdir( $p );//remove empty folder\n }//end if\n\n return true;\n }", "public static function deleteFolder($dirname = null) {\n \n if(!isset($dirname) || $dirname == '') {\n throw new Exception(\"Path can't null!\", 500);\n }\n \n $path = UPLOADPATH . '/' . $dirname;\n \n if(!is_dir($path)) {\n $status['status'] = 'Folder '. $dirname .' not found!';\n $status['path'] = $path;\n \n return $status;\n die();\n }\n \n array_map('unlink', glob(\"$path/*.*\"));\n rmdir($path);\n \n $status['status'] = 'success';\n $status['path'] = UPLOADPATH . '/' . $dirname;\n \n return $status;\n }", "function deletedirectory($path)\n{\n $files = glob($path . '*', GLOB_MARK);\n foreach ($files as $file)\n {\n unlink($file);\n }\n rmdir($path);\n}", "public function DeleteFolder($id, $parentid) {\n ZLog::Write(LOGLEVEL_DEBUG, sprintf(\"BackendCalDAV->DeleteFolder('%s','%s')\", $id, $parentid));\n return false;\n }", "public function DeleteFolder($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "private function clearFolder()\n {\n foreach (File::allFiles(Auth()->user()->getPublicPath()) as $file) {\n File::delete($file);\n }\n return null;\n }", "public function destroy($id)\n {\n $file = File::findOrFail($id);\n $folder = $file->folder;\n\n $file->delete_file();\n $file->delete();\n\n return redirect(route('folders.show', $folder->id))->with(\n 'status', 'File successfully deleted.'\n );\n }", "public function destroy(Folder $folder)\n {\n $folder->delete();\n return response()->json(null, 204);\n }", "private function deleteFolderRecursively($path) {\n\t\t\t$path = self::folderPath($path);\n\t\t\t$handle = opendir($path);\n\t\t\t\n\t\t\tif (!$handle)\n\t\t\t\tthrow new ServiceException(\"REQUEST_FAILED\", \"Could not open directory for traversal (recurse): \".$path);\n\t\t \n\t\t while (false !== ($item = readdir($handle))) {\n\t\t\t\tif ($item != \".\" and $item != \"..\" ) {\n\t\t\t\t\t$fullpath = $path.$item;\n\t\n\t\t\t\t\tif (is_dir($fullpath)) {\n\t\t\t\t\t\t$this->deleteFolderRecursively($fullpath);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!unlink($fullpath)) {\n\t\t\t\t\t\t\tclosedir($handle);\n\t\t\t\t\t\t\tthrow new ServiceException(\"REQUEST_FAILED\", \"Failed to remove file (recurse): \".$fullpath);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tclosedir($handle);\n\t\t\t\n\t\t\tif (!rmdir($path))\n\t\t\t\tthrow new ServiceException(\"REQUEST_FAILED\", \"Failed to remove directory (delete_directory_recurse): \".$path);\n\t\t}", "public function delete($path)\n {\n }", "public function removeFolder(int $folderId): ApiInterface;", "public function deleteFolder($id = 0)\n {\n $folder = Folder::find($id);\n\n if ( File::findByFolder($id)->isEmpty() and Folder::findByParent($id)->isEmpty()) {\n $folder->delete($id);\n\n return $this->result(\n true,\n trans('files.folder_deleted', ['name'=>$folder->name]),\n $folder->name\n );\n\n } else {\n return $this->result(\n false,\n trans('files.folder_not_empty', ['name'=>$folder->name]),\n $folder->name\n );\n }\n }", "public function delete_with_dir() {\n if(!empty($this->username && $this->id)) {\n if($this->delete()) {\n $target = SITE_PATH . DS . 'admin' . DS . $this->image_path . DS . $this->username;\n if(is_dir($target)){\n $this->delete_files_in_dir($target);\n return rmdir($target) ? true : false;\n echo \"yes\";\n }\n }else{\n return true;\n }\n }else{\n return false;\n }\n }", "function delete_dir( $dir ) {\n\t\t$file_array = sb_folder_listing( $dir . '/', array( '.txt', '.gz' ) );\n\t\tif ( count( $file_array ) == 0 ) {\n\t\t\t// Directory is empty, delete it...\n\t\t\tsb_delete_directory( $dir );\n\t\t} else {\n\t\t\tfor ( $i = 0; $i < count( $file_array ); $i++ ) {\n\t\t\t\tsb_delete_file( $dir . '/' . $file_array[$i] );\n\t\t\t}\n\t\t\tsb_delete_directory( $dir );\n\t\t}\n\t}", "public function clear_folder($folder = null) {\n return $this->delete_message('*', $folder);\n }", "public function deleteObject($path)\n\t{\n\t\t// Re-authenticate if necessary\n\t\t$token = $this->getToken();\n\n\t\t// Get the URL to list containers\n\t\t$url = $this->getStorageEndpoint();\n\t\t$url = rtrim($url, '\\\\/');\n\t\t$path = ltrim($path, '\\\\/');\n\t\t$url .= '/' . $path;\n\n\t\t// Get the request object\n\t\t$request = new Request('DELETE', $url);\n\t\t$request->setHeader('X-Auth-Token', $token);\n\n\t\t$request->getResponse();\n\t}", "public static function delete_folder( $dir ) {\r\n\t\t\tif ( !is_dir( $dir ) ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif ( self::emtpy_folder( $dir ) ) {\r\n\t\t\t\t// sleep 1 second\r\n\t\t\t\t// when a folder contains sub folders it will take the OS time to update internally\r\n\t\t\t\t// without a sleep rmdir will throw a Warning that the folder could not be removed because its not empty\r\n\t\t\t\tsleep( 1 );\r\n\t\t\t\treturn rmdir( $dir );\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}", "public function delete($path)\n {\n $endpoint = 'https://api.dropboxapi.com/2/files/delete';\n $headers = [\n 'Content-Type: application/json'\n ];\n $postdata = json_encode(['path' => $path]);\n return Dropbox::postRequest($endpoint, $headers, $postdata);\n }", "public function deleteFolderContent($path){\n $path = rtrim($path, DIRECTORY_SEPARATOR);\n $files = glob($path . DIRECTORY_SEPARATOR . '*' ); // get all file names\n foreach($files as $file){ // iterate files\n if(is_dir($file)) {\n $this->deleteFolderContent($file);\n rmdir($file);\n } else {\n unlink($file);\n }\n }\n }", "public function doDelete($path);", "public function delete_output_dir($modeloutputdir, $uniqueid);", "function gttn_tpps_rmdir($dir) {\n if (is_dir($dir)) {\n $children = scandir($dir);\n foreach ($children as $child) {\n if ($child != '.' and $child != '..') {\n if (is_dir($dir . '/' . $child) and !is_link($dir . '/' . $child)) {\n gttn_tpps_rmdir($dir . '/' . $child);\n }\n else {\n unlink($dir . '/' . $child);\n }\n }\n }\n rmdir($dir);\n }\n}", "public static function delete (string $path, bool $sub = true): bool {\n $path = realpath($path);\n if (!is_dir($path)) {\n return unlink($path);\n }\n if (count(scandir($path)) <= 2) {\n return rmdir($path);\n }\n if (!$sub) {\n logger::write(\"tools::delete function used\\ndelete function cannot delete folder because its have subFiles and sub parameter haven't true value\",loggerTypes::ERROR);\n throw new bptException('DELETE_FOLDER_HAS_SUB');\n }\n $it = new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS);\n $files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);\n foreach ($files as $file) {\n $file->isDir() ? rmdir($file->getRealPath()) : unlink($file->getRealPath());\n }\n return rmdir($path);\n }", "function email_removefolder($folderid, $options) {\n\n\tglobal $CFG;\n\n\t// Check if this folder have subfolders\n\tif ( get_record('email_subfolder', 'folderparentid', $folderid) ) {\n\t\t// This folder is parent of other/s folders. Don't remove this\n\t\t// Notify\n \tredirect( $CFG->wwwroot.'/blocks/email_list/email/view.php?id='.$options->id.'&amp;action=viewmails', '<div class=\"notifyproblem\">'.get_string('havesubfolders', 'block_email_list').'</div>' );\n\t}\n\n\t// Get folder\n\tif ($folders = get_records('email_folder', 'id', $folderid)) {\n\n\t // For all folders . . .\n\t foreach($folders as $folder) {\n\n\t\t\t// Before removing references to foldermail, move this mails to root folder parent.\n\t\t\tif ($foldermails = get_records('email_foldermail', 'folderid', $folder->id) ) {\n\n\t\t\t\t// Move mails\n\t\t\t\tforeach ( $foldermails as $foldermail ) {\n\t\t\t\t\t// Get folder\n\t\t\t\t\tif ( $folder = email_get_folder($foldermail->folderid) ) {\n\n\t\t\t\t\t\t// Get root folder parent\n\t\t\t\t\t\tif ( $parent = email_get_parentfolder($foldermail->folderid) ) {\n\n\t\t\t\t\t\t\t// Assign mails it\n\t\t\t\t\t\t\temail_move2folder($foldermail->mailid, $foldermail->id, $parent->id);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tprint_error('failgetparentfolder', 'block_email_list');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprint_error('failreferencemailfolder', 'block_email_list');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Delete all subfolders of this\n\t\t\tif (! delete_records('email_subfolder', 'folderparentid', $folder->id)) {\n\t\t\t \treturn false;\n\t\t\t}\n\n\t\t\t// Delete all subfolders of this\n\t\t\tif (! delete_records('email_subfolder', 'folderchildid', $folder->id)) {\n\t\t\t \treturn false;\n\t\t\t}\n\n\t\t\t// Delete all filters of this\n\t\t\tif (! delete_records('email_filter', 'folderid', $folder->id)) {\n\t\t\t \treturn false;\n\t\t\t}\n\n\t\t\t// Delete all foldermail references\n\t\t\tif (! delete_records('email_foldermail', 'folderid', $folder->id)) {\n\t\t\t \treturn false;\n\t\t\t}\n\t }\n\n\t // Delete all folders\n\t if (! delete_records('email_folder', 'id', $folderid)) {\n\t\t \treturn false;\n\t\t}\n\t}\n\n\tadd_to_log($folderid, \"email\", \"remove subfolder\", \"$folderid\");\n\n\tnotify(get_string('removefolderok', 'block_email_list'));\n\n\treturn true;\n}", "protected function removeBackupFolder() {}", "public function delete($path) {\n\n $this->getNodeForPath($path)->delete();\n\n }", "public function delete(string $path) : bool\n {\n $path = $this->normalizePath($path);\n\n // Check if the path contains folders we dont want to delete\n if ($this->isAllowedFolder($path)) {\n return true;\n }\n\n $action = 'GetFolderByServerRelativeUrl(\\''.$this->folderPath.$path.'\\')';\n\n $this->requestHeaders['IF-MATCH'] = 'etag';\n\n $this->requestHeaders['X-HTTP-Method'] = 'DELETE';\n\n $options = [\n 'headers' => $this->requestHeaders,\n ];\n\n $response = $this->send('POST', $action, $options);\n\n return $response->getStatusCode() === 200 ? true : false;\n }", "function FTPdelete($file,$path,$parent=''){\n}", "private function deleteDirectory($path)\n {\n $files = glob('../' . $path . '/*');\n\n //Supprime les fichiers\n foreach ($files as $file) { // iterate files\n if (is_file($file)) {\n unlink($file); // delete file\n }\n }\n //suppression du dossier vide\n if (is_dir('../' . $path)) {\n rmdir('../' . $path);\n }\n }", "public function testRemoveDirectory()\n {\n $directory = vfsStream::url('foo');\n $method = $this->makeMethodPublic('empty_directory');\n $method->invokeArgs($this->testModel, [$directory, true]);\n\n $this->assertFileNotExists(vfsStream::url('foo'));\n }", "public function removeTempFolderNDataAction()\n {\n $user_id = Auth_UserAdapter::getIdentity()->getId();\n Helper_common::deleteDir(SERVER_PUBLIC_PATH.'/images/albums/temp_storage_for_socialize_wall_photos_post/user_'.$user_id.'/');\n }", "function remove_client_dir(){\n\t\t$cmd=\"rm -rf $this->client_dir\";\n\t\t`$cmd`;\n\t}", "function issuu_api_folder_delete(array $settings, array $folder_ids = NULL) {\n try {\n // Construct request parameters.\n $parameters = issuu_api_create_request_parameters();\n $parameters->addStringListParam('folderIds', $folder_ids);\n // Create client and perform action.\n return issuu_api_create_client(ISSUU_API_CLIENT_API, $settings)->issuu_folder_delete($parameters);\n }\n catch (Exception $ex) {\n // Log exception to watchdog.\n watchdog_exception('issuu_api', $ex);\n // Return the error code.\n return $ex->getCode();\n }\n}", "function wpdev_rm_dir($dir) {\r\n\r\n if (DIRECTORY_SEPARATOR == '/')\r\n $dir=str_replace('\\\\','/',$dir);\r\n else\r\n $dir=str_replace('/','\\\\',$dir);\r\n\r\n $files = glob( $dir . '*', GLOB_MARK );\r\n debuge($files);\r\n foreach( $files as $file ){\r\n if( is_dir( $file ) )\r\n $this->wpdev_rm_dir( $file );\r\n else\r\n unlink( $file );\r\n }\r\n rmdir( $dir );\r\n }", "function delete_tmp_folder_content()\n{\n\t$baseDir = '../backups/tmp/';\n\t$files = scandir($baseDir);\n\tforeach ($files as $file) \n\t{\n\t\tif ( ($file != '.') && ($file != '..') && ($file != '.htaccess') ) \n\t\t{\n\t\t\tif ( is_dir($baseDir . $file) ) recursive_deletion($baseDir.$file.'/');\n\t\t\telse unlink('../backups/tmp/' . $file);\n\t\t}\n\t}\n}", "public function destroy(Folder $folder)\n {\n //\n if ($folder->delete()) {\n return response()->json(['success'=>true, 'msg' => 'Record Succesfully Deleted'], 200);\n }\n return response()->json(['success'=>false, 'msg' => 'Folder not found'], 400);\n }", "public function delete($flags=0)\n\t{\n\t\tif ($this instanceof Fs_Symlink) {\n\t\t\tparent::delete($flags);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (!$this->exists()) return;\n\t\t\t\t\n\t\tif ($flags & Fs::RECURSIVE) {\n\t\t\t$files = scandir($this->_path);\n\t\t\t\n\t\t\tforeach ($files as $file) {\n\t\t\t\tif ($file == '.' || $file == '..') continue;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif (is_dir(\"{$this->_path}/$file\") && !is_link(\"{$this->_path}/$file\")) $this->$file->delete($flags);\n\t\t\t\t\t else unlink(\"{$this->_path}/$file\");\n\t\t\t\t} catch (Fs_Exception $e) {\n\t\t\t\t\ttrigger_error($e->getMessage(), E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!@rmdir($this->_path)) throw new Fs_Exception(\"Failed to delete '{$this->_path}'\", error_get_last());\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function deleteDirPhoto() {\n if(is_file($this->getLinkplan())){\n unlink($this->getLinkplan());\n }\n return (rmdir($this->dirPhoto));\n }", "function deleteFTP($file,$path,$parent=''){\n\tif(!NOFPT){\n\t\t$id_ftp=ftp_connect(FTPSERVER,21);\n\t\tftp_login ($id_ftp,FTPACCOUNT,FTPPASS);\n\t\tftp_pasv ($id_ftp,false);\n\t\tftp_chdir ($id_ftp,$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/'));\n\t\t//echo ftp_pwd($id_ftp).'/'.$path.'/'.$file.' delete: '.$file.'//////<br>';\n\t\t@ftp_delete($id_ftp,$file);\n//\t\tif(){\n//\t\t\techo ' eliminado.++++++++++++';\n//\t\t}else{\n//\t\t\techo ' fallido.++++++++++++';\n//\t\t}\n\t\tftp_quit($id_ftp);\n\t}else{\n\t\t@unlink($parent.'img/'.$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/').$file);\n\t}\n}", "function deleteFTP($file,$path,$parent=''){\n\tif(!NOFPT){\n\t\t$id_ftp=ftp_connect(FTPSERVER,21);\n\t\tftp_login ($id_ftp,FTPACCOUNT,FTPPASS);\n\t\tftp_pasv ($id_ftp,false);\n\t\tftp_chdir ($id_ftp,$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/'));\n\t\t//echo ftp_pwd($id_ftp).'/'.$path.'/'.$file.' delete: '.$file.'//////<br>';\n\t\t@ftp_delete($id_ftp,$file);\n//\t\tif(){\n//\t\t\techo ' eliminado.++++++++++++';\n//\t\t}else{\n//\t\t\techo ' fallido.++++++++++++';\n//\t\t}\n\t\tftp_quit($id_ftp);\n\t}else{\n\t\t@unlink($parent.'img/'.$path.'/'.($path=='tags'?'':$_SESSION['ws-tags']['ws-user']['code'].'/').$file);\n\t}\n}", "public static function delete_directory() {\n\n\t \t$dirname = ABSPATH . trailingslashit( get_option('upload_path') ) . 'zip_downloads';\n\t\n\t if ( is_dir( $dirname ) )\n\t \t$dir_handle = opendir( $dirname ); \n\t\n\t if ( !$dir_handle )\n\t\t\treturn false;\n\t\n\t while( $file = readdir( $dir_handle ) ) {\n\t\n\t \tif ( $file != \".\" && $file != \"..\" ) {\n\t \tif ( !is_dir( $dirname . \"/\" . $file ) ) \n\t \t\tunlink( $dirname . \"/\" . $file ); \n\t \t} \n\t } \n\t\n\t closedir( $dir_handle );\n\t rmdir( $dirname ); \n\t return true; \n \t}", "public function deleteFolder($folderName, $parent)\n {\n return $this->filesystem->deleteFolder($folderName, $parent);\n }", "protected function delete($destination)\n\t{\n\t\techo ' I am now in delete. Here is the folder name: ' . $destination . '<br />';\n\n\t\tif (Services::Filesystem()->folderExists($destination)) {\n\t\t\tchmod($destination, \"0777\");\n\t\t\t$results = Services::Filesystem()->folderDelete($destination);\n\t\t}\n\n\t\techo 'after delete';\n\t\t//todo - test to see if the folder is there since a false is returned from j!\n//\t\tif ($results == false) {\n//\t\t\t//error copying source to destination\n//\t\t\treturn false;\n//\t\t}\n\t\treturn true;\n\t}", "function deleteArticleTree() {\n\t\tparent::rmtree($this->filesDir);\n\t}", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete($delete_dir_if_empty = true)\n\t{\n\t\t$this->_parent->{$this->_name.'_file_name'} = '';\n\t\t$this->_parent->{$this->_name.'_file_size'} = 0;\n\t\t$this->_parent->{$this->_name.'_content_type'} = '';\n\t\t$this->_parent->save(array('validate' => false, 'save_attachments' => false));\n\n\n\t\t/* Since the parent is updated by this point, this attachment now thinks everything is \"junk\" */\n\t\t$this->deleteJunk();\n\n\t\t/* Now, lets remove the parent folder to keeps things clean */\n\t\t$dir = dirname($this->path());\n\t\tif(is_dir($dir))\n\t\t\trmdir(dirname($this->path()));\n\n\t\treturn true;\n\t}" ]
[ "0.7798941", "0.70827353", "0.7049093", "0.6945274", "0.68058544", "0.6735048", "0.66564804", "0.6656304", "0.66138196", "0.6602093", "0.65329677", "0.6527285", "0.6527285", "0.6480294", "0.64106894", "0.64018613", "0.6392145", "0.63863206", "0.6385144", "0.6380662", "0.6365019", "0.63487226", "0.6304919", "0.6286571", "0.6279131", "0.627497", "0.62742335", "0.62514627", "0.6188691", "0.6179087", "0.6131352", "0.6127139", "0.61252046", "0.6113008", "0.6111304", "0.6012009", "0.59686285", "0.5967396", "0.5966553", "0.5966553", "0.5962511", "0.59500504", "0.59302443", "0.5924308", "0.5898117", "0.5894743", "0.5887893", "0.5879695", "0.58769387", "0.58589834", "0.58478165", "0.58473825", "0.5843269", "0.58415973", "0.5838242", "0.58355343", "0.583234", "0.5823133", "0.5811825", "0.5805595", "0.5804902", "0.58029103", "0.5797529", "0.57935745", "0.57885474", "0.5775202", "0.5770844", "0.57680136", "0.57643783", "0.57626826", "0.5737077", "0.5719989", "0.5719645", "0.57118547", "0.5696448", "0.56931174", "0.56862885", "0.56847453", "0.56844664", "0.5684168", "0.56770813", "0.56612194", "0.5660094", "0.5655327", "0.5643407", "0.5635969", "0.56209457", "0.56179637", "0.5615121", "0.56116456", "0.5610025", "0.5594819", "0.558618", "0.558618", "0.55820084", "0.5572737", "0.55724645", "0.55668616", "0.55657756", "0.55593705" ]
0.71326876
1
Delete all PFS files for a specific user. Returns number of items removed.
function cot_pfs_deleteall($userid) { global $db, $db_pfs_folders, $db_pfs, $cfg; if (!$userid || !is_int($userid)) { return 0; } $pfs_dir_user = cot_pfs_path($userid); $thumbs_dir_user = cot_pfs_thumbpath($userid); $sql = $db->query("SELECT pfs_file, pfs_folderid FROM $db_pfs WHERE pfs_userid=$userid"); while($row = $sql->fetch()) { $pfs_file = $row['pfs_file']; $f = $row['pfs_folderid']; $ff = $pfs_dir_user.$pfs_file; if (file_exists($ff)) { @unlink($ff); if(file_exists($thumbs_dir_user.$pfs_file)) { @unlink($thumbs_dir_user.$pfs_file); } } } $sql->closeCursor(); $num += $db->delete($db_pfs_folders, "pff_userid='".(int)$userid."'"); $num += $db->delete($db_pfs, "pfs_userid='".(int)$userid."'"); if ($cfg['pfs']['pfsuserfolder'] && $userid>0) { @rmdir($pfs_dir_user); @rmdir($thumbs_dir_user); } return($num); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleted(User $user)\n {\n // delete all files\n }", "public function deleteAllForUser($userId);", "public function deleteAllForUser($userId);", "public function deleteFileInfo(User $user)\n {\n }", "public function delete_all_files($user){\n $data['acc_yr'] = str_replace('/','-' ,$this->acc_year[0]['academic_year']);\n $acc_yr = str_replace('/','-' ,$this->acc_year[0]['academic_year']);\n \n $files = glob('./sProMAS_documents/'. $acc_yr.'/registration_files/'.$user.'/*'); // get all file names\n foreach($files as $file){ // iterate files\n if(is_file($file)){\n if(unlink($file)){\n $file_del=TRUE;\n } // delete file\n }\n }\n $data['user']=$user;\n if($file_del==TRUE){\n $data['message'] = 'File deleted successfully';\n } else {\n $data['message'] = 'File not deleted, Try again';\n } \n //$data['views']= array('manage_users/add_group_view');\n //page_load($data);\n \n }", "public function delete()\n {\n foreach ($this->users as $user) {\n $uid = $user->id;\n // delete whole website info for this user\n if ((bool)$this->delete) {\n $model = new FormUserClear($user);\n $model->comments = true;\n $model->content = true;\n $model->feedback = true;\n $model->wall = true;\n $model->make();\n }\n\n // delete avatars\n File::remove('/upload/user/avatar/big/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/medium/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/small/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/original/' . $uid . '.jpg');\n // delete user profile and auth data\n $user->profile()->delete();\n // delete user provider data\n $user->provider()->delete();\n // delete user object\n $user->delete();\n }\n }", "public function deleteData()\n {\t\t\n \t$arrayId = $this->getAllUserId($this->readFromLocalFile());\n \tforeach($arrayId as $id)\n \t{\n \t\t$user = User::find()->where(['id' => $id])->one();\n \t\tif($user)\n \t\t{\n \t\t\t$user->delete();\n \t\t}\n \t}\n \t$this->deleteSelectedLocalItems('user');\n }", "public function actionRemoveAll() {\n if (!isset($_POST['removeAll']))\n die('what?');\n CUserfiles::model()->RemoveAllFiles($this->user_id);\n }", "public function deleteAllByUser($userId) {\n $this->getDb()->delete('t_playlist', array('user_id' => $userId));\n }", "function deleteUserImageFiles($username) {\n $target_dir = \"uploads/\" . $username . \"/\";\n\n $files = glob(\"$target_dir/*.*\");\n foreach ($files as $file) {\n unlink($file);\n }\n if (is_dir($target_dir)) {\n rmdir($target_dir);\n }\n}", "public function delete_old_files($user_id){\n\t\t$user=$this->get_by_id('id', $user_id);\n\t\t$avatar_path=$user->avatar;\n\t\t$thumb_path=$user->thumb;\n\t\tif($avatar_path != NULL)\n\t\t\tunlink($avatar_path);\n\t\tif($thumb_path != NULL)\n\t\t\tunlink($thumb_path);// ( BUGFIX zapravio ne pravi koppiju u drugom folderu)\n\t}", "public function clearAll($userId);", "function delete_user_dir($userId) {\n\t$userDir=get_user_dir($userId);\t\n\tif($userDir) {\t\t\n\t\t//File destination\n\t\t$userPath=FS_PATH.$userDir;\"some/dir/*.txt\";\n\t\tarray_map('unlink', glob(FS_PATH.$userDir.\"/*.*\"));\n\t\tif(rmdir($userPath)) { \n\t\t\treturn true;\n\t\t} else return false;\t\t\n\t} else {\n\t\terror_log(\"delete_user_dir: user_dir could not be found.\",0);\n\t\treturn false;\n\t}\n}", "public function bulkDelete(User $user)\n {\n //\n }", "protected function removeGenomeUploads() {\n // Retrieves genome uploads main folder (before users' folders)\n $rootDir = new Folder($this->GenomeUpload->getUploadPath(''), false);\n\n // Checks if folder exists\n if(!$rootDir->Path) {\n $this->error('no-uploads-root', 'Uploads root folder has not been found');\n }\n\n // Loops users' folders\n foreach($rootDir->find() as $userId) {\n // Instances folder\n $userDir = new Folder($rootDir->pwd() . DS . $userId, false);\n // Checks if folder exists\n if($userDir->path) {\n // Searches user\n $user = $this->findUser($userId);\n // Case folder is not bound to any user\n if(!$user) {\n // Removes folder\n $userDir->remove();\n }\n // Case folder ha an user bound to istelf\n else {\n // Makes a list of files which should be stored into current user's directory\n $uploads = array();\n foreach($user['configs'] as $config) {\n $uploads = array_merge($uploads, $config['uploads']);\n }\n\n // Lists files into directory\n $files = $userDir->find();\n // Loops every file\n foreach($files as $file) {\n // Checks if name is present into uploads array\n if (!isset($uploads[$file]) || !$uploads[$file]) {\n $file = new File($userDir->pwd() . DS . $file, false);\n $file->delete();\n }\n }\n }\n }\n }\n }", "function removePermanentlyDeletedFiles() {\n try {\n DB::beginWork('Start removing permanently deleted files');\n $files_to_delete = array();\n\n defined('STATE_DELETED') or define('STATE_DELETED', 0); // Make sure that we have STATE_DELETED constant defined\n\n if ($this->isModuleInstalled('files')) {\n // find file ids which are deleted\n $file_ids = DB::executeFirstColumn('SELECT id FROM ' . TABLE_PREFIX . 'project_objects WHERE type = ? AND state = ?', 'File', STATE_DELETED);\n // add their locations to cumulative list\n $files_to_delete = array_merge($files_to_delete, (array) DB::executeFirstColumn('SELECT varchar_field_2 FROM ' . TABLE_PREFIX . 'project_objects WHERE type = ? AND id IN (?)', 'File', $file_ids));\n // add file versions locations to the list\n $files_to_delete = array_merge($files_to_delete, (array) DB::executeFirstColumn('SELECT location FROM ' . TABLE_PREFIX . 'file_versions WHERE file_id IN (?)', $file_ids));\n // delete file versions\n DB::execute('DELETE FROM ' . TABLE_PREFIX . 'file_versions WHERE file_id IN (?)', $file_ids);\n } // if\n\n // add attachment locations to the list\n $files_to_delete = array_merge($files_to_delete, (array) DB::executeFirstColumn('SELECT location FROM ' . TABLE_PREFIX . 'attachments WHERE state = ?', STATE_DELETED));\n\n // delete all files related to previously deleted objects\n if (is_foreachable($files_to_delete)) {\n foreach ($files_to_delete as $file_to_delete) {\n $full_path_to_delete = UPLOAD_PATH . '/' . $file_to_delete;\n if (is_file($full_path_to_delete)) {\n @unlink($full_path_to_delete);\n } // if\n } // foreach\n } // if\n\n DB::commit('Successfully removed permanently deleted files');\n } catch (Exception $e) {\n DB::rollback('Failed to remove permanently deleted files');\n return $e->getMessage();\n } // if\n\n return true;\n }", "function removeHard()\r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t$userid = ($this->user) ? $this->user->id : $this->owner_id;\r\n\r\n\t\tUserFilesRemoveFile($dbh, $this->id, $userid, false, true);\r\n\t}", "public function deleteFromFavorites($user_id, $item_id);", "function deleteDocument($userSpace){\n unlink(\"$userSpace/friends.txt\");\n if ( $handle = opendir( \"$userSpace/files\" ) ) {\n while ( false !== ( $item = readdir( $handle ) ) ) {\n if ( $item != \".\" && $item != \"..\" ) {\n if( unlink( \"$userSpace/files/$item\" ) ) echo \"delete the file successfully:$userSpace/$item \\n\"; \n }\n }\n closedir( $handle );\n rmdir(\"$userSpace/files\");\n if( rmdir( $userSpace ) ) echo \"delete Directory successfully: $userSpace \\n\";\n }\n }", "function cot_pfs_deletefile($userid, $id)\n{\n\tglobal $db, $db_pfs, $cfg;\n\n\t$sql = $db->query(\"SELECT pfs_id FROM $db_pfs WHERE pfs_userid=\".(int)$userid.\" AND pfs_id=\".(int)$id.\" LIMIT 1\");\n\n\tif ($sql->rowCount()>0)\n\t{\n\t\t$fpath = cot_pfs_filepath($id);\n\n\t\tif (file_exists($thumbs_dir_user.$fpath))\n\t\t{\n\t\t\t@unlink($thumbs_dir_user.$fpath);\n\t\t}\n\t\tif (file_exists($pfs_dir_user.$fpath))\n\t\t{\n\t\t\t@unlink($pfs_dir_user.$fpath);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t$sql = $db->delete($db_pfs, \"pfs_id='\".(int)$id.\"'\");\n\t\treturn TRUE;\n\t}\n\telse\n\t{\n\t\treturn FALSE;\n\t}\n}", "function files_delete()\n{\n // remove module vars and masks\n xarModDelAllVars('files');\n xarRemoveMasks('files');\n\n // Deletion successful\n return true;\n}", "public function deleteAllFromUser(string $userId)\n {\n $queryBuilder = $this->getQueryBuilder()\n ->delete(\"entry\")\n ->where(\"userid = ?\")\n ->setParameter(0, $userId);\n \n $queryBuilder->execute();\n }", "public function deleteAllFiles()\n {\n\t\t$data = $this->call(array(), \"DELETE\", \"sensors/files.json\");\n\t\treturn $data;\n }", "public function destroyAll()\n {\n if ( ! Input::has('users')) return;\n\n $ids = [];\n\n foreach(Input::get('users') as $k => $user) {\n $ids[] = $user['id'];\n }\n\n if ($deleted = User::destroy($ids)) {\n return response(trans('app.deleted', ['number' => $deleted]));\n }\n }", "public function destroy(User $user)\n {\n $conteudos = $user->contents()->get();\n\n //Delete user contents from disk\n foreach($conteudos as $conteudo) {\n Storage::delete($conteudo->nome);\n $conteudo->forceDelete();\n }\n\n if ($user->forceDelete()) {\n return redirect()->back()->withSuccess(__('controllers.delete_user'));\n } else {\n return redirect()->back()->withErrors(__('controllers.error_occured'));\n }\n }", "function cot_pfs_deletefolder($userid, $folderid)\n{\n\tglobal $db, $db_pfs_folders, $db_pfs, $cfg;\n\n\t$sql = $db->query(\"SELECT pff_path FROM $db_pfs_folders WHERE pff_userid=\".(int)$userid.\" AND pff_id=\".(int)$folderid.\" LIMIT 1\");\n\tif($row = $sql->fetch())\n\t{\n\t\t$fpath = $row['pff_path'];\n\n\t\t// Remove files\n\t\t$sql = $db->query(\"SELECT pfs_id FROM $db_pfs WHERE pfs_folderid IN (SELECT pff_id FROM $db_pfs_folders WHERE pff_path LIKE '\".$fpath.\"%')\");\n\t\twhile($row = $sql->fetch())\n\t\t{\n\t\t\tcot_pfs_deletefile($row['pfs_id']);\n\t\t}\n\t\t$sql->closeCursor();\n\n\t\t// Remove folders\n\t\t$sql = $db->query(\"SELECT pff_id, pff_path FROM $db_pfs_folders WHERE pff_path LIKE '\".$fpath.\"%' ORDER BY CHAR_LENGTH(pff_path) DESC\");\n\t\t$count = $sql->rowCount();\n\t\twhile($row = $sql->fetch())\n\t\t{\n\t\t\tif($cfg['pfs']['pfsuserfolder'])\n\t\t\t{\n\t\t\t\t@rmdir($pfs_dir_user.$row['pff_path']);\n\t\t\t\t@rmdir($thumbs_dir_user.$row['pff_path']);\n\t\t\t}\n\t\t\t$db->delete($db_pfs_folders, \"pff_id='\".(int)$row['pff_id'].\"'\");\n\t\t}\n\t\t$sql->closeCursor();\n\t\tif($count > 0)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn FALSE;\n\t}\n}", "function cvs_delete_user($cvs_user, $cvs_project) {\r\n $all_cvs_users = cvs_read_passwd($cvs_project);\r\n $cvs_fields=$all_cvs_users[$cvs_user];\r\n if (!is_null($cvs_fields)) {\r\n\tunset($all_cvs_users[$cvs_user]);\r\n\tcvs_write_file($all_cvs_users, $cvs_project);\r\n\tcvs_log(1, \"Deleted user $cvs_user\");\r\n } else {\r\n\tcvs_log(3, \"User $cvs_user does not exist\");\r\n } \r\n}", "public function deleteAction()\n {\n $user = $this->getConnectedUser();\n\n $em = $this->getDoctrine()->getManager();\n\n $currentFolderId = null;\n\n $request = $this->get('request');\n if ($request->getMethod() == 'POST') {\n $foldersId = $request->request->get('foldersId');\n $foldersId = json_decode($foldersId);\n $filesId = $request->request->get('filesId');\n $filesId = json_decode($filesId);\n $currentFolderId = $request->request->get('currentFolderId');\n $permanentDelete = $request->request->get('permanentDelete');\n $permanentDelete = ($permanentDelete == \"true\") ? true : false;\n\n if (!is_null($filesId) && sizeof($filesId)>0) {\n $filesToDelete = $em->getRepository('TimeBoxMainBundle:File')->findBy(array(\n 'id' => $filesId,\n 'user' => $user\n ));\n foreach ($filesToDelete as $file) {\n if ($permanentDelete) {\n $user->setStorage(max($user->getStorage() - $file->getTotalSize(), 0));\n $em->persist($user);\n $em->remove($file);\n }\n else {\n $file->setIsDeleted(true);\n $file->setFolder();\n }\n }\n $em->flush();\n }\n\n if (!is_null($foldersId) && sizeof($foldersId)>0) {\n $foldersToDelete = $em->getRepository('TimeBoxMainBundle:Folder')->findBy(array(\n 'id' => $foldersId,\n 'user' => $user\n ));\n foreach ($foldersToDelete as $folder) {\n if ($permanentDelete) {\n $em->remove($folder);\n }\n else {\n $folder->setParent();\n $this->manageFolderContent($folder, true);\n }\n }\n $em->flush();\n }\n }\n\n $url = $this->get('router')->generate('time_box_main_file_deleted', array(\n 'folderId' => $currentFolderId\n ));\n return new Response($url);\n }", "public function doremoveusers() {\r\n \tif (isset($_SESSION['userid'])) {\r\n \t\tif (isset($_POST['userid']) && isset($_POST['projectid'])){\r\n \t\t\tforeach ($_POST['userid'] as $userid) {\r\n \t\t\t\t$this->model->deleteuserproject($userid, $_POST['projectid']);\r\n \t\t\t}\r\n \t\t}\r\n \t\t$this->redirect('?v=userproject&a=show&p='.$_POST['projectid']);\r\n \t} else {\r\n \t\t$this->redirect('?v=index&a=show');\r\n \t}\r\n }", "public function unshare($user, $filename) {\n $stmt = $this->pdo->prepare('delete from share where owner_id = :id and file_id = (select id from file where user_id = :id and filename = :filename)');\n $stmt->bindValue(':id', $this->id);\n $stmt->bindValue(':filename', $filename);\n return $stmt->execute();\n }", "function deleteUsers($users) {\n\t$db = DB::getInstance();\n\t$i = 0;\n\tforeach($users as $id){\n\t\t$query1 = $db->query(\"DELETE FROM users WHERE id = ?\",array($id));\n\t\t$query2 = $db->query(\"DELETE FROM user_permission_matches WHERE user_id = ?\",array($id));\n\t\t$query3 = $db->query(\"DELETE FROM profiles WHERE user_id = ?\",array($id));\n\t\t$i++;\n\t}\n\treturn $i;\n}", "public function deleteAllByUser($userId)\n {\n $this->getDb()->delete('comments', ['user_id' => $userId]);\n }", "public function deleteAllByUser($userId) {\n $this->getDb()->delete('t_comment', array('usr_id' => $userId));\n }", "public static function deleteFile($fileName, $userId);", "function removeUnusedFiles( )\r\n{\r\n // select all files that aren't referenced anymore\r\n $sql = \"SELECT DISTINCT f.id, f.filename\r\n\t\t\tFROM \" . dropbox_cnf(\"tbl_file\") . \" f\r\n\t\t\tLEFT JOIN \" . dropbox_cnf(\"tbl_person\") . \" p ON f.id = p.file_id\r\n\t\t\tWHERE p.user_id IS NULL\";\r\n $result = api_sql_query($sql,__FILE__,__LINE__);\r\n while ( $res = mysql_fetch_array( $result))\r\n {\r\n\t\t//delete the selected files from the post and file tables\r\n $sql = \"DELETE FROM \" . dropbox_cnf(\"tbl_post\") . \" WHERE file_id='\" . $res['id'] . \"'\";\r\n $result1 = api_sql_query($sql,__FILE__,__LINE__);\r\n $sql = \"DELETE FROM \" . dropbox_cnf(\"tbl_file\") . \" WHERE id='\" . $res['id'] . \"'\";\r\n $result1 = api_sql_query($sql,__FILE__,__LINE__);\r\n\r\n\t\t//delete file from server\r\n @unlink( dropbox_cnf(\"sysPath\") . \"/\" . $res[\"filename\"]);\r\n }\r\n}", "function rmUser($user){\n\tglobal $dbLink;\n\t\n\t$sqlgetInfo = \"SELECT main_group FROM users WHERE uid='$user'\";\n\t\n\tif($getInfo = $dbLink->query($sqlgetInfo)){\n\t\twhile($getResult = $getInfo->fetch_assoc()){\n\t\tif($getResult['main_group'] != 'student'){\n\t\t\n\t\t\t$sqlSelectClass = \"SELECT c_id FROM classes WHERE t_uid='$user'\";\n\t\t\tif($SelectClass = $dbLink->query($sqlSelectClass)){\n\t\t\t\twhile($ArrayClass = $SelectClass->fetch_assoc()){\n\t\t\t\t\tforeach($ArrayClass as $class){\n\t\t\t\t\t\t$sqlDeleteReg = \"DELETE FROM registrar WHERE c_id='$class'\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!$dbLink->query($sqlDeleteReg)){\n\t\t\t\t\t\t\t$_SESSION['error_message'] = \"Could not delete the class\";\n\t\t\t\t\t\t\theader(\"Location: ../admin.php\");\n\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$sqlSelectFiles = \"SELECT fid FROM file_registrar WHERE c_id='$class'\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($getFid = $dbLink->query($sqlSelectFiles)){\n\t\t\t\t\t\t\twhile($ArrFid = $getFid->fetch_assoc()){\n\t\t\t\t\t\t\t\tforeach($ArrFid as $fid){\n\t\t\t\t\t\t\t\t\t$sqlDeleteFiles = \"DELETE FROM edu_files WHERE fid='$fid'\";\n\t\t\t\t\t\t\t\t\tif(!$dbLink->query($sqlDeleteFiles)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$_SESSION['error_message'] = \"Could not delete files\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theader(\"Location: ../admin.php\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t\t\t\t}//delete files where the fid is stated\n\t\t\t\t\t\t\t\t}//end of foreach($ArrFid\n\t\t\t\t\t\t\t}//end of while loop to get FID's\n\t\t\t\t\t\t}//end of if statement to select file ID's\n\t\t\t\t\t\t$sqlDeleteFReg = \"DELETE FROM file_registrar WHERE c_id='$class'\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!$dbLink->query($sqlDeleteFReg)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$_SESSION['error_message'] = \"Could not delete from File Registrar\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theader(\"Location: ../admin.php\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t}\n\t\t\t\t\t}//end of foreach($Array\n\t\t\t\t}//end of while\n\t\t\t}//end of if to remove class data\n\t\t\t$sqlDeleteClass = \"DELETE FROM classes WHERE t_uid='$user'\";\n\t\t\tif(!$dbLink->query($sqlDeleteClass)){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$_SESSION['error_message'] = \"Could not delete from the classes table\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\theader(\"Location: ../admin.php\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdie();\n\t\t\t}//end of if to remove class from the classes table\t\n\t\t\t\n\t\t\t$sqlrmStudent = \"DELETE FROM users WHERE uid='$user'\";\n\t\t\t$sqlrmTorrent = \"DELETE FROM `xbt_users` WHERE uid='$user'\";\n\t\t\tif(!$dbLink->query($sqlrmStudent)){\n\t\t\t\t\t\t\t\n\t\t\t}//end of remove student if statement\n\n\t\t\tif(!$dbLink->query($sqlrmTorrent)){\n\t\t\t\t\t\t\t$_SESSION['error_message'] = \"The user has not been deleted\";\n\t\t\t\t\t\t\theader(\"Location: ../admin.php\");\n\t\t\t\t\t\t\tdie();\n\t\t\t}//end of remove student if statement\n\t\t\telse{\n\t\t\t\t\t\t\t$_SESSION['error_message'] = \"The user has been deleted\";\n\t\t\t\t\t\t\theader(\"Location: ../admin.php\");\n\t\t\t\t\t\t\tdie();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif($getResult['main_group'] == 'student'){\n\t\t\t$sqlrmStudent = \"DELETE FROM users WHERE uid='$user'\";\n\t\t\t$sqlrmTorrent = \"DELETE FROM `xbt_users` WHERE uid='$user'\";\n\t\t\tif(!$dbLink->query($sqlrmStudent)){\n\t\t\t\t\t\t\t\n\t\t\t}//end of remove student if statement\n\t\t\t\n\t\t\tif(!$dbLink->query($sqlrmTorrent)){\n\t\t\t\t\t\t\t$_SESSION['error_message'] = \"The user has not been deleted\";\n\t\t\t\t\t\t\theader(\"Location: ../admin.php\");\n\t\t\t\t\t\t\tdie();\n\t\t\t}//end of remove student if statement\n\t\t\telse{\n\t\t\t\t\t\t\t$_SESSION['error_message'] = \"The user has been deleted\";\n\t\t\t\t\t\t\theader(\"Location: ../admin.php\");\n\t\t\t\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\t\t\n\t\t}//end of while getInfo Array\n\t}//end of if(sqlgetInfo\n}", "public function deleteUnusedFiles(){\n \n }", "public function delete($files);", "public function delete_user($user);", "function delete() {\n global $USER;\n if($this->Dir !== 0 && $this->mayI(DELETE)) {\n $this->loadStructure();\n foreach($this->files as $file) {\n $file->delete();\n }\n foreach($this->folders as $folder) {\n $folder->delete();\n }\n rmdir($this->path);\n parent::delete();\n }\n }", "public function onDeleteUser($iUser)\n\t{\n\t\t// get the ids for the photos of this user\n\t\t$aPhotos = $this->database()\n\t\t\t->select('p.photo_id, pa.album_id, pb.battle_id, pt.tag_id')\n\t\t\t->from($this->_sTable, 'p')\n\t\t\t->leftjoin(Phpfox::getT('photo_album'), 'pa', 'pa.user_id = ' . (int)$iUser)\n\t\t\t->leftjoin(Phpfox::getT('photo_battle'), 'pb', 'pb.user_id = ' . (int)$iUser)\n\t\t\t->leftjoin(Phpfox::getT('photo_tag'), 'pt', 'pt.user_id = ' . (int)$iUser)\n\t\t\t->where('p.user_id = ' . (int)$iUser)\n\t\t\t->execute('getSlaveRows');\n\n\t\tforeach ($aPhotos as $aPhoto)\n\t\t{\n\t\t\tif (isset($aPhoto['photo_id']))\n\t\t\t{\n\t\t\t\tPhpfox::getService('photo.process')->delete($aPhoto['photo_id']);\n\t\t\t}\n\t\t\tif (isset($aPhoto['album_id']))\n\t\t\t{\n\t\t\t\tPhpfox::getService('photo.album.process')->delete($aPhoto['album_id']);\n\t\t\t}\n\t\t\tif (isset($aPhoto['tag_id']))\n\t\t\t{\n\t\t\t\t// delete tags added by this user\n\t\t\t\tPhpfox::getService('photo.tag.process')->delete($aPhoto['tag_id']);\n\t\t\t}\n\t\t}\n\n\t\tPhpfox::getService('photo.battle.process')->deleteByUser($iUser);\n\t\tPhpfox::getService('photo.rate.process')->deleteByUser($iUser);\n\t\t\n\t}", "function deleteUserFilesCount($userID){\n global $conn;\n \n $sql = \"SELECT files FROM users WHERE chat_id ='$userID' LIMIT 1\";\n $q = $conn->query($sql);\n $r = $q->fetch(PDO::FETCH_ASSOC);\n $oldFileCount = $r['files'];\n $newFileCount = $oldFileCount-1;\n $Update = \"UPDATE users SET files='$newFileCount' WHERE chat_id ='$userID'\";\n $ap = $conn->prepare($Update);\n $ap->execute();\n}", "public function deleteAllSession($appUserID)\n {\n $result = $this->sdb->query(\n 'delete from session where appuser_fk=$1',\n array($appUserID));\n }", "public static function delete_data_for_users(approved_userlist $userlist) {\n $context = $userlist->get_context();\n\n if (!$context instanceof \\context_module) {\n return;\n }\n\n $userids = $userlist->get_userids();\n $cmid = $context->instanceid;\n self::delete_document_for_users($cmid, 'local_ousearch_documents', $userids);\n self::delete_document_for_users($cmid, 'local_ousearch_docs_2011', $userids);\n self::delete_document_for_users($cmid, 'local_ousearch_docs_2012', $userids);\n self::delete_document_for_users($cmid, 'local_ousearch_docs_2013', $userids);\n self::delete_document_for_users($cmid, 'local_ousearch_docs_2014', $userids);\n self::delete_document_for_users($cmid, 'local_ousearch_docs_2015', $userids);\n self::delete_document_for_users($cmid, 'local_ousearch_docs_2016', $userids);\n self::delete_document_for_users($cmid, 'local_ousearch_docs_2017', $userids);\n self::delete_document_for_users($cmid, 'local_ousearch_docs_2018', $userids);\n self::delete_document_for_users($cmid, 'local_ousearch_docs_2019', $userids);\n self::delete_document_for_users($cmid, 'local_ousearch_docs_2020', $userids);\n }", "public function deleteallwatchforuser($user_id) {\n\t\t// get the list of watches for this user\n\t\t$query = $this->isirdb->get_where('users_watches', array(\"user_id\" => $user_id))->result_array();\n\n\t\tif (sizeof($query) > 0) {\n\t\t\t$ids = array();\n\t\t\tforeach ($query as $i) {\n\t\t\t\tarray_push($ids, $i['id']);\n\t\t\t}\n\n\t\t\t// delete them\n\t\t\t$this->deletewatches($ids);\t\t\t\t\n\t\t}\n\t}", "function delUser() // Renomeada para n�o ser usada. Antiga delUser() \n{\n\tglobal $xoopsDB, $myts, $xoopsConfig, $xoopsModule;\n\n\t$query = \"SELECT * FROM \". $xoopsDB->prefix('xmail_newsletter') .\" WHERE user_email='\" . $myts->makeTboxData4Save($_POST['user_mail']) . \"' \";\n\t$result = $xoopsDB->query($query);\n\t$myarray = $xoopsDB->fetchArray($result);\n\n\t$mymail = $myts->makeTboxData4Save($_POST['user_mail']);\n\tif ($myarray) {\n\t\tif ($myarray['confirmed'] == '0')\n\t\t\treturn -1;\n\n\t\t$query = \"DELETE from \" . $xoopsDB->prefix('xmail_newsletter') . \" WHERE user_email='$mymail'\";\n\t\t$result = $xoopsDB->queryF($query);\n\t\t\n\t\t// eliminar o perfil\n\t\t$sql=' delete from '.$xoopsDB->prefix('xmail_perfil_news').' where user_id='.$myarray['user_id'];\n\t\t$result2=$xoopsDB->queryf($sql);\n\t\tif(!$result2){\n\t\t\txoops_error('Erro ao eliminar perfil'.$xoopsDB->error());\n\t\t}\n\t\t\t\n\t\t\n\t\treturn 1;\n\t} else {\n\t\treturn -2;\n\t}\n}", "public function meDeleteALL ( )\n\t{\n\t\t$userId = $this->getCurrentUserId();\n\t\treturn $this->adminDeleteAllByUser($userId);\n\t}", "public function deleteByUser($iUser)\n\t{\n\t\t// Select all the image_id that this user has rated in battle\n\t\t$aPhotos = $this->database()\n\t\t\t->select('pb.photo_1, pb.battle_id, p.total_battle')\n\t\t\t->from(Phpfox::getT('photo_battle'), 'pb')\n\t\t\t->leftjoin($this->_sTable, 'p', 'p.photo_id = pb.photo_1')\n\t\t\t->where('pb.user_id = ' . (int)$iUser)\n\t\t\t->execute('getSlaveRows');\n\t\t\n\t\t// Now decrement the total_battle\n\t\tforeach ($aPhotos as $aPhoto)\n\t\t{\t\t\t\t\t\t\n\t\t\t//delete the vote on the battles\n\t\t\t$this->database()->delete(Phpfox::getT('photo_battle'), 'battle_id = ' . $aPhoto['battle_id']);\n\t\t}\n\t}", "protected function utilPurgeUploads()\n {\n if (!$this->confirm('This will PERMANENTLY DELETE files in the uploads directory that do not exist in the \"system_files\" table.')) {\n return;\n }\n\n $uploadsDisk = Config::get('system.storage.uploads.disk', 'local');\n if ($uploadsDisk !== 'local') {\n $this->error('Purging uploads is only supported on the local disk');\n return;\n }\n\n $purgeFunc = function($localPath) {\n $chunks = collect(File::allFiles($localPath))->chunk(50);\n $filesToDelete = [];\n\n foreach ($chunks as $chunk) {\n $filenames = [];\n foreach ($chunk as $file) {\n $filenames[] = $file->getFileName();\n }\n\n $foundModels = FileModel::whereIn('disk_name', $filenames)->pluck('disk_name')->all();\n\n foreach ($chunk as $file) {\n if (!in_array($file->getFileName(), $foundModels)) {\n $filesToDelete[$file->getFileName()] = $file->getPath() . DIRECTORY_SEPARATOR . $file->getFileName();\n }\n }\n }\n\n return $filesToDelete;\n };\n\n $localPath = Config::get('filesystems.disks.local.root', storage_path('app'))\n . '/'\n . Config::get('system.storage.uploads.folder');\n\n // Protected directory\n $this->comment('Scanning directory: '.$localPath.'/protected');\n $filesToDelete = $purgeFunc($localPath.'/protected');\n\n if (count($filesToDelete)) {\n $this->comment('Found the following files to delete');\n $this->comment(implode(', ', array_keys($filesToDelete)));\n if ($this->confirm('Please confirm file destruction.')) {\n foreach ($filesToDelete as $path) {\n File::delete($path);\n }\n }\n }\n else {\n $this->comment('No files found to purge.');\n }\n\n // Public directory\n $this->comment('Scanning directory: '.$localPath.'/public');\n $filesToDelete = $purgeFunc($localPath.'/public');\n\n if (count($filesToDelete)) {\n $this->comment('Found the following files to delete');\n $this->comment(implode(', ', array_keys($filesToDelete)));\n if ($this->confirm('Please confirm file destruction.')) {\n foreach ($filesToDelete as $path) {\n File::delete($path);\n }\n }\n }\n else {\n $this->comment('No files found to purge.');\n }\n }", "function deleteFolder($user_dir){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'.$user_dir; // '.' for current\r\n\r\n\t\t\t\t\t\r\n\t\t\t}", "public function delete($user)\n {\n $user->deleteProfilePhoto();\n $user->tokens->each->delete();\n\n // $user->delete(); csak logikai törlés a megngedett\n $user->update([\"name\" => \"deleted\".$user->id,\n \"email\" => \"deleted\".$user->id.\"@deleted.com\",\n \"password\" => \"psw\".rand(100000,999999)]);\n\n \\DB::table('members')\n ->where('user_id','=',$user->id)\n ->delete();\n\n }", "protected function removeFiles() {}", "function local_avatars_delete_image($user_id){\n\tlocal_avatars_get_plugin()->file_handler->delete_image($user_id);\n}", "public function deleted(User $user)\n {\n $this->clearCache($this->key);\n\n FileHelpers::deleteFile($user->avatar);\n }", "function del_all ($user = false) {\n\t\t$user = $user ?: $this->user_id;\n\t\tif ($user == User::GUEST_ID) {\n\t\t\treturn false;\n\t\t}\n\t\tEvent::instance()->fire(\n\t\t\t'System/Session/del_all',\n\t\t\t[\n\t\t\t\t'id' => $user\n\t\t\t]\n\t\t);\n\t\t$sessions = $this->db_prime()->qfas(\n\t\t\t\"SELECT `id`\n\t\t\tFROM `[prefix]sessions`\n\t\t\tWHERE `user` = '$user'\"\n\t\t);\n\t\tforeach ($sessions ?: [] as $session) {\n\t\t\tif (!$this->del($session)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function purgeSessions($user);", "public function removeusers() {\r\n \tif (isset($_SESSION['userid'])) {\r\n \t\t$users=$this->model->getusersprojects($_GET['p']);\r\n \t\t$this->view->set('users',$users);\r\n \t\t$project=$this->model->getproject($_GET['p']);\r\n \t\t$this->view->set('project',$project[0]);\r\n \t\t$this->view->removeusers();\r\n \t} else {\r\n \t\t$this->redirect('?v=index&a=show');\r\n \t}\r\n }", "private function purgefiles()\n\t{\n\t\t$params=JComponentHelper::getParams('com_jbolo');\n\t\t$uploaddir=JPATH_COMPONENT.DS.'uploads';\n\t\t$exp_file_time=3600*24*$params->get('purge_days');\n\t\t$currts=time();\n\t\techo \"<div class='alert alert-success'>\".\n\t\tJText::_('COM_JBOLO_PURGE_OLD_FILES');\n\t\t/*\n\t\t * JFolder::files($path,$filter,$recurse=false,$full=false,$exclude=array('.svn'),$excludefilter=array('^\\..*'))\n\t\t*/\n\t\t$current_files=JFolder::files($uploaddir,'',1,true,array('index.html'));\n\t\t//print_r($current_files);die;\n\t\tforeach($current_files as $file)\n\t\t{\n\t\t\tif( $file != \"..\" && $file != \".\" )\n\t\t\t{\n\t\t\t\t$diffts=$currts-filemtime($file);\n\t\t\t\tif($diffts > $exp_file_time )\n\t\t\t\t{\n\t\t\t\t\techo '<br/>'.JText::_('COM_JBOLO_PURGE_DELETING_FILE').$file;\n\t\t\t\t\tif(!JFile::delete($file)){\n\t\t\t\t\t\techo '<br/>'.JText::_('COM_JBOLO_PURGE_ERROR_DELETING_FILE').'-'.$file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo \"</div>\";\n\t}", "function userDeleted($user, $success) {\r\r\n\t\tglobal $_CB_database,$_CB_framework;\r\r\n\r\r\n\t\t$params = $this->params;\r\r\n\t\t$pmsType = $params->get('pmsType', '1');\r\r\n\r\r\n\t\tif (!$this->_checkPMSinstalled($pmsType)) {\r\r\n\t\t\treturn false;\r\r\n\t\t}\r\r\n\t\t$pmsUserDeleteOption = $params->get('pmsUserDeleteOption', '3');\r\r\n\t\t$pmsUserFunction = $params->get('pmsUserFunction','1');\r\r\n\t\t\r\r\n $cb_extra_rules = 0;\r\r\n\t\tSWITCH($pmsType) {\r\r\n\t\t\tcase 1:\t\t//MyPMS OS\r\r\n\t\t\t\tswitch ($pmsUserDeleteOption) {\r\r\n\t\t\t\t\tcase '1':\t// Keep all messages\r\r\n\t\t\t\t\t\t$query_pms_delete = \"\";\r\r\n\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\tcase '2':\t// Remove all messages (received and sent)\r\r\n\t\t\t\t\tcase '3':\t// Remove received messages only\r\r\n\t\t\t\t\tcase '4':\t// Remove sent message only\r\r\n\t\t\t\t\t\t$query_pms_delete = \"DELETE FROM #__pms WHERE username='\" . $_CB_database->getEscaped($user->username) .\"'\";\r\r\n\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\tdefault:\r\r\n\t\t\t\t\t\t$query_pms_delete = \"DELETE FROM #__pms WHERE username='\" . $_CB_database->getEscaped($user->username) .\"'\";\r\r\n\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t}\r\r\n\t\t\t\tif(file_exists( $_CB_framework->getCfg('absolute_path') . \"/components/com_pms/cb_extra.php\")) {\r\r\n\t\t\t\t\tinclude_once( $_CB_framework->getCfg('absolute_path') . \"/components/com_pms/cb_extra.php\");\r\r\n\t\t\t\t\tif (function_exists('user_delete')) {\r\r\n\t\t\t\t\t\t$cb_extra_rules = 1;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\tif (function_exists('user_delete_ext')) {\r\r\n\t\t\t\t\t\t$cb_extra_rules = 2;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\t\t\r\r\n\t\t\t\tbreak;\r\r\n\t\t\tcase 2:\t\t//PMS Pro\r\r\n\t\t\t\tswitch ($pmsUserDeleteOption) {\r\r\n\t\t\t\t\tcase '1':\t// Keep all messages\r\r\n\t\t\t\t\t\t$query_pms_delete = \"\";\r\r\n\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\tcase '2':\t// Remove all messages (received and sent)\r\r\n\t\t\t\t\tcase '3':\t// Remove received messages only\r\r\n\t\t\t\t\tcase '4':\t// Remove sent message only\r\r\n\t\t\t\t\t\t$query_pms_delete = \"DELETE FROM #__mypms WHERE username='\" . $_CB_database->getEscaped($user->username) .\"'\";\r\r\n\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\tdefault:\r\r\n\t\t\t\t\t\t$query_pms_delete = \"DELETE FROM #__mypms WHERE username='\" . $_CB_database->getEscaped($user->username) .\"'\";\r\r\n\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t}\r\r\n\t\t\t\tif(file_exists( $_CB_framework->getCfg('absolute_path') . \"/components/com_mypms/cb_extra.php\")) {\r\r\n\t\t\t\t\tinclude_once( $_CB_framework->getCfg('absolute_path') . \"/components/com_mypms/cb_extra.php\");\r\r\n\t\t\t\t\tif (function_exists('user_delete')) {\r\r\n\t\t\t\t\t\t$cb_extra_rules = 1;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\tif (function_exists('user_delete_ext')) {\r\r\n\t\t\t\t\t\t$cb_extra_rules = 2;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\t\t\r\r\n\t\t\t\tbreak;\r\r\n\t\t\tcase 3:\t\t//UddeIM 0.4\r\r\n\t\t\tcase 4:\t\t//UddeIM 1.0\r\r\n\t\t\t\tswitch ($pmsUserDeleteOption) {\r\r\n\t\t\t\t\tcase '1':\t// Keep all messages\r\r\n\t\t\t\t\t\t$query_pms_delete = \"\";\r\r\n\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\tcase '2':\t// Remove all messages (received and sent)\r\r\n\t\t\t\t\t\t$query_pms_delete = \"DELETE FROM #__uddeim WHERE fromid='\" . (int) $user->id .\"' OR toid='\" . (int) $user->id . \"'\";\r\r\n\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\tcase '3':\t// Remove received messages only\r\r\n\t\t\t\t\t\t$query_pms_delete = \"DELETE FROM #__uddeim WHERE toid='\" . (int) $user->id . \"'\";\r\r\n\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\tcase '4':\t// Remove sent message only\r\r\n\t\t\t\t\t\t$query_pms_delete = \"DELETE FROM #__uddeim WHERE fromid='\" . (int) $user->id .\"'\";\r\r\n\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\tdefault:\r\r\n\t\t\t\t\t\t$query_pms_delete = \"DELETE FROM #__uddeim WHERE fromid='\" . (int) $user->id .\"' OR toid='\" . (int) $user->id . \"'\";\r\r\n\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t}\r\r\n\t\t\t\t$query_pms_delete_extra1 = \"DELETE FROM #__uddeim_emn WHERE userid='\" . (int) $user->id . \"'\";\r\r\n\t\t\t\t$query_pms_delete_extra2 = \"DELETE FROM #__uddeim_blocks WHERE blocker='\" . (int) $user->id . \"' OR blocked='\" . (int) $user->id . \"'\";\r\r\n\t\t\t\tif(file_exists( $_CB_framework->getCfg('absolute_path') . \"/components/com_uddeim/cb_extra.php\")) {\r\r\n\t\t\t\t\tinclude_once( $_CB_framework->getCfg('absolute_path') . \"/components/com_uddeim/cb_extra.php\");\r\r\n\t\t\t\t\tif (function_exists('user_delete')) {\r\r\n\t\t\t\t\t\t$cb_extra_rules = 1;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\tif (function_exists('user_delete_ext')) {\r\r\n\t\t\t\t\t\t$cb_extra_rules = 2;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\t\t\r\r\n\t\t\t\tbreak;\t\t\r\r\n\t\t\tcase 5:\t\t//PMS enhanced 2.x by Stefan Klingner\r\r\n\t\t\t\tswitch ($pmsUserDeleteOption) {\r\r\n\t\t\t\t\tcase '1':\t// Keep all messages\r\r\n\t\t\t\t\t\t$query_pms_delete = \"\";\r\r\n\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\tcase '2':\t// Remove all messages (received and sent)\r\r\n\t\t\t\t\t\t$query_pms_delete = \"DELETE FROM #__pms WHERE recip_id='\" . (int) $user->id . \"' OR sender_id='\" . (int) $user->id . \"'\";\r\r\n\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\tcase '3':\t// Remove received messages only\r\r\n\t\t\t\t\t\t$query_pms_delete = \"DELETE FROM #__pms WHERE recip_id='\" . (int) $user->id . \"'\";\r\r\n\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\tcase '4':\t// Remove sent message only\r\r\n\t\t\t\t\t\t$query_pms_delete = \"DELETE FROM #__pms WHERE sender_id='\" . (int) $user->id . \"'\";\r\r\n\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\tdefault:\r\r\n\t\t\t\t\t\t$query_pms_delete = \"DELETE FROM #__pms WHERE recip_id='\" . (int) $user->id . \"' OR sender_id='\" . (int) $user->id . \"'\";\r\r\n\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t}\r\r\n\t\t\t\tif(file_exists( $_CB_framework->getCfg('absolute_path') . \"/components/com_pms/cb_extra.php\")) {\r\r\n\t\t\t\t\tinclude_once( $_CB_framework->getCfg('absolute_path') . \"/components/com_pms/cb_extra.php\");\r\r\n\t\t\t\t\tif (function_exists('user_delete')) {\r\r\n\t\t\t\t\t\t$cb_extra_rules = 1;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\tif (function_exists('user_delete_ext')) {\r\r\n\t\t\t\t\t\t$cb_extra_rules = 2;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\t\t\r\r\n\t\t\t\tbreak;\r\r\n\t\t\tcase 6:\t\t//JIM 1.0.1\r\r\n\t\t\t\t$query_pms_delete = \"DELETE FROM #__jim WHERE username='\" . $_CB_database->getEscaped($user->username) .\"'\";\r\r\n\t\t\t\tif(file_exists( $_CB_framework->getCfg('absolute_path') . \"/components/com_jim/cb_extra.php\")) {\r\r\n\t\t\t\t\tinclude_once( $_CB_framework->getCfg('absolute_path') . \"/components/com_jim/cb_extra.php\");\r\r\n\t\t\t\t\tif (function_exists('user_delete')) {\r\r\n\t\t\t\t\t\t$cb_extra_rules = 1;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\tif (function_exists('user_delete_ext')) {\r\r\n\t\t\t\t\t\t$cb_extra_rules = 2;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\t\t\r\r\n\t\t\t\tbreak;\r\r\n\t\t\tdefault:\r\r\n\t\t\t\t$this->_setErrorMSG(\"Incorrect PMS type\");\r\r\n\t\t\t\treturn false;\r\r\n\t\t\t\tbreak;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\tif (!$cb_extra_rules || $pmsUserFunction=='1') {\r\r\n\t\t\t// print \"Deleting pms data for user \".$user->id;\r\r\n\t\t\tif ($pmsUserDeleteOption != 1) {\r\r\n\t\t\t\t$_CB_database->setQuery( $query_pms_delete );\r\r\n\t\t\t\tif (!$_CB_database->query()) {\r\r\n\t\t\t\t\t$this->_setErrorMSG(\"SQL error \" . $query_pms_delete . $_CB_database->stderr(true));\r\r\n\t\t\t\t\treturn false;\t\t\t\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t\tif ($pmsType == 4 || $pmsType == 3) {\r\r\n\t\t\t\t$_CB_database->setQuery( $query_pms_delete_extra1 );\r\r\n\t\t\t\tif (!$_CB_database->query()) {\r\r\n\t\t\t\t\t$this->_setErrorMSG(\"SQL error \" . $query_pms_delete_extra1 . $_CB_database->stderr(true));\r\r\n\t\t\t\t\treturn false;\t\t\t\r\r\n\t\t\t\t}\t\t\t\r\r\n\t\t\t\t$_CB_database->setQuery( $query_pms_delete_extra2 );\r\r\n\t\t\t\tif (!$_CB_database->query()) {\r\r\n\t\t\t\t\t$this->_setErrorMSG(\"SQL error \" . $query_pms_delete_extra2 . $_CB_database->stderr(true));\r\r\n\t\t\t\t\treturn false;\t\t\t\r\r\n\t\t\t\t}\t\t\t\r\r\n\t\t\t}\r\r\n\t\t\t$cb_extra_return = true;\r\r\n\t\t} else {\r\r\n\t\t\tswitch ($cb_extra_rules) {\r\r\n\t\t\t\tcase 1:\r\r\n\t\t\t\t\t$cb_extra_return = user_delete($user->id);\r\r\n\t\t\t\t\tbreak;\r\r\n\t\t\t\tcase 2:\r\r\n\t\t\t \t$cb_extra_return = user_delete_ext($user->id,$pmsUserDeleteOption);\r\r\n\t\t\t \tbreak;\r\r\n\t\t\t}\t\r\r\n\t\t}\r\r\n\t\treturn $cb_extra_return;\r\r\n\t}", "public function adminDeleteAllByUser($userId)\n\t{\n\t\t// get the user\n\t\t$user = $this->getUser($userId);\n\t\t// get the authkeys for that user\n\t\t$authKeys = $user->authKey()->get();\n\t\t// delete links between the user and any authkeys\n\t\t$user->authKey()->detach();\n\t\t// We need to delete any authkeys that have been detached\n\t\t// and that don't belong to another user\n\t\t$authKeys->each(function($authKey) {\n\t\t\t// If there is no user for the authkey\n\t\t\tif( $authKey->user()->get()->isEmpty() ) {\n\t\t\t\t// soft delete authkey\n\t\t\t\t$authKey->forceDelete();\n\t\t\t}\n\t\t});\n\t\t\n\t\t// return a code 204 header and no content\n\t\treturn $this->setHttpStatusCode('204')->respondWithEmpty();\n\t}", "public function purgeAll() {\n\t\tset_time_limit(300);\n\t\t$this->load->model(\"filehandlerbase\");\n\t\t$fileList = $this->filehandlerbase->findDeletedItems();\n\t\t$mfa = $this->input->post(\"mfa\");\n\t\t$serial = $this->input->post(\"arn\");\n\n\t\t/**\n\t\t * we need to cache this because MFA is only good once\n\t\t */\n\t\t$lastUsedToken = null;\n\t\tforeach($fileList as $fileEntry) {\n\t\t\t$fileHandler = $this->filehandler_router->getHandlerForObject($fileEntry->getFileObjectId());\n\t\t\tif(!$fileHandler) { \n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif(!$fileHandler->loadFromObject($fileEntry)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($lastUsedToken)) {\n\t\t\t\t$fileHandler->s3model->sessionToken = $lastUsedToken;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif(!$fileHandler->deleteSource($serial,$mfa)) {\n\t\t\t\t\t$this->logging->logError(\"purgeAll\",\"Could not delete asset with key\" . $fileEntry->getFileObjectId());\n\t\t\t\t}\n\t\t\t\t$lastUsedToken = $fileHandler->s3model->sessionToken;\n\t\t\t}\n\t\t\tcatch (Exception $e) {\n\t\t\t\techo $e;\n\t\t\t\techo \"Deletion fail\";\n\t\t\t}\n\n\t\t}\n\n\t\tinstance_redirect(\"/admin\");\n\t}", "public function delete_user(&$username)\n {\n // The vBulletin documentation suggests using userdm->delete()\n // to delete a user, but upon examining the code, this doesn't\n // delete everything associated with the user. The following\n // is adapted from admincp/user.php instead.\n // NOTE: THIS MAY REQUIRE MAINTENANCE WITH NEW VBULLETIN UPDATES.\n\n $userdata = $this->db->query_first_slave(\"SELECT userid FROM \"\n . TABLE_PREFIX . \"user WHERE username='{$username}'\");\n $userid = $userdata['userid'];\n if ($userid) {\n\n // from admincp/user.php 'do prune users (step 1)'\n\n // delete subscribed forums\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"subscribeforum WHERE userid={$userid}\");\n // delete subscribed threads\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"subscribethread WHERE userid={$userid}\");\n // delete events\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"event WHERE userid={$userid}\");\n // delete event reminders\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"subscribeevent WHERE userid={$userid}\");\n // delete custom avatars\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"customavatar WHERE userid={$userid}\");\n $customavatars = $this->db->query_read(\"SELECT userid, avatarrevision FROM \"\n . TABLE_PREFIX . \"user WHERE userid={$userid}\");\n while ($customavatar = $this->db->fetch_array($customavatars)) {\n @unlink($this->vbulletin->options['avatarpath'] . \"/avatar{$customavatar['userid']}_{$customavatar['avatarrevision']}.gif\");\n }\n // delete custom profile pics\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"customprofilepic WHERE userid={$userid}\");\n $customprofilepics = $this->db->query_read(\n \"SELECT userid, profilepicrevision FROM \"\n . TABLE_PREFIX . \"user WHERE userid={$userid}\");\n while ($customprofilepic = $this->db->fetch_array($customprofilepics)) {\n @unlink($this->vbulletin->options['profilepicpath'] . \"/profilepic$customprofilepic[userid]_$customprofilepic[profilepicrevision].gif\");\n }\n // delete user forum access\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"access WHERE userid={$userid}\");\n // delete moderator\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"moderator WHERE userid={$userid}\");\n // delete private messages\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"pm WHERE userid={$userid}\");\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"pmreceipt WHERE userid={$userid}\");\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"session WHERE userid={$userid}\");\n // delete user group join requests\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"usergrouprequest WHERE userid={$userid}\");\n // delete bans\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"userban WHERE userid={$userid}\");\n // delete user notes\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"usernote WHERE userid={$userid}\");\n\n // from admincp/users.php 'do prune users (step 2)'\n\n // update deleted user's posts with userid=0\n $this->db->query_write(\"UPDATE \" . TABLE_PREFIX\n . \"thread SET postuserid = 0, postusername = '\"\n . $this->db->escape_string($username)\n . \"' WHERE postuserid = $userid\");\n $this->db->query_write(\"UPDATE \" . TABLE_PREFIX\n . \"post SET userid = 0, username = '\"\n . $this->db->escape_string($username)\n . \"' WHERE userid = $userid\");\n\n // finally, delete the user\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"usertextfield WHERE userid={$userid}\");\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"userfield WHERE userid={$userid}\");\n $this->db->query_write(\"DELETE FROM \" . TABLE_PREFIX\n . \"user WHERE userid={$userid}\");\n }\n /*\n the following is suggested in the documentation but doesn't work:\n\n $existing_user = fetch_userinfo_from_username($username);\n $this->userdm->set_existing($existing_user);\n return $this->userdm->delete();\n */\n }", "static function deleteFiles($pool) {\n $path = JPATH_COMPONENT.DS.\"data\".DS.$pool;\n system(\"rm -rf \".$path);\n $path = JPATH_COMPONENT.DS.\"private\".DS.$pool;\n system(\"rm -rf \".$path);\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleteByUser($user_id)\n {\n return $this->getMapper()->delete(\n $this->getModel()\n ->setUserId($user_id)\n );\n }", "public function destroy(Requests\\DeleteUserRequest $request, $id)\n {\n $user = User::with('photos')->findOrFail($id);\n\n foreach ($user->photos as $photo) {\n if (\\File::exists($photo->PhotoPath)) {\n \\File::delete($photo->PhotoPath);\n }\n }\n\n $user->delete();\n\n return redirect('admin/users')->with('message', 'User successfully deleted!');\n }", "function delete_all_savedproduct($user_id){\t\n\t\t\n\t\t$this -> db -> where('user_id', $user_id);\n\t\t\n\t\t$this -> db -> delete('tbl_saved_product');\n\t\t\n\t\treturn true;\t\t\n\t}", "static final public function count_users_to_undelete() {\n global $CFG, $DB;\n $params = array('confirmed' => 1, 'deleted' => 1, 'mnethostid' => $CFG->mnet_localhost_id);\n return $DB->count_records('user', $params);\n }", "private function delete_all_user_metas() {\n\t\tglobal $wpdb;\n\n\t\t// User option keys are prefixed in single site and multisite when not in network mode.\n\t\t$key_prefix = $this->context->is_network_mode() ? '' : $wpdb->get_blog_prefix();\n\t\t$user_query = new \\WP_User_Query(\n\t\t\tarray(\n\t\t\t\t'fields' => 'id',\n\t\t\t\t'meta_key' => $key_prefix . OAuth_Client::OPTION_ACCESS_TOKEN,\n\t\t\t\t'compare' => 'EXISTS',\n\t\t\t)\n\t\t);\n\n\t\t$users = $user_query->get_results();\n\n\t\tforeach ( $users as $user_id ) {\n\t\t\t// Deletes all user stored options.\n\t\t\t$user_options = new User_Options( $this->context, $user_id );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_ACCESS_TOKEN );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_ACCESS_TOKEN_EXPIRES_IN );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_ACCESS_TOKEN_CREATED );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_REFRESH_TOKEN );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_REDIRECT_URL );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_AUTH_SCOPES );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_ERROR_CODE );\n\t\t\t$user_options->delete( OAuth_Client::OPTION_PROXY_ACCESS_CODE );\n\t\t\t$user_options->delete( Verification::OPTION );\n\t\t\t$user_options->delete( Verification_Tag::OPTION );\n\t\t\t$user_options->delete( Profile::OPTION );\n\n\t\t\t// Clean up old user api key data, moved to options.\n\t\t\t// @todo remove after RC.\n\t\t\t$user_options->delete( 'googlesitekit_api_key' );\n\t\t\t$user_options->delete( 'sitekit_authentication' );\n\t\t\t$user_options->delete( 'googlesitekit_stored_nonce_user_id' );\n\t\t}\n\t}", "public function clearAll($userId)\n {\n $this->db->createCommand()\n ->update($this->notificationsTable, [\n 'is_deleted' => 1,\n 'updated_at' => time()\n ], [\n 'user_id' => $userId,\n 'is_deleted' => 0\n ])\n ->execute();\n }", "public function deleteAll()\n {\n \\Core\\File\\System::rrmdir($this->_getPath(), false, true);\n }", "public static function deleteByUser($a_user_id)\r\n\t{\r\n\t\tglobal $ilDB;\r\n\t\t\r\n\t\t$query = \"DELETE FROM cal_shared WHERE obj_id = \".$ilDB->quote($a_user_id ,'integer').\" \";\r\n\t\t$res = $ilDB->manipulate($query);\r\n\t\treturn true;\r\n\t\t\r\n\t\t// TODO: delete also cal_shared_user_status\r\n\t}", "public static function deleteFiles() : void{\n $files = glob(self::DIRECTORY . '/*');\n foreach($files as $file){\n if(is_file($file))\n unlink($file);\n }\n }", "public function delete($user){\n }", "public function deleteFilePerm(){\r\n\t\t$storage_name = $this->uri->segment(3);\r\n\r\n\t\t//Check if the file exists\r\n\t\tif(!$this->DataModel->fileExists($storage_name) == TRUE){\r\n\t\t\t//File doesn't exist\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Check if the user has permission to delete the file\r\n\t\tif(!$this->DataModel->userPermission('edit', $storage_name, $this->authentication->uid)){\r\n\t\t\t//User doesn't has permission to edit / delete this file\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n\r\n\t\t//Get information of file\r\n\t\t$file = $this->DataModel->fileInformation($storage_name);\r\n\t\t//Make sure that that file is already trashed\r\n\t\tif($file['trash'] == 1){\r\n\t\t\t//Permanently delete the file\r\n\t\t\t$files = array ();\r\n\t\t\t$files[] = $file;\r\n\t\t\t$this->deleteFilesPermanently($files);\r\n\r\n\t\t}\telse{\r\n\t\t\tredirect('/');\r\n\t\t}\r\n\t}", "public function maybe_delete_files() {\n\n\t\t// If there are files to delete, delete them.\n\t\tif ( ! empty( gf_dropbox()->files_to_delete ) ) {\n\n\t\t\t// Log files being deleted.\n\t\t\t$this->log_debug( __METHOD__ . '(): Deleting local files => ' . print_r( gf_dropbox()->files_to_delete, 1 ) );\n\n\t\t\t// Delete files.\n\t\t\tarray_map( 'unlink', gf_dropbox()->files_to_delete );\n\n\t\t}\n\n\t}", "protected function utilPurgeOrphans()\n {\n if (!$this->confirmToProceed('This will PERMANENTLY DELETE files in \"system_files\" that do not belong to any other model.')) {\n return;\n }\n\n $orphanedFiles = 0;\n\n // Locate orphans\n $files = FileModel::whereNull('attachment_id')->get();\n\n foreach ($files as $file) {\n $file->delete();\n $orphanedFiles += 1;\n }\n\n if ($orphanedFiles > 0) {\n $this->comment(sprintf('Successfully deleted %d orphaned record(s).', $orphanedFiles));\n }\n else {\n $this->comment('No records to purge.');\n }\n }", "public function deleteUser()\n {\n $this->delete();\n }", "public static function delete_data_for_users(approved_userlist $userlist) {\n }", "public function deleteAll($userId) {\n $this->db\n ->where('idUser', $userId)\n ->delete('Notification');\n return $this->db->affected_rows();\n }", "public function delete(User $user)\n {\n if (!$user->exists()) {\n return;\n }\n\n $users = $this->getAll();\n\n //Array con las líneas del archivo\n $lines = [];\n\n //Recorro el array de usuarios y voy generando las líneas del archivo con\n //json_encode de cada usuario, salteando al usuario a eliminar\n foreach ($users as $readUser) {\n if ($readUser->getId() == $user->getId()) {\n continue;\n }\n\n $lines[] = json_encode($readUser->toArray());\n }\n\n //Piso el archivo con el nuevo contenido\n file_put_contents($this->getJsonFilePath(), implode(\"\\n\", $lines).\"\\n\");\n }", "public function deleteMutipleUsers(){\n\t\t if(count($_REQUEST['user_ids']>0)){\n\t\t\tforeach($_REQUEST['user_ids'] as $val){\n\t\t\t\t$user \t\t= Sentinel::findUserById($val);\n\t\t\t\t$id \t\t=\t $user->id;\n\t\t\t\t\n\t\t\t$userInfoArr\t=\tDB::table('user_payments')->where('user_id','=',$id)\n\t\t\t->where('stripe_customer_id','!=','')\n\t\t\t->where('status','=','active')\n\t\t\t->first();\n\t\t\t\n\t\t\tif(count($userInfoArr)>0){\n\t\t\t\t$url_cst = 'https://api.stripe.com/v1/customers/'.$userInfoArr->stripe_customer_id;\n\t\t\t\t$delete_stripe_customer = $this->delete_stripe_customer($headers,$url_cst,'DELETE');\n\t\t\t\t\n\t\t\t}\n\t\t\t\t$userInvite = DB::table('users')->select('email')->where('id',\"=\",$id)->first();\n\t\t\t\tDB::table('userinvites')->where('email','=',$userInvite->email)->delete();\n\t\t\t\tDB::table('users')->where('id', '=', $id)->delete();\n\t\t\t\tDB::table('user_payments')->where('user_id', '=', $id)->delete();\n\t\t\t\tDB::table('events')->where('user_id', '=', $id)->delete();\n\t\t\t\t\n\t\t\t}\n\t\t }\n\t }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function deleteByFileIds()\n\t{\n\t\tif ( isset( \\IPS\\Request::i()->fileIds ) )\n\t\t{\n\t\t\t$ids = \\IPS\\Request::i()->fileIds;\n\t\t\t\n\t\t\tif ( ! \\is_array( $ids ) )\n\t\t\t{\n\t\t\t\t$try = json_decode( $ids, TRUE );\n\t\t\t\t\n\t\t\t\tif ( ! \\is_array( $try ) )\n\t\t\t\t{\n\t\t\t\t\t$ids = array( $ids );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$ids = $try;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( \\count( $ids ) )\n\t\t\t{\n\t\t\t\t\\IPS\\cms\\Media::deleteByFileIds( $ids );\n\t\t\t}\n\t\t}\n\t}", "function delete_all_user_settings()\n {\n }", "private function clearTemporaryFiles($usertempdir)\n\t{\n\t\tif (file_exists($usertempdir))\n\t\t{\n\t\t\t$handle=opendir($usertempdir);\n\t\t\n\t\t\twhile (($file = readdir($handle))!==false)\n\t\t\t{\n\t\t\t\t@unlink($usertempdir.'/'.$file);\n\t\t\t}\n\t\t\n\t\t\tclosedir($handle);\n\t\t}\n\t}", "public static function delete(Users $user)\n {\n $email=$user->Email;\n DB::delete(\"user\",\"Email='$email' AND IsDeleted=0\");\n \n //$conn->close();\n header('location: DeleteUser.php');\n\n }", "public function flushCommand() {\n\t\t$iterator = new DirectoryIterator(UploadManager::UPLOAD_FOLDER);\n\n\t\t$counter = 0;\n\t\tforeach ($iterator as $file) {\n\t\t\tif ($file->isFile()) {\n\t\t\t\t$counter++;\n\t\t\t\tunlink(UploadManager::UPLOAD_FOLDER . DIRECTORY_SEPARATOR . $file->getFilename());\n\t\t\t}\n\t\t}\n\n\t\t$this->outputLine(sprintf('I have removed %s file(s).', $counter));\n\t}", "public static function delete_data_for_users(approved_userlist $userlist) {\n global $DB;\n\n if (empty($userlist->get_userids())) {\n return;\n }\n\n $context = $userlist->get_context();\n if ($context instanceof \\context_course) {\n list($usersql, $userparams) = $DB->get_in_or_equal($userlist->get_userids(), SQL_PARAMS_NAMED);\n $select = \"itemid = :itemid AND userid {$usersql} AND type = :type\";\n $params = $userparams;\n $params['itemid'] = $context->instanceid;\n $params['type'] = \\backup::TYPE_1COURSE;\n\n $DB->delete_records_select('backup_controllers', $select, $params);\n\n $params = $userparams;\n $params['course'] = $context->instanceid;\n $params['type'] = \\backup::TYPE_1SECTION;\n $sectionsql = \"itemid IN (SELECT id FROM {course_sections} WHERE course = :course)\";\n $select = $sectionsql . \" AND userid {$usersql} AND type = :type\";\n $DB->delete_records_select('backup_controllers', $select, $params);\n }\n if ($context instanceof \\context_module) {\n list($usersql, $userparams) = $DB->get_in_or_equal($userlist->get_userids(), SQL_PARAMS_NAMED);\n $select = \"itemid = :itemid AND userid {$usersql} AND type = :type\";\n $params = $userparams;\n $params['itemid'] = $context->instanceid;\n $params['type'] = \\backup::TYPE_1ACTIVITY;\n\n // Delete activity backup data.\n $select = \"itemid = :itemid AND type = :type AND userid {$usersql}\";\n $params = ['itemid' => $context->instanceid, 'type' => 'activity'] + $userparams;\n $DB->delete_records_select('backup_controllers', $select, $params);\n }\n }", "public function clearAll() {\n $list = scandir(self::ROOT_PATH . \"/public/{$this->storagePath}\");\n foreach ($list as $file) {\n if ($file == '.' || $file == '..') {\n continue;\n }\n $filePath = self::ROOT_PATH . \"/public/{$this->storagePath}/$file\";\n unlink($filePath);\n }\n $this->_tableGw->delete();\n }", "function forum_delete_user($user) {\n $pp = BoincPost::enum(\"user=$user->id\");\n foreach ($pp as $p) {\n $t = BoincThread::lookup_id($p->thread);\n $f = BoincForum::lookup_id($t->forum);\n if ($t && $f) {\n delete_post($p, $t, $f);\n }\n }\n $ss = BoincSubscription::enum(\"userid=$user->id\");\n foreach ($ss as $s) {\n BoincSubscription::delete($s->userid, $s->threadid);\n }\n $p = BoincForumPrefs::lookup_userid($user->id);\n $p->delete();\n}", "public function actionRemove() {\n if (!isset($_POST['id']))\n die(\"what?\");\n $id = (int) $_POST['id'];\n if ($id < 1)\n die(\"unknown file\");\n CUserfiles::model()->RemoveFile($this->user_id, $id);\n\n echo \"OK\";\n }", "public function destroy(Request $request, User $user)\n {\n $this->authorize('delete', $user);\n Auth::guard('web')->logout();\n $request->session()->invalidate();\n $request->session()->regenerateToken();\n $user->comments()->each(function($comment) {\n $comment->delete(); // <-- direct deletion\n });\n $user->posts()->each(function($post) {\n if(!is_null($post->file)) $post->file->delete();\n $post->delete(); // <-- direct deletion\n });\n $user->delete();\n\n return redirect(route('login'))->with('message', 'User Deleted Successfully!');\n }", "public function removeUserData($user)\n {\n\t throw new Ingo_Exception(_(\"Removing user data is not supported with the current filter storage backend.\"));\n }", "function delete_user($user_id, $db){\n $db->DBDelete(\"comments\", array(\"users_id\"=>$user_id));\n // delete all his posts with its comments\n // get all his posts\n $all_posts = $db->DBSelectAll(\"posts\", \"id\", array(\"users_id\"=>$user_id));\n if($all_posts != null && count($all_posts) > 0){\n foreach ($all_posts as $value) {\n // get all its comments\n $all_comments = $db->DBSelectAll(\"comments\", \"id\", array(\"posts_id\"=>$value[\"id\"]));\n // delete them all\n if($all_comments != null && count($all_comments) > 0){\n foreach ($all_comments as $com) {\n $db->DBDelete(\"comments\", array(\"id\"=>$com[\"id\"]));\n }\n }\n // delete the post\n $db->DBDelete(\"posts\", array(\"id\"=>$value[\"id\"]));\n // delete its pic\n $img_to_del = \"images/post/\".$value[\"id\"].\".png\";\n if(file_exists($img_to_del)){\n $file = \"test.txt\";\n unlink($img_to_del);\n }\n }\n }\n \n // delete his ava\n $img_to_del = \"images/ava/\".$user_id.\".png\";\n if(file_exists($img_to_del)){\n $file = \"test.txt\";\n unlink($img_to_del);\n }\n // delete him\n $db->DBDelete(\"users\", array(\"id\"=>$user_id));\n}", "public function destroy($user)\n {\n $post = Post::findOrFail($user);\n\n if($post->photo->file)\n {\n unlink(public_path(). $post->photo->file);\n }\n\n $post->delete();\n\n return redirect('/admin/posts');\n }" ]
[ "0.7186379", "0.68628603", "0.68628603", "0.67843044", "0.6757004", "0.665675", "0.66114825", "0.6603041", "0.64864606", "0.64622504", "0.6282791", "0.6076416", "0.6042093", "0.6027785", "0.60093176", "0.6000545", "0.5975668", "0.59659314", "0.5959334", "0.5893966", "0.5844271", "0.5842512", "0.5825231", "0.5808576", "0.5803318", "0.5801086", "0.579441", "0.57921016", "0.5757056", "0.57526386", "0.57484865", "0.5747006", "0.5746758", "0.5743277", "0.5742818", "0.57420975", "0.57306534", "0.5717048", "0.5688465", "0.567801", "0.5675198", "0.56653893", "0.5656115", "0.5650813", "0.5644888", "0.56387633", "0.5624053", "0.56195754", "0.5614674", "0.56146634", "0.56044704", "0.558715", "0.55779576", "0.5570624", "0.5559811", "0.55495447", "0.5546544", "0.5531734", "0.5519947", "0.55174303", "0.551661", "0.5507303", "0.5506084", "0.54805535", "0.54805535", "0.54805535", "0.54785585", "0.54669636", "0.5462171", "0.5458922", "0.5456928", "0.54541445", "0.5453074", "0.5451801", "0.54448986", "0.54344827", "0.54328865", "0.5408268", "0.5405702", "0.5402736", "0.53920037", "0.5386173", "0.5384268", "0.53833556", "0.5382901", "0.5382901", "0.5382901", "0.5382011", "0.53751665", "0.53645825", "0.536282", "0.5360413", "0.5356101", "0.5354835", "0.5354462", "0.5351366", "0.53477055", "0.5344621", "0.5338587", "0.5337556" ]
0.77030516
0
Returns path to file relative from user's/system directory
function cot_pfs_filepath($id) { global $db, $db_pfs_folders, $db_pfs, $cfg; $sql = $db->query("SELECT p.pfs_file AS file, f.pff_path AS path FROM $db_pfs AS p LEFT JOIN $db_pfs_folders AS f ON p.pfs_folderid=f.pff_id WHERE p.pfs_id=".(int)$id." LIMIT 1"); if($row = $sql->fetch()) { return ($cfg['pfs']['pfsuserfolder'] && $row['path']!='') ? $row['path'].'/'.$row['file'] : $row['file']; } else { return ''; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_full_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_full_name();\n\t}", "public function getLocalPath()\r\n\t{\r\n\t\t$accountNumber = $this->getAccountNumber();\r\n\r\n\t\t$file_dir = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t$file_dir2 = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t\r\n\t\tif ($this->owner_id!=null)\r\n\t\t{\r\n\t\t\t$file_dir .= \"/\".$this->owner_id;\r\n\t\t\t$file_dir2 .= \"/\".$this->owner_id;\r\n\t\t}\r\n\r\n\t\tif (!file_exists($file_dir.\"/\".$this->name_lcl))\r\n\t\t{\r\n\t\t\tif (file_exists($file_dir2.\"/\".$this->name_lcl))\r\n\t\t\t\t$file_dir = $file_dir2;\r\n\t\t}\r\n\r\n\t\t$file_dir .= \"/\".$this->name_lcl;\r\n\r\n\t\treturn $file_dir;\r\n\t}", "function dirPath() {return (\"../../../../\"); }", "private function getPath()\n\t{\n\t\treturn $this->_sys_path;\n\t}", "private function _getSourceFileSystemPath()\n\t{\n\t\treturn rtrim($this->getSettings()->path, '/').'/';\n\t}", "function dirPath() { return (\"../\"); }", "public static function getFilePath()\n\t{\n\t\treturn __FILE__;\n\t}", "public static function getFilePath()\n\t{\n\t\treturn __FILE__;\n\t}", "function dirPath () { return (\"../../\"); }", "public static function getFileLocation()\n {\n $config = Yaml::parseFile(__DIR__.'/../../config.yaml');\n return (isset($config[\"log\"][\"file\"])) ? __DIR__.\"/\".$config[\"log\"][\"file\"] : __DIR__.\"/app.log\";\n }", "public function getFilePath()\n {\n\n if (is_writable($_SERVER['DOCUMENT_ROOT'])) {\n return $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $this->getFileName();\n }\n\n }", "public function getSystemDirectoryPath() {\n return Mage::getBaseDir('var') . '/smartling/localization_files';\n }", "protected function getCurrentAbsolutePath() {\n\t\treturn dirname(SS_ClassLoader::instance()->getManifest()->getItemPath(get_class($this)));\n\t}", "function relative_path() {\n $rel = str_replace($_SERVER['DOCUMENT_ROOT'], null, str_replace(basename(dirname(__FILE__)), null, dirname(__FILE__)));\n return (preg_match('/^\\//', $rel)) ? substr($rel, 1, strlen($rel)) : $rel;\n}", "protected function determinedFullPath()\n {\n // TODO: See why windows cannot use the the full path\n /*return dirname((new ReflectionClass($this))->getFileName()) .\n DIRECTORY_SEPARATOR .\n '..' .\n DIRECTORY_SEPARATOR .*/\n return $this->getWebRoot() .\n DIRECTORY_SEPARATOR .\n $this->path;\n }", "public function getFilepath() {\n\t\treturn RuntimeDirectoryManager::getDocumentRoot().$this->filename;\n\t}", "public function GetRealPath()\n {\n return PATH_CMS_CUSTOMER_DATA.'/'.$this->GetRealFileName();\n }", "public static function path($file)\n\t{\n\t\tif (strpos($file, APP_PATH) === 0)\n\t\t{\n\t\t\t$file = 'APP_PATH' . DS . substr($file, strlen(APP_PATH));\n\t\t}\n\t\telseif (strpos($file, MOD_PATH) === 0)\n\t\t{\n\t\t\t$file = 'MOD_PATH' . DS . substr($file, strlen(MOD_PATH));\n\t\t}\n\t\telseif (strpos($file, SYS_PATH) === 0)\n\t\t{\n\t\t\t$file = 'SYS_PATH' . DS . substr($file, strlen(SYS_PATH));\n\t\t}\n\t\treturn $file;\n\t}", "public function getAbsoluteDir()\n {\n return $this->getMachine()->getHome() . '/' . $this->getDir() . '/';\n }", "public function getLocalPath();", "public function filePath($file) {\r\n $file = $this->fileLoad($file);\r\n return drupal_realpath($file->uri);\r\n }", "public function path(): string\n {\n return realpath($this->file);\n }", "static public function getFilePath($file, $base_path = null)\n {\n // If this is already a correct path, return it\n if (@is_file($file) && @is_readable($file)) {\n return realpath($file);\n }\n\n // Determine the application path\n $app = JRequest::getInt('app', JFactory::getApplication()->getClientId());\n if ($app == 1) {\n $app_path = JPATH_ADMINISTRATOR;\n } else {\n $app_path = JPATH_SITE;\n }\n\n // Make sure the basepath is not a file\n if (@is_file($base_path)) {\n $base_path = dirname($base_path);\n }\n\n // Determine the basepath\n if (empty($base_path)) {\n if (substr($file, 0, 1) == '/') {\n $base_path = JPATH_SITE;\n } else {\n $base_path = $app_path;\n }\n }\n\n // Append the base_path\n if (strstr($file, $base_path) == false && !empty($base_path)) {\n $file = $base_path.'/'.$file;\n }\n\n // Detect the right application-path\n if (JFactory::getApplication()->isAdmin()) {\n if (strstr($file, JPATH_ADMINISTRATOR) == false && @is_file(JPATH_ADMINISTRATOR.'/'.$file)) {\n $file = JPATH_ADMINISTRATOR.'/'.$file;\n } else if (strstr($file, JPATH_SITE) == false && @is_file(JPATH_SITE.'/'.$file)) {\n $file = JPATH_SITE.'/'.$file;\n }\n } else {\n if (strstr($file, JPATH_SITE) == false && @is_file(JPATH_SITE.'/'.$file)) {\n $file = JPATH_SITE.'/'.$file;\n }\n }\n\n // If this is not a file, return empty\n if (@is_file($file) == false || @is_readable($file) == false) {\n return null;\n }\n\n // Return the file\n return realpath($file);\n }", "function absPath($value){\r\n\treturn realpath(dirname(__dir__, $value));\r\n}", "function absPath($value){\r\n\treturn realpath(dirname(__dir__, $value));\r\n}", "public function getRelativePath($file)\n {\n return $this->config['directories']['app'] . '/' . $file;\n }", "public function getFullPath()\n\t{\n\t\treturn $this->getServerName() . $this->getScriptDirectory();\n\t}", "protected function getPath () {\n\tglobal $Config;\n\treturn $Config->get('dir_root').'/'.$this->dir.'/'.$this->name;\n }", "public function relativePath() : string {\n $path = empty($this->path) ? '' : Path::toRelative($this->path, true);\n return $path; \n }", "protected function getFilesystemPath()\n {\n return dirname($this->path);\n }", "function getRealpath( $_path )\n{\n $__path = $_path;\n if ( isRelative( $_path ) ) {\n $__curdir = unifyPath( realpath( \".\" ) . _PL_OS_SEP );\n $__path = $__curdir . $__path;\n }\n $__startPoint = \"\";\n if ( checkCurrentOS( \"Win\" ) ) {\n list( $__startPoint, $__path ) = explode( \":\", $__path, 2 );\n $__startPoint .= \":\";\n }\n # From now processing is the same for WIndows and Unix, and hopefully for others.\n $__realparts = array( );\n $__parts = explode( _PL_OS_SEP, $__path );\n for ( $i = 0; $i < count( $__parts ); $i++ ) {\n if ( strlen( $__parts[ $i ] ) == 0 || $__parts[ $i ] == \".\" ) {\n continue;\n }\n if ( $__parts[ $i ] == \"..\" ) {\n if ( count( $__realparts ) > 0 ) {\n array_pop( $__realparts );\n }\n }\n else {\n array_push( $__realparts, $__parts[ $i ] );\n }\n }\n return $__startPoint . _PL_OS_SEP . implode( _PL_OS_SEP, $__realparts );\n}", "function getFileFullPath($fileName) {\n\tglobal $GrunPath;\n\treturn $GrunPath.\"/\".$fileName;\n}", "protected function getCurrentAbsolutePath() \n\t{\n\t\t$filename = self::$test_class_manifest->getItemPath(get_parent_class($this));\n\t\tif(!$filename) throw new LogicException(\"getItemPath returned null for \" . get_parent_class($this));\n\t\treturn dirname($filename);\n\t}", "function getAbsolutePath() ;", "function getAppPath() {\r\n\r\n $root = str_replace('\\\\', '/', $_SERVER['DOCUMENT_ROOT']);\r\n if (substr($root, -1) === '/') { // remove any trailing / which should not be there\r\n $root = substr($root, 0, -1);\r\n }\r\n $dir = str_replace('\\\\', '/', dirname(__FILE__));\r\n\r\n $path = str_replace($root, '', $dir) . '/';\r\n\r\n return $path;\r\n\r\n }", "protected static function getPathThisScriptNonCli() {}", "function serendipity_getRealDir($file) {\n $dir = str_replace( \"\\\\\", \"/\", dirname($file));\n $base = preg_replace('@/include$@', '', $dir) . '/';\n return $base;\n}", "public function getUsablePath()\n {\n $extension = pathinfo($path = $this->getRelativePath(), PATHINFO_EXTENSION);\n\n $path = strstr($path, \".{$extension}\", true);\n\n return \"{$path}.{$this->getUsableExtension()}\";\n }", "function cot_pfs_path($userid)\n{\n\tglobal $cfg;\n\n\tif ($cfg['pfs']['pfsuserfolder'])\n\t{\n\t\treturn($cfg['pfs_dir'].'/'.$userid.'/');\n\t}\n\telse\n\t{\n\t\treturn($cfg['pfs_dir'].'/');\n\t}\n}", "public function getSystemPath() {\n return $this->system_path;\n }", "static public function getLocalPath($path) {\n\t\t$datadir = \\OC_User::getHome(\\OC_User::getUser()) . '/files';\n\t\t$newpath = $path;\n\t\tif (strncmp($newpath, $datadir, strlen($datadir)) == 0) {\n\t\t\t$newpath = substr($path, strlen($datadir));\n\t\t}\n\t\treturn $newpath;\n\t}", "public function getPathToFile(): string;", "public function path( $relative_path = '/' ) {\n\t\treturn plugin_dir_path( $this->main_file ) . ltrim( $relative_path, '/' );\n\t}", "function cot_pfs_relpath($userid)\n{\n\tglobal $cfg;\n\n\tif ($cfg['pfs']['pfsuserfolder'])\n\t{\n\t\treturn($userid.'/');\n\t}\n\telse\n\t{\n\t\treturn('');\n\t}\n}", "public function getFullPath();", "abstract public function getLocalPath(File $file);", "protected function get_file() {\n\n\t\treturn __FILE__;\n\t}", "protected function action_getUserMainDir() {}", "public static function file() {\r\n\t\treturn __FILE__;\r\n\t}", "function relative_to_absolute($filepath) {\n\treturn str_replace(__CHV_RELATIVE_ROOT__, __CHV_ROOT_DIR__, str_replace('\\\\', '/', $filepath));\n}", "function getLocalFilePath($fileName) {\n return PATHS[$fileName];\n}", "function path($path='') {\n return $this->base_dir . $path;\n }", "public function getRelativeFilename(): string\n {\n return $this->relative_filename;\n }", "function getServerFilePath($fileName) {\n return $_SERVER['DOCUMENT_ROOT'].PATHS[$fileName];\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 }", "public function getAbsolutePath(): string\n {\n return sprintf('%s/%s', $this->baseDirectory, $this->relativePath);\n }", "public function getFilepath()\n {\n $filepath = $this->_path['dirname'].DIRECTORY_SEPARATOR.$this->_path['filename'];\n\n if ($this->_path['extension'])\n $filepath .= '.'.$this->_path['extension'];\n\n return $filepath;\n }", "public function getFileAbsolutePath($file);", "function getApplicationSystemPath(){\n\treturn $_SESSION[ SESSION_NAME_SPACE ][ 'systemPath' ];\n}", "public static function getFileadminPath() {\n\t\treturn 'fileadmin/';\n\t}", "public function getEnvironmentFilePath()\n {\n return $this->getEnvironmentPath() . '/' . $this->getEnvironmentFile();\n }", "public function getFilepath();", "public function getFullPath(): string;", "protected function getAbsolutePath()\n {\n return '/var/www/html/ColdkitchenSymfony/web/'.$this->getUploadPath();\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}", "function filepath()\n {\n return \"/var/www/html/mover/\";\n }", "public function getAbsolutePathOfRelativeReferencedFileOrPathResolvesFileCorrectlyDataProvider() {}", "public function getResource(string $relativePath): string {\n return (new \\SplFileObject($relativePath, 'rb', true))->getRealPath();\n }", "public function getPath($file_path = null)\n {\n if (!$file_path) {\n return $this->base_path;\n }\n\n return $this->base_path.'/'.$file_path;\n }", "public static function getFullPath($fileResource)\n {\n $extensionManager = OntoWiki::getInstance()->extensionManager;\n $privateConfig = $extensionManager->getPrivateConfig('files');\n $path = $privateConfig->path;\n\n return _OWROOT . $path . DIRECTORY_SEPARATOR . md5($fileResource);\n }", "public static function getPath()\r\n {\r\n if ( ! self::$_path) {\r\n self::$_path = dirname(__FILE__);\r\n }\r\n return self::$_path;\r\n }", "public function fullPath(){\n if ( strpos( $this->template, DIRECTORY_SEPARATOR ) === 0 ) {\n return $this->template . '.php';\n } else {\n return $this->path . DIRECTORY_SEPARATOR . $this->template . '.php';\n }\n }", "public static function getFilePath(): string\n {\n return static::getInstance()->getFilePath();\n }", "public function myFileLocation()\r\n {\r\n $reflection = new ReflectionClass($this);\r\n\r\n return dirname($reflection->getFileName());\r\n }", "protected function getPath($file)\n {\n return $this->root . '/' . $file;\n }", "abstract public function getCurrentPath();", "function absolute_to_relative($filepath) {\n\treturn str_replace(__CHV_ROOT_DIR__, __CHV_RELATIVE_ROOT__, str_replace('\\\\', '/', $filepath));\n}", "public function getPath()\n {\n return $this->directory->getRealPath();\n }", "private static function getFilePath( $file )\n\t\t{\n\t\t\treturn Runtime::get('LOCALE_DIR').'/'.self::get().'/'.$file;\n\t\t}", "function base_path($path = '')\n {\n return str_replace('//' ,'/',str_ireplace('/' . SYSTEMPATHS['core'], '/', __DIR__) . '/' . $path);\n }", "private function getRealPath(string $relativePath): string\n {\n return str_replace(\" \", \"\\ \", realpath($relativePath));\n }", "private function get_relative_file( $file ) {\n\t\treturn ltrim( str_replace( dirname( app()->plugin_file ), '', $file ), '/' );\n\t}", "private function getRealPath(string $path): string\n {\n if (false === ($ret = realpath($path))) {\n $this->error(\"File does not exist: \\\"$path\\\".\");\n }\n return $ret;\n }", "function cemhub_get_private_file_system_path($absolute_path = FALSE) {\n $stored_path = variable_get('file_private_path', FALSE);\n\n $return_path = $stored_path;\n\n if ($stored_path && $absolute_path) {\n $return_path = getcwd() . '/' . $stored_path;\n }\n\n return $return_path;\n}", "public function getAbsolutePath(){\n\t \treturn $this->getAbsoluteDirname().'/'.$this->filename.'.'.$this->extension;\n\t }", "public function get_path()\n\t\t{\n\t\t\tif ($this->path) {\n\t\t\t\treturn $this->path.'/'.$this->get_full_name();\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t$hash = $this->hash();\n\t\t\t\t} catch(\\System\\Error\\File $e) {\n\t\t\t\t\t$hash = null;\n\t\t\t\t}\n\n\t\t\t\tif ($hash) {\n\t\t\t\t\treturn $this->get_path_hashed();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}", "function get_parent_theme_file_path($file = '')\n {\n }", "public function getFilepath() {\n\t\treturn $this->directory.$this->fileprefix.'-'.$this->filename.'.'.static::EXTENSION;\n\t}", "public function getFullpath()\n\t{\n\t\treturn $this->filesystem->getAdapter()->root . $this->path;\n\t}", "public static function toAbsolute(String $relativePath=''): String\n {\n return __DIR__ . \"/../../$relativePath\";\n }", "private function getFilePath() {\n return FileService::getInstance()->getTempDirPath() . DIRECTORY_SEPARATOR . $this->fileBaseName;\n }", "public function filePath() {\n return $this->baseDir() . '/' . $this->fileName();\n }", "public function getAbsolutePath() {}", "public function getAbsolutePath() {}", "public function get_file() {\n\t\treturn __FILE__;\n\t}", "public function getResourceSpacePath()\n\t{\n\t\treturn realpath(dirname(__FILE__).'/../../../'.Yii::app()->config->system['rsDirectory']).'/';\n\t}", "public function getAbsolutePath();", "public function getAppPath()\n\t{\n\t\t$appName = $this->getAppName();\n\t\tif (empty($this->_appBasePath) || empty($appName)) {\n\t\t\trequire_once 'Syx/Platform/Exception.php';\n\t\t\tthrow new Syx_Platform_Exception('applications base path and application name must assign before use');\n\t\t}\n\t\treturn $this->_appBasePath . '/' . $appName;\n\t}", "function fn_get_http_files_dir_path()\n{\n $path = fn_get_rel_dir(fn_get_files_dir_path());\n $path = Registry::get('config.http_location') . '/' . $path;\n\n return $path;\n}", "public function getExternalPath() {\n if (true === $this->_config->getConfigData('development_environment')) {\n $extPath = EXT_ROOT . $this->_config->getConfigData('base_path_dev');\n } else {\n $extPath = EXT_ROOT . $this->_config->getConfigData('base_path');\n }\n return $extPath;\n }", "function get_path_relative_to($path, $relative_to) {\n return substr($path, strlen($relative_to));\n }" ]
[ "0.69055176", "0.69027007", "0.68939555", "0.687307", "0.6829995", "0.6775589", "0.67542493", "0.67542493", "0.6751884", "0.6690843", "0.6671286", "0.6670056", "0.66671604", "0.66572946", "0.6634951", "0.6634836", "0.662934", "0.65823036", "0.65779316", "0.6566234", "0.6525042", "0.65143657", "0.6508931", "0.6505936", "0.6505936", "0.65054417", "0.6495394", "0.64864534", "0.6485683", "0.6476142", "0.64748025", "0.64688927", "0.64662975", "0.646447", "0.64611626", "0.64568454", "0.6425748", "0.6407663", "0.64005065", "0.63970554", "0.6392324", "0.6379416", "0.6361431", "0.635907", "0.6350618", "0.63433015", "0.6327266", "0.6322598", "0.63130224", "0.6308667", "0.6306166", "0.6298568", "0.629662", "0.6292679", "0.62879723", "0.62849367", "0.62808055", "0.6276475", "0.62759364", "0.62758726", "0.6270741", "0.6267828", "0.62618726", "0.62531334", "0.6249853", "0.6249674", "0.6238712", "0.6234862", "0.6232994", "0.6230395", "0.6229612", "0.622092", "0.62207323", "0.6218169", "0.6217321", "0.6216607", "0.6216265", "0.6215271", "0.6211799", "0.6207511", "0.6205063", "0.6203439", "0.6189664", "0.6185366", "0.6178237", "0.61756164", "0.61710966", "0.6169968", "0.6168535", "0.6165917", "0.6165301", "0.6163398", "0.61560905", "0.61560905", "0.6155678", "0.61508864", "0.6145542", "0.6144765", "0.61420494", "0.61387795", "0.6130591" ]
0.0
-1
Returns path to folder relative from user's/system directory
function cot_pfs_folderpath($folderid, $fullpath='') { global $db, $db_pfs_folders, $cfg; if($fullpath==='') $fullpath = $cfg['pfs']['pfsuserfolder']; if($fullpath && $folderid>0) { // TODO Clean up this mess and fix pff_path $sql = $db->query("SELECT pff_path FROM $db_pfs_folders WHERE pff_id=".(int)$folderid); if($sql->rowCount()==0) { return FALSE; } else { return $sql->fetchColumn().'/'; } } else { return ''; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dirPath () { return (\"../../\"); }", "function dirPath() {return (\"../../../../\"); }", "function dirPath() { return (\"../\"); }", "public function getLocalPath()\r\n\t{\r\n\t\t$accountNumber = $this->getAccountNumber();\r\n\r\n\t\t$file_dir = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t$file_dir2 = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t\r\n\t\tif ($this->owner_id!=null)\r\n\t\t{\r\n\t\t\t$file_dir .= \"/\".$this->owner_id;\r\n\t\t\t$file_dir2 .= \"/\".$this->owner_id;\r\n\t\t}\r\n\r\n\t\tif (!file_exists($file_dir.\"/\".$this->name_lcl))\r\n\t\t{\r\n\t\t\tif (file_exists($file_dir2.\"/\".$this->name_lcl))\r\n\t\t\t\t$file_dir = $file_dir2;\r\n\t\t}\r\n\r\n\t\t$file_dir .= \"/\".$this->name_lcl;\r\n\r\n\t\treturn $file_dir;\r\n\t}", "public function getSystemDirectoryPath() {\n return Mage::getBaseDir('var') . '/smartling/localization_files';\n }", "public function getAbsoluteDir()\n {\n return $this->getMachine()->getHome() . '/' . $this->getDir() . '/';\n }", "public static function get_directory() : string {\r\n\t\treturn Core::get_app_path( self::$directory );\r\n\t}", "private function getPathToRootDir()\n {\n return '%kernel.project_dir%';\n }", "protected function getPath () {\n\tglobal $Config;\n\treturn $Config->get('dir_root').'/'.$this->dir.'/'.$this->name;\n }", "function cot_pfs_path($userid)\n{\n\tglobal $cfg;\n\n\tif ($cfg['pfs']['pfsuserfolder'])\n\t{\n\t\treturn($cfg['pfs_dir'].'/'.$userid.'/');\n\t}\n\telse\n\t{\n\t\treturn($cfg['pfs_dir'].'/');\n\t}\n}", "protected function getFilesystemPath()\n {\n return dirname($this->path);\n }", "function cot_pfs_relpath($userid)\n{\n\tglobal $cfg;\n\n\tif ($cfg['pfs']['pfsuserfolder'])\n\t{\n\t\treturn($userid.'/');\n\t}\n\telse\n\t{\n\t\treturn('');\n\t}\n}", "private function getTemplatesFolderLocation()\n {\n return str_replace('//', '/', APP_DIR . '/') . self::TEMPLATES_DIR;\n }", "public function getDir() {\n return Yii::getAlias('@static').'/'.$this->module.'/'. $this->parent_id .'/';\n }", "function getAppPath() {\r\n\r\n $root = str_replace('\\\\', '/', $_SERVER['DOCUMENT_ROOT']);\r\n if (substr($root, -1) === '/') { // remove any trailing / which should not be there\r\n $root = substr($root, 0, -1);\r\n }\r\n $dir = str_replace('\\\\', '/', dirname(__FILE__));\r\n\r\n $path = str_replace($root, '', $dir) . '/';\r\n\r\n return $path;\r\n\r\n }", "private function getDir() {\n return sprintf(\"%s/%s/\", app_path(), config('newportal.portlets.namespace'));\n }", "private function getPath()\n\t{\n\t\treturn $this->_sys_path;\n\t}", "public function get_base_dir()\r\n\t\t{\r\n\t\t\treturn str_replace( \"/\", DIRECTORY_SEPARATOR, __DIR__ . \"/../../\" . self::HOME_DIR );\r\n\t\t}", "public function getRootDir(){\n\t\treturn str_replace(realpath($_SERVER['DOCUMENT_ROOT']), \"\", realpath(dirname(__DIR__ . \"/../core.php\")));\n\t}", "public function getAppBaseDirName(){\n return $this->getSite()->getParent()->getAppDir(true);\n }", "protected function action_getUserMainDir() {}", "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}", "protected function getApplicationDir()\n {\n return app_path('Applications/Standard');\n }", "public function get_full_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_full_name();\n\t}", "public function getRootDir();", "public static function get_directory(): string {\n return Simply_Static\\Options::instance()->get('local_dir') ?: '';\n }", "public static function getFilesFolderPath() {\n return self::isProductionEnv() ? \"/var/www/html/\".self::$DESIGNS_RELATIVE_PATH : \"../../\".self::$DESIGNS_RELATIVE_PATH;\n }", "public function getDirectory()\n {\n return mfConfig::get('mf_sites_dir').\"/\".$this->getSiteName().\"/\".$this->getApplication().\"/view/pictures/\".$this->get('lang');\n }", "private function _getSourceFileSystemPath()\n\t{\n\t\treturn rtrim($this->getSettings()->path, '/').'/';\n\t}", "public function getDirectoryRelativePath(): string\n {\n return $this->config->getValue('general/file/import_images_base_dir');\n }", "public function GetAppDir ();", "public function dir() {\n\t\treturn dirname($this->_path) . '/';\n\t}", "function CurrentUserFolder() {\n\treturn $_SESSION['username'];\n}", "public function getRootDir()\n {\n return sys_get_temp_dir() . '/base-kernel/' . 'kernel-' . substr(\n hash(\n 'md5',\n json_encode([\n $this->bundlesToLoad,\n $this->configuration,\n $this->routes,\n ])\n ),\n 0,\n 10\n );\n }", "static public function getLocalPath($path) {\n\t\t$datadir = \\OC_User::getHome(\\OC_User::getUser()) . '/files';\n\t\t$newpath = $path;\n\t\tif (strncmp($newpath, $datadir, strlen($datadir)) == 0) {\n\t\t\t$newpath = substr($path, strlen($datadir));\n\t\t}\n\t\treturn $newpath;\n\t}", "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 path() {\n\t\t\treturn rtrim($this->application->configuration([ \"packagemanager\", \"directory\" ]), \"/\") . \"/\" . $this->package_directory;\n\t\t}", "public static function getWorkingDir()\n {\n return Mage::getBaseDir('var') . DS . 'storelocator' . DS;\n }", "private function absolutePathPrefix() : string {\n return DIRECTORY_SEPARATOR . implode(\n DIRECTORY_SEPARATOR,\n [\n 'app',\n 'storage',\n 'app'\n ]\n );\n }", "public function getCurrentDirectory();", "public function getCurrentDirectory();", "protected function getPackageRootPath(): string\n {\n return getcwd() . '/';\n }", "public function getInstallDirectory() {\n if ($this->isInstalled() && ($relative_path = \\Drupal::service('extension.list.theme')->getPath($this->name))) {\n // The return value of\n // \\Drupal::service('extension.list.theme')->getPath() is always relative\n // to the site, so prepend DRUPAL_ROOT.\n return DRUPAL_ROOT . '/' . dirname($relative_path);\n }\n else {\n // When installing a new theme, prepend the requested root directory.\n return $this->root . '/' . $this->getRootDirectoryRelativePath();\n }\n }", "public function getSystemPath() {\n return $this->system_path;\n }", "public function get_core_dir() {\n\t\t\treturn trailingslashit( $this->settings['base_dir'] );\n\t\t}", "public static function folderPath(){\n\t\treturn DATA.static::$folderPrefix.'files/';\n\t}", "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 getBaseDir();", "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 }", "public function getPath()\n {\n $path = Yii::getAlias('@webroot') .\n DIRECTORY_SEPARATOR . \"uploads\" .\n DIRECTORY_SEPARATOR . $this->folder_uploads .\n DIRECTORY_SEPARATOR . $this->guid;\n\n if (!is_dir($path)) {\n mkdir($path);\n }\n\n return $path;\n }", "protected function _getPath()\n {\n if (!empty($this->_path)) {\n return $this->_path;\n }\n\n $id = $this->_config['id'];\n $dir0 = $id % 10000;\n $dir1 = $dir0 % 100;\n $dir2 = $dir0 - $dir1 * 100;\n if ($dir2 < 0) {\n $dir2 = 0;\n }\n $path = 'apps/';\n\n switch ($this->_config['section']) {\n case 1 :\n $path .= 'scripteditor/' . $dir2 . '/' . $dir1 . '/';\n break;\n \tcase 2 :\n $path .= 'slave/' . $dir2 . '/' . $dir1 . '/';\n break;\n default :\n $path .= 'tmp/';\n break;\n }\n $this->_path = $path;\n return $this->_path;\n }", "function getApplicationSystemPath(){\n\treturn $_SESSION[ SESSION_NAME_SPACE ][ 'systemPath' ];\n}", "function base_path($path = '')\n {\n return str_replace('//' ,'/',str_ireplace('/' . SYSTEMPATHS['core'], '/', __DIR__) . '/' . $path);\n }", "public static function getLAJSFolderPath() {\n return getenv('LAJS_FOLDER_PATH') ?: \"../../\";\n }", "function base_path()\n {\n return dirname(__DIR__);\n }", "public function getFolderPath(){}", "public static function ApplicationFolder()\n {\n return dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.Configuration::getApplicationFolder();\n }", "public function getPath()\n {\n return $this->_folder . DIRECTORY_SEPARATOR . $this->_name;\n }", "public function getFileRootPath(): string\n {\n return str_replace(\n ':',\n '.',\n $this->getDatasetSubmission()->getDataset()->getUdi()\n ) . DIRECTORY_SEPARATOR;\n }", "protected function _getThemesPath()\n {\n $pathElements = array(\n dirname(__FILE__),\n '..',\n '..',\n 'public',\n 'themes'\n );\n return realpath(implode(DIRECTORY_SEPARATOR, $pathElements));\n }", "protected function determinedFullPath()\n {\n // TODO: See why windows cannot use the the full path\n /*return dirname((new ReflectionClass($this))->getFileName()) .\n DIRECTORY_SEPARATOR .\n '..' .\n DIRECTORY_SEPARATOR .*/\n return $this->getWebRoot() .\n DIRECTORY_SEPARATOR .\n $this->path;\n }", "public function getHomeDirectory() {\n $physicalWebDir = getcwd();\n\n return $physicalWebDir . 'data';\n }", "public function getPath()\n {\n return str_replace(\n ['/', '\\\\'],\n Storage::GetSeparator(),\n Storage::GetPath() . '/' . $this->dirname . '/' . $this->basename\n );\n }", "public function pwd()\n {\n if ($this->path === null) {\n $dir = $this->Folder->pwd();\n if (is_dir($dir)) {\n $this->path = $this->Folder->slashTerm($dir) . $this->name;\n }\n }\n\n return $this->path;\n }", "public function getPath(): string\n {\n return $this->directory->getPath();\n }", "public function get_base_root()\r\n {\r\n return realpath(ROOT_DIR_NAME);\r\n }", "public function getRocketeerConfigFolder()\n\t{\n\t\treturn $this->getUserHomeFolder().'/.rocketeer';\n\t}", "protected static function packagePath(): string\n {\n return dirname(dirname(__DIR__));\n }", "protected function getCurrentAbsolutePath() {\n\t\treturn dirname(SS_ClassLoader::instance()->getManifest()->getItemPath(get_class($this)));\n\t}", "protected function getUploadRootDir()\n {\n //$racine = sudo chmod ;\n return __DIR__.'/../../../web/ressources/uploads/'.$this->getUploadDir();\n }", "protected function getRootDir()\n {\n return $this->appConfig->getRootDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../uploads/user/';\n }", "function absPath($value){\r\n\treturn realpath(dirname(__dir__, $value));\r\n}", "function absPath($value){\r\n\treturn realpath(dirname(__dir__, $value));\r\n}", "public static function GetSystemTmpDir ();", "public function getFullPath()\r\n\t{\r\n\t\t$path = $this->getValue(\"name\");\r\n\r\n\t\t// We are at the real root\r\n\t\tif (!$this->getValue(\"parent_id\") && $path == '/')\r\n\t\t\treturn $path;\r\n\r\n\t\t// This condition should never happen, but just in case\r\n\t\tif (!$this->getValue(\"parent_id\"))\r\n\t\t\treturn false;\r\n\r\n\t\t$pfolder = CAntObject::factory($this->dbh, \"folder\", $this->getValue(\"parent_id\"), $this->user);\r\n\t\t$pre = $pfolder->getFullPath();\r\n\r\n\t\tif ($pre == \"/\")\r\n\t\t\treturn \"/\" . $path;\r\n\t\telse\r\n\t\t\treturn $pre . \"/\" . $path;\r\n\t}", "public function getRootFolder() : string;", "protected function getProcessDirectoryPath() {\r\n $processDirName = str_replace(' ', '_', $this->getProcessName());\r\n $dateDirName = Mage::getModel('core/date')->date('Y-m-d');\r\n $this->relativeProcessUrl = \r\n 'var/lycenok/' . $dateDirName . '/' . $processDirName;\r\n $extensionDir = \r\n Mage::getBaseDir('var') . DIRECTORY_SEPARATOR . 'lycenok';\r\n $dirPath = $extensionDir . DIRECTORY_SEPARATOR . $dateDirName \r\n . DIRECTORY_SEPARATOR . $processDirName;\r\n return $dirPath; \r\n}", "public function GetRealPath()\n {\n return PATH_CMS_CUSTOMER_DATA.'/'.$this->GetRealFileName();\n }", "protected function projectRootAbsolutePath()\n {\n return realpath(__DIR__ . '/../../../..');\n }", "function base_path($path)\n{\n return __DIR__.'/../'.$path;\n}", "public function getHomeDirectory() {\n $physicalWebDir = getcwd();\n\n return $physicalWebDir . 'data';\n }", "private function getPath()\r\n\t{\r\n\t\treturn WORDWEBPRESS_INCLUDE . \r\n\t\t\t\tWordwebpress::getInstance()->configuration()->get_cfn_value('core_path') .\r\n\t\t\t\tDIRECTORY_SEPARATOR .\r\n\t\t\t\t'Wordwebpress' .\r\n\t\t\t\tDIRECTORY_SEPARATOR .\r\n\t\t\t\t'Admin' .\r\n\t\t\t\tDIRECTORY_SEPARATOR .\r\n\t\t\t\t'Html' .\r\n\t\t\t\tDIRECTORY_SEPARATOR;\r\n\t}", "public function getcwd(): string;", "function uploads_dir() {\n\tglobal $root;\n\treturn $root.Media::instance()->path;\n}", "public static function basedir() {\n\t\t$directory = trim($_SERVER['SUBDIRECTORY'], '/');\n\t\t$directory = str_replace('\\\\', '/', $directory);\n\n\t\treturn '/' . $directory;\n\t}", "private function getFraxResourceDirPath() {\r\n\t\treturn self::getFraxResourceDirPathWithFolderId($this->fraxionResourceService->getResourceFolderId());\r\n\t}", "public function get_files_directory() {\n return '../data/files/' . hash_secure($this->name);\n }", "public static function getFileadminPath() {\n\t\treturn 'fileadmin/';\n\t}", "public function getWebroot() {\n return Yii::getAlias('@static') .DIRECTORY_SEPARATOR. 'web' .DIRECTORY_SEPARATOR.$this->module.DIRECTORY_SEPARATOR. $this->parent_id .DIRECTORY_SEPARATOR;\n }", "public function getPath()\n {\n return $this->directory->getRealPath();\n }", "public function getPath(): string\n {\n $root = null;\n $currentDirectory = __DIR__;\n\n do {\n $currentDirectory = dirname($currentDirectory);\n $config = $currentDirectory . '/.refresh-database.yml';\n\n if (file_exists($config)) {\n $root = $currentDirectory;\n }\n } while (is_null($root) && $currentDirectory != '/');\n\n return $config;\n }", "function relative_path() {\n $rel = str_replace($_SERVER['DOCUMENT_ROOT'], null, str_replace(basename(dirname(__FILE__)), null, dirname(__FILE__)));\n return (preg_match('/^\\//', $rel)) ? substr($rel, 1, strlen($rel)) : $rel;\n}", "public function getInstallationPath()\n {\n return get_storage_path($this->getSubdir().DIRECTORY_SEPARATOR.$this->getId());\n }", "function expandHomeDirectory($path) {\r\n\t$homeDirectory = getenv ( 'HOME' );\r\n\tif (empty ( $homeDirectory )) {\r\n\t\t$homeDirectory = getenv ( \"HOMEDRIVE\" ) . getenv ( \"HOMEPATH\" );\r\n\t}\r\n\treturn str_replace ( '~', realpath ( $homeDirectory ), $path );\r\n}", "public function getWorkDir(): string\n {\n return $this->getPwd();\n }", "abstract public function getRelativeDataDir();", "public function getBaseDir()\n {\n return $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA)->getAbsolutePath(self::MEDIA_PATH);\n\n }", "protected function getSiteFolder(string $site_name) {\n return $_SERVER['HOME'] . '/pantheon-local-copies/' . $site_name;\n }", "protected function getUploadRootDir()\n {\n \t// guardar los archivos cargados\n \treturn 'uploads/registros/';\n }", "public function getLocalPath();" ]
[ "0.7399993", "0.73861754", "0.7383157", "0.71432847", "0.70720494", "0.703621", "0.6965563", "0.68030715", "0.6775655", "0.67573196", "0.6731361", "0.66862786", "0.66735494", "0.6656249", "0.66267794", "0.6626765", "0.660271", "0.65980655", "0.6585902", "0.656657", "0.65617955", "0.6536713", "0.6513014", "0.6507409", "0.650697", "0.64710337", "0.64611465", "0.6460813", "0.64497894", "0.64342815", "0.64331996", "0.6416318", "0.6408376", "0.6398567", "0.6396735", "0.6391594", "0.6371803", "0.63663924", "0.63643813", "0.63614887", "0.63614887", "0.6346444", "0.6336947", "0.6334161", "0.6327246", "0.632093", "0.63185775", "0.63178205", "0.63127255", "0.63125616", "0.6307382", "0.6302177", "0.63018125", "0.62978774", "0.6296926", "0.62906474", "0.62882364", "0.62853193", "0.62835366", "0.6281868", "0.6279743", "0.6276007", "0.62736094", "0.62631345", "0.6259412", "0.62560076", "0.6255779", "0.6251627", "0.6249606", "0.62455696", "0.6244246", "0.62418455", "0.62216717", "0.62216717", "0.621919", "0.6216901", "0.62117755", "0.62113535", "0.62058765", "0.6203134", "0.6203047", "0.62021106", "0.6201769", "0.619823", "0.6197975", "0.619725", "0.61952", "0.6191225", "0.618206", "0.6179133", "0.61714023", "0.6168504", "0.6161608", "0.61615497", "0.61609644", "0.6159666", "0.6159423", "0.6158164", "0.6154127", "0.6154072", "0.6149142" ]
0.0
-1
Create a new directory
function cot_pfs_mkdir($path, $feedback=FALSE) { global $cfg; if(substr($path, 0, 2) == './') { $path = substr($path, 2); } if(!$feedback && !file_exists($pfs_dir_user)) { cot_pfs_mkdir($pfs_dir_user, TRUE); } if(@mkdir($path, $cfg['dir_perms'])) { return TRUE; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createDirectory() {}", "function createDirectory() {\n\t$fmpImporter = new FilemakerProImporter();\n\t$fmpImporter->createDirectory();\n}", "public function createDirectory(Directory $directory): void;", "public function createDirectory($path) {\n\n $parentPath = dirname($path);\n if ($parentPath=='.') $parentPath='/';\n $parent = $this->getNodeForPath($parentPath);\n $parent->createDirectory(basename($path));\n\n }", "private function makeDirectory(): void\n {\n $this->directory = $this->simulation->fileAbsolutePath('correlations/' . $this->id);\n Utils::createDirectory($this->directory);\n }", "function create_dir($dir_path){\r\n die( __FILE__ . ' : ' . __LINE__ );\r\n }", "public static function createDirectory ($path) {\n\t\t\\clearstatcache(true, $path);\n\t\tif (!\\is_dir($path)) {\n\t\t\t\\mkdir($path, 493, true);\n\t\t}\n\t}", "public function mkDir($path);", "public function createDirectory()\n {\n $bReturn = $this->exists();\n if( !$bReturn && $this->_sPath->isValid() )\n {\n $bReturn = mkdir( (string)$this->_sPath, 0770, TRUE);\n if( $bReturn )\n {\n $this->_sPath->setValue( $this->getRealPath() );\n }\n }\n return $bReturn;\n }", "protected function createDir()\n\t\t{\n\t\t\t//si no existe la carpeta la creamos\n\t\t\tif (!file_exists($this->ruta))\n\t\t\t{\n\t\t\t\tmkdir($this->ruta,0777,true);\t\n\t\t\t}\n\t\t\t\n\t\t\tif (!file_exists($this->rutaMini))\n\t\t\t{\n\t\t\t\tmkdir($this->rutaMini,0777,true);\t\t\n\t\t\t}\t\n\t\t\t\t\n\t\t}", "public function mkdir($dir)\n {\n }", "protected function createDirectories() {\n\t\t@mkdir($this->getAbsoluteBasePath(), 0777, TRUE); // @ - Directories may exist\n\t}", "public function createDir($dirname, Config $config)\n {\n }", "private static function createDirectory($path)\n {\n $success = true;\n\n if (! is_dir($path))\n $success = mkdir($path, 0700, true);\n\n if ($success === false)\n throw new RuntimeException(\"Could not create $path\");\n }", "public function makeDir($dirs, $mode = 0777);", "public function testMkdir() {\n $testDirName = self::TEST_DIR . '/testMkdir';\n\n (new Directory($testDirName))->mkdir();\n\n $this->assertDirectoryExists($testDirName);\n }", "public function testMakeDirectory()\n {\n $this->assertTrue(Storage::mkdir(self::$temp.DS.'created'));\n $this->assertTrue(is_dir(self::$temp.DS.'created'));\n }", "private function createNewTempdir(){\n $tempdirname = '';\n do{\n $tempdirname = uniqid('temp_',true);\n }while(file_exists(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname));\n\n if(@mkdir(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname)){\n mkdir(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname.DIRECTORY_SEPARATOR.'gallery');\n }else{\n die(json_encode(array('state'=>'error','data'=> $this->text('e28').': '.FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.'!')));\n }\n return $tempdirname;\n }", "public function createDirectories()\n {\n self::createDirectory($this->contentDirectoryPath);\n\n if ($this->staticPreviewIsEnabled())\n self::createDirectory($this->cacheDirectoryPath);\n }", "function mkdir() {\n\t\t$this->checkOnce();\n\t\t$nr = $this->getMain()->nr();\n\n\t\t$remoteCmd = 'cd '.$this->deployPath.' && mkdir v'.$nr;\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "private function createDir()\n {\n if ($this->dirCreated) {\n return;\n }\n\n $dir = $this->getDirFromStream($this->url);\n if (null !== $dir && !is_dir($dir)) {\n $this->errorMessage = null;\n set_error_handler(array($this, 'customErrorHandler'));\n $status = mkdir($dir, 0777, true);\n restore_error_handler();\n if (false === $status) {\n throw new \\UnexpectedValueException(sprintf('There is no existing directory at \"%s\" and its not buildable: '.$this->errorMessage, $dir));\n }\n }\n $this->dirCreated = true;\n }", "function mdl_create_directory_if_not_exists(string $dirname)\n{\n // Create the path directory if not exists\n if (!is_dir($dirname)) {\n mkdir($dirname, 0777, true);\n }\n}", "protected function createDirectory($path)\n {\n if (! File::exists($path)) {\n File::makeDirectory($path, 0755, true);\n }\n }", "public function mkdir($path)\n {\n \n }", "public function makeDirectory($path, $mode = 0755, $isRecursive = true);", "public function createDirectory(DirectoryInterface $directory, DirectoryInterface $parent): DirectoryInterface;", "protected function createDirectories() :void\n {\n $directories = ['Entities', 'Resources', 'Services'];\n\n foreach ($directories as $directory) {\n $directory = app_path($directory);\n\n Storage::makeDirectory($directory, true);\n Storage::put($directory . '/' . '.gitkeep', \"\");\n }\n }", "function generate_directory($id){\n $filename = \"intranet/usuarios/\" . $id . \"/uploads/\";\n if (!file_exists($filename)) {\n mkdir($filename, 0777, true);\n }\n }", "function createDirectory($name, $path=ModuleCreator::PATH_MODULE_ROOT) \n {\n // create base directory\n/* $directoryName = $path.$name;\n if ( !file_exists( $directoryName ) ) {\n mkdir( $directoryName, ModuleCreator::DIR_MODE );\n }\n $this->values[ ModuleCreator::KEY_PATH_MODULE_ROOT ] = $directoryName.'/';\n*/\n $directoryName = $this->values[ ModuleCreator::KEY_PATH_MODULE_ROOT ];\n if ( !file_exists( $directoryName ) ) {\n mkdir( $directoryName, ModuleCreator::DIR_MODE );\n }\n \n // create sub directories\n // objects_bl\n// $blDirectory = $directoryName.ModuleCreator::PATH_OBJECT_BL;\n// $this->values[ ModuleCreator::KEY_PATH_MODULE_BL ] = $blDirectory;\n $blDirectory = $this->values[ ModuleCreator::KEY_PATH_MODULE_BL ];\n\n if ( !file_exists( $blDirectory ) ) {\n mkdir( $blDirectory, ModuleCreator::DIR_MODE );\n }\n \n // objects_da\n $daDirectory = $directoryName.ModuleCreator::PATH_OBJECT_DA;\n if ( !file_exists( $daDirectory ) ) {\n mkdir( $daDirectory, ModuleCreator::DIR_MODE );\n }\n \n // objects_pages\n $pageDirectory = $directoryName.ModuleCreator::PATH_OBJECT_PAGES;\n if ( !file_exists( $pageDirectory ) ) {\n mkdir( $pageDirectory, ModuleCreator::DIR_MODE );\n }\n \n // templates\n $templateDirectory = $directoryName.ModuleCreator::PATH_TEMPLATES;\n if ( !file_exists( $templateDirectory ) ) {\n mkdir( $templateDirectory, ModuleCreator::DIR_MODE );\n }\n \n }", "protected function createDestinationDirectory()\n {\n if ($this->fs->exists($this->destinationDirectory)) {\n if (!$this->overwrite) {\n throw new RuntimeException(t('The directory %s already exists.', $this->destinationDirectory));\n }\n if ($this->fs->isFile($this->destinationDirectory)) {\n throw new RuntimeException(t('The destination %s is a file, not a directory.', $this->destinationDirectory));\n }\n\n return;\n }\n if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {\n $this->output->writeln(t('Creating directory %s', $this->destinationDirectory));\n }\n if (!$this->fs->makeDirectory($this->destinationDirectory)) {\n throw new RuntimeException(t('Failed to create the directory %s.', $this->destinationDirectory));\n }\n }", "protected static function makeDir($path) {\n\t\tif (!file_exists($path)) {\n\t\t\tmkdir($path, 0777, true);\n\t\t}\n\t}", "protected static function makeDir($path) {\n\t\tif (!file_exists($path)) {\n\t\t\tmkdir($path, 0777, true);\n\t\t}\n\t}", "function createDirectory($training_id){\n\t\t$main_folder = \"./../training_documents\";\n\t\tif(is_dir($main_folder)===false){\n\t\t\tmkdir($main_folder);\t\t\n\t\t}\n\t\tif(is_dir($main_folder.\"/\".$training_id)===false){\n\t\t\tmkdir($main_folder.\"/\".$training_id);\t\n\t\t}\n\t\treturn $training_id;\n\t}", "function create_dir($dir){\r\n\t$arr = array($dir);\r\n\twhile(true){\r\n\t\t$dir = dirname($dir);\r\n\t\tif($dir == dirname($dir)){\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t$arr[] = $dir;\r\n\t}\r\n\t$arr = array_reverse($arr);\r\n\tforeach($arr as $dir){\r\n\t\tif(!is_dir($dir)){\r\n\t\t\tmkdir($dir);\r\n\t\t}\r\n\t}\r\n}", "public function create($path)\n {\n return $this->fs->cloud()->createDir($path);\n }", "public function createDir($dirname, Config $config) {\n return $this->write($dirname . '/', '', $config);\n }", "function mkdir_p($directory, $mode = 0777) {\n if (!is_dir($directory)) {\n mkdir($directory, $mode, true);\n }\n}", "protected function makeDirectory($path)\r\n {\r\n if (!is_dir(dirname($path))) {\r\n mkdir(dirname($path), 0777, true);\r\n }\r\n }", "protected function makeDirectory($path)\r\n {\r\n if (!is_dir(dirname($path))) {\r\n mkdir(dirname($path), 0777, true);\r\n }\r\n }", "public static function createDirectory($path_directory)\n {\n if(isset($path_directory)) {\n if (!file_exists($path_directory)) {\n mkdir($path_directory);\n }\n }\n }", "function createFolder(string $foldername);", "public function makeDir($dir = '')\n {\n if (!is_dir($dir) && $dir !== '') {\n mkdir($dir, 0777);\n }\n }", "protected function _createDir($dir)\r\n\t{\r\n\t\tif ( substr($dir, -1) != DIRECTORY_SEPARATOR )\r\n\t\t\t$dir .= DIRECTORY_SEPARATOR;\r\n\t\tif (!is_dir($dir))\r\n\t\t\tmkdir($dir,0744,TRUE);\r\n\t\treturn $dir;\r\n\t}", "private function createDir($path)\n {\n if (!is_dir($path)) {\n $success = mkdir($path, 0775, true);\n if (!$success) {\n throw new \\Exception(\"Cannot create folder {$path}. Check file system permissions.\");\n }\n }\n }", "public static function makeDir($path){\n $path = public_path() . $path . date(\"Y\") . date(\"m\") . \"/\";\n if(!file_exists($path)){//不存在则建立 \n $mk=@mkdir($path,0777, true); //权限 \n if(!$mk){\n echo \"No access for mkdir $path\";die();\n }\n @chmod($path,0777); \n } \n return $path; \n \n }", "function createDirectoryIfNonExistent() {\n if (! file_exists($this->path)) {\n mkdir($this->path);\n }\n }", "function createDirectory($dirname)\n {\n $ftpconnection = ssh2_sftp ($this->connection);\n $dircreated = ssh2_sftp_mkdir($ftpconnection, $dirname, true);\n if(!$dircreated) \n {\n $this->debug(\"Directory not created: \".$dirname);\n }\n return $dircreated;\n }", "public function mkdirDeepCreatesDirectoryWithAndWithoutDoubleSlashesDataProvider() {}", "function create_folder($name)\n{\n $location = Path::get_repository_path() . 'lib/content_object/';\n Filesystem::create_dir($location . $name);\n}", "protected function makeDirectory($path)\n {\n if (!is_dir(dirname($path))) {\n mkdir(dirname($path), 0777, true);\n }\n }", "protected function createDestination(): void\n {\n $directory = \\dirname($this->to);\n\n if (! is_dir($directory)) {\n mkdir($directory, 0777, true);\n }\n }", "private function createDirectory(string $directory): void\n {\n $path = MiPaPo::ComponentPath($directory);\n File::makeDirectory($path);\n }", "function create_dir($path, $make_writable = false) {\n if(mkdir($path)) {\n if($make_writable) {\n if(!chmod($path, 0777)) {\n return false;\n } // if\n } // if\n } else {\n return false;\n } // if\n \n return true;\n }", "private function createDir($path)\n {\n if (!is_dir($path)) {\n if (!mkdir($path, self::CHMOD, true)) {\n throw new Exception('unable to create path '.$path);\n }\n }\n }", "public function test_create_exists()\n {\n Directory::create(ROOT.DS.'application');\n }", "public static function create()\n {\n $directories = [\n self::PATH.'/app',\n self::PATH.'/logs',\n self::PATH.'/bootstrap/cache',\n self::PATH.'/framework/cache',\n self::PATH.'/framework/views',\n ];\n\n foreach ($directories as $directory) {\n if (! is_dir($directory)) {\n function_exists('__vapor_debug') && __vapor_debug(\"Creating storage directory: $directory\");\n\n mkdir($directory, 0755, true);\n }\n }\n }", "public static function create_dir($dir_to_create)\n\t{\n\t\tif (mkdir($dir_to_create))\n\t\t{\n\t\t\tif (self::findServerOS() == 'LINUX')\n\t\t\t{\n\t\t\t\t$perms = self::unix_file_permissions($dir_to_create);\n\t\t\t\tif ( $perms != '0755') @chmod($dirPath, 0755);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthrow new Exception(\"Error creating directory '{$dir_to_create}'\");\n\n\t\t\treturn false;\n\t\t}\n\t}", "static public function newdir($dir, $depth=0) \n {\n if (is_file($dir)) return unlink($dir);\n // attempt to create the folder we want empty\n if (!$depth && !file_exists($dir)) {\n mkdir($dir, 0775, true);\n @chmod($dir, 0775); // let @, if www-data is not owner but allowed to write\n return;\n }\n // should be dir here\n if (is_dir($dir)) {\n $handle=opendir($dir);\n while (false !== ($entry = readdir($handle))) {\n if ($entry == \".\" || $entry == \"..\") continue;\n self::newDir($dir.'/'.$entry, $depth+1);\n }\n closedir($handle);\n // do not delete the root dir\n if ($depth > 0) rmdir($dir);\n // timestamp newDir\n else touch($dir);\n return;\n }\n }", "function makeDir($UUID, $SUBDIR){\n #make a hash of the UUID\n $hash = md5($UUID);\n #specify the path to the directory to be made\n $dir = \"./\" . $SUBDIR . \"/\" . substr($hash,0,2) . \"/$hash\";\n # a if it already exits, return\n if(is_dir($dir)) { return $dir; }\n #otherwise, attempt to make it-\n if(!mkdir($dir,0777,true)){\n echo(\"Failed to create '$dir'. Function makeDir\\n\");\n return false;\n }\n else\n return $dir;\n}", "function MakeDir()\n{\t\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t$sFileUrl = trim($_REQUEST['file-path']);\n\t\n\t\n\t$bIsDirectoryCreate = false;\n\t$bIsDirectoryCreate = mkdir($sFileUrl, 0777, true);\n\t\n\tif($bIsDirectoryCreate === true)\n\t{\n\t\techo '<correct>correct create directory</correct>';\n\t} else\n\t{\n\t\techo '<fail>cant create directory</fail>';\n\t}\n}", "public function createDir()\n\t{\n\t\tif (!Core_File::isDir($this->_dir))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tCore_File::mkdir($this->_dir, CHMOD, TRUE);\n\t\t\t} catch (Exception $e) {}\n\t\t}\n\n\t\treturn $this;\n\t}", "public function create_dir() {\n\t\t$permission = 0777;\n\t\t$directory_path = ! defined( 'CODE_SNIPPET_DIR' )\n\t\t? ABSPATH . 'wp-code-snippet'\n\t\t: CODE_SNIPPET_DIR;\n\t\n\t\tif ( ! file_exists( $directory_path ) ) {\n\t\t\tmkdir( $directory_path );\n\t\t\t// @chmod( $directory_path, $permission );\n\t\t}\n\n\t\treturn $directory_path;\n\t}", "public function createDirectory($folder){\n $folder = $this->cleanPath($folder);\n\n if($this->disk->exists($folder)){\n return \"Directory '$folder' already exists.\";\n }\n\n return $this->disk->makeDirectory($folder);\n //you can create a directory with subdirectoty like '/dd/cc' in one call\n }", "protected static function createDirectory( string $dir )\n\t{\n\t\t$perm = 0755;\n\n\t\tif( !is_dir( $dir ) && !mkdir( $dir, $perm, true ) )\n\t\t{\n\t\t\t$msg = 'Unable to create directory \"%1$s\" with permission \"%2$s\"';\n\t\t\tthrow new \\RuntimeException( sprintf( $msg, $dir, $perm ) );\n\t\t}\n\t}", "public function mkDir($path)\n {\n // Try get into this dir, maybe it already there\n if (!@ftp_chdir($this->handle, $path)) {\n // Create dir\n ftp_mkdir($this->handle, $path);\n // Change rights\n ftp_chmod($this->handle, 0755, $path);\n // Go to it\n ftp_chdir($this->handle, $path);\n }\n }", "protected function makeDirectory($path)\n {\n if (!$this->files->exists($path)) {\n if (!$this->files->isDirectory($path)) {\n $this->files->makeDirectory($path, 0755, true, true);\n }\n }\n }", "function make_dir($path) {\n\t\t$subdir = \"\";\n\t\t$arrPath = explode('/', $path);\n\t\tforeach ($arrPath as $dir) {\n\t\t\t$subdir .= \"$dir\" . '/';\n\t\t\tif (!file_exists($subdir)) {\n\t\t\t\tmkdir($subdir);\n\t\t\t\tchmod($subdir, 0777);\n\t\t\t}\n\t\t}\n\t}", "function create_dirs($path)\n{\n if (!is_dir($path))\n {\n $directory_path = \"\";\n $directories = explode(\"/\",$path);\n array_pop($directories);\n \n foreach($directories as $directory)\n {\n $directory_path .= $directory.\"/\";\n if (!is_dir($directory_path))\n {\n mkdir($directory_path);\n chmod($directory_path, 0777);\n }\n }\n }\n}", "private function createFileDir()\n\t{\n\t\t$this->fileDir = IMAGES.'uploads'.DS.$this->model.DS.$this->modelId;\n\t\t$this->imgDir = 'uploads/'.$this->model.'/'.$this->modelId;\n\t}", "function mkdirp($dirname, $mode = 0777) {\n if (!is_dir($dirname)) {\n mkdir($dirname, $mode, true);\n }\n}", "public function createDirectory($name)\n {\n global $DB, $user;\n\n $transaction = $DB->start_delegated_transaction();\n try {\n $this->fileStorage->create_directory(\n $this->storedFile->get_contextid(),\n $this->storedFile->get_component(),\n $this->storedFile->get_filearea(),\n $this->storedFile->get_itemid(),\n $this->storedFile->get_filepath() . \"/$name/\",\n $user->id\n );\n // Invalidate the current children list\n $this->children = null;\n } catch (Exception $e) {\n $transaction->rollback(\n new Sabre_DAV_Exception('PoolDirectory:createDirectory() - '. $e->getMessage())\n );\n }\n $transaction->allow_commit();\n }", "static public function mkdir($path) {\n\t\treturn self::$defaultInstance->mkdir($path);\n\t}", "public function createFolder($path) {\n $this->_command->setCommand(\"mkdir -p {$path}\");\n $this->_command->run();\n\n $this->_log->log(LogLevel::info, \"'{$path}' folder created\\n\");\n }", "public function mkdir($name, $chmod = 755);", "public static function createDirectory($directory, $mask=0755) {\r\n\tif (!file_exists($directory))\r\n\t return mkdir($directory, $mask, TRUE);\r\n }", "private function make_path($path){\n\t\t\t// Test if path extist\n\t\t\tif(is_dir($path) || file_exists($path))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Create it\n\t\t\t\tmkdir($path, 0777, true);\n\t\t\t}\n\t}", "function makeDIR($directory,$debugtxt=0,$nMode) {\n // Create payload directory if it doesn't exist:\n if (file_exists($directory)) {\n //if ($debugtxt) { echo \"<p>Directory <b>$directory</b> already exists </p>\"; }\n $result = true; // Return true as success is when the directory has either been created or already exists\n } else {\n // Make the new temp sub_folder for unzipped files\n if (!mkdir($directory, $nMode, true)) {\n if ($debugtxt) { \n echo \"<p>Error: Could not create folder <b>$directory</b> - check file permissions\";\n echo '<div class=\"admin_img\"><a href=\"'.$sSiteUrl.'/admin\" class=\"btn btn-lg btn-primary color-white\">Admin</a></div><div class=\"play_img\"><a href=\"'.$sSiteUrl.'/play\" class=\"btn btn-lg btn-primary color-white\">Play</a></div>';\n }\n $result= false;\n } else { \n //if ($debugtxt) { echo \"Folder <b>$directory</b> Created <br>\";} \n $result = true;\n } // END mkdir\n } // END if file exists\n return $result;\n }", "function create_folder($dir) {\n\t\t// explode\n\t\t$explode = explode('/', $dir);\n\t\t$url = WWW_ROOT;\n\n\t\tif(!is_dir(WWW_ROOT.$dir)) {\n\t\t\t// loop through\n\t\t\tforeach($explode as $e) {\n\t\t\t\t$url .= $e.DS;\n\t\t\t\tif(!is_dir($url)) {\n\t\t\t\t\tmkdir($url);\n\t\t\t\t\tchmod($url, 0777);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function createExportDirectory()\n\t{\n\t\tif (!@is_dir($this->getExportDirectory()))\n\t\t{\n\t\t\t$usrf_data_dir = ilUtil::getDataDir().\"/usrf_data\";\n\t\t\tilUtil::makeDir($usrf_data_dir);\n\t\t\tif(!is_writable($usrf_data_dir))\n\t\t\t{\n\t\t\t\t$this->ilias->raiseError(\"Userfolder data directory (\".$usrf_data_dir\n\t\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->MESSAGE);\n\t\t\t}\n\n\t\t\t// create Export subdirectory (data_dir/lm_data/lm_<id>/Export)\n\t\t\t$export_dir = $usrf_data_dir.\"/export\";\n\t\t\tilUtil::makeDir($export_dir);\n\t\t\tif(!@is_dir($export_dir))\n\t\t\t{\n\t\t\t\t$this->ilias->raiseError(\"Creation of Userfolder Export Directory failed.\",$this->ilias->error_obj->MESSAGE);\n\t\t\t}\n\t\t}\n\t}", "public function createAppDirectory() {\n $dir = app_path() . '/EasyApi';\n if (!file_exists($dir)) {\n mkdir($dir);\n }\n }", "private static function make_directory($directory)\n\t{\n\t\t// -----------------------------------------------------\n\t\t// Create the directory.\n\t\t// -----------------------------------------------------\n\t\tmkdir($directory, 02777);\n\n\t\t// -----------------------------------------------------\n\t\t// Set the directory permissions.\n\t\t// -----------------------------------------------------\n\t\tchmod($directory, 02777);\n\t}", "public function createDirectory()\n\t{\n\t\tif(is_dir($this->storagePath) and is_writable($this->storagePath)===false)\n\t\t{\n\t\t\tchmod($this->storagePath,$this->permissions);\n\t\t}\n\t\t\n\t\tif(is_dir($this->storagePath) and is_writable($this->storagePath))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif(!is_dir($this->storagePath) and $this->createDir===true and mkdir($this->storagePath,$this->permissions,true))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tthrow new \\RuntimeException(\"Cannot to create the storage path:\".$this->storagePath);\n\t}", "protected function createCacheDir()\n {\n if ( ! file_exists($this->cacheDir)) {\n mkdir($this->cacheDir);\n }\n }", "protected function makeDirectory($path)\n {\n if (!$this->filesystem->isDirectory(dirname($path))) {\n $this->filesystem->makeDirectory(dirname($path), 0777, true, true);\n }\n }", "function CreateDirectory($dirname=false, $checkbase=TEMP_DIRECTORY, $permission=0755)\n{\n\tif (!$dirname) {\n\t\treturn false;\n\t}\n\n\tif (is_dir($dirname)) {\n\t\treturn true;\n\t}\n\n\t$dirname = str_replace($checkbase, '', $dirname);\n\n\t$parts = explode('/', $dirname);\n\t$result = false;\n\t$size = count($parts);\n\t$base = $checkbase;\n\tfor ($i = 0; $i < $size; $i++) {\n\t\tif ($parts[$i] == '') {\n\t\t\tcontinue;\n\t\t}\n\t\t$base .= '/' . $parts[$i];\n\t\tif (!is_dir($base)) {\n\t\t\t$result = mkdir($base, $permission);\n\t\t\tif (!$result) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tchmod($base, $permission);\n\t\t}\n\t}\n\treturn true;\n}", "public function mkdir($path)\n {\n return FileHelper::mkdir($path);\n }", "public function createFolders() {\n $this->output('Current directory: ' . getcwd());\n\n // user folder.\n try {\n \\File::read_dir($this->repo_home . '/' . $this->user_id);\n $this->output('User directory already exist.');\n } catch (Exception $e) {\n $p = new Process('mkdir ' . $this->repo_home . '/' . $this->user_id);\n $p->run();\n $this->output('Created user Directory: ' . $this->user_dir);\n }\n $this->user_dir = $this->repo_home . '/' . $this->user_id;\n\n // repo folder.\n try {\n \\File::read_dir($this->user_dir . '/' . $this->deploy_id);\n $this->output('Repository directory already exist.');\n } catch (Exception $ex) {\n $p = new Process('mkdir ' . $this->user_dir . '/' . $this->deploy_id);\n $p->run();\n $this->output('Created repository directory: ' . $this->repo_dir);\n }\n $this->repo_dir = $this->user_dir . '/' . $this->deploy_id;\n }", "private function createDirectory(string $pathDirectory) : void{\n if(!file_exists($pathDirectory) && !is_dir($pathDirectory)){\n mkdir($pathDirectory, 0777);\n }\n }", "protected function createDirectories()\n {\n if (! is_dir(app_path('Http/Controllers/Teamwork'))) {\n mkdir(app_path('Http/Controllers/Teamwork'), 0755, true);\n }\n if (! is_dir(app_path('Listeners/Teamwork'))) {\n mkdir(app_path('Listeners/Teamwork'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork'))) {\n mkdir(base_path('resources/views/teamwork'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork/emails'))) {\n mkdir(base_path('resources/views/teamwork/emails'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork/members'))) {\n mkdir(base_path('resources/views/teamwork/members'), 0755, true);\n }\n }", "function fud_mkdir($path)\n{\n\t$dirs = array();\n\twhile (!is_dir($path)) {\n\t\t$dirs[] = $path;\n\t\t$path = dirname($path);\n\t\tif (!$path || $path == '/') {\n\t\t\tbreak;\n\t\t}\n\t}\n\tforeach (array_reverse($dirs) as $dir) {\n\t\tif (!mkdir($dir, 0755)) {\n\t\t\tfe('Failed to create \"'. $dir .'\" directory.');\t\n\t\t}\n\t}\n}", "protected function _createDirs()\n {\n $dir = $this->_class_dir;\n \n if (! file_exists($dir)) {\n $this->_outln('Creating app directory.');\n mkdir($dir, 0755, true);\n } else {\n $this->_outln('App directory exists.');\n }\n \n $list = array('Layout', 'Locale', 'Public', 'View');\n \n foreach ($list as $sub) {\n if (! file_exists(\"$dir/$sub\")) {\n $this->_outln(\"Creating app $sub directory.\");\n mkdir(\"$dir/$sub\", 0755, true);\n } else {\n $this->_outln(\"App $sub directory exists.\");\n }\n }\n }", "static public function create($directory, $mode=0777)\n\t{\n\t\tif (empty($directory)) {\n\t\t\tthrow new fValidationException('No directory name was specified');\n\t\t}\n\t\t\n\t\tif (file_exists($directory)) {\n\t\t\tthrow new fValidationException(\n\t\t\t\t'The directory specified, %s, already exists',\n\t\t\t\t$directory\n\t\t\t);\n\t\t}\n\t\t\n\t\t$parent_directory = fFilesystem::getPathInfo($directory, 'dirname');\n\t\tif (!file_exists($parent_directory)) {\n\t\t\tfDirectory::create($parent_directory, $mode);\n\t\t}\n\t\t\n\t\tif (!is_writable($parent_directory)) {\n\t\t\tthrow new fEnvironmentException(\n\t\t\t\t'The directory specified, %s, is inside of a directory that is not writable',\n\t\t\t\t$directory\n\t\t\t);\n\t\t}\n\t\t\n\t\tmkdir($directory, $mode);\n\t\t\n\t\t$directory = new fDirectory($directory);\n\t\t\n\t\tfFilesystem::recordCreate($directory);\n\t\t\n\t\treturn $directory;\n\t}", "public function makeDir ($hdfsDir)\n {\n try\n {\n $this->stat($hdfsDir);\n //directory already exists\n throw new Exception\\AlreadyExistsException(\"Path already exists: $hdfsDir\", false);\n }\n catch(Exception\\NotFoundException $e)\n {\n //dir does not exist so we can create it\n }\n\n //if parent directory does not exist\n try\n {\n $this->stat(dirname($hdfsDir));\n }\n catch (Exception\\NotFoundException $e)\n {\n throw new Exception\\NotFoundException($e->getMessage(), $e->isLocal());\n }\n\n $response = $this->web->exec(Method::PUT, $hdfsDir, 'MKDIRS');\n if ($response->getException())\n {\n throw $response->getException();\n }\n }", "protected function makeDirectory($path)\n {\n\n if ( ! $this->files->isDirectory(dirname($path)))\n {\n $this->files->makeDirectory(dirname($path), 0777, true, true);\n }\n }", "function makeDirectories()\n {\n $pathFolderStr = '';\n foreach ($this->nestedArray as $i => $part) {\n $pathFolderStr .= $part.'/';\n if (!is_dir($this->baseDestinationFolder.$pathFolderStr)) {\n mkdir($this->baseDestinationFolder.$pathFolderStr);\n }\n }\n }", "private function Make_UniqueDIR( )\n\t{\n\t\t$this -> DIR = self :: $Request -> server -> get( 'DOCUMENT_ROOT' ) . $this -> FULL_PATH . self :: FOLDER_BASE_NAME . $this -> ID;\n\t\tif ( !file_exists( $this -> DIR ) )\n\t\t\tmkdir( $this -> DIR , 0777 , true ) ;\n\t}", "public static function createFolder(String $dirname)\n\t{\n\t\tif (is_dir($dirname)) {\n\t\t\tself::$errorsArray[$dirname] = \"$dirname already exists in \" . dirname($dirname);\n\t\t\treturn false;\n\t\t}\n\t\tmkdir($dirname);\n\t}", "public function create($mode=0777, $flags=0)\n \t{\n \t\tif ($this->exists()) {\n \t\t\tif ($flags & Fs::PRESERVE) return;\n \t\t\tthrow new Fs_Exception(\"Unable to create directory '{$this->_path}': File already exists\");\n \t\t}\n \t\t\n \t\t$path = (string)$this->realpath();\n \t\tif (!@mkdir($path, $mode, $flags & Fs::RECURSIVE)) throw new Fs_Exception(\"Failed to create directory '$path'\", error_get_last());\n \t\t$this->clearStatCache();\n \t}", "protected function createDirectory($path)\n {\n $filesystem = App::make('files');\n if (!$filesystem->isDirectory($path)) {\n $this->comment(\"Creating directory: \".$path);\n $filesystem->makeDirectory($path, 0777, true);\n return $filesystem;\n }\n return $filesystem;\n }", "function cemhub_create_directory($directory) {\n $return = FALSE;\n\n if (!is_dir($directory)) {\n if (!mkdir($directory, 0777, TRUE)) {\n watchdog('cemhub', 'Could not create directory: {$directory}');\n }\n else {\n $return = TRUE;\n }\n }\n\n return $return;\n}", "protected function createOtherDirs()\n {\n $this->createDir('Database', true);\n $this->createDir('Database/Migrations', true);\n $this->createDir('Database/Seeds', true);\n $this->createDir('Filters', true);\n $this->createDir('Language', true);\n $this->createDir('Validation', true);\n }" ]
[ "0.83172524", "0.7627738", "0.75388604", "0.7384499", "0.7381146", "0.73666817", "0.73175186", "0.72809327", "0.72737545", "0.7193673", "0.7177672", "0.7177558", "0.7124097", "0.7112226", "0.70990056", "0.70924807", "0.70917445", "0.7062571", "0.7056554", "0.70376134", "0.7021688", "0.7006283", "0.6992743", "0.69536537", "0.69094425", "0.68909967", "0.6882536", "0.6879826", "0.687097", "0.6826452", "0.6800079", "0.6800079", "0.67974347", "0.6781883", "0.6769817", "0.676673", "0.6766249", "0.6752905", "0.6752905", "0.6744132", "0.6740647", "0.6729519", "0.6724194", "0.67221636", "0.6718344", "0.6713736", "0.67127067", "0.66968083", "0.6692626", "0.6685024", "0.6678754", "0.66712844", "0.667059", "0.6668453", "0.6665595", "0.66564643", "0.6651601", "0.66287446", "0.6625574", "0.66117495", "0.661121", "0.6602639", "0.6600665", "0.6599203", "0.6598941", "0.65828955", "0.65752137", "0.6568812", "0.6565236", "0.656079", "0.6547827", "0.6537019", "0.6533107", "0.6525279", "0.65197396", "0.6518795", "0.6517737", "0.65141994", "0.6513125", "0.6509944", "0.6500763", "0.6498225", "0.64920545", "0.6485518", "0.64838356", "0.64821404", "0.648128", "0.647391", "0.6443948", "0.64435786", "0.6439098", "0.6424425", "0.64174527", "0.6412117", "0.6410948", "0.64065754", "0.6403651", "0.6399303", "0.6395893", "0.6394314", "0.639195" ]
0.0
-1
Returns PFS path for a user, relative from site root
function cot_pfs_path($userid) { global $cfg; if ($cfg['pfs']['pfsuserfolder']) { return($cfg['pfs_dir'].'/'.$userid.'/'); } else { return($cfg['pfs_dir'].'/'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cot_pfs_relpath($userid)\n{\n\tglobal $cfg;\n\n\tif ($cfg['pfs']['pfsuserfolder'])\n\t{\n\t\treturn($userid.'/');\n\t}\n\telse\n\t{\n\t\treturn('');\n\t}\n}", "protected function action_getUserMainDir() {}", "public function path()\n {\n return $this->user->path() . $this->slug;\n }", "public function getLocalPath()\r\n\t{\r\n\t\t$accountNumber = $this->getAccountNumber();\r\n\r\n\t\t$file_dir = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t$file_dir2 = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t\r\n\t\tif ($this->owner_id!=null)\r\n\t\t{\r\n\t\t\t$file_dir .= \"/\".$this->owner_id;\r\n\t\t\t$file_dir2 .= \"/\".$this->owner_id;\r\n\t\t}\r\n\r\n\t\tif (!file_exists($file_dir.\"/\".$this->name_lcl))\r\n\t\t{\r\n\t\t\tif (file_exists($file_dir2.\"/\".$this->name_lcl))\r\n\t\t\t\t$file_dir = $file_dir2;\r\n\t\t}\r\n\r\n\t\t$file_dir .= \"/\".$this->name_lcl;\r\n\r\n\t\treturn $file_dir;\r\n\t}", "public function public_path();", "function fm_get_user_dir_space($userid = NULL) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($userid == NULL) {\r\n\t\t$userid = $USER->id;\r\n\t}\r\n\t\r\n\treturn \"file_manager/users/$userid\";\r\n}", "public function path(): string\n {\n // path to your own account\n if ($this->model->isLoggedIn() === true) {\n return 'account';\n }\n\n return 'users/' . $this->model->id();\n }", "function CurrentUserFolder() {\n\treturn $_SESSION['username'];\n}", "public function getUserPath($user_id, $type = 'curl') {\n\t\t$user_name = Yii::app()->db->createCommand()\n\t\t\t->select('username')\n\t\t\t->from('user')\n\t\t\t->where(':id = id', array(':id' => $user_id))\n\t\t\t->queryColumn();\n\t\t\n\t\t$type = ($type == 'curl') ? 'curl' : 'ftp';\n\t\t\n\t\treturn Yii::getPathOfAlias('application.' . $type . '_downloads') . DIRECTORY_SEPARATOR . $user_name[0];\n\t}", "private function getPublicPath($path=null){\n return sprintf(\"%s/%s/\", public_path(), strtolower(config('newportal.portlets.namespace'))).$path;\n }", "protected function getPathSite() {}", "protected function getPathSite() {}", "public static function personal_folder_path($user_id) {\n\n\n $user = Backend_User::find($user_id);\n\n $slash = Config::get('portal.back_slash');\n\n\n if($user) {\n\n $route = '';\n\n if ($user->user_type == 0 || $user->user_type == 1) {\n\n //get first and last name \n $details = Backend_User_Details::where('user_id','=',$user->id)->get(array('first_name','last_name'));\n\n\n\n $details = $details[0];\n\n //form route\n $route .= 'users'. $slash .$details->last_name.'-'.$details->first_name.'-'.$user->id;\n\n }//if user or admin \n else {\n\n //get client's details\n $client_details = Backend_Client::infos($user->id);\n\n $client_details = $client_details[0];\n\n\n if($client_details->client_type_id == 1 ) {\n\n $route .= 'clients'. $slash.'individual'.$slash.str_replace(' ', '-', $client_details->last_name).'-'.str_replace(' ', '-',$client_details->first_name).'-'.$user->id;\n \n }//if individual\n else{\n\n $folder = Backend_Client_Type::get_name_by_client_type_id($client_details->client_type_id);\n\n $route .= 'clients'. $slash.strtolower($folder). $slash .str_replace(' ', '-',$client_details->name).'-'.$user->id;\n\n }//if corporate\n\n\n }//if client\n\n return $route;\n\n }//if the user exsists\n\n return false;\n\n }", "public function getUserPath($path)\n\t{\n\t\tif (file_exists($this->user_theme_templates_path . $path))\n\t\t{\n\t\t\treturn $this->user_theme_templates_path . $path;\n\t\t}\n\t\telseif (file_exists($this->user_theme_assets_path . $path))\n\t\t{\n\n\t\t\treturn $this->user_theme_assets_path . $path;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "static public function getLocalPath($path) {\n\t\t$datadir = \\OC_User::getHome(\\OC_User::getUser()) . '/files';\n\t\t$newpath = $path;\n\t\tif (strncmp($newpath, $datadir, strlen($datadir)) == 0) {\n\t\t\t$newpath = substr($path, strlen($datadir));\n\t\t}\n\t\treturn $newpath;\n\t}", "function getdirections_locations_user_path($fromuid, $touid) {\n if (module_exists('location') && is_numeric($fromuid) && is_numeric($touid)) {\n return \"getdirections/locations_user/$fromuid/$touid\";\n }\n}", "public function uploadPath()\n {\n return config('quikservice.user.upload.profile-picture.path');\n }", "function public_path()\n {\n $paths = getPaths();\n\n return $paths['public'];\n }", "function dirPath () { return (\"../../\"); }", "protected function getLocalRepoPath()\n {\n return sfConfig::get('sf_data_dir').'/'.str_replace(array('/',':'), '_', $this->getScm()->getHost()).'/'.str_replace(array('/'), '_', $this->getScm()->getPath());\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/user';\n }", "function getdirections_locations_user_via_path($uids) {\n if (module_exists('location')) {\n return \"getdirections/locations_user_via/$uids\";\n }\n}", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../uploads/user/';\n }", "function dirPath() { return (\"../\"); }", "public function getLocalPath();", "public static function getFileadminPath() {\n\t\treturn 'fileadmin/';\n\t}", "public function path()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" path ?\");\n\t}", "function cot_pfs_filepath($id)\n{\n\tglobal $db, $db_pfs_folders, $db_pfs, $cfg;\n\n\t$sql = $db->query(\"SELECT p.pfs_file AS file, f.pff_path AS path FROM $db_pfs AS p LEFT JOIN $db_pfs_folders AS f ON p.pfs_folderid=f.pff_id WHERE p.pfs_id=\".(int)$id.\" LIMIT 1\");\n\tif($row = $sql->fetch())\n\t{\n\t\treturn ($cfg['pfs']['pfsuserfolder'] && $row['path']!='') ? $row['path'].'/'.$row['file'] : $row['file'];\n\t}\n\telse\n\t{\n\t\treturn '';\n\t}\n}", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/users';\n }", "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 publicPath($path = '')\n\t{\n\t\treturn $this['path.public'].ltrim($path, '/');\n\t}", "public function getHomeDirectory(string $user): string\n {\n $this->executor->execute('getent', ['passwd', $user], __DIR__, []);\n\n $info = explode(':', trim($this->output->getBuffer()));\n\n return $info[count($info)-2];\n }", "function dirPath() {return (\"../../../../\"); }", "public function userTempFolder(): string\n {\n /** @var \\TYPO3\\CMS\\Core\\Resource\\Folder $folder */\n $folder = $this->getBeUser()->getDefaultUploadTemporaryFolder();\n return $folder->getPublicUrl();\n }", "function public_path($path=null)\n\t{\n\t\treturn rtrim(app()->basePath('../public_html/'.$path), '/');\n\t}", "public function loginPath()\n\t{\n\t\treturn property_exists($this, 'loginPath') ? $this->loginPath : '/';\n\t}", "function tep_get_local_path($path) {\n if (substr($path, -1) == '/') $path = substr($path, 0, -1);\n\n return $path;\n}", "public function getPublicBasePath();", "function urlfor($path) {\n return basepath() . $path;\n}", "protected function rootPath()\n {\n return Pi::path('upload') . '/' . $this->getModule();\n }", "function user_get_basedir($username) {\n global $_CONFIG;\n if(user_validate_name($username)) {\n return realpath($_CONFIG['UserBase']) . '/' . $username;\n } else {\n trigger_error(\"user_get_basedir(): Illegal username!\", E_USER_WARNING);\n return false;\n }\n}", "public function redirectPath()\n {\n $redirect = app('user.logic')->getUserInfo('admin') ? $this->redirectTo : $this->redirectToHome;\n return $redirect;\n }", "function get_home_path()\n {\n }", "public function getDefaultUserAliasesPath()\n {\n return $this->getUserHomePath().'/'.self::USER_ALIASES_DIR_NAME;\n }", "public function profilePhotoDirectory(): string\n {\n return config('filament-jet.profile_photo_directory', 'profile-photos');\n }", "function public_path($path = '')\n {\n return phanda()->publicPath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n }", "function rootSite() {\n // $dirname = preg_replace('/\\\\\\+/', '/', dirname(realpath($uri)));\n $dirname = preg_replace('/\\\\\\+/', '/', dirname($_SERVER['PHP_SELF']));\n if (substr($dirname, -1) == \"/\")\n $dirname = substr($dirname, 0, strlen($dirname) - 1); // remove / if it is there to be consistent for URL\n return $dirname;\n }", "public function getRemoteHomePath() {\n return @$this->attributes['remote_home_path'];\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return '/uploads/users/'.$this->getId().'/';\n }", "public function fullPath(){\n\t $this->path = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\treturn $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n }", "function ajan_core_get_site_path() {\n\tglobal $current_site;\n\n\tif ( is_multisite() )\n\t\t$site_path = $current_site->path;\n\telse {\n\t\t$site_path = (array) explode( '/', home_url() );\n\n\t\tif ( count( $site_path ) < 2 )\n\t\t\t$site_path = '/';\n\t\telse {\n\t\t\t// Unset the first three segments (http(s)://domain.com part)\n\t\t\tunset( $site_path[0] );\n\t\t\tunset( $site_path[1] );\n\t\t\tunset( $site_path[2] );\n\n\t\t\tif ( !count( $site_path ) )\n\t\t\t\t$site_path = '/';\n\t\t\telse\n\t\t\t\t$site_path = '/' . implode( '/', $site_path ) . '/';\n\t\t}\n\t}\n\n\treturn apply_filters( 'ajan_core_get_site_path', $site_path );\n}", "public static function site_path() {\n $segments = self::segments();\n return implode('/', $segments);\n }", "function path($path='') {\n return $this->base_dir . $path;\n }", "public function getFileRootPath(): string\n {\n return str_replace(\n ':',\n '.',\n $this->getDatasetSubmission()->getDataset()->getUdi()\n ) . DIRECTORY_SEPARATOR;\n }", "public function getFilesCurrentUser(User $user)\n {\n }", "function getDistributorSitePath() {\n\t\treturn $this->getParam(self::PARAM_DISTRIBUTOR_SITE_PATH);\n\t}", "public function get_path()\n\t\t{\n\t\t\tif ($this->path) {\n\t\t\t\treturn $this->path.'/'.$this->get_full_name();\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t$hash = $this->hash();\n\t\t\t\t} catch(\\System\\Error\\File $e) {\n\t\t\t\t\t$hash = null;\n\t\t\t\t}\n\n\t\t\t\tif ($hash) {\n\t\t\t\t\treturn $this->get_path_hashed();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}", "public function getFullPath();", "public function getWebappPath();", "public function getPublicPath()\n {\n return $this->getSettingArray()[\"public_path\"];\n }", "private function getPath()\n\t{\n\t\treturn $this->_sys_path;\n\t}", "function get_image_phy_destination_path_user() {\n\n\t\t global $upload_folder_path;\n\t$tmppath = $upload_folder_path;\n\t$destination_path = ABSPATH . $tmppath . 'users/';\n\tif ( ! file_exists( $destination_path ) ) {\n\t\t$imagepatharr = explode( '/',$tmppath . 'users' );\n\t\t$year_path = ABSPATH;\n\t\tfor ( $i = 0;$i < count( $imagepatharr );$i++ ) {\n\t\t\tif ( $imagepatharr[ $i ] ) {\n\t\t\t\t$year_path .= $imagepatharr[ $i ] . '/';\n\t\t\t\tif ( ! file_exists( $year_path ) ) {\n\t\t\t\t\tmkdir( $year_path, 0777 );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t return $destination_path;\n\n}", "public function basePathUpload() {\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t\t$pathupload = realpath ( APPLICATION_PATH . '/../public/data/uploads' );\n\t\t\t\t\t\treturn $pathupload;\n\t\t\t\t\t}", "protected function getAbsolutePath()\n {\n return '/var/www/html/ColdkitchenSymfony/web/'.$this->getUploadPath();\n }", "public static function getpassthrupath($path) {\n\n $adjustedpath = PassThru::$_realPath.$path;\n return $adjustedpath;\n }", "function cot_pfs_folderpath($folderid, $fullpath='')\n{\n\tglobal $db, $db_pfs_folders, $cfg;\n\n\tif($fullpath==='') $fullpath = $cfg['pfs']['pfsuserfolder'];\n\n\tif($fullpath && $folderid>0)\n\t{\n\t\t// TODO Clean up this mess and fix pff_path\n\t\t$sql = $db->query(\"SELECT pff_path FROM $db_pfs_folders WHERE pff_id=\".(int)$folderid);\n\t\tif($sql->rowCount()==0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $sql->fetchColumn().'/';\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn '';\n\t}\n}", "public function getPublicPath(): string\n {\n return Path::unifyPath(Environment::getPublicPath());\n }", "function getRealpath( $_path )\n{\n $__path = $_path;\n if ( isRelative( $_path ) ) {\n $__curdir = unifyPath( realpath( \".\" ) . _PL_OS_SEP );\n $__path = $__curdir . $__path;\n }\n $__startPoint = \"\";\n if ( checkCurrentOS( \"Win\" ) ) {\n list( $__startPoint, $__path ) = explode( \":\", $__path, 2 );\n $__startPoint .= \":\";\n }\n # From now processing is the same for WIndows and Unix, and hopefully for others.\n $__realparts = array( );\n $__parts = explode( _PL_OS_SEP, $__path );\n for ( $i = 0; $i < count( $__parts ); $i++ ) {\n if ( strlen( $__parts[ $i ] ) == 0 || $__parts[ $i ] == \".\" ) {\n continue;\n }\n if ( $__parts[ $i ] == \"..\" ) {\n if ( count( $__realparts ) > 0 ) {\n array_pop( $__realparts );\n }\n }\n else {\n array_push( $__realparts, $__parts[ $i ] );\n }\n }\n return $__startPoint . _PL_OS_SEP . implode( _PL_OS_SEP, $__realparts );\n}", "function sitepath()\n {\n return \"/mover/\";\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents/images/profile';\n }", "public function getPublicPath(string $path = \"\"): string {\n return $this->context->getPublicPath($path);\n }", "public function path();", "public function getFilepath() {\n\t\treturn RuntimeDirectoryManager::getDocumentRoot().$this->filename;\n\t}", "function getPath($path) {\n if (substr($path,0,4)=='EXT:') {\n $keyEndPos = strpos($path, '/', 6);\n $key = substr($path,4,$keyEndPos-4);\n $keyPath = t3lib_extMgm::siteRelpath($key);\n $newPath = $keyPath.substr($path,$keyEndPos+1);\n return $newPath;\n }\telse {\n return $path;\n }\n }", "protected function getPath () {\n\tglobal $Config;\n\treturn $Config->get('dir_root').'/'.$this->dir.'/'.$this->name;\n }", "function root_path($path = null)\n{\n return statamic_path('../' . $path);\n}", "public function get_path_hashed()\n\t\t{\n\t\t\treturn $this->get_path_hashed_dir().'/'.$this->get_path_hashed_name();\n\t\t}", "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}", "function getAbsolutePath() ;", "function public_path($path = '')\n {\n return app()->make('path.public') . ($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path);\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 }", "public function publicPath()\n {\n return rtrim($this->publicPath, '/') .'/';\n }", "public function image_path($user_info){\n\t\t$i=3; \n\t $string='';\n\t if($user_info != null){\n\t \tif($user_info->avatar != null){\n\t\t\t\t$link_part=explode(\"/\", $user_info->avatar);\n\t\t\t while(isset($link_part[$i])){\n\t\t\t $string .='/'.$link_part[$i];\n\t\t\t $i++;\n\t\t\t }\n\t \t}\n\t \t}\n\t if($string==NULL)\n\t {\n\t \t$string=\"codeigniter-LessonLearned/public_html/images/placeholder.png\";\n\t }\n\t $string='http://localhost/'.$string;\n\t return($string);\n\t\t}", "function base_path() {\n return (new Server)->get('DOCUMENT_ROOT');\n }", "public function rootPath()\n {\n return public_path() . $this->helper->ds();\n }", "protected function getUploadDir()\n {\n // al mostrar el documento/imagen cargada en la vista.\n return 'usuarios/fotos_perfil';\n }", "private function _getSourceFileSystemPath()\n\t{\n\t\treturn rtrim($this->getSettings()->path, '/').'/';\n\t}", "public function getHomeDirectory() {\n $physicalWebDir = getcwd();\n\n return $physicalWebDir . 'data';\n }", "function getPath($path) {\n\t\tif (substr($path,0,4)=='EXT:') {\n\t\t\t$keyEndPos = strpos($path, '/', 6);\n\t\t\t$key = substr($path,4,$keyEndPos-4);\n\t\t\t$keyPath = t3lib_extMgm::siteRelpath($key);\n\t\t\t$newPath = $keyPath.substr($path,$keyEndPos+1);\n\t\treturn $newPath;\n\t\t}\telse {\n\t\t\treturn $path;\n\t\t}\n\t}", "public function getPartialRootPath() {}", "public function getPhotoUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'upload/admin/user';\n }", "protected function getAbsoluteBasePath() {}", "function serverRealPath($path){\n\treturn '/'.implode(array_slice(explode('/', realpath($path)), 3));\n}", "function path_PMS() {\n global $nome_cartella;\n $path = $nome_cartella;\n if(!empty($path)) $path = $nome_cartella .\"/\";\n return \"http://\" . $_SERVER['SERVER_NAME'] . \"/\".$path;\n}", "function public_path(?string $path = null): string\n{\n global $root, $slash;\n return \"{$root}{$slash}public{$slash}{$path}\";\n}", "public function GetRealPath()\n {\n return PATH_CMS_CUSTOMER_DATA.'/'.$this->GetRealFileName();\n }", "function fn_get_http_files_dir_path()\n{\n $path = fn_get_rel_dir(fn_get_files_dir_path());\n $path = Registry::get('config.http_location') . '/' . $path;\n\n return $path;\n}", "public function getServerRelativePath()\n {\n return $this->getProperty(\"ServerRelativePath\");\n }", "function getAvatarPath($pseudo){\n $path =\"./public/images/avatar/\";\n if (isset($_GET['pseudo'])){\n $infoUser = selectInfoUser($_GET['pseudo']);\n }elseif (isset($pseudo) && $pseudo != \"\") {\n $infoUser = selectInfoUser($pseudo);\n }else{\n $infoUser = selectInfoUser($_SESSION['pseudo']);\n }\n\n if (isset($infoUser['avatar'])){\n $name = $infoUser['avatar'];\n }else{\n $name = 'default.png';\n }\n $path .= $name;\n\n return $path;\n}", "public function getPath()\n {\n return $this->getCommonOptions()->getPublicPath();\n }" ]
[ "0.77711326", "0.6666445", "0.6565013", "0.65203464", "0.64711154", "0.6429615", "0.6420107", "0.63435465", "0.6265776", "0.61245036", "0.6090737", "0.6090737", "0.60855997", "0.6064823", "0.59834766", "0.59624964", "0.5937484", "0.5912007", "0.5903187", "0.59026796", "0.59016365", "0.5896686", "0.5894935", "0.589038", "0.58854496", "0.5883494", "0.5883286", "0.587787", "0.587539", "0.5872529", "0.5856701", "0.58481264", "0.584471", "0.5839656", "0.58297926", "0.5820827", "0.58116364", "0.5792234", "0.5789233", "0.57840395", "0.5762177", "0.5753859", "0.5745153", "0.57383376", "0.57278186", "0.57263714", "0.5717559", "0.57160884", "0.57158583", "0.57119274", "0.5708441", "0.57040834", "0.56990844", "0.5693616", "0.568996", "0.5681671", "0.5681604", "0.5679142", "0.5672624", "0.5666544", "0.5664147", "0.5653126", "0.5650622", "0.56495535", "0.5642359", "0.56333065", "0.5632758", "0.56317884", "0.5628788", "0.562832", "0.5623519", "0.5605048", "0.56015164", "0.5596436", "0.5586591", "0.55835", "0.5583389", "0.5579615", "0.5576899", "0.5573067", "0.55567133", "0.55487835", "0.5547812", "0.5543595", "0.5542069", "0.55414814", "0.55328745", "0.5527753", "0.55210495", "0.55186784", "0.5518391", "0.5512422", "0.5510451", "0.55079246", "0.5502315", "0.550205", "0.5495015", "0.54935217", "0.5490638", "0.54877084" ]
0.80595
0
Returns PFS path for a user, relative from PFS root
function cot_pfs_relpath($userid) { global $cfg; if ($cfg['pfs']['pfsuserfolder']) { return($userid.'/'); } else { return(''); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cot_pfs_path($userid)\n{\n\tglobal $cfg;\n\n\tif ($cfg['pfs']['pfsuserfolder'])\n\t{\n\t\treturn($cfg['pfs_dir'].'/'.$userid.'/');\n\t}\n\telse\n\t{\n\t\treturn($cfg['pfs_dir'].'/');\n\t}\n}", "public function getLocalPath()\r\n\t{\r\n\t\t$accountNumber = $this->getAccountNumber();\r\n\r\n\t\t$file_dir = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t$file_dir2 = AntConfig::getInstance()->data_path.\"/$accountNumber/userfiles\";\r\n\t\t\r\n\t\tif ($this->owner_id!=null)\r\n\t\t{\r\n\t\t\t$file_dir .= \"/\".$this->owner_id;\r\n\t\t\t$file_dir2 .= \"/\".$this->owner_id;\r\n\t\t}\r\n\r\n\t\tif (!file_exists($file_dir.\"/\".$this->name_lcl))\r\n\t\t{\r\n\t\t\tif (file_exists($file_dir2.\"/\".$this->name_lcl))\r\n\t\t\t\t$file_dir = $file_dir2;\r\n\t\t}\r\n\r\n\t\t$file_dir .= \"/\".$this->name_lcl;\r\n\r\n\t\treturn $file_dir;\r\n\t}", "function fm_get_user_dir_space($userid = NULL) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($userid == NULL) {\r\n\t\t$userid = $USER->id;\r\n\t}\r\n\t\r\n\treturn \"file_manager/users/$userid\";\r\n}", "public function getUserPath($user_id, $type = 'curl') {\n\t\t$user_name = Yii::app()->db->createCommand()\n\t\t\t->select('username')\n\t\t\t->from('user')\n\t\t\t->where(':id = id', array(':id' => $user_id))\n\t\t\t->queryColumn();\n\t\t\n\t\t$type = ($type == 'curl') ? 'curl' : 'ftp';\n\t\t\n\t\treturn Yii::getPathOfAlias('application.' . $type . '_downloads') . DIRECTORY_SEPARATOR . $user_name[0];\n\t}", "protected function action_getUserMainDir() {}", "public function path()\n {\n return $this->user->path() . $this->slug;\n }", "public function path(): string\n {\n // path to your own account\n if ($this->model->isLoggedIn() === true) {\n return 'account';\n }\n\n return 'users/' . $this->model->id();\n }", "function getdirections_locations_user_path($fromuid, $touid) {\n if (module_exists('location') && is_numeric($fromuid) && is_numeric($touid)) {\n return \"getdirections/locations_user/$fromuid/$touid\";\n }\n}", "static public function getLocalPath($path) {\n\t\t$datadir = \\OC_User::getHome(\\OC_User::getUser()) . '/files';\n\t\t$newpath = $path;\n\t\tif (strncmp($newpath, $datadir, strlen($datadir)) == 0) {\n\t\t\t$newpath = substr($path, strlen($datadir));\n\t\t}\n\t\treturn $newpath;\n\t}", "function getdirections_locations_user_via_path($uids) {\n if (module_exists('location')) {\n return \"getdirections/locations_user_via/$uids\";\n }\n}", "public static function personal_folder_path($user_id) {\n\n\n $user = Backend_User::find($user_id);\n\n $slash = Config::get('portal.back_slash');\n\n\n if($user) {\n\n $route = '';\n\n if ($user->user_type == 0 || $user->user_type == 1) {\n\n //get first and last name \n $details = Backend_User_Details::where('user_id','=',$user->id)->get(array('first_name','last_name'));\n\n\n\n $details = $details[0];\n\n //form route\n $route .= 'users'. $slash .$details->last_name.'-'.$details->first_name.'-'.$user->id;\n\n }//if user or admin \n else {\n\n //get client's details\n $client_details = Backend_Client::infos($user->id);\n\n $client_details = $client_details[0];\n\n\n if($client_details->client_type_id == 1 ) {\n\n $route .= 'clients'. $slash.'individual'.$slash.str_replace(' ', '-', $client_details->last_name).'-'.str_replace(' ', '-',$client_details->first_name).'-'.$user->id;\n \n }//if individual\n else{\n\n $folder = Backend_Client_Type::get_name_by_client_type_id($client_details->client_type_id);\n\n $route .= 'clients'. $slash.strtolower($folder). $slash .str_replace(' ', '-',$client_details->name).'-'.$user->id;\n\n }//if corporate\n\n\n }//if client\n\n return $route;\n\n }//if the user exsists\n\n return false;\n\n }", "function CurrentUserFolder() {\n\treturn $_SESSION['username'];\n}", "public function path()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" path ?\");\n\t}", "public function getHomeDirectory(string $user): string\n {\n $this->executor->execute('getent', ['passwd', $user], __DIR__, []);\n\n $info = explode(':', trim($this->output->getBuffer()));\n\n return $info[count($info)-2];\n }", "function cot_pfs_filepath($id)\n{\n\tglobal $db, $db_pfs_folders, $db_pfs, $cfg;\n\n\t$sql = $db->query(\"SELECT p.pfs_file AS file, f.pff_path AS path FROM $db_pfs AS p LEFT JOIN $db_pfs_folders AS f ON p.pfs_folderid=f.pff_id WHERE p.pfs_id=\".(int)$id.\" LIMIT 1\");\n\tif($row = $sql->fetch())\n\t{\n\t\treturn ($cfg['pfs']['pfsuserfolder'] && $row['path']!='') ? $row['path'].'/'.$row['file'] : $row['file'];\n\t}\n\telse\n\t{\n\t\treturn '';\n\t}\n}", "function dirPath () { return (\"../../\"); }", "function dirPath() { return (\"../\"); }", "protected function getLocalRepoPath()\n {\n return sfConfig::get('sf_data_dir').'/'.str_replace(array('/',':'), '_', $this->getScm()->getHost()).'/'.str_replace(array('/'), '_', $this->getScm()->getPath());\n }", "public function public_path();", "public function getLocalPath();", "public function getFullPath()\r\n\t{\r\n\t\t$path = $this->getValue(\"name\");\r\n\r\n\t\t// We are at the real root\r\n\t\tif (!$this->getValue(\"parent_id\") && $path == '/')\r\n\t\t\treturn $path;\r\n\r\n\t\t// This condition should never happen, but just in case\r\n\t\tif (!$this->getValue(\"parent_id\"))\r\n\t\t\treturn false;\r\n\r\n\t\t$pfolder = CAntObject::factory($this->dbh, \"folder\", $this->getValue(\"parent_id\"), $this->user);\r\n\t\t$pre = $pfolder->getFullPath();\r\n\r\n\t\tif ($pre == \"/\")\r\n\t\t\treturn \"/\" . $path;\r\n\t\telse\r\n\t\t\treturn $pre . \"/\" . $path;\r\n\t}", "public function getFileRootPath(): string\n {\n return str_replace(\n ':',\n '.',\n $this->getDatasetSubmission()->getDataset()->getUdi()\n ) . DIRECTORY_SEPARATOR;\n }", "function getRealpath( $_path )\n{\n $__path = $_path;\n if ( isRelative( $_path ) ) {\n $__curdir = unifyPath( realpath( \".\" ) . _PL_OS_SEP );\n $__path = $__curdir . $__path;\n }\n $__startPoint = \"\";\n if ( checkCurrentOS( \"Win\" ) ) {\n list( $__startPoint, $__path ) = explode( \":\", $__path, 2 );\n $__startPoint .= \":\";\n }\n # From now processing is the same for WIndows and Unix, and hopefully for others.\n $__realparts = array( );\n $__parts = explode( _PL_OS_SEP, $__path );\n for ( $i = 0; $i < count( $__parts ); $i++ ) {\n if ( strlen( $__parts[ $i ] ) == 0 || $__parts[ $i ] == \".\" ) {\n continue;\n }\n if ( $__parts[ $i ] == \"..\" ) {\n if ( count( $__realparts ) > 0 ) {\n array_pop( $__realparts );\n }\n }\n else {\n array_push( $__realparts, $__parts[ $i ] );\n }\n }\n return $__startPoint . _PL_OS_SEP . implode( _PL_OS_SEP, $__realparts );\n}", "function cot_pfs_folderpath($folderid, $fullpath='')\n{\n\tglobal $db, $db_pfs_folders, $cfg;\n\n\tif($fullpath==='') $fullpath = $cfg['pfs']['pfsuserfolder'];\n\n\tif($fullpath && $folderid>0)\n\t{\n\t\t// TODO Clean up this mess and fix pff_path\n\t\t$sql = $db->query(\"SELECT pff_path FROM $db_pfs_folders WHERE pff_id=\".(int)$folderid);\n\t\tif($sql->rowCount()==0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $sql->fetchColumn().'/';\n\t\t}\n\t}\n\telse\n\t{\n\t\treturn '';\n\t}\n}", "function dirPath() {return (\"../../../../\"); }", "function get_image_phy_destination_path_user() {\n\n\t\t global $upload_folder_path;\n\t$tmppath = $upload_folder_path;\n\t$destination_path = ABSPATH . $tmppath . 'users/';\n\tif ( ! file_exists( $destination_path ) ) {\n\t\t$imagepatharr = explode( '/',$tmppath . 'users' );\n\t\t$year_path = ABSPATH;\n\t\tfor ( $i = 0;$i < count( $imagepatharr );$i++ ) {\n\t\t\tif ( $imagepatharr[ $i ] ) {\n\t\t\t\t$year_path .= $imagepatharr[ $i ] . '/';\n\t\t\t\tif ( ! file_exists( $year_path ) ) {\n\t\t\t\t\tmkdir( $year_path, 0777 );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t return $destination_path;\n\n}", "public function get_path()\n\t\t{\n\t\t\tif ($this->path) {\n\t\t\t\treturn $this->path.'/'.$this->get_full_name();\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t$hash = $this->hash();\n\t\t\t\t} catch(\\System\\Error\\File $e) {\n\t\t\t\t\t$hash = null;\n\t\t\t\t}\n\n\t\t\t\tif ($hash) {\n\t\t\t\t\treturn $this->get_path_hashed();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../uploads/user/';\n }", "public function getPath($from_root = false)\n {\n return $this->getFolder($from_root) . $this->filename;\n }", "public function getUserPath($path)\n\t{\n\t\tif (file_exists($this->user_theme_templates_path . $path))\n\t\t{\n\t\t\treturn $this->user_theme_templates_path . $path;\n\t\t}\n\t\telseif (file_exists($this->user_theme_assets_path . $path))\n\t\t{\n\n\t\t\treturn $this->user_theme_assets_path . $path;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "function user_get_basedir($username) {\n global $_CONFIG;\n if(user_validate_name($username)) {\n return realpath($_CONFIG['UserBase']) . '/' . $username;\n } else {\n trigger_error(\"user_get_basedir(): Illegal username!\", E_USER_WARNING);\n return false;\n }\n}", "public static function getpassthrupath($path) {\n\n $adjustedpath = PassThru::$_realPath.$path;\n return $adjustedpath;\n }", "function tep_get_local_path($path) {\n if (substr($path, -1) == '/') $path = substr($path, 0, -1);\n\n return $path;\n}", "protected function getPath () {\n\tglobal $Config;\n\treturn $Config->get('dir_root').'/'.$this->dir.'/'.$this->name;\n }", "public static function getFileadminPath() {\n\t\treturn 'fileadmin/';\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 uploadPath()\n {\n return config('quikservice.user.upload.profile-picture.path');\n }", "public function getFullPath();", "function root_path($path = null)\n{\n return statamic_path('../' . $path);\n}", "private function getPublicPath($path=null){\n return sprintf(\"%s/%s/\", public_path(), strtolower(config('newportal.portlets.namespace'))).$path;\n }", "protected function rootPath()\n {\n return Pi::path('upload') . '/' . $this->getModule();\n }", "private function getPath()\n\t{\n\t\treturn $this->_sys_path;\n\t}", "public function userTempFolder(): string\n {\n /** @var \\TYPO3\\CMS\\Core\\Resource\\Folder $folder */\n $folder = $this->getBeUser()->getDefaultUploadTemporaryFolder();\n return $folder->getPublicUrl();\n }", "public function get_full_relative_path(){\n\t\treturn $this->dir . '/' . $this->get_full_name();\n\t}", "public function getDefaultUserAliasesPath()\n {\n return $this->getUserHomePath().'/'.self::USER_ALIASES_DIR_NAME;\n }", "function path($path='') {\n return $this->base_dir . $path;\n }", "public function getPathLocation(): string;", "protected function getFilesystemPath()\n {\n return dirname($this->path);\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/user';\n }", "function getdirections_location_user_path($direction, $uid) {\n if (module_exists('location') && is_numeric($uid) && ($direction == 'to' || $direction == 'from')) {\n return \"getdirections/location_user/$direction/$uid\";\n }\n}", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/users';\n }", "public function getFullPath(): string;", "public function getFullpath()\n\t{\n\t\treturn $this->filesystem->getAdapter()->root . $this->path;\n\t}", "public function pwd()\n {\n if ($this->path === null) {\n $dir = $this->Folder->pwd();\n if (is_dir($dir)) {\n $this->path = $this->Folder->slashTerm($dir) . $this->name;\n }\n }\n\n return $this->path;\n }", "public function getFilesCurrentUser(User $user)\n {\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return '/uploads/users/'.$this->getId().'/';\n }", "public function path();", "public function user_upgrade_path( $user_id = 0 ) {\n\t\tif ( empty( $user_id ) ) {\n\t\t\t$user_id = get_current_user_id();\n\t\t}\n\t\t$path = array();\n\t\t$plan_id = 0;\n\t\t$status = rcp_get_status( $user_id );\n\n\t\tif ( ! rcp_is_expired( $user_id ) && in_array( $status, array( 'active', 'cancelled' ) ) ) {\n\t\t\t$plan_id = rcp_get_subscription_id( $user_id );\n\t\t}\n\n\t\tif ( $plan_id ) {\n\t\t\t$path = $this->upgrade_paths( $plan_id );\n\t\t} else {\n\t\t\t// User isn't currently enrolled.\n\t\t\t$path = array( 1, 2, 3, 4 );\n\t\t}\n\n\t\treturn $path;\n\t}", "public function get_path_hashed()\n\t\t{\n\t\t\treturn $this->get_path_hashed_dir().'/'.$this->get_path_hashed_name();\n\t\t}", "function serverRealPath($path){\n\treturn '/'.implode(array_slice(explode('/', realpath($path)), 3));\n}", "function getPath($path) {\n if (substr($path,0,4)=='EXT:') {\n $keyEndPos = strpos($path, '/', 6);\n $key = substr($path,4,$keyEndPos-4);\n $keyPath = t3lib_extMgm::siteRelpath($key);\n $newPath = $keyPath.substr($path,$keyEndPos+1);\n return $newPath;\n }\telse {\n return $path;\n }\n }", "protected function _getPath()\n {\n if (!empty($this->_path)) {\n return $this->_path;\n }\n\n $id = $this->_config['id'];\n $dir0 = $id % 10000;\n $dir1 = $dir0 % 100;\n $dir2 = $dir0 - $dir1 * 100;\n if ($dir2 < 0) {\n $dir2 = 0;\n }\n $path = 'apps/';\n\n switch ($this->_config['section']) {\n case 1 :\n $path .= 'scripteditor/' . $dir2 . '/' . $dir1 . '/';\n break;\n \tcase 2 :\n $path .= 'slave/' . $dir2 . '/' . $dir1 . '/';\n break;\n default :\n $path .= 'tmp/';\n break;\n }\n $this->_path = $path;\n return $this->_path;\n }", "protected function privateRelativePath() : string {\n return $this->privateFolder['relative'];\n }", "public function loginPath()\n\t{\n\t\treturn property_exists($this, 'loginPath') ? $this->loginPath : '/';\n\t}", "function getPath(): string;", "public function getRootPath();", "public function getRootPath();", "public function getProjectPath(Project $project, bool $absolute = false, int $userId = null): string\n {\n $userId = $userId ?? DB::table('users_projects')->where('project_id', $project->id)->first()->user_id;\n $path = \"{$userId}/{$project->uuid}\";\n return $absolute ? public_path(\"storage/projects/$path\") : $path;\n }", "public function profilePhotoDirectory(): string\n {\n return config('filament-jet.profile_photo_directory', 'profile-photos');\n }", "public function publicPath($path = '')\n\t{\n\t\treturn $this['path.public'].ltrim($path, '/');\n\t}", "function public_path()\n {\n $paths = getPaths();\n\n return $paths['public'];\n }", "public function getUserAliasesPath()\n {\n if(!$this->hasUserAliasesPath() && $this->hasDefaultUserAliasesPath())\n $this->setUserAliasesPath($this->getDefaultUserAliasesPath());\n return $this->userAliasesPath;\n }", "function _getUser()\n\t{\n\t\treturn 'root';\n\t}", "private function _getSourceFileSystemPath()\n\t{\n\t\treturn rtrim($this->getSettings()->path, '/').'/';\n\t}", "public function pwd()\n\t{\n\t\tif (is_resource($this->_sftp) == FALSE)\n\t\t{\n\t\t\treturn NULL;\n\t\t}\n\t\treturn ssh2_sftp_realpath($this->_sftp, '.');;\n\t}", "function getPath($path) {\n\t\tif (substr($path,0,4)=='EXT:') {\n\t\t\t$keyEndPos = strpos($path, '/', 6);\n\t\t\t$key = substr($path,4,$keyEndPos-4);\n\t\t\t$keyPath = t3lib_extMgm::siteRelpath($key);\n\t\t\t$newPath = $keyPath.substr($path,$keyEndPos+1);\n\t\treturn $newPath;\n\t\t}\telse {\n\t\t\treturn $path;\n\t\t}\n\t}", "public function getRootFolder() : string;", "public function getGpgLocation() {\n\t\t$webuser = \\FreePBX::Freepbx_conf()->get('AMPASTERISKWEBUSER');\n\n\t\tif (!$webuser) {\n\t\t\tthrow new \\Exception(_(\"I don't know who I should be running GPG as.\"));\n\t\t}\n\n\t\t// We need to ensure that we can actually read the GPG files.\n\t\t$web = posix_getpwnam($webuser);\n\t\tif (!$web) {\n\t\t\tthrow new \\Exception(sprintf(_(\"I tried to find out about %s, but the system doesn't think that user exists\"),$webuser));\n\t\t}\n\t\t$home = trim($web['dir']);\n\t\tif (!is_dir($home)) {\n\t\t\t// Well, that's handy. It doesn't exist. Let's use ASTSPOOLDIR instead, because\n\t\t\t// that should exist and be writable.\n\t\t\t$home = \\FreePBX::Freepbx_conf()->get('ASTSPOOLDIR');\n\t\t\tif (!is_dir($home)) {\n\t\t\t\t// OK, I give up.\n\t\t\t\tthrow new \\Exception(sprintf(_(\"Asterisk home dir (%s) doesn't exist, and, ASTSPOOLDIR doesn't exist. Aborting\"),$home));\n\t\t\t}\n\t\t}\n\n\t\t// If $home doesn't end with /, add it.\n\t\tif (substr($home, -1) != \"/\") {\n\t\t\t$home .= \"/\";\n\t\t}\n\n\t\t// Make sure that home exists\n\t\tif (!is_dir($home)) {\n\t\t\t$ret = @mkdir($home);\n\t\t\tif (!$ret) {\n\t\t\t\tthrow new \\Exception(sprintf(_(\"Home directory %s doesn't exist, and I can't create it\"),$home));\n\t\t\t}\n\t\t}\n\n\t\t$dir = $home.\".gnupg\";\n\n\t\tif (!is_dir($dir)) {\n\t\t\t// That's worrying. Can I make it?\n\t\t\t$ret = @mkdir($dir);\n\t\t\tif (!$ret) {\n\t\t\t\tthrow new \\Exception(sprintf(_(\"Directory %s doesn't exist, and I can't make it (getGpgLocation).\"),$dir));\n\t\t\t}\n\t\t}\n\n\t\tif (is_writable($dir)) {\n\t\t\treturn $dir;\n\t\t} else {\n\t\t\tthrow new \\Exception(sprintf(_(\"Don't have permission/can't write to %s\"),$dir));\n\t\t}\n\t}", "public function pwd(): string\n {\n\n if (is_null($this->_pwd) || empty($this->_pwd))\n {\n $pwd = $this->_realpath(\".\");\n $this->_pwd = explode(\"/\", $pwd);\n }\n if (count($this->_pwd) > 1)\n {\n return implode(\"/\", $this->_pwd);\n } else\n {\n return \"/\";\n }\n }", "abstract public function getLocalPath(File $file);", "public function getPath()\n {\n return str_replace(\n ['/', '\\\\'],\n Storage::GetSeparator(),\n Storage::GetPath() . '/' . $this->dirname . '/' . $this->basename\n );\n }", "public function getPath()\n {\n return $this->_folder . DIRECTORY_SEPARATOR . $this->_name;\n }", "public function getPublicBasePath();", "abstract protected function getPath();", "function fm_get_folder_path($folderid, $notsecure = false, $groupid=0) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($folderid == 0) {\r\n\t\treturn '';\r\n\t} else {\r\n\t\t// Ensure user owns the folder\r\n\t\tif ($notsecure == false && $groupid == 0) { fm_user_owns_folder($folderid); }\r\n\t\tif ($notsecure == false && $groupid != 0) { fm_group_owns_folder($folderid, $groupid); }\r\n\t\tif (!$retval = get_record('fmanager_folders', 'id', $folderid)) {\r\n\t\t\treturn '';\r\n\t\t} \r\n\t\treturn $retval->path.$retval->name;\r\n\t}\r\n}", "public function path($append = '') {\n // Default path to user's profile\n $path = route('show', $this->username);\n // If an append argument is received, return the path with the append added, otherwise, return the default path.\n return $append ? \"{$path}/${append}\" : $path;\n }", "public function getRootDir();", "private static function findUserHome()\n {\n if (false !== ($home = getenv('HOME'))) {\n return $home;\n }\n\n if (self::isWindows() && false !== ($home = getenv('USERPROFILE'))) {\n return $home;\n }\n\n if (function_exists('posix_getuid') && function_exists('posix_getpwuid')) {\n $info = posix_getpwuid(posix_getuid());\n\n return $info['dir'];\n }\n\n throw new \\RuntimeException('Could not determine user directory');\n }", "public function GetRealPath()\n {\n return PATH_CMS_CUSTOMER_DATA.'/'.$this->GetRealFileName();\n }", "public function getFilepath() {\n\t\treturn RuntimeDirectoryManager::getDocumentRoot().$this->filename;\n\t}", "public static function getPath($ip)\n {\n if (!self::checkIpAddress($ip)) {\n return false;\n }\n $ret = Config::get('share_dir').'/'.$ip;\n if (!is_dir($ret) || !is_writable($ret)) {\n return false;\n }\n\n return $ret;\n }", "static function LockFilePath( $theUser )\n\t{\n\t\t//\n\t\t// Create name.\n\t\t//\n\t\t$name = kPORTAL_PREFIX.md5( $theUser ).\".lock\";\n\t\t\n\t\t//\n\t\t// Create base path.\n\t\t//\n\t\t$path = sys_get_temp_dir();\n\t\tif( substr( $path, strlen( $path ) - 1, 1 ) != '/' )\n\t\t\t$path .= '/';\n\t\t\n\t\treturn $path.$name;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\t\n\t}", "function public_path($path = '')\n {\n return phanda()->publicPath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n }", "public function getFolderPath(){}", "function public_path(?string $path = null): string\n{\n global $root, $slash;\n return \"{$root}{$slash}public{$slash}{$path}\";\n}", "public function cwd()\n {\n return ssh2_sftp_realpath($this->sftpHandle, \".\");\n }", "public function getPath(): string\n {\n return $this->directory->getPath();\n }", "public function basePathUpload() {\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t\t$pathupload = realpath ( APPLICATION_PATH . '/../public/data/uploads' );\n\t\t\t\t\t\treturn $pathupload;\n\t\t\t\t\t}", "function getAbsolutePath() ;", "public function path(): string\n {\n return components_path($this->name);\n }" ]
[ "0.80103356", "0.6662947", "0.6594732", "0.64392906", "0.6302571", "0.62818074", "0.6245706", "0.61275065", "0.60601425", "0.6046632", "0.6027554", "0.6017885", "0.6003769", "0.5987012", "0.5976595", "0.5836177", "0.582765", "0.5824922", "0.58175373", "0.57843316", "0.57786834", "0.5778545", "0.57766527", "0.5717961", "0.5702443", "0.56856203", "0.5669861", "0.5662681", "0.5655321", "0.56518936", "0.56418884", "0.5632327", "0.56269217", "0.5622464", "0.56115675", "0.5611301", "0.5605814", "0.5598133", "0.5597275", "0.55862176", "0.55738825", "0.55598754", "0.55568606", "0.55446064", "0.5531106", "0.5497403", "0.5492618", "0.549018", "0.54855514", "0.54786545", "0.5477091", "0.5476965", "0.54733723", "0.54708713", "0.54582757", "0.54556555", "0.5453603", "0.5452316", "0.5431349", "0.5423323", "0.542075", "0.541687", "0.5412295", "0.5384676", "0.5381244", "0.53716004", "0.53716004", "0.5369758", "0.53691196", "0.5367849", "0.5361525", "0.5361023", "0.535688", "0.5356275", "0.53428835", "0.5339297", "0.53375095", "0.5331286", "0.5324084", "0.53180385", "0.53145456", "0.5313459", "0.5302911", "0.53011006", "0.53009593", "0.529984", "0.52986217", "0.52916694", "0.5291287", "0.52912277", "0.52837235", "0.5283054", "0.5282669", "0.5281731", "0.5280697", "0.52763575", "0.5270764", "0.52673835", "0.5267317", "0.5265646" ]
0.7798964
1
Upload one or more files, return parent folder ID
function cot_pfs_upload($userid, $folderid='') { global $db, $cfg, $sys, $cot_extensions, $gd_supported, $maxfile, $maxtotal, $db_pfs, $db_pfs_folders, $L, $err_msg; if($folderid==='') $folderid = cot_import('folderid','P','INT'); $ndesc = cot_import('ndesc','P','ARR'); $npath = cot_pfs_folderpath($folderid); /* === Hook === */ foreach (cot_getextplugins('pfs.upload.first') as $pl) { include $pl; } /* ===== */ cot_die($npath===FALSE); for ($ii = 0; $ii < $cfg['pfs']['pfsmaxuploads']; $ii++) { $disp_errors = ''; $u_tmp_name = $_FILES['userfile']['tmp_name'][$ii]; $u_type = $_FILES['userfile']['type'][$ii]; $u_name = $_FILES['userfile']['name'][$ii]; $u_size = $_FILES['userfile']['size'][$ii]; $u_name = str_replace("\'",'',$u_name ); $u_name = trim(str_replace("\"",'',$u_name )); if (!empty($u_name)) { $disp_errors .= $u_name . ' : '; $u_name = mb_strtolower($u_name); $dotpos = mb_strrpos($u_name,".")+1; $f_extension = mb_substr($u_name, $dotpos); $f_extension_ok = 0; $desc = $ndesc[$ii]; if($cfg['pfs']['pfstimename']) { $u_name = time().'_'.$u_name; } if(!$cfg['pfs']['pfsuserfolder']) { $u_name = $usr['id'].'_'.$u_name; } $u_newname = cot_safename($u_name, true); $u_sqlname = $db->prep($u_newname); if ($f_extension!='php' && $f_extension!='php3' && $f_extension!='php4' && $f_extension!='php5') { foreach ($cot_extensions as $k => $line) { if (mb_strtolower($f_extension) == $line[0]) { $f_extension_ok = 1; } } } if (is_uploaded_file($u_tmp_name) && $u_size>0 && $u_size<$maxfile && $f_extension_ok && ($pfs_totalsize+$u_size)<$maxtotal) { $fcheck = cot_file_check($u_tmp_name, $u_name, $f_extension); if($fcheck == 1) { $pfs_dir_user = cot_pfs_path($userid); $thumbs_dir_user = cot_pfs_thumbpath($userid); if (!file_exists($pfs_dir_user.$npath.$u_newname)) { $is_moved = true; if ($cfg['pfs']['pfsuserfolder']) { if (!is_dir($pfs_dir_user)) { $is_moved &= mkdir($pfs_dir_user, $cfg['dir_perms']); } if (!is_dir($thumbs_dir_user)) { $is_moved &= mkdir($thumbs_dir_user, $cfg['dir_perms']); } } $is_moved &= move_uploaded_file($u_tmp_name, $pfs_dir_user.$npath.$u_newname); $is_moved &= chmod($pfs_dir_user.$npath.$u_newname, $cfg['file_perms']); $u_size = filesize($pfs_dir_user.$npath.$u_newname); if ($is_moved && (int)$u_size > 0) { /* === Hook === */ foreach (cot_getextplugins('pfs.upload.moved') as $pl) { include $pl; } /* ===== */ $db->insert($db_pfs, array( 'pfs_userid' => (int)$userid, 'pfs_date' => (int)$sys['now'], 'pfs_file' => $u_sqlname, 'pfs_extension' => $f_extension, 'pfs_folderid' => (int)$folderid, 'pfs_desc' => $desc, 'pfs_size' => (int)$u_size, 'pfs_count' => 0 )); $db->update($db_pfs_folders, array('pff_updated' => $sys['now']), 'pff_id="'.$folderid.'"'); $disp_errors .= $L['Yes']; $pfs_totalsize += $u_size; /* === Hook === */ foreach (cot_getextplugins('pfs.upload.done') as $pl) { include $pl; } /* ===== */ if ( in_array($f_extension, $gd_supported) && Cot::$cfg['pfs']['th_amode']!='Disabled' && file_exists($pfs_dir_user.$u_newname) ) { @unlink($thumbs_dir_user.$npath.$u_newname); $th_colortext = Cot::$cfg['pfs']['th_colortext']; $th_colorbg = Cot::$cfg['pfs']['th_colortext']; cot_imageresize( $pfs_dir_user . $npath . $u_newname, $cfg['pfs']['thumbs_dir_user'] . $npath . $u_newname, Cot::$cfg['pfs']['th_x'], Cot:: $cfg['pfs']['th_y'], '', $th_colorbg, Cot::$cfg['pfs']['th_jpeg_quality'], true ); } } else { @unlink($pfs_dir_user.$npath.$u_newname); $disp_errors .= $L['pfs_filenotmoved']; } } else { $disp_errors .= $L['pfs_fileexists']; } } elseif($fcheck == 2) { $disp_errors .= sprintf($L['pfs_filemimemissing'], $f_extension); } else { $disp_errors .= sprintf($L['pfs_filenotvalid'], $f_extension); } } else { $disp_errors .= $L['pfs_filetoobigorext']; } $err_msg[] = $disp_errors; } } return $folderid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function upload(){\r\n\t\t\tglobal $_POST;\r\n\t\t\t$_POST['folder'] = str_replace('/umeos','',$_POST['folder']);\r\n\t\t\t$_POST['folder'] = str_replace('/root/infinite-home/','',$_POST['folder']);\r\n\r\n\t\t\tif (!empty($_FILES)) {\r\n\t\t\t\tforeach($_FILES as $file){\r\n\t\t\t if (!empty($file['tmp_name'])) {\r\n\t\t\t $this->mFile['size']\t= $file['size'];\r\n\t\t\t $this->mFile['type']\t= $file['type'];\r\n\t\t\t \t$tmp \t\t\t\t\t= $file['tmp_name'];\r\n\t\t\t \t$this->mFile['path'] \t= ($_POST['user_id']) ? $_SERVER['HTTP_HOST'].'/'. $_POST['user_id'] : $_SERVER['HTTP_HOST'] ;\r\n\t\t\t $this->mFile['name'] \t= $file['name'];\r\n\t\t\t $this->mFile['md5'] \t= md5_file($tmp);\r\n\t\t\t $this->mFile['real'] \t= htmlentities(urlencode($this->mFile['name']));\r\n\t\t\t $this->mFile['loc'] \t= '/^/'.$this->mFile['path'] .'/'. $this->mFile['md5'];\r\n\t\t\t $this->mFile['src'] \t= str_replace('//','/',$_SERVER['DOCUMENT_ROOT'].$this->mFile['loc']);\r\n\t\t\t // Uncomment the following line if you want to make the directory if it doesn't exist\r\n\t\t\t /**\r\n\t\t\t * we dont want to save the file in a dir tree...\r\n\t\t\t * only the db holds that info. instead we change save the file as its md5 hash.\r\n\t\t\t *\r\n\t\t\t */\r\n\r\n\t\t\t if(!file_exists($_SERVER['DOCUMENT_ROOT'].'/^/')){\r\n\t\t\t \tmkdir($_SERVER['DOCUMENT_ROOT'].'/^/', 0755, true);\r\n\t\t\t }\r\n\r\n\t\t\t $path = $_SERVER['DOCUMENT_ROOT'].'/^/'.$this->mFile['path'];\r\n\t\t\t $path = str_replace('//','/',$path);\r\n\r\n\r\n\t\t\t if(!file_exists($path)){\r\n\t\t\t \tmkdir($path, 0755, true);\r\n\t\t\t }\r\n\r\n\t\t\t move_uploaded_file($tmp,$this->mFile['src']);\r\n\t\t\t return $this->Index();\r\n\t\t\t }\r\n\t\t\t }\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}", "public function getUploadId()\n {\n return $this->data['upload_id'];\n }", "function upload_image($parent_id){\n\t\tif(!is_numeric($parent_id)){\n\t\t\tredirect('site_security/not_allowed');\n\t\t}\n\t\t$this->load->library('session');\n // security form\n\t\t$this->load->module('site_security');\n\t\t$this->site_security->_make_sure_is_admin();\n // get id\n\n\t\t$data['parent_id'] = $parent_id;\n\t\t$data['flash'] = $this->session->flashdata('item');\n\n\t // submit handler\n\n\t\t$data['headline'] = 'upload image';\n //$data['stor_items'] = 'stor_items';\n\t\t$data['view_file'] = 'upload_image';\n\t\t$this->load->module('templates');\n\t\t$this->templates->admin($data);\n\t}", "public function upload($id, array $files);", "public function multiple_upload($id) {\n\n\t\t // getting all of the post data\n\t\t $files = Input::file('document');\n\t\t // Making counting of uploaded images\n\t\t $file_count = count($files);\n\t\t // start count how many uploaded\n\t\t if (Input::hasFile('document')) {\n\t\t\t $uploadcount = 0; \n\t\t\t foreach($files as $file) {\n\t\t \t \t\t$destinationPath = 'uploads/employer_document';\n\t\t\t\t $extension = $file->getClientOriginalName();\n\t\t\t\t $filename = rand(11111,99999).'.'.$extension; // renameing image\n\t\t\t\t $upload_success = $file->move($destinationPath, $filename);\n\t\t\t\t $fileName[]= $filename;\n\t\t\t \n\t\t\t }\n\t\t\t return $fileName;\n\t\t }\n \n \t }", "public function upload()\n {\n if (!Request::hasPost('requestToken') || !RequestToken::validate(Request::getPost('requestToken'))) {\n $objResponse = new ResponseError();\n $objResponse->setMessage('Invalid Request Token!');\n $objResponse->output();\n }\n\n if (!Request::getInstance()->files->has($this->name)) {\n return;\n }\n\n $objTmpFolder = new \\Folder(MultiFileUpload::UPLOAD_TMP);\n\n // contao 4 support, create tmp dir symlink\n if (version_compare(VERSION, '4.0', '>=')) {\n // tmp directory is not public, mandatory for preview images\n if (!file_exists(System::getContainer()->getParameter('contao.web_dir') . DIRECTORY_SEPARATOR . MultiFileUpload::UPLOAD_TMP)) {\n $objTmpFolder->unprotect();\n $command = new SymlinksCommand();\n $command->setContainer(System::getContainer());\n $input = new ArrayInput([]);\n $output = new NullOutput();\n $command->run($input, $output);\n }\n }\n\n $strField = $this->name;\n $varFile = Request::getInstance()->files->get($strField);\n // Multi-files upload at once\n if (is_array($varFile)) {\n // prevent disk flooding\n if (count($varFile) > $this->maxFiles) {\n $objResponse = new ResponseError();\n $objResponse->setMessage('Bulk file upload violation.');\n $objResponse->output();\n }\n\n /**\n * @var UploadedFile $objFile\n */\n foreach ($varFile as $strKey => $objFile) {\n $arrFile = $this->uploadFile($objFile, $objTmpFolder->path, $strField);\n $varReturn[] = $arrFile;\n\n if (\\Validator::isUuid($arrFile['uuid'])) {\n $arrUuids[] = $arrFile['uuid'];\n }\n }\n } // Single-file upload\n else {\n /**\n * @var UploadedFile $varFile\n */\n $varReturn = $this->uploadFile($varFile, $objTmpFolder->path, $strField);\n\n if (\\Validator::isUuid($varReturn['uuid'])) {\n $arrUuids[] = $varReturn['uuid'];\n }\n }\n\n if ($varReturn !== null) {\n $this->varValue = $arrUuids;\n $objResponse = new ResponseSuccess();\n $objResult = new ResponseData();\n $objResult->setData($varReturn);\n $objResponse->setResult($objResult);\n\n return $objResponse;\n }\n }", "public function Do_Upload_images($d, $files) {\n// echo \"<br/>\";\n// var_dump($_FILES);\n $data = array(\n \"table\" => \"comp484_parent_dl\",\n \"field\" => \"parent_id\",\n \"value\" => $d['parent_id']\n );\n $get_number_of_images = $this->GetNumberOfImages($data);\n\n $number = $get_number_of_images['row_count'];\n\n // Create directory if it does not exist\n $folder_name = \"license_parentid_\" . $d['parent_id'] . '/';\n if (!is_dir(ABSOLUTH_PATH_IMAGES . $folder_name)) {\n mkdir(ABSOLUTH_PATH_IMAGES . $folder_name);\n }\n\n\n $upload_file_new_name = preg_replace('/^.*\\.([^.]+)$/D', \"dl_number_\" . ((int) $number + 1) . \".$1\", basename($_FILES[\"uploadimage\"]['name']));\n// echo \"<br/>\";\n// echo $upload_file_new_name;\n $upload_folder = ABSOLUTH_PATH_IMAGES . $folder_name;\n $upload_file = ABSOLUTH_PATH_IMAGES . $folder_name . $upload_file_new_name;\n\n //$path_2 = FE_IMAGES . $logo_name . \"_logo/\";\n //$path = P_IMAGE_PATH . $logo_name . \"_logo/\";\n\n $uploadOk = 1;\n\n $imageFileType = pathinfo($upload_file, PATHINFO_EXTENSION);\n\n\n if (isset($_POST)) {\n \n }\n if (file_exists($upload_file)) {\n $uploadOk = 0;\n }\n if ($_FILES['uploadimage'][\"size\"] > 5000000) {\n \n }\n if ($imageFileType != \"jpg\" && $imageFileType != \"png\" && $imageFileType != \"jpeg\" && $imageFileType != \"gif\" && $imageFileType != \"PNG\" && $imageFileType != \"JPG\" && $imageFileType != \"JPEG\" && $imageFileType != \"GIF\") {\n $uploadOk = 0;\n }\n if ($uploadOk == 0) {\n \n } else {\n if (file_exists(\"$folder_name.$upload_file\")) {\n unlink(\"$folder_name.$upload_file\");\n }\n\n if (move_uploaded_file($_FILES['uploadimage'][\"tmp_name\"], $upload_file)) {\n\n $insert_image = \"INSERT INTO `comp484_parent_dl` (parent_id, other_name, folder, image_name, date_added) \"\n . \"VALUES \"\n . \"('\" . $d['parent_id'] . \"', '\" . $d['other_name'] . \"', '\" . $upload_folder . \"', '\" . $upload_file_new_name . \"', '\" . DATE_ADDED . \"')\";\n// echo \"<br/>\";\n// echo $insert_image;\n $insert_result = $this->_mysqli->query($insert_image);\n return true;\n } else {\n return false;\n }\n }\n }", "public function getRelativeUploadPath(): string;", "public function uploadPath();", "public function uploadFiles($folder, $formdata, $itemId = null) {\n $folder_url = WWW_ROOT.$folder;\n $rel_url = $folder;\n \n // create the folder if it does not exist\n if(!is_dir($folder_url)) {\n mkdir($folder_url);\n }\n \n // if itemId is set create an item folder\n if($itemId) {\n // set new absolute folder\n $folder_url = WWW_ROOT.$folder.'/'.$itemId; \n // set new relative folder\n $rel_url = $folder.'/'.$itemId;\n // create directory\n if(!is_dir($folder_url)) {\n mkdir($folder_url);\n }\n }\n \n // list of permitted file types, this is only images but documents can be added\n $permitted = array('image/gif','image/jpeg','image/pjpeg','image/png');\n \n // loop through and deal with the files\n foreach($formdata as $file) {\n // replace spaces with underscores\n $filename = str_replace(' ', '_', $file['name']);\n // assume filetype is false\n $typeOK = false;\n // check filetype is ok\n foreach($permitted as $type) {\n if($type == $file['type']) {\n $typeOK = true;\n break;\n }\n }\n \n // if file type ok upload the file\n if($typeOK) {\n // switch based on error code\n switch($file['error']) {\n case 0:\n // check filename already exists\n if(!file_exists($folder_url.'/'.$filename)) {\n // create full filename\n $full_url = $folder_url.'/'.$filename;\n $url = $rel_url.'/'.$filename;\n // upload the file\n $success = move_uploaded_file($file['tmp_name'], $url);\n } else {\n // create unique filename and upload file\n ini_set('date.timezone', 'Europe/London');\n $now = date('Y-m-d-His');\n $full_url = $folder_url.'/'.$now.$filename;\n $url = $rel_url.'/'.$now.$filename;\n $success = move_uploaded_file($file['tmp_name'], $url);\n }\n // if upload was successful\n if($success) {\n // save the url of the file\n $result['urls'][] = $url;\n } else {\n $result['errors'][] = \"Error uploaded $filename. Please try again.\";\n }\n break;\n case 3:\n // an error occured\n $result['errors'][] = \"Error uploading $filename. Please try again.\";\n break;\n default:\n // an error occured\n $result['errors'][] = \"System error uploading $filename. Contact webmaster.\";\n break;\n }\n } elseif($file['error'] == 4) {\n // no file was selected for upload\n $result['nofiles'][] = \"No file Selected\";\n } else {\n // unacceptable file type\n $result['errors'][] = \"$filename cannot be uploaded. Acceptable file types: gif, jpg, png.\";\n }\n }\n return $result;\n }", "function uploader($post_type, $id){\n $target_dir = realpath(__DIR__.'/../upload/');\n $full_path = $target_dir.'/'.$post_type.'/'.$id;\n// var_dump($target_dir, $full_path);\n// die;\n if(!is_dir($full_path)){\n if (!mkdir($full_path, 777, true)) {\n die('Не удалось создать директории...');\n }\n }\n $base_name = basename($_FILES[\"fileToUpload\"][\"name\"]);\n $target_file = $full_path . $base_name;\n if (!empty($_FILES[\"file\"])) {\n if ($_FILES[\"file\"][\"error\"] > 0) {\n echo \"Error: \" . $_FILES[\"file\"][\"error\"] . \"<br>\";\n } else {\n move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], $target_file);\n return $base_name;\n }\n }\n}", "public function upload($files)\n {\n $exception = null;\n\n //for each client\n foreach ($this->children as $child) {\n $this->logger->info(sprintf('[dizda-backup] Uploading to %s', $child->getName()));\n\n try {\n //try to upload every file, one at a time\n foreach ($files as $file) {\n $child->upload($file);\n }\n } catch (\\Exception $e) {\n //save the exception for later, there might be other children that are working\n $exception = $e;\n }\n }\n\n if ($exception) {\n throw $exception;\n }\n }", "public function upload()\n {\n $path = $this->file_path;\n if (!file_exists($path)) {\n mkdir($path, 0777, true);\n }\n\n // Upload file. \n $file_name = strtolower(basename($_FILES['uploaded_file']['name']));\n $file_name = str_replace(' ', '-', $file_name); // Replace spaces with dashes.\n $path = $path . $file_name;\n\n $acceptable = array(\n 'image/jpeg',\n 'image/jpg',\n 'image/gif',\n 'image/png'\n );\n\n if(in_array($_FILES['uploaded_file']['type'], $acceptable)) {\n\n if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {\n\n $file_msg = 'The file '. $path . ' has been uploaded';\n \n // Not ideal but good for now\n \n // Refresh parent on upload.\n echo \"<script>window.parent.location.reload(true);</script>\";\n\n } else {\n\n $file_msg = 'There was a problem with the upload.';\n }\n }\n else {\n\n $file_msg = 'Bad file uploaded.';\n }\n return $file_msg;\n }", "public function process_uploaded_files($id){\n\t\tif(isset($_POST['files']) && !empty($_POST['files']) && is_array($_POST['files'])){\n\t\t\t$files = arr::map_post_keys($_POST['files']);\n\t\t\t\n\t\t\tif($files){\n\t\t\t\tforeach($files as $k => $file){\n\t\t\t\t\tif(empty($file['id']) && file_exists(DOCROOT.'uploads/'.$file['system_name'])){\t\t\t\t\t\t\t\n\t\t\t\t\t\tfile::insert(\n\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t$this->section_url,\n\t\t\t\t\t\t\t$file['type'],\n\t\t\t\t\t\t\t$file['name'],\n\t\t\t\t\t\t\t$file['system_name'],\n\t\t\t\t\t\t\t$file['mime_type'],\n\t\t\t\t\t\t\t$file['size'],\n\t\t\t\t\t\t\t$file['extension']\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\n\t\treturn;\n\t}", "function do_upload($parent_id){\n\t\tif(!is_numeric($parent_id)){\n\t\t\tredirect('site_security/not_allowed');\n\t\t}\n\t\t$this->load->library('session');\n\t\t$this->load->module('site_security');\n\t\t$this->site_security->_make_sure_is_admin();\n\t\t//submit value\n\t\t$submit = $this->input->post('submit', TRUE);\n //cansel button\n\t\tif($submit == 'Cancel'){\n\t\n\t\t\tredirect('item_galleries/update_group/'.$parent_id);\n\t\t}\n\t\t//upload\n\t\t$config['upload_path'] = './assets/img/gallery/';\n\t\t$config['allowed_types'] = 'gif|jpg|png|jpeg';\n\t\t$config['max_size'] = 3000;\n\t\t$config['max_width'] = 2024;\n\t\t$config['max_height'] = 1568;\n\n\t\t$this->load->library('upload', $config);\n\n\t\tif (!$this->upload->do_upload('userfile'))\n\t\t{\n\t\t\t$data['error'] = array('error' => $this->upload->display_errors());\n \n\t\t\t//$this->load->view('upload_form', $error)\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t $data['flash'] = $this->session->flashdata('item');\n\n\t\t\t$data['headline'] = 'upload image';\n //$data['stor_items'] = 'stor_items';\n\t\t $data['view_file'] = 'upload_image';\n\t\t\t$this->load->module('templates');\n\t\t\t$this->templates->admin($data);\n\t }\n\t\telse\n\t\t{ \n\t\t\t$data = array('upload_data' => $this->upload->data());\n\t\t\t//get finename \n\t\t\t$upload_data = $data['upload_data'];\n\t\t\t$file_name = $upload_data['file_name'];\n\t unset($data);\n // insert image into database\n\t $data['parent_id'] = $parent_id;\n\t\t\t$data['picture'] = $file_name;\n $this->_insert($data);\n\t\t\t//get id \n\t\t\t\n\t\t $data['flash'] = $this->session->flashdata('item');\n\n\t\t redirect('item_galleries/update_group/'.$parent_id);\n\t\t}\n\t}", "public function uploadFile(){\n\n if (!$this->request->is('post'))\n {\n $this->setErrorMessage('Post method required');\n return;\n }\n\n if (!isset($this->request->data['currentPath']) ||\n !isset($this->request->params['form']) ||\n !isset($this->request->params['form']['idia'])\n ){\n $this->setErrorMessage('Invalid parameters');\n return;\n }\n\n $path = ltrim(trim($this->request->data['currentPath']), DS);\n $tokens = explode(DS, strtolower($path));\n\n ($tokens[0] == 'root') && ($tokens = array_slice($tokens, 1, null, true));\n\n $path = implode(DS, $tokens);\n $fullPath = WWW_FILE_ROOT . strtolower($path);\n\n if(!is_dir($fullPath)){\n $this->setErrorMessage('Invalid path');\n return;\n }\n\n if(is_file($fullPath . DS . strtolower($this->request->params['form']['idia']['name']))){\n $this->setErrorMessage('File with similar name already exist');\n return;\n }\n\n $newFile = new File($fullPath . DS . strtolower($this->request->params['form']['idia']['name']), true );\n $newFile->close();\n\n $tempFile = new File(($this->request->params['form']['idia']['tmp_name']));\n $tempFile->copy($fullPath . DS .$this->request->params['form']['idia']['name']);\n $tempFile->delete();\n\n $this->set(array(\n 'status' => 'ok',\n \"message\" => 'successful',\n \"_serialize\" => array(\"message\", \"status\")\n ));\n }", "function uploadFiles () {\n\n}", "function insertFile($service, $title, $description, $parentId,$mimeType,$uploadfilename)\n{\n\n $file = new Google_Service_Drive_DriveFile();\n $file->setTitle($title);\n $file->setDescription($description);\n $file->setMimeType($mimeType);\n if ($parentId != null) {\n $parent = new Google_Service_Drive_ParentReference();\n $parent->setId($parentId);\n $file->setParents(array($parent));\n }\n try\n {\n $data =file_get_contents($uploadfilename);\n $createdFile = $service->files->insert($file, array(\n 'data' => $data,\n 'mimeType' => $mimeType,\n 'uploadType' => 'media',\n ));\n\n $fileid = $createdFile->getId();\n\n\n }\n catch (Exception $e)\n {\n $file_flag=0;\n\n }\n return $fileid;\n\n}", "protected function iterateImages() {\n $currentFilesNumber = 0;\n\n // Cycle through all file to check number of images present in folder.\n foreach ($this->getIterator($this->filePath) as $info) {\n if ($info->isDot() || $info->isDir()) {\n continue;\n }\n\n if ($info->isFile() && $this->isImage($info)) {\n $currentFilesNumber += 1;\n }\n }\n\n // If the limit for maximum number of images was not reached\n // than upload file to the folder.\n if ($currentFilesNumber < $this->maxFilesInFolder) {\n $filaName = $this->getFileName($this->file->getClientOriginalName(), $currentFilesNumber);\n\n $this->file->move($this->filePath, $filaName);\n\n return UPLOAD_PATH . $this->typeFolder . '/'\n . $this->yearFolder . '/'\n . $this->lastFolder . '/' . $filaName;\n } else {\n\n // If not create a new folder to upload the file.\n // The new folder's name is a date (corrispondent to lastFolder date), \n // incremented by one day. \n $this->lastFolder = date('Y-m-d', strtotime($this->lastFolder) + 86400);\n\n $newPath = $this->rootFolder . '/'\n . $this->yearFolder . '/'\n . $this->lastFolder;\n\n mkdir($newPath, 0777);\n \n // Set id file's name to 0.\n $filaName = $this->getFileName($this->file->getClientOriginalName(), 0);\n\n $this->file->move($newPath, $filaName);\n\n return UPLOAD_PATH . $this->typeFolder . '/'\n . $this->yearFolder . '/'\n . $this->lastFolder . '/' . $filaName;\n }\n }", "public function pushUpload(){\n\t\tif(!empty($_FILES[\"docs\"][\"name\"]))\n\t\t{\n\t\t\tif (Upload::setDirs()){ //Check the necessary directories needed to be created\n\t\t\t\t//Do not create tmp directory if setReplace variable is not set\n\t\t\t\tif(!isset($_POST['replace'])){\n\t\t\t\t\tif(is_dir(self::$tmpSubDir))\n\t\t\t\t\t\tUpload::destroyAll(self::$tmpSubDir); //Remove the previously created temporary directory if exists \n\n\t\t\t\t\tUpload::checkFiles($_FILES[\"docs\"][\"name\"]); //Stores the already existing filename.\n\t\t\t\t\tUpload::setDirs();\n\t\t\t\t\tUpload::uploadConfirm();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$lsTmp = scandir(self::$tmpSubDir);\n\t\t\t\t\tforeach($_POST['setReplace'] as $tmpReplace){\n\t\t\t\t\t\tif(in_array($tmpReplace,$lsTmp)) //checks the array $tmpReplace with the array that has duplicate filesname stored in it\n\t\t\t\t\t\t\tcopy(self::$tmpSubDir.$tmpReplace,self::$subDir.$tmpReplace); //Replace the original one with the new file\t\t\n\t\t\t\t\t}\n\t\t\t\t\tUpload::destroyAll(self::$tmpSubDir);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t}", "public function getParentFolder() {}", "public function getParentFolder() {}", "public function getParentFolder() {}", "public function getUploaderFolder (){\n\t\treturn $this->uploadFolder ;\n\t}", "function upload($filedata) {\r\n\t\t// Error if no file to upload\r\n\t\tif (empty($filedata)) {\r\n\t\t\treturn array('error' => __d('caracole_documents', 'No file uploaded', true));\r\n\t\t}\r\n\t\t// Error during upload\r\n\t\tif (!empty($filedata['error'])) {\r\n\t\t\treturn array('error' => $this->__getUploadError($filedata['error']));\r\n\t\t}\r\n\t\t// Getting data from the file\r\n\t\t$data = $this->extractMetadata($filedata);\r\n\r\n\t\t// Validating the upload (type, filesize, etc)\r\n\t\tif (!$this->validatesUpload($data)) {\r\n\t\t\treturn array('error' => $this->uploadValidationError);\r\n\t\t}\r\n\r\n\t\t// Creating the complete filepath\r\n\t\t$uploadPath = $this->getOrCreateUploadDirectory(date('Y'), date('m'), date('d'));\r\n\t\tif ($uploadPath===false) {\r\n\t\t\treturn array('error' => __d('caracole_documents', 'Unable to create upload directory. Check that your files/ directory is writable.', true));\r\n\t\t}\r\n\r\n\t\t$data['id'] = String::uuid();\r\n\t\t$data['parent_id'] = 0;\r\n\t\t$filepath = $uploadPath.$data['id'].'.'.$data['ext'];\r\n\r\n\t\t// Moving the uploaded file to its upload directory\r\n\t\tif (!$this->__moveUploadedFile($filedata['tmp_name'], $filepath)) {\r\n\t\t\treturn array('error' => __d('caracole_documents', 'Unable to write file on disk. Check that your files/ directory is writable.', true));\r\n\t\t}\r\n\r\n\t\t$data['path'] = $filepath;\r\n\r\n\t\t// Returning complete upload data\r\n\t\treturn $data;\r\n\t}", "abstract protected function getUploadDir(): string;", "private function uploadFolder()\n {\n return \"instagram/{$this->InstagramUserID}\";\n }", "function pilihmedia(){\n\t\t$idp = explode(\"_\",$_POST['idparent']);\n\t\t$id_ini = end($idp);\n\t\t$ini = $this->m_fmanager->ini_folder($id_ini);\n\t\tif(count($idp)==1){\n\t\t\t$komponen = \"assets/media/upload/\".$ini->link.\"/\";\n\t\t} else {\n\t\t\t$komponen = \"\";\n\t\t\tfor($i=0;$i<count($idp)-1;$i++){\n\t\t\t\t$iniF = $this->m_fmanager->ini_folder($idp[$i]);\n\t\t\t\t$komponen = $komponen.$iniF->link.\"/\";\n\t\t\t}\n\t\t\t$komponen = \"assets/media/upload/\".$komponen.$ini->link.\"/\";\n\t\t}\n\n\t\t$idd = end($idp);\n\t\t$data['idp'] = $_POST['idparent'];\n\t\t$data['level'] = $_POST['level'];\n\t\t$data['folder'] = $this->m_fmanager->ini_folder($idd);\n\t\t$data['isi'] = $this->m_fmanager->getfile($idd);\n\t\t$data['idd'] = $idd;\n\t\t$data['path'] = $komponen;\n\n\t\t$this->load->view('fmanager/pilihmedia',$data);\n\t}", "function Upload() {\n\t\t// What permissions checks do we need?\n\n\t\tset_time_limit(600);\n\t\tignore_user_abort(1);\n\n\t\t$taskID = Request::post('taskid');\n\t\t$projectID = Request::post('projectid');\n\t\t$file = Request::files('document', Request::R_ARRAY);\n\t\t$caller = Request::post('caller');\n\n\t\tforeach ($file[\"error\"] as $key => $error)\n\t\t{\n\t\t\tif ($error == UPLOAD_ERR_OK)\n\t\t\t{\n\t\t\t\t$file_tmp = $file['tmp_name'][$key];\n\t\t\t\t$file_name = $file['name'][$key];\n\t\t\t\t$file_type = $file['type'][$key];\n\t\t\t\t$file_size = $file['size'][$key];\n\t\t\t\tif ($file_size > 0) \n\t\t\t\t{\n\t\t\t\t\t$project_dir = str_pad($projectID, 7, '0', STR_PAD_LEFT);\n\t\t\t\t\t$task_dir = str_pad($taskID, 7, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t$trailer = substr(SYS_FILEPATH, strlen(SYS_FILEPATH) - 1, 1);\n\t\t\t\t\t$filepath = ( ($trailer != '\\\\') && ($trailer != '/') ) ? SYS_FILEPATH . '/' : SYS_FILEPATH;\n\n\t\t\t\t\t$project_path = $filepath . $project_dir;\n\t\t\t\t\t$task_path = $filepath . $project_dir . '/'. $task_dir;\n\t\t\t\t\t@mkdir($project_path, 0777);\n\t\t\t\t\t@mkdir($task_path, 0777);\n\n\t\t\t\t\t$new_file_name = $this->MD5($projectid.$taskid.$file_name.microtime(true));\n\t\t\t\t\t$new_file_path = $task_path . '/' . $new_file_name;\n\n\t\t\t\t\t// File versioning has introduced a different file naming convention.\n\t\t\t\t\t// Instead of <project id>/<task id>/<md5 hash> we will have \n\t\t\t\t\t// <project id>/<task id>/md5 hash/<md5 hash>_<version>\n\t\t\t\t\t// ie. the hash becomes the folder, and version number is a suffix of the on-disk filename.\n\t\t\t\t\tif ( defined( 'FILE_VERSIONING_ENABLED' ) && FILE_VERSIONING_ENABLED == '1' )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( !is_dir( $new_file_path ) )\n\t\t\t\t\t\t\tmkdir( $new_file_path, 0777 );\n\t\t\t\t\t\t$versionSuffix = 1; // We are always uploading a new file in Springboard, so it gets version=1. \n\t\t\t\t\t\t$new_file_path .= '/' . $new_file_name . '_' . $versionSuffix;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( move_uploaded_file($file_tmp, $new_file_path) ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$SQL = sprintf(SQL_FILE_CREATE, $file_name, '', $file_type, $this->User->ID, date('Y-m-d H:i:s'), $file_size, 1, $new_file_name, 0, '0', $projectID, $taskID);\n\t\t\t\t\t\t$this->DB->Execute($SQL);\n\n\t\t\t\t\t\t$fileID = $this->DB->ExecuteScalar( SQL_LAST_INSERT );\n\t\t\t\t\t\t$SQL = sprintf(SQL_FILE_LOG, $fileID, $this->User->ID, date('Y-m-d H:i:s'), MSG_UPLOADED, $version);\n\t\t\t\t\t\t$this->DB->Execute($SQL);\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$no_redirect = 1;\n\t\t\t\t\t\t$message = \"Post Max Size: \".ini_get('post_max_size');\n\t\t\t\t\t\t$message .= ' - Upload Max Filesize: '.ini_get('upload_max_filesize');\n\t\t\t\t\t\t$this->ThrowError(4000, base64_encode($message));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$module = ($caller == 'springboard') ? 'springboard' : 'projects';\n\t\tResponse::redirect(\"index.php?module=$module&action=taskview&projectid=$projectID&taskid=$taskID\");\n\t}", "public function upload() {\n\t\t\n\t\t$output = array();\n\t\tCore\\Debug::log($_POST + $_FILES, 'files');\n\n\t\t// Set path.\n\t\t// If an URL is also posted, use that URL's page path. Without any URL, the /shared path is used.\n\t\t$path = $this->getPathByPostUrl();\n\t\t\n\t\t// Move uploaded files\n\t\tif (isset($_FILES['files']['name'])) {\n\t\n\t\t\t// Check if upload destination is writable.\n\t\t\tif (is_writable($path)) {\n\t\n\t\t\t\t$errors = array();\n\n\t\t\t\t// In case the $_FILES array consists of multiple files (IE uploads!).\n\t\t\t\tfor ($i = 0; $i < count($_FILES['files']['name']); $i++) {\n\t\n\t\t\t\t\t// Check if file has a valid filename (allowed file type).\n\t\t\t\t\tif (FileSystem::isAllowedFileType($_FILES['files']['name'][$i])) {\n\t\t\t\t\t\t$newFile = $path . Core\\Str::sanitize($_FILES['files']['name'][$i]);\n\t\t\t\t\t\tmove_uploaded_file($_FILES['files']['tmp_name'][$i], $newFile);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$errors[] = Text::get('error_file_format') . ' \"' . FileSystem::getExtension($_FILES['files']['name'][$i]) . '\"';\n\t\t\t\t\t}\n\t\n\t\t\t\t}\n\n\t\t\t\t$this->clearCache();\n\t\t\n\t\t\t\tif ($errors) {\n\t\t\t\t\t$output['error'] = implode('<br />', $errors);\n\t\t\t\t} \n\n\t\t\t} else {\n\t\t\n\t\t\t\t$output['error'] = Text::get('error_permission') . ' \"' . basename($path) . '\"';\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn $output;\n\t\t\t\n\t}", "function uploadFiles($folder, $formdata, $permitted = null, $itemId = null) \n\t\t{\n\t\t\t// setup dir names absolute and relative\n\t\t\t$folder_url = WWW_ROOT.$folder;\n\t\t\t$rel_url = $folder;\n\t\t\t\n\t\t\t// create the folder if it does not exist\n\t\t\tif(!is_dir($folder_url)) {\n\t\t\t\tmkdir($folder_url);\n\t\t\t}\n\t\t\t\t\n\t\t\t// if itemId is set create an item folder\n\t\t\tif($itemId) {\n\t\t\t\t// set new absolute folder\n\t\t\t\t$folder_url = WWW_ROOT.$folder.'/'.$itemId; \n\t\t\t\t// set new relative folder\n\t\t\t\t$rel_url = $folder.'/'.$itemId;\n\t\t\t\t// create directory\n\t\t\t\tif(!is_dir($folder_url)) {\n\t\t\t\t\tmkdir($folder_url);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// list of permitted file types, this is only images but documents can be added\n\t\t\t//$permitted = array('image/gif','image/jpeg','image/pjpeg','image/png');\n\t\t\t\n\t\t\t$file = $formdata;\n\t\t\t//$file['tmp_name'] = $file['tmp_name'].'.tmp';\n\t\t\t// loop through and deal with the files\n\t\t\tforeach($formdata as $file) \n\t\t\t{\n\t\t\t\t\n\t\t\t\t// replace spaces with underscores\n\t\t\t\t$filename = str_replace(' ', '_', $file['name']);\n\t\t\t\t// assume filetype is false\n\t\t\t\t\n\t\t\t\tif($permitted != null)\n\t\t\t\t{\n\t\t\t\t\t$typeOK = false;\n\t\t\t\t\t// check filetype is ok\n\t\t\t\t\tforeach($permitted as $type) \n\t\t\t\t\t{\n\t\t\t\t\t\tif($type == $file['type']) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$typeOK = true;\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}else\n\t\t\t\t{\n\t\t\t\t\t$typeOK = true;\n\t\t\t\t}\n\t\t\t\t// if file type ok upload the file\n\t\t\t\tif($typeOK) {\n\t\t\t\t\t// switch based on error code\n\t\t\t\t\tswitch($file['error']) {\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t// check filename already exists\n\t\t\t\t\t\t\tif(!file_exists($folder_url.'/'.$filename)) {\n\t\t\t\t\t\t\t\t// create full filename\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$full_url = $folder_url.'/'.$filename;\n\t\t\t\t\t\t\t\t$url = $rel_url.'/'.$filename;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// upload the file\n\t\t\t\t\t\t\t\t$success = move_uploaded_file($file['tmp_name'], $full_url);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// create unique filename and upload file\n\t\t\t\t\t\t\t\tini_set('date.timezone', 'Europe/London');\n\t\t\t\t\t\t\t\t$now = date('Y-m-d-His');\n\t\t\t\t\t\t\t\t$full_url = $folder_url.'/'.$now.$filename;\n\t\t\t\t\t\t\t\t$url = $rel_url.'/'.$now.$filename;\n\t\t\t\t\t\t\t\t$success = move_uploaded_file($file['tmp_name'], $full_url);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// if upload was successful\n\t\t\t\t\t\t\tif($success) {\n\t\t\t\t\t\t\t\t// save the url of the file\n\t\t\t\t\t\t\t\t$result['urls'][] = $full_url;//$url;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$result['errors'][] = \"Error uploading $filename. Please try again.\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t// an error occured\n\t\t\t\t\t\t\t$result['errors'][] = \"Error uploading $filename. Please try again.\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t// an error occured\n\t\t\t\t\t\t\t$result['errors'][] = \"System error uploading $filename. Contact webmaster.\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} elseif($file['error'] == 4) {\n\t\t\t\t\t// no file was selected for upload\n\t\t\t\t\t$result['nofiles'][] = \"No file Selected\";\n\t\t\t\t} else {\n\t\t\t\t\t// unacceptable file type\n\t\t\t\t\t$result['errors'][] = \"$filename cannot be uploaded. Acceptable file types: gif, jpg, png.\";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "public function uploadThis ($files)\n {\n $this->getInputName();\n $this->checkDir(); // Check if directory exists else try to create it\n $this->setFiles(); // Prepare files to be uploaded\n $this->checkFiles(); // Check files before upload\n \n if($this->fileStatus !== false) // If no error\n {\n return $this->uploadFiles(); // Upload files\n } else {\n return $this->returnErrors(); // Else return errors\n }\n }", "function FilesMoveToFolder()\r\n{\r\n global $PH;\r\n\r\n $file_ids= getPassedIds('file','files_*');\r\n\r\n if(!$file_ids) {\r\n $PH->abortWarning(__(\"Select some files to move\"));\r\n exit();\r\n }\r\n\r\n\r\n\r\n /**\r\n * by default render list of folders...\r\n */\r\n $target_id=-1;\r\n\r\n /**\r\n * ...but, if folder was given, directly move files...\r\n */\r\n $folder_ids= getPassedIds('folder','folders_*');\r\n if(count($folder_ids) == 1) {\r\n if($folder_task= Task::getVisibleById($folder_ids[0])) {\r\n $target_id= $folder_task->id;\r\n }\r\n }\r\n\r\n /**\r\n * if no folders was selected, move files to project root\r\n */\r\n else if(get('from_selection')) {\r\n $target_id= 0;\r\n }\r\n\r\n\r\n if($target_id != -1) {\r\n\r\n\r\n if($target_id != 0){\r\n if(!$target_task= Task::getEditableById($target_id)) {\r\n $PH->abortWarning(__(\"insufficient rights\"));\r\n\r\n }\r\n ### get path of target to check for cycles ###\r\n $parent_tasks= $target_task->getFolder();\r\n $parent_tasks[]= $target_task;\r\n }\r\n else {\r\n $parent_tasks=array();\r\n }\r\n\r\n\r\n $count=0;\r\n foreach($file_ids as $id) {\r\n if($file= File::getEditableById($id)) {\r\n\r\n $file->parent_item= $target_id;\r\n $file->update();\r\n }\r\n else {\r\n $PH->messages[]= sprintf(__(\"Can not edit file %s\"), $file->name);\r\n }\r\n }\r\n\r\n ### return to from-page? ###\r\n if(!$PH->showFromPage()) {\r\n $PH->show('home');\r\n }\r\n exit();\r\n }\r\n #else if($target_id != -1) {\r\n # $PH->abortWarning(__(\"insufficient rights to edit any of the selected items\"));\r\n #}\r\n\r\n\r\n\r\n\r\n /**\r\n * build page folder lists...\r\n */\r\n\r\n ### get project ####\r\n if(!$file= File::getVisibleById($file_ids[0])) {\r\n $PH->abortWarning(\"could not get file\", ERROR_BUG);\r\n }\r\n\r\n if(!$project= Project::getVisibleById($file->project)) {\r\n $PH->abortWarning(\"file without project?\", ERROR_BUG);\r\n }\r\n\r\n\r\n ### set up page and write header ####\r\n {\r\n $page= new Page(array('use_jscalendar'=>false, 'autofocus_field'=>'company_name'));\r\n $page->cur_tab='projects';\r\n $page->type= __(\"Edit files\");\r\n $page->title=\"$project->name\";\r\n $page->title_minor=__(\"Select folder to move files into\");\r\n\r\n $page->crumbs= build_project_crumbs($project);\r\n\r\n $page->options[]= new NaviOption(array(\r\n 'target_id' =>'filesMoveToFolder',\r\n ));\r\n\r\n echo(new PageHeader);\r\n }\r\n echo (new PageContentOpen);\r\n\r\n\r\n ### write form #####\r\n {\r\n ### write files as hidden entry ###\r\n foreach($file_ids as $id) {\r\n if($file= File::getEditableById($id)) {\r\n echo \"<input type=hidden name='files_{$id}_chk' value='1'>\";\r\n }\r\n }\r\n\r\n\r\n ### write list of folders ###\r\n {\r\n require_once(confGet('DIR_STREBER') . 'lists/list_tasks.inc.php');\r\n $list= new ListBlock_tasks();\r\n $list->reduced_header= true;\r\n $list->query_options['show_folders']= true;\r\n #$list->query_options['folders_only']= true;\r\n $list->query_options['project']= $project->id;\r\n $list->groupings= NULL;\r\n $list->block_functions= NULL;\r\n $list->id= 'folders';\r\n $list->no_items_html= __('No folders available');\r\n unset($list->columns['status']);\r\n unset($list->columns['date_start']);\r\n unset($list->columns['days_left']);\r\n unset($list->columns['created_by']);\r\n unset($list->columns['label']);\r\n unset($list->columns['project']);\r\n\r\n $list->functions= array();\r\n\r\n $list->active_block_function = 'tree';\r\n\r\n\r\n $list->print_automatic($project,NULL);\r\n }\r\n\r\n echo __(\"(or select nothing to move to project root)\"). \"<br> \";\r\n\r\n echo \"<input type=hidden name='from_selection' value='1'>\"; # keep flag to ungroup files\r\n echo \"<input type=hidden name='project' value='$project->id'>\";\r\n $button_name=__(\"Move items\");\r\n echo \"<input class=button2 type=submit value='$button_name'>\";\r\n\r\n $PH->go_submit='filesMoveToFolder';\r\n\r\n }\r\n echo (new PageContentClose);\r\n echo (new PageHtmlEnd());\r\n\r\n}", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->id . '.' .$this->ext\n );\n\n // set the ext property to the filename where you've saved the file\n //$this->ext = $this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "function processUpload() {\n $result = FALSE;\n // we need the surfer id to save the file owner\n if (!$this->loadSurferData()) {\n return FALSE;\n }\n if (isset($this->params['folder_id']) && isset($_FILES) && is_array($_FILES) &&\n isset($_FILES[$this->paramName]) && is_array($_FILES[$this->paramName])) {\n $maxUploadSize = $this->getMaxUploadSize();\n $result = TRUE;\n for ($i = 0; $i < count($_FILES[$this->paramName]['name']['upload']); $i++) {\n if ($_FILES[$this->paramName]['tmp_name']['upload'][$i] != '') {\n $file['tempname'] = $_FILES[$this->paramName]['tmp_name']['upload'][$i];\n $file['size'] = $_FILES[$this->paramName]['size']['upload'][$i];\n $file['name'] = $_FILES[$this->paramName]['name']['upload'][$i];\n $file['type'] = $_FILES[$this->paramName]['type']['upload'][$i];\n $file['error'] = $_FILES[$this->paramName]['error']['upload'][$i];\n if ($i == 0 &&\n isset($this->params['file_id']) && $this->params['file_id'] != '' &&\n isset($this->currentFile) && isset($this->currentFile['current_version_id']) &&\n isset($this->params['replace']) && $this->params['replace']) {\n $this->replaceUploadedFile($file['tempname'], $file['name'], $file['type']);\n } else {\n $files[$i] = $file;\n }\n }\n if ($_FILES[$this->paramName]['error']['upload'][$i] != 0 &&\n $_FILES[$this->paramName]['error']['upload'][$i] != 4) {\n $result = FALSE;\n switch ($_FILES[$this->paramName]['error']['upload'][$i]) {\n case 1:\n $this->addMsg(\n MSG_ERROR,\n sprintf(\n $this->_gt('File #%d is too large (PHP_INI, %s).'),\n $i + 1,\n $this->formatFileSize($maxUploadSize)\n )\n );\n break;\n case 2:\n $this->addMsg(\n MSG_ERROR,\n sprintf(\n $this->_gt('File #%d is too large (HTML_FORM, %s).'),\n $i + 1,\n $this->formatFileSize($maxUploadSize)\n )\n );\n break;\n case 3:\n $this->addMsg(\n MSG_ERROR,\n sprintf($this->_gt('File #%d was only partially uploaded.'), $i + 1)\n );\n break;\n case 6:\n $this->addMsg(\n MSG_ERROR,\n $this->_gt('Temporary folder not found.')\n );\n break;\n case 7:\n $this->addMsg(\n MSG_ERROR,\n sprintf($this->_gt('File #%d could not be written to disk.'), $i + 1)\n );\n break;\n case 8:\n $this->addMsg(\n MSG_ERROR,\n sprintf($this->_gt('Extension of file #%d is blocked.'), $i + 1)\n );\n break;\n default:\n $this->addMsg(MSG_ERROR, $this->_gt('An unknown error occurred.'));\n break;\n }\n } elseif ($_FILES[$this->paramName]['size']['upload'][$i] > $maxUploadSize) {\n $this->addMsg(\n MSG_ERROR,\n sprintf(\n $this->_gt('File #%d \"%s\" is too large (PAPAYA_MAX_UPLOAD_SIZE, %s)'),\n $i + 1,\n $_FILES[$this->paramName]['name']['upload'][$i],\n $this->formatFileSize($maxUploadSize)\n )\n );\n unset($files[$i]);\n }\n }\n\n if (isset($files) && is_array($files) && count($files) > 0) {\n foreach ($files as $file) {\n $fileId = $this->addFile(\n $file['tempname'],\n $file['name'],\n empty($this->params['folder_id']) ? 0 : (int)$this->params['folder_id'],\n $this->surfer['surfer_id'],\n $file['type'],\n 'uploaded_file'\n );\n if ($fileId) {\n $this->addMsg(\n MSG_INFO,\n sprintf($this->_gt('File \"%s\" (%s) uploaded.'), $file['name'], $fileId)\n );\n $this->switchFile($fileId);\n } else {\n $this->getErrorForType($this->lastError);\n }\n }\n }\n } else {\n $this->addMsg(\n MSG_ERROR,\n $this->_gt('Upload failed.').' '.sprintf(\n $this->_gt('File may not be larger than %s.'),\n $this->formatFileSize($this->getMaxUploadSize())\n )\n );\n }\n return $result;\n }", "function acf_upload_files($ancestors = array())\n{\n}", "function uploadMultiFiles($filesField, $targetPath) {\r\n $filesList = [];\r\n if (!empty($_FILES)) { \r\n try \r\n {\r\n foreach($_FILES[$filesField]['tmp_name'] as $index => $file) {\r\n $targetFileName = uniqid() . '_' . $_FILES[$filesField]['name'][$index];\r\n if (move_uploaded_file($file, $targetPath . $targetFileName))\r\n array_push($filesList, $targetFileName);\r\n };\r\n echo \"done\";\r\n } catch (\\Throwable $th) \r\n {\r\n echo \"failure\";\r\n }\r\n }\r\n else\r\n {\r\n echo \"choose a file please\";\r\n }\r\n return $filesList;\r\n}", "function FileUpload(){\n $client = $this->getClientInfo();\n $this->previousFileDelete($client);\n $backupFiles = $this->getSqlBackupFiles();\n// $this->pr($backupFiles);die;\n if(!empty($backupFiles)){\n foreach($backupFiles as $backup){\n $info = $this->fileUploadInoGoogleDrive($client,$backup);\n print_r($info);\n print \"\\n\";\n }\n }\n die;\n }", "protected function getUploadDir()\n {\n return 'upload/files';\n }", "public function upload();", "function fileUpload(){\n\tinclude '../../database.php';\n\t$imageList = array(\"png\", \"jpeg\", \"jpg\", \"gif\");\n\t$videoList = array(\"mp4\", \"avi\");\n\t$pdfList = array(\"pdf\");\n\t$counter = 0;\n\t$lastInsertedFileId = array();\n\tforeach ($_FILES[\"medium\"][\"name\"] as $k => $v) {\n $medium = str_replace(\" \", \"_\", $_FILES[\"medium\"][\"name\"][$k]);\n $ext = pathinfo($medium, PATHINFO_EXTENSION);\n\n if (in_array($ext, $imageList)) {\n $type = \"photo\";\n }\n if (in_array($ext, $videoList)) {\n $type = \"video\";\n }\n\t\tif (in_array($ext, $pdfList)) {\n\t\t\t$type = \"pdf\";\n\t\t}\n\t\t\n\t\tif($type == \"photo\"){\n\t\t//4 random numbers before filename for identification\n\t\t$digits = 4;\n\t\t$prename = str_pad(rand(0, pow(10, $digits)-1), $digits, '0', STR_PAD_LEFT);\n\t\t\n\t\t$server_url = \"/KBS/Project-KBS/bestanden/media/\" . $type . \"/\" . $prename . $medium;\n\t\t$url = $_SERVER[\"DOCUMENT_ROOT\"] . \"/KBS/Project-KBS/bestanden/media/\" . $type . \"/\" . $prename . $medium;\n\t\t//$url = \"/bestanden/media/\" . $type . \"/\" . $medium;\n\t\t\n if (move_uploaded_file($_FILES[\"medium\"][\"tmp_name\"][$k], $url)) {\n\t\t\t\t$stmt = $conn->prepare(\"INSERT INTO file (location, type) VALUES (?,?)\");\n\t\t\t\t$stmt->execute(array($server_url, $type));\n\t\t\t\t$lastInsertedFileId[0] = $conn->lastInsertId();\n\t\t\t}\n\t\t\treturn $lastInsertedFileId;\n\t\t}\n\t\telseif(!($type == \"photo\")){\n\t\t\treturn false;\n\t\t}\n\t}\n}", "protected function getUploadRootDir()\n {\n // documents should be saved\n return $this->getUploadDir();\n }", "public function upload(array $files);", "function upload_project_chat_file_ajax(){\n \t$this->load->model(\"portalmodel\");\n \t\n \t$fk_project_id = $this->input->post('project_id');\n\t $fk_user_id = $this->session->userdata('id');\n \t\n \tfor ($i=0;$i<count($_FILES['files']['name']);$i++){\n \t\t// first we will add a new record for new chat, and then will add new file with chat reference number\n\t \t$message = \"added file...\";\n\t \t$data_file_add_message = array(\n\t \t'fk_project_id'=>$fk_project_id,\n\t \t'fk_user_id'=>0,\n\t \t\t'fk_customer_id'=>$fk_user_id,\n\t \t'message'=>$message,\n\t \t'created_on'=>date(\"Y-m-d H:i:s\")\n\t );\n\t $fk_chat_id = $this->portalmodel->insert_query_('chat_projects', $data_file_add_message);\n\t \n\t // upload file and add one chat message for file upload\n\t \t$filename = strtotime(\"now\");\n\t $this->load->library('upload');\n\t \n\t \t$_FILES['userfile']['name'] = $_FILES['files']['name'][$i];\n\t\t\t$_FILES['userfile']['type'] = $_FILES['files']['type'][$i];\n\t\t\t$_FILES['userfile']['tmp_name'] = $_FILES['files']['tmp_name'][$i];\n\t\t\t$_FILES['userfile']['error'] = $_FILES['files']['error'][$i];\n\t\t\t$_FILES['userfile']['size'] = $_FILES['files']['size'][$i];\n\t\t\t$dir_path = './project_chat_files/';\n\t\t\t$ext = pathinfo($_FILES['files']['name'][$i], PATHINFO_EXTENSION);\n\t\t\t$path = '/project_chat_files/' . $filename . '.' . $ext;\n\t\t\t$config = array(\n\t\t\t\t'file_name' => $filename,\n\t\t\t\t'allowed_types' => '*',\n\t\t\t\t'max_size' => 3000,\n\t\t\t\t'overwrite' => FALSE,\n\t\t\t\t'upload_path' => $dir_path\n\t\t\t);\n\t\t\t$this->upload->initialize($config);\n\t\t\tif (!$this->upload->do_upload()):\n\t\t\t\t$error = array(\n\t\t\t\t\t'error' => $this->upload->display_errors()\n\t\t\t\t);\n\t\t\telse:\n\t\t\t\t$final_files_data[] = $this->upload->data();\n\t\t\t\t$data1 = array(\n\t\t\t\t\t'filepath' => $path,\n\t\t\t\t\t'fk_chat_id' => $fk_chat_id\n\t\t\t\t);\n\t\t\t\t$result1 = $this->portalmodel->insert_query_('chat_project_files', $data1);\n\t\t\tendif;\n \t}\n \t\n }", "public static function upload_id()\n\t{\n $j = 0; \n \n\t\t//if folder doesn't exist create it\n\t\tif (!file_exists(SURL_PUB . \"/userverify/\" . Session::get('user_id') . \"/\")) {\n mkdir(SURL_PUB . \"/userverify/\" . Session::get('user_id'). \"/\", 0777);\n }\n \n\t // Declaring Path for uploaded images.\n\t $target_path = SURL_PUB . \"/userverify/\" . Session::get('user_id') . \"/\"; \n \n\t\tfor ($i = 0; $i < count($_FILES['file']['name']); $i++)\n\t\t{\n // Extensions which are allowed.\n $validextensions = array(\n \"jpeg\",\n \"jpg\",\n \"png\"); \n \n\t\t\t\t// Explode file name from dot(.)\n\t\t\t\t$ext = explode('.', basename($_FILES['file']['name'][$i]));\n \n\t\t\t\t// Store extensions in the variable.\n\t\t\t\t$file_extension = end($ext); \n \n\t\t\t\t// Set the target path with a new name of image.\n\t\t\t\t$target_path = $target_path . md5(uniqid()) . \".\" . $ext[count($ext) - 1]; \n \n\t\t\t\t// Increment the number of uploaded images according to the files in array.\n\t\t\t\t$j = $j + 1; \n \n\t\t\t\t//if it's below max file size and a valid image carry on\n\t\t\t\tif (($_FILES[\"file\"][\"size\"][$i] < MAX_FILE_SIZE) && in_array($file_extension, $validextensions)) \n\t\t\t\t{\n if (move_uploaded_file($_FILES['file']['tmp_name'][$i], $target_path)) {\n \n\t\t\t\t\t\t//get the users info\n\t\t\t\t\t\t$user = UserModel::user();\n \n\t\t\t\t\t\t//all their images\n\t\t\t\t\t\t$allimgs = $verimgs->user_verifyimg . \",\" . $target_path;\n \n\t\t\t\t\t\t//run the sql\n\t\t\t\t\t\t$insert = $database->prepare(\"UPDATE user SET user_verifyimg = ? WHERE user_id = ?\");\n\t\t\t\t\t\t$insert->execute(array($allimgs, Session::get('user_id')));\n \n\t\t\t\t\t\t//update their information\n\t\t\t\t\t\t$this->model->userverifydetails(Request::post('firstname'), Request::post('lastname'), Request::post('address1'), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequest::post('address2'), Request::post('city'), Request::post('zip'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequest::post('state'), Request::post('country'), Request::post('dob'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSession::get('user_id'));\n \n NotificationsModel::addmessage(\"You have submitted verification details\", \"You have recently submitted information for our user \n\t\t\t\t\t\t\t\t\t\t\t\t\tverification. Our team will verify this <b><u>as soon as possible</u></b>\", Session::get('user_id'), \"System\", \"account\");\n \n\t\t\t\t\t\t//success message here\n \n } else { \n echo $j . ').<span id=\"error\">please try again!.</span><br/><br/>';\n }\n } else { \n echo $j . ').<span id=\"error\">***Invalid file Size or Type***</span><br/><br/>';\n }\n }\n }", "function custom_upload_directory( $args ) {\n\t$id = $_REQUEST['post_id'];\n\t$parent = get_post( $id )->post_parent;\n\tif( \"music\" == get_post_type( $id ) || \"music\" == get_post_type( $parent ) ) {\n\t\t$args['path'] = plugin_dir_path(__FILE__) . \"uploads\";\n\t\t$args['url'] = plugin_dir_url(__FILE__) . \"uploads\";\n\t\t$args['basedir'] = plugin_dir_path(__FILE__) . \"uploads\";\n\t\t$args['baseurl'] = plugin_dir_url(__FILE__) . \"uploads\";\n\t}\n\treturn $args;\n}", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n if(!is_dir($this->getTargetUploadRootDir())){\n mkdir($this->getTargetUploadRootDir(), 0777, true);\n }\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getTargetUploadRootDir(),\n $this->file->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = date('Y-m-d').DIRECTORY_SEPARATOR.$this->id.DIRECTORY_SEPARATOR.$this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if ( !in_array('upload', Files::allowed_actions()) AND\n // replacing files needs upload and delete permission\n !( $this->input->post('replace_id') && !in_array('delete', Files::allowed_actions()) )\n ) {\n show_error(lang('files:no_permissions')) ;\n }\n\n $result = null ;\n $input = ci()->input->post() ;\n\n if ( $input['replace_id'] > 0 ) {\n $result = Files::replace_file($input['replace_id'], $input['folder_id'], $input['name'], 'file', $input['width'], $input['height'], $input['ratio'], null, $input['alt_attribute']) ;\n //$result['status'] AND Events::trigger('file_replaced', $result['data']) ;\n } elseif ($input['folder_id'] and $input['name'] ) {\n $result = Files::upload($input['folder_id'], $input['name'], 'file', $input['width'], $input['height'], $input['ratio'], null, $input['alt_attribute']) ;\n $result['status'] AND Events::trigger('file_uploaded', $result['data']) ;\n }\n\n ob_end_flush() ;\n //echo json_encode($result) ;\n echo '1';\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // si on avait un ancien fichier on le supprime\n if (null !== $this->tempFilename) {\n $oldFile = $this->getUploadRootDir().'/'.$this->id.'.'.$this->tempFilename;\n if (file_exists($oldFile)) {\n unlink($oldFile);\n }\n }\n\n // déplace le fichier envoyé dans le répertoire de notre choix\n $this->file->move(\n $this->getUploadRootDir(), // répertoire de destination\n $this->id.'.'.$this->url // nom du fichier à créer \"id.extension\"\n );\n\n }", "function upload($id,$path){\r\n\t$result=0;\r\n\t$allowtype=array(\"jpg\",\"jpeg\",\"gif\",\"png\");\r\n\t\r\n\t$filename=$_FILES[$id]['name'];\r\n\t$filename=str_replace(\"#\",\"_\",$filename);\r\n\t$filename=str_replace(\"$\",\"_\",$filename);\r\n\t$filename=str_replace(\"%\",\"_\",$filename);\r\n\t$filename=str_replace(\"^\",\"_\",$filename);\r\n\t$filename=str_replace(\"&\",\"_\",$filename);\r\n\t$filename=str_replace(\"*\",\"_\",$filename);\r\n\t$filename=str_replace(\"?\",\"_\",$filename);\r\n\t$filename=str_replace(\" \",\"_\",$filename);\r\n\t$filename=str_replace(\"!\",\"_\",$filename);\r\n\t$filename=str_replace(\"@\",\"_\",$filename);\r\n\t$filename=str_replace(\"(\",\"_\",$filename);\r\n\t$filename=str_replace(\")\",\"_\",$filename);\r\n\t$filename=str_replace(\"/\",\"_\",$filename);\r\n\t$filename=str_replace(\";\",\"_\",$filename);\r\n\t$filename=str_replace(\":\",\"_\",$filename);\r\n\t$filename=str_replace(\"'\",\"_\",$filename);\r\n\t$filename=str_replace(\"\\\\\",\"_\",$filename);\r\n\t$filename=str_replace(\",\",\"_\",$filename);\r\n\t$filename=str_replace(\"+\",\"_\",$filename);\r\n\t$filename=str_replace(\"-\",\"_\",$filename);\r\n\t$filesize=$_FILES[$id]['size'];\r\n\t$filetype=end(explode(\".\",strtolower($filename)));\r\n\tif(!in_array($filetype,$allowtype)){\r\n\t\t$result=\"2;\";\r\n\t}\r\n\tif($filesize>$_POST['MAX_FILE_SIZE'] || $filesize==0){\r\n\t\t$result=\"1;\";\r\n\t}\r\n\tif($result==0){\r\n\t\t$subfolder=date(\"Y_m_d_H_i_s\");\r\n\t\t$path=$path.$subfolder.\"/\";\r\n\t\tmkdir($path,0777,true);\r\n\t\tif(move_uploaded_file($_FILES[$id]['tmp_name'],$path.$filename)){\r\n\t\t\t$result=$result.\";\".$path.$filename;\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$result=\"3;\";\r\n\t\t}\r\n\t}\r\n\treturn $result;\r\n}", "public function getRootUploadedPath()\n {\n return \"{$this->uploaded_filename}\";\n }", "protected function getUploadRootDir()\n {\n return $this->getUploadDir();\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/photos';\n }", "protected function getUploadDir() {\r\n return 'uploads/documents';\r\n }", "public function getUploadPath()\n {\n $reflect = new ReflectionClass($this);\n return $this->uploadPath . $reflect->getShortName() . '/' . $this->id . '/';\n }", "function do_post() {\n\t\t$folder_id = $this->request->get_parameter(0);\n\t\t$folder_id = intval($folder_id);\n\n\t\t$template = $this->get_page_template();\n\t\t// Instantiate class for communicating with files tables\n\t\t$files_db = $this->files_database;\n\n\t\t// Check if the user requested to create a folder\n\t\tif (isset($_POST['folder'])) {\n\t\t\ttry {\n\t\t\t\t// Attempt to create a new folder\n\t\t\t\t$status = $files_db->create_new_folder($folder_id, $_POST['name']);\n\n\t\t\t\t// Return response corresponding to status\n\t\t\t\tif ($status === FilesDatabase::NEW_ITEM_OKAY) {\n\t\t\t\t\t// Return okay message since upload succeeded\n\t\t\t\t\t$template->status = \"okay\";\n\t\t\t\t\t$template->message = \"Successfully created folder!\";\n\t\t\t\t}\n\t\t\t\telse if ($status === FilesDatabase::NEW_ITEM_INVALID_NAME) {\n\t\t\t\t\t$template->status = \"error\";\n\t\t\t\t\t$template->message = \"Valid folder names must contain a-zA-z0-9_.- and spaces.\";\n\t\t\t\t} else {\n\t\t\t\t\t$template->status = \"error\";\n\t\t\t\t\t$template->message = \"An unknown error occured created the new folder\";\n\t\t\t\t}\n\t\t\t} catch (PDOException $e) {\n\t\t\t\t$template->status = \"error\";\n\t\t\t\t$template->message = \"An unknown error occured created the new folder\";\n\t\t\t}\n\t\t}\n\n\t\t// Check if the user requested to upload a file\n\t\telse if (isset($_POST['file'])) {\n\n\t\t\tprint_r($_FILES);\n\n\t\t\t// Verify that file was sent, or set error message\n\t\t\tif (!isset($_FILES['codefile']['error'])) {\n\t\t\t\t$template->status = \"error\";\n\t\t\t\t$template->message = \"Error: No file was sent!\";\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$file_status = $_FILES['codefile']['error'];\n\n\t\t\t// Verify that status is okay, or set error message\n\t\t\tif ($file_status !== UPLOAD_ERR_OK) {\n\t\t\t\t$template->status = \"error\";\n\t\t\t\tswitch ($_FILES['codefile']['error']) {\n\t\t\t\t\tcase UPLOAD_ERR_INI_SIZE:\n\t\t\t\t\tcase UPLOAD_ERR_FORM_SIZE:\n\t\t\t\t\t\t$template->message = \"The file you attempted to upload was too large!\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$template->message = \"An unknown error occured uploading the file\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Open and read file\n\t\t\t$tmp_name = $_FILES['codefile']['tmp_name'];\n\t\t\t$fp = fopen($tmp_name);\n\t\t\t$contents = fread($fp, filesize($tmp_name));\n\n\t\t\t// Attempt database operation\n\t\t\ttry {\n\t\t\t\t// Attempt to add a database record for this file\n\t\t\t\t$status = $files_db->add_file_to_folder($folder_id, $_POST['name'], $contents);\n\n\t\t\t\t// Return response corresponding to status\n\t\t\t\tif ($status === FilesDatabase::NEW_ITEM_OKAY) {\n\t\t\t\t\t$template->status = \"okay\";\n\t\t\t\t\t$template->message = \"Successfully created file!\";\n\t\t\t\t}\n\t\t\t\telse if ($status === FilesDatabase::NEW_ITEM_INVALID_NAME) {\n\t\t\t\t\t$template->status = \"error\";\n\t\t\t\t\t$template->message = \"Valid file names must contain a-zA-z0-9_.- and spaces.\";\n\t\t\t\t} else {\n\t\t\t\t\t$template->status = \"error\";\n\t\t\t\t\t$template->message = \"An unknown error occured created the new file\";\n\t\t\t\t}\n\t\t\t} catch (PDOException $e) {\n\t\t\t\t$template->status = \"error\";\n\t\t\t\t$template->message = \"An unknown error occured created the new file\";\n\t\t\t}\n\t\t}\n\t}", "public function actionUpload($id = null){ \n\t\tif(Yii::app()->request->isPostRequest && Yii::app()->request->isAjaxRequest){\n\t\t\t\n\t\t\t$id = isset($id) ? $id : 0;\n\t\t\t/*if($id > 0){\n\t\t\t\t$model = $this->loadModel($id);\n\t\t\t\tif(count($model->images) == 4){\n\t\t\t\t\t$result = array('error' => 'Too many items would be uploaded. Item limit is 4.')\t;\t\n\t\t\t\t\t$result=htmlspecialchars(json_encode($result), ENT_NOQUOTES);\n\t\t\t\t\techo $result;\n\t\t\t\t\tYii::app()->end();\n\t\t\t\t}\n\t\t\t}*/\n\t\t\t$params \t= CParams::load();\n\t\t\t$thumb300x0 = $params->params->uploads->article->thumb300x0;\n\t\t\t$detail960x0 = $params->params->uploads->article->detail960x0;\n\t\t\t$origin \t= $params->params->uploads->article->origin;\n\t\t\t\n\t\t\t$thumb300x0_folder = $this->setPath ( $thumb300x0->p );\n\t\t\t$detail960x0_folder = $this->setPath ( $detail960x0->p );\n\t\t\t$origin_folder = $this->setPath ( $origin->p );\n\t\t\t$path_folder = $this->setPath ( $params->params->uploads->article->path, false );\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tYii::import(\"backend.extensions.EFineUploader.qqFileUploader\");\n\t\t\t$uploader = new qqFileUploader();\n\t\t\t$uploader->allowedExtensions = array('jpg','jpeg','png');\n\t\t\t$uploader->sizeLimit = $params->params->uploads->article->size;//maximum file size in bytes\n\t\t\t$uploader->chunksFolder = $origin_folder;\n\t\t\t\n\t\t\t$result = $uploader->handleUpload($origin_folder);\n\t\t\t$origin_uploaded_path = $origin_folder . DS . $uploader->getUploadName ();\n\t\t\t$resize_large_img = false;\n\t\t\tlist ( $width, $height ) = getimagesize ( $origin_uploaded_path );\n\t\t\t\n\t\t\t\n\t\t\tif ($width < $thumb300x0->w || $height < $thumb300x0->h) {\n\t\t\t\t$result ['success'] = false;\n\t\t\t\t$result ['error'] = \"Please choose a image file with minimum weight size is {$thumb300x0->w}px and minimum height size is{$thumb300x0->h}px\";\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tYii::import(\"backend.extensions.image.Image\");\n\t\t\t\t\n\t\t\t\tif ($width > $height) {\n\t\t\t\t\t$resize_type = Image::HEIGHT;\n\t\t\t\t} else {\n\t\t\t\t\t$resize_type = Image::WIDTH;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (isset ( $result ['success'] )) {\n\t\t\t\t\t\t\n\t\t\t\t\t// begin resize and crop for thumbnail\n\t\t\t\t\t//Yii::app()->image->load($origin_uploaded_path)->resize($thumb300x0->w, $thumb300x0->h, $resize_type)->crop ( $thumb300x0->w, $thumb300x0->h )->save($thumb300x0_folder.DS.$uploader->getUploadName());\n\t\t\t\t\tYii::app()->image->load($origin_uploaded_path)->resize($thumb300x0->w, $thumb300x0->h)->crop ( $thumb300x0->w, $thumb300x0->h )->save($thumb300x0_folder.DS.$uploader->getUploadName());\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t// resize for detail (width 600)\n\t\t\t\t\tYii::app ()->image->load ( $origin_uploaded_path )->resize ( $detail960x0->w, $detail960x0->w, Image::WIDTH )->save ( $detail960x0_folder . DS . $uploader->getUploadName () );\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//save to database\n\t\t\t\t\t$image = new ArticleImage();\n\t\t\t\t\t$image->article_id = $id;\n\t\t\t\t\t$image->image = $uploader->getUploadName();\n\t\t\t\t\t$image->path = $path_folder;\n\t\t\t\t\t$image->save();\n\t\t\t\t\t$result['image_id'] = $image->id;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$result['filename'] = $uploader->getUploadName();\n\t\t\t$result['filepath'] = $path_folder;\n\t\t\theader(\"Content-Type: text/plain\");\n\t\t\t$result=htmlspecialchars(json_encode($result), ENT_NOQUOTES);\n\t\t\techo $result;\n\t\t\tYii::app()->end();\n\t\t}\n\t\t\n\t}", "public function basePathUpload() {\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t\t$pathupload = realpath ( APPLICATION_PATH . '/../public/data/uploads' );\n\t\t\t\t\t\treturn $pathupload;\n\t\t\t\t\t}", "public function uploadMultiple()\n {\n\n foreach ($this->uploads['multiple'] as $field) {\n $files = [];\n\n if (is_array(Request::file($field))) {\n\n foreach (Request::file($field) as $file) {\n\n if ($file instanceof UploadedFile) {\n $files[] = Uploader::upload($file, $this->upload_folder . '/' . $field);\n }\n\n }\n\n }\n\n $this->setFileMultiple($field, $files);\n }\n\n }", "public function actionUpload()\n\t{\n\n\t\t$input = craft()->request->getPost();\n\n\t\t$file = UploadedFile::getInstanceByName('file');\n\n\t\t$folder = craft()->assets->findFolder(array(\n\t\t 'id' => $input['id']\n\t\t));\n\n\t\tif ($folder) {\n\t\t\t$folderId = $input['id'];\n\t\t}\n\n\t\tcraft()->assets->insertFileByLocalPath(\n\t\t $file->getTempName(),\n\t\t $file->getName(),\n\t\t $folderId,\n\t\t AssetConflictResolution::KeepBoth);\n\n\t\tcraft()->end();\n\t}", "public function upload(){\n\n //$mailer->resend('[email protected]','kusamochi2','44444444','test');\n\n $result = $this->TOOL->loadChildData();\n\n $childData = array();\n foreach($result as $tmp){\n $childData[] = ['id' => $tmp['Id'],'name' => $tmp['username']];\n }\n\n $this->set('data',$childData);\n\n }", "abstract protected function doUpload();", "protected function getUploadRootDir()\r\n {\r\n // the absolute directory path where uploaded documents should be saved\r\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\r\n }", "public function moveAction()\n {\n $user = $this->getConnectedUser();\n $em = $this->getDoctrine()->getManager();\n\n $request = $this->get('request');\n if ($request->getMethod() == 'POST') {\n $currentFolderId = $request->request->get('currentFolderId');\n $moveFolderId = $request->request->get('moveFolderId');\n $foldersId = $request->request->get('foldersId');\n $foldersId = json_decode($foldersId);\n $filesId = $request->request->get('filesId');\n $filesId = json_decode($filesId);\n\n if (!is_null($moveFolderId)) {\n $parent = null;\n if (is_numeric($moveFolderId)) {\n $parent = $em->getRepository('TimeBoxMainBundle:Folder')->findOneById($moveFolderId);\n if (!$parent) {\n throw $this->createNotFoundException('Unable to find Folder entity.');\n }\n }\n\n $files = $em->getRepository('TimeBoxMainBundle:File')->findBy(array(\n 'user' => $user,\n 'id' => $filesId\n ));\n $folders = $em->getRepository('TimeBoxMainBundle:Folder')->findBy(array(\n 'user' => $user,\n 'id' => $foldersId\n ));\n\n if (!is_null($files) && sizeof($files) > 0) {\n foreach ($files as $file) {\n is_null($parent) ? $file->setFolder() : $file->setFolder($parent);\n $file->setIsDeleted(false);\n }\n }\n if (!is_null($folders) && sizeof($folders) > 0) {\n foreach ($folders as $folder) {\n is_null($parent) ? $folder->setParent() : $folder->setParent($parent);\n $this->manageFolderContent($folder, false);\n }\n }\n\n $em->flush();\n\n return $this->redirect($this->generateUrl('time_box_main_file', array(\n 'folderId' => $moveFolderId\n )));\n }\n\n $filesId = json_encode($filesId);\n $foldersId = json_encode($foldersId);\n\n $folders = $em->getRepository('TimeBoxMainBundle:Folder')->findBy(\n array(\n 'user' => $user,\n 'isDeleted' => false\n ),\n array(\n 'parent' => 'ASC',\n 'name' => 'ASC'\n )\n );\n\n return $this->render('TimeBoxMainBundle:File:move.html.twig', array(\n 'folders' => $folders,\n 'folderId' => $currentFolderId,\n 'filesId' => $filesId,\n 'foldersId' => $foldersId\n ));\n }\n return new Response('');\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return '/uploads/users/'.$this->getId().'/';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'images/page/'.$this->page->getId();\n }", "public function uploadPhoto($currentAlbumId, $currentUserID, $photoName, $shortDescription, $placeTaken, $selectedCategories, $writtenTags, $photoFile, $titlePhoto,$users){\n\n $insertedPhotoId = 'nothing to upload';\n\n // upload photo to server\n if (!empty($photoFile)){\n\n foreach($photoFile as $file) {\n $destinationPath = 'uploads/albums/'.$currentAlbumId;\n\n //creates album directory if not exist\n if(!is_dir('uploads'))\n mkdir('uploads', 0777, true);\n if(!is_dir('uploads/albums'))\n mkdir('uploads/albums', 0777, true);\n if(!is_dir('uploads/albums/'.$currentAlbumId))\n mkdir('uploads/albums/'.$currentAlbumId, 0777, true);\n\n $filename = $file->getClientOriginalName();\n $extension = $file->getClientOriginalExtension();\n if ($extension == 'jpeg') {\n $extension = 'jpg';\n }\n $fileSize = $file->getSize();\n\n if($extension == 'jpeg' || $extension == 'jpg' || $extension == 'bmp' || $extension == 'png' || $extension == 'gif')\n if($fileSize <= 1024*1024*10){\n //make: if this albumId exist in albums table do this insert\n $isAlbumIdExist = DB::select('select album_id from albums where album_id = ?', array($currentAlbumId));\n if($isAlbumIdExist){\n //upload photo in database\n $insertedPhotoId = DB::table('photos')->insertGetId(\n array('photo_name' => $photoName,\n 'photo_short_description' => $shortDescription,\n 'photo_taken_at' => $placeTaken,\n 'album_id' => $currentAlbumId,\n 'user_id' => $currentUserID,\n 'photo_size' => $fileSize\n )\n );\n\n UserAction::add('Photo \"' . $photoName . '\" was uploaded');\n\n $explodedTags = preg_replace(\"/[^\\w\\ _]+/\", '', $writtenTags); // strip all punctuation characters, news lines, etc.\n $explodedTags = preg_split(\"/\\s+/\", $explodedTags); // split by left over spaces\n $tagLine = \"\";\n for($i=0; $i<sizeOf($explodedTags); $i++)\n $tagLine = $tagLine.$explodedTags[$i].\", \";\n $tagLine = substr($tagLine, 0, -2);\n\n DB::insert('insert into photo_tags (photo_id, tags) values (?,?)', array($insertedPhotoId, $tagLine));\n\n\n\n $upload_success = $file->move($destinationPath, $insertedPhotoId.\".\".$extension);\n if($upload_success){\n //makes photo thumb\n $fileForThumb = $destinationPath.\"/\".$insertedPhotoId.\".\".$extension;\n App::make('phpthumb')\n ->create('resize', array($fileForThumb, 200, 200, 'adaptive'))\n ->save($destinationPath.\"/\", $insertedPhotoId.\"_thumb.\".$extension);\n\n DB::update('update photos set\n photo_destination_url = ?,\n photo_thumbnail_destination_url = ?\n where photo_id = ?',\n array(\n $destinationPath.\"/\".$insertedPhotoId.\".\".$extension,\n $destinationPath.\"/\".$insertedPhotoId.\"_thumb.\".$extension,\n $insertedPhotoId));\n }\n\n //add categories\n for($i = 0; $i < sizeOf($selectedCategories); $i++){\n $catId = DB::select('select * from categories where category_name = ?', array($selectedCategories[$i]));\n if($catId)\n DB::table('photo_categories')->insert(\n array(\n 'photo_id' => $insertedPhotoId,\n 'category_id' => $catId[0]->category_id,\n )\n );\n }\n //add users\n $ob = new User();\n foreach($users as $user){\n if($user != \"\"){\n $usId = $ob->getUserNameById($user);\n $photoP = DB::insert('insert into photo_people (photo_id, user_id) values (?,?)',array($insertedPhotoId,$usId));\n }\n }\n\n //-----------------Editing album title photo data---------------------//\n //if 'make uploaded photo to title album photo' property is selected\n if($titlePhoto){\n\n //gets old title url\n $titlePhoto = DB::table('albums')->where('album_id', $currentAlbumId)->get();\n\n //if album exist\n if($titlePhoto != null){\n\n //deletes old title photo if exists from directory\n $oldAlbumTitlePhoto = null;\n $oldAlbumTitlePhoto = $titlePhoto[0]->album_title_photo_url;\n if($oldAlbumTitlePhoto != null ){\n if(is_file($oldAlbumTitlePhoto))\n File::delete($oldAlbumTitlePhoto);\n }\n //deletes old title photo thumb if exists from directory\n $oldAlbumTitlePhotoThumb = null;\n $oldAlbumTitlePhotoThumb = $titlePhoto[0]->album_title_photo_thumb_url;\n if($oldAlbumTitlePhotoThumb != null )\n if(is_file($oldAlbumTitlePhotoThumb))\n File::delete($oldAlbumTitlePhotoThumb);\n }\n\n //gets current photo url\n $newTitlePhoto = DB::table('photos')->where('photo_id', $insertedPhotoId)->get();\n if($newTitlePhoto){\n\n //photo\n $photo = null;\n $photo = $newTitlePhoto[0]->photo_destination_url;\n if($photo != null ){\n if(is_file($photo)){\n $photoExtension = File::extension($photo);\n $newPhoto = $destinationPath.\"/title_\".$currentAlbumId.\".\".$photoExtension;\n File::copy($photo, $newPhoto);\n $photo = $newPhoto;\n }\n }\n\n //thumb\n $photoThumb = null;\n $photoThumb = $newTitlePhoto[0]->photo_thumbnail_destination_url;\n if($photoThumb != null){\n if(is_file($photoThumb)){\n $thumbExtension = File::extension($photoThumb);\n $newPhotoThumbUrl = $destinationPath.\"/title_\".$currentAlbumId.\"_thumb.\".$thumbExtension;\n File::copy($photoThumb, $newPhotoThumbUrl);\n $photoThumb = $newPhotoThumbUrl;\n }\n }\n else if($photoThumb == null && is_file($photo) != null){\n App::make('phpthumb')\n ->create('resize', array($photo, 200, 200, 'adaptive'))\n ->save($destinationPath.\"/\", \"title_\".$currentAlbumId.\"_thumb.\".$photoExtension);\n $photoThumb = $destinationPath.\"/title_\".$currentAlbumId.\"_thumb.\".$photoExtension;\n }\n\n //insert uploaded/unuploaded files to database\n DB::table('albums')\n ->where('album_id', $currentAlbumId)\n ->update(array(\n 'album_title_photo_url' => $photo,\n 'album_title_photo_thumb_url' => $photoThumb\n ));\n }\n }\n }\n }\n }\n }\n return $insertedPhotoId;\n }", "public function getFiles(){\r\n $fids = Input::get('FILES');\r\n $files = array();\r\n foreach($fids as $fid){\r\n $file = UploadedFiles::find($fid);\r\n if($file == null)\r\n return -1;\r\n $files[]=$file;\r\n }\r\n return json_encode($files);\r\n }", "public static function rpc_uploadFile()\r\n\t{\r\n\t\tSERIA_RPCHost::requireAuthentication();\r\n\t\t$results = array();\r\n\t\tforeach ($_FILES as $nam => $fileinfo) {\r\n\t\t\tswitch ($fileinfo['error']) {\r\n\t\t\t\tcase UPLOAD_ERR_OK:\r\n\t\t\t\t\t$error = false;\r\n\t\t\t\t\t$file = new SERIA_File($fileinfo['tmp_name'], $fileinfo['name']);\r\n\t\t\t\t\t$sha1 = sha1_file($file->get('localPath'));\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase UPLOAD_ERR_INI_SIZE:\r\n\t\t\t\t\t$error = _t('Upload was denied because of size. (php.ini)');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase UPLOAD_ERR_FORM_SIZE:\r\n\t\t\t\t\t$error = _t('Upload was denied because of size. (form specified max)');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase UPLOAD_ERR_PARTIAL:\r\n\t\t\t\t\t$error = _t('Upload was truncated.');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase UPLOAD_ERR_NO_FILE:\r\n\t\t\t\t\t$error = _t('No file received.');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase UPLOAD_ERR_NO_TMP_DIR:\r\n\t\t\t\t\t$error = _t('Can\\'t find a tmp directory.');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase UPLOAD_ERR_CANT_WRITE:\r\n\t\t\t\t\t$error = _t('Can\\'t write files to tmp.');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase UPLOAD_ERR_EXTENSION:\r\n\t\t\t\t\t$error = _t('An extension has denied upload.');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$error = _t('Unknown upload error.');\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$results[$nam] = array(\r\n\t\t\t\t'id' => ($error === false ? $file->get('id') : false),\r\n\t\t\t\t'error' => $error,\r\n\t\t\t\t'sha1' => ($error === false ? $sha1 : false)\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $results;\r\n\t}", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/lots';\n }", "public function iN_INSERTUploadedMessageFiles($uid, $conversationID, $filePath, $fileXPath, $ext) {\n\t\t$uid = mysqli_real_escape_string($this->db, $uid);\n\t\t$filePath = mysqli_real_escape_string($this->db, $filePath);\n\t\t$fileXPath = mysqli_real_escape_string($this->db, $fileXPath);\n\t\t$fileExtension = mysqli_real_escape_string($this->db, $ext);\n\t\t$uploadTime = time();\n\t\t$userIP = $_SERVER['REMOTE_ADDR'];\n\t\t$query = mysqli_query($this->db, \"INSERT INTO i_user_conversation_uploads (iuid_fk,con_id_fk,uploaded_file_path,uploaded_x_file_path, uploaded_file_ext,upload_time,ip)VALUES('$uid','$conversationID' ,'$filePath','$fileXPath','$fileExtension','$uploadTime','$userIP')\") or die(mysqli_error($this->db));\n\t\t$ids = mysqli_insert_id($this->db);\n\t\treturn $ids;\n\t}", "public function upload($sub_folder = '') {\n\t\t\t// check if input method not used\n\t\t\tif(!$this->input) {\n\t\t\t\t$this->errors[] = \"Error: input method not used\";\n\n\t\t\t\treturn ['status' => 'error', 'errors' => $this->errors];\n\t\t\t}\n\n\t\t\t// upload files\n\t\t\tif($this->multiple) {\n\t\t\t\tfor($i = 0; $i < $this->total; $i++) {\n\t\t\t\t\t// check if file uploaded and accepted\n\t\t\t\t\tif($this->error[$i] == 0 && $this->accepted[$i] == 1) {\n\t\t\t\t\t\t$final_dir = ($sub_folder != '') ? $this->dir . $sub_folder .'/'. $this->name[$i] : $this->dir . $this->name[$i];\n\t\t\t\t\t\t$move = move_uploaded_file($this->tmp_name[$i], $final_dir);\n\t\t\t\t\t\n\t\t\t\t\t\tif($move) {\n\t\t\t\t\t\t\t$this->uploaded++;\n\t\t\t\t\t\t\t$this->return['names'][] = $this->name[$i];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->errors[] = \"File couldn't uploaded: \" . $this->name[$i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set return array\n\t\t\t\t$this->return['status'] = 'ok';\n\t\t\t\t$this->return['uploaded'] = $this->uploaded;\n\t\t\t\t$this->return['errors'] = $this->errors;\n\n\t\t\t\t// return\n\t\t\t\treturn $this->return;\n\t\t\t} else {\n\t\t\t\tif($this->error == 0 && $this->accepted == 1) {\n\t\t\t\t\t$final_dir = ($sub_folder != '') ? $this->dir . $sub_folder .'/'. $this->name : $this->dir . $this->name;\n\t\t\t\t\t$move = move_uploaded_file($this->tmp_name, $final_dir);\n\t\t\t\t\t$this->final_dir = $final_dir;\n\n\t\t\t\t\tif($move) {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\t'status' => 'ok',\n\t\t\t\t\t\t\t'file' => $this->name,\n\t\t\t\t\t\t\t'type' => $this->type,\n\t\t\t\t\t\t\t'dir' => $final_dir\n\t\t\t\t\t\t];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->errors[] = \"File couldn't uploaded \" . $this->name;\n\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\t'status' => 'error',\n\t\t\t\t\t\t\t'errors' => $this->errors\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'status' => 'error',\n\t\t\t\t\t\t'errors' => $this->errors\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function getUploadedFiles() {}", "public function iN_INSERTUploadedFiles($uid, $filePath, $tumbnailPath, $fileXPath, $ext) {\n\t\t$uid = mysqli_real_escape_string($this->db, $uid);\n\t\t$filePath = mysqli_real_escape_string($this->db, $filePath);\n\t\t$fileXPath = mysqli_real_escape_string($this->db, $fileXPath);\n\t\t$fileExtension = mysqli_real_escape_string($this->db, $ext);\n\t\t$uploadTime = time();\n\t\t$userIP = $_SERVER['REMOTE_ADDR'];\n\t\t$query = mysqli_query($this->db, \"INSERT INTO i_user_uploads (iuid_fk,uploaded_file_path,upload_tumbnail_file_path,uploaded_x_file_path, uploaded_file_ext,upload_time,ip)VALUES('$uid' ,'$filePath','$tumbnailPath','$fileXPath','$fileExtension','$uploadTime','$userIP')\") or die(mysqli_error($this->db));\n\t\t$ids = mysqli_insert_id($this->db);\n\t\treturn $ids;\n\t}", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/tracks';\n }", "protected function getUploadDir()\n {\n \t// when displaying uploaded doc/image in the view.\n \treturn 'uploads/imagen';\n }", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads/';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'pictures';\n }", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads/contact/contactlist/images';\n }", "protected function getUploadDir()\r\n {\r\n // when displaying uploaded doc/image in the view.\r\n return 'uploads/images';\r\n }", "function handleUpload($db, $module, $id_column_name, $folder) {\n\t$params =checkParameters(array($id_column_name, \"userid\", \"insertedby\"));\n\t$id=$params[\"$id_column_name\"];\n\t$insertedby=$_REQUEST['insertedby'];\n\t$userid= $_REQUEST['userid'];\n\n\texistsUserid($db, $params['userid']);\n\texistsUserid($db, $params['insertedby']);\n\t\n\t$x = uploadFile(dirname(dirname(__FILE__)) . \"/$folder\");\n\tif($x) {\n\t\tprintResult(insert($db, $module,\n\t\t\t\tarray($id_column_name=>$id,\n\t\t\t\t\t\t\"originalFilename\"=>$x['name'], \"actualFileName\"=>$x['new_name'],\n\t\t\t\t\t\t\"userid\"=>$insertedby ,\"insertedby\"=>$userid )) );\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function publicUpload()\n {\n $this->request->validate([\n $this->inputName => $this->extensions,\n ]);\n\n if ($uploadedFile = $this->request->file($this->inputName))\n {\n $fileName = time() . $uploadedFile->getClientOriginalName();\n $uploadedFile->move(uploadedImagePath() . DIRECTORY_SEPARATOR . $this->path, $fileName);\n $filePath = uploadedImagePath() . DIRECTORY_SEPARATOR . $this->path . DIRECTORY_SEPARATOR .$fileName;\n $image = $this->modelName::create(['name' => $fileName, 'path' => $filePath]);\n return $image->id;\n }\n\n }", "public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return static::UPLOAD_DIRECTORY;\n }", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "function uploads_dir() {\n\tglobal $root;\n\treturn $root.Media::instance()->path;\n}", "protected function getUploadRootDir()\n {\n// documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'documents';\n }", "function ft_hook_upload($dir, $file) {}", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../'.$this->getUploadDir();\n }" ]
[ "0.64707035", "0.62114835", "0.6207102", "0.61252356", "0.6113334", "0.6100969", "0.6089091", "0.6024513", "0.5980981", "0.5977257", "0.5966816", "0.595665", "0.5955808", "0.59494936", "0.5914015", "0.5909059", "0.5904296", "0.5852198", "0.5837207", "0.58265305", "0.5792741", "0.57918036", "0.57918036", "0.57799274", "0.57770234", "0.57578105", "0.5741875", "0.57349163", "0.5724052", "0.57166934", "0.57030684", "0.56979996", "0.56900245", "0.5671198", "0.5652244", "0.56225514", "0.5612433", "0.56122196", "0.56094354", "0.5595129", "0.5572659", "0.55624366", "0.5550423", "0.5535782", "0.5529895", "0.55208176", "0.55174106", "0.5512682", "0.5509614", "0.5509013", "0.5494329", "0.5491133", "0.54890835", "0.5480033", "0.5473251", "0.54660934", "0.54645944", "0.5461866", "0.54603076", "0.5455987", "0.5452973", "0.5448319", "0.5445693", "0.5436729", "0.543424", "0.5431061", "0.5427739", "0.54258585", "0.5423196", "0.5420253", "0.5414076", "0.54046816", "0.54021955", "0.5401697", "0.5394526", "0.5394526", "0.5394526", "0.5394526", "0.5394526", "0.5394526", "0.5394526", "0.5394526", "0.5393505", "0.5387045", "0.5383235", "0.5374696", "0.537342", "0.53711724", "0.53691363", "0.53689796", "0.53681874", "0.53681874", "0.536579", "0.53652334", "0.5361572", "0.53588516", "0.5358211", "0.5356576", "0.5355333", "0.535265" ]
0.53806734
85
Renders PFS folder selection dropdown
function cot_selectbox_folders($user, $skip, $check, $name = 'folderid') { global $db, $db_pfs_folders, $R; $user = (int) $user; $sql = $db->query("SELECT pff_id, pff_title, pff_isgallery, pff_ispublic FROM $db_pfs_folders WHERE pff_userid=$user ORDER BY pff_title ASC"); $check = (empty($check) || $check == '/') ? '0' : $check; $result_arr = array(); if ($skip != '/' && $skip != '0') { $result_arr[0] = '/'; } while ($row = $sql->fetch()) { if ($skip != $row['pff_id']) { $result_arr[$row['pff_id']] = htmlspecialchars($row['pff_title']); } } $sql->closeCursor(); $result = cot_selectbox($check, $name, array_keys($result_arr), array_values($result_arr), false); return ($result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function renderLanguageSelect() {}", "public function renderFiles() {\r\n\t\tlist($name, $id) = $this->resolveNameID();\r\n\t\t$id .= \"-files\";\r\n\t\t$basePath = $this->basePath;\r\n\t\tif (is_array($basePath)) {\r\n\t\t\t$basePath = array_shift($basePath); // the first folder is selected by default\r\n\t\t}\r\n\t\tob_start();\r\n\t\t$this->widget('zii.widgets.jui.CJuiSelectable', array(\r\n\t\t\t'items'=>array(\r\n\t\t\t\t'id1'=>'<strong>blah</strong> Item 1',\r\n\t\t\t\t'id2'=>'Item 2',\r\n\t\t\t\t'id3'=>'Item 3',\r\n\t\t\t),\r\n\t\t\t'id' => $id,\r\n\t\t));\r\n\t\tYii::app()->clientScript->registerCSS(__CLASS__.\":\".$id,<<<CSS\r\n#$id .ui-selecting { background: #FECA40; }\r\n#$id .ui-selected { background: #F39814; color: white; }\r\n#$id { list-style-type: none; margin: 0; padding: 0; }\r\n#$id li {\r\n\tmargin: 3px;\r\n\tpadding: 10px;\r\n\tfloat: left;\r\n\twidth: 60px;\r\n\theight: 40px;\r\n\ttext-align: center;\r\n\t}\r\n\t\t\r\nCSS\r\n\t\t);\r\n\t\t$html = ob_get_clean();\r\n\t\treturn $html;\r\n\t}", "public function run()\n\t{\n\t\tlist($name,$id)=$this->resolveNameID();\n\n\t\tif(isset($this->htmlOptions['id']))\n\t\t\t$id=$this->htmlOptions['id'];\n\t\telse\n\t\t\t$this->htmlOptions['id']=$id;\n\t\tif(isset($this->htmlOptions['name']))\n\t\t\t$name=$this->htmlOptions['name'];\n\t\telse\n\t\t\t$this->htmlOptions['name']=$name;\n\t\t\n\t\t//$items = $this->data->roots()->findAll($this->dataCondition, $this->paramsCondition);\n\t\t$items = $this->listRoots;\n\t\t$html = '';\n\t\t$html .= CHtml::openTag('div', array('class' => 'jlb_tree_drop_down_list'));\n\t\t$html .= CHtml::openTag('select', $this->htmlOptions);\n\t\tif (count($items)) {\n\t\t\tforeach($items as $item) {\n\t\t\t\t$htmlOptions = array();\n\t\t\t\t$htmlOptions['value'] = $item->id;\n\t\t\t\tif ($this->model->parent_id == $item->id)\n\t\t\t\t\t$htmlOptions['selected'] = 'selected';\n\t\t\t\t$html .= CHtml::openTag('option', $htmlOptions);\n\t\t\t\t$html .= CHtml::encode($item->name);\n\t\t\t\t$html .= CHtml::closeTag('option');\n\t\t\t\t$descendants = $item->descendants()->findAllByAttributes($this->findByAttributes);\n\t\t\t\t$trees = $item->toArray($descendants);\n\t\t\t\t$html .= $this->renderDropDownList($trees);\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$html .= CHtml::tag('option', array('value'=>'root'), 'Root', false);\n\t\t}\n\t\t$html .= CHtml::closeTag('select');\n\t\t$html .= CHtml::closeTag('div');\n\t\techo $html;\n\t\t//Yii::app()->clientScript->registerScript(__CLASS__.'#'.$this->htmlOptions['id'], $this->_getScript(), CClientScript::POS_READY);\n\t}", "public function render()\n {\n return view('filament::components.dropdown');\n }", "public function render_options_page()\n\t{\n\t\treturn include 'src/views/form.php';\n\t}", "public function render()\n {\n return view('adminhub::components.dropdown.button');\n }", "function bls_sf_selectForTypes() {\n\tbls_ut_backTrace(\"bls_sf_selectForTypes\");\n\tglobal $bls_sf_location;\n\n\techo \"<select name=\\\"s_pkg_srctype\\\">\";\n\tforeach ($bls_sf_location as $key => $val) {\n\t\techo \"<option value=\\\"$key\\\">$val</option>\";\n\t}\n\techo \"</select>\";\n}", "static public function flistSelect($value = null, $form = null,\n $tagname = 'actionvalue')\n {\n global $conf, $registry;\n\n if ($registry->hasMethod('mail/folderlist')) {\n $createfolder = $registry->hasMethod('mail/createFolder');\n try {\n $mailboxes = $registry->call('mail/folderlist');\n\n $text = '<select class=\"flistSelect\" id=\"' . $tagname . '\" name=\"' . $tagname . '\">' .\n '<option value=\"\">' . _(\"Select target folder:\") . '</option>' .\n '<option disabled=\"disabled\">- - - - - - - - - -</option>';\n\n if ($createfolder) {\n $text .= '<option class=\"flistCreate\" value=\"\">' . _(\"Create new folder\") . '</option>' .\n '<option disabled=\"disabled\">- - - - - - - - - -</option>';\n }\n\n foreach ($mailboxes as $key => $val) {\n $text .= sprintf(\n \"<option value=\\\"%s\\\"%s>%s</option>\\n\",\n htmlspecialchars($key),\n ($key === $value) ? ' selected=\"selected\"' : '',\n str_repeat('&nbsp;', $val['level'] * 2) . htmlspecialchars($val['label'])\n );\n }\n\n Horde::addScriptFile('new_folder.js', 'ingo');\n Horde::addInlineJsVars(array(\n 'IngoNewFolder.folderprompt' => _(\"Please enter the name of the new folder:\")\n ));\n\n return $text . '</select>';\n } catch (Horde_Exception $e) {}\n }\n\n return '<input id=\"' . $tagname . '\" name=\"' . $tagname . '\" size=\"40\" value=\"' . $value . '\" />';\n }", "function hundope_select_field_render() { \n\t\n}", "public static function getSelectULList($table, $selected_id = -1){\n\t\n\t$htmlList = '';\n\t$htmlListFirstEntry = \"<li data-value='-1' class='disabled'><a href='#'>Select folder </a></li><li class='divider'></li>\";\t\n\t\n\tswitch ($table){\n\t\tcase 'folder':\n\t\tcase 'parentfolder':\n\t\t{\n\t\t\tif($table=='folder'){\n\t\t\t\t$list = Folder::getAll() ; //'SELECT id_folder, folderName, id_user from folder';\n\t\t\t}elseif($table=='parentfolder'){\n\t\t\t\t$list = Folder::getAllParents() ; //'SELECT id_folder, folderName, id_user from folder';\n\t\t\t}\t\t\n\t\t\tif(false !== $list){\n\t\t\t\t$htmlItem = '';\n\t\t\t\tforeach($list as $item){\n\t\t\t\tif($item['id_folder'] == $selected_id){$is_selected=' selected ';}else{$is_selected='';}\n\t\t\t\t$htmlItem = \"<li data-value='{$item['id_folder']}'><a href='#'>{$item['folderName']}</a></li>\";\n\t\t\t\t\t$htmlList = $htmlList.$htmlItem.PHP_EOL;\n\t\t\t\t}\n\t\t\tif($selected_id == -1) $htmlList = $htmlListFirstEntry.PHP_EOL.$htmlList;\t\t\t\n\t\t\t}\n\t\t\telse $htmlList = \"<li data-value='-1' class='disabled'><a href='#'>No folders</a></li>\";\n\t\t}\n\t\t$htmlList = \"<ul class='dropdown-menu' role='menu'>\".$htmlList.\"</ul>\";\n\t\tbreak;\n\t\tcase 'folderGroupped':{\n\t\t\t$list = Folder::getFoldersArray() ; //groupped array\n\t\t\tif(false !== $list AND count($list) > 0){\n\t\t\t\t$htmlItem = '';\n\t\t\t\tforeach($list as $folderSet){\n\t\t\t\t\t$fldNameParent = $folderSet['parentName'];\n\t\t\t\t\t$fldCountParent = $folderSet['folderCount'];\n\t\t\t\t\t$fldIDParent = $folderSet['parentID'];\n\t\t\t\t\t\n\t\t\t\t\tif( count($folderSet['subfolders']) > 0 ){\n\t\t\t\t\t\t//group header//\n\t\t\t$htmlItem = \"<li data-value='{$fldIDParent}' class='ulheader'><a href='#'>{$fldNameParent}</a></li>\";\n\t\t\t$htmlList = $htmlList.$htmlItem.PHP_EOL;\n\t\t\t\n\t\t\tforeach($folderSet['subfolders'] as $subfolder){\n\t\t\t\n\t\t\t\t$folderName = $subfolder['folderName'];\n\t\t\t\t$folderCount = $subfolder['folderCount'];\n\t\t\t\t$folderID = $subfolder['id_folder'];\n\t\t\t\t$HTMLfldID = 'subfolder'.$folderID;\n\t$htmlItem = \"<li data-value='{$folderID}'><a href='#'>{$folderName}</a></li>\";\n\t$htmlList = $htmlList.$htmlItem.PHP_EOL;\n\t\t\t\t}\n\t\t\t\t$htmlList = $htmlList.\"<li class='divider'></li>\";\n\t\t}else{\n\t\t\t$htmlItem = \"<li data-value='{$fldIDParent}' class='ulheader'><a href='#'>{$fldNameParent}</a></li>\";\n\t\t\t$htmlList = $htmlList.$htmlItem.PHP_EOL;\n\t\t\t$htmlList = $htmlList.\"<li class='divider'></li>\";\n\t\t}\n\t\t\t\t}\n\t\t\tif($selected_id == -1) $htmlList = $htmlListFirstEntry.PHP_EOL.$htmlList;\t\t\t\n\t\t\t}\n\t\t\telse $htmlList = \"<li data-value='-1' class='disabled'><a href='#'>No folders</a></li>\";\n\t\t}\n\t\t$htmlList = \"<ul class='dropdown-menu' role='menu'>\".$htmlList.\"</ul>\";\t\t\n\t\tbreak;\n\n\t\tcase 'tag':{\n\t\t\t$list = Tag::getAll() ;\n\t\t\tif(false !== $list){\n\t\t\t\t$htmlItem = '';\n\t\t\t\tforeach($list as $item){\t\t\t\n\t\t\t\t\tif($item['id_tag'] === $selected_id){\n\t\t$htmlItem = \"<li data-value='{$item['id_tag']}' selected><a href='#'>{$item['tagName']}</a></li>\";\t\t\n\t\t\t\t\t}else{\n\t\t$htmlItem = \"<li data-value='{$item['id_tag']}'><a href='#'>{$item['tagName']}</a></li>\";\n\t\t\t\t\t}\t\n\t\t\t\t\t$htmlList = $htmlList.$htmlItem.PHP_EOL;\n\t\t\t\t}\n\t\t\t\tif($selected_id == -1) $htmlList = $htmlListFirstEntry.PHP_EOL.$htmlList;\t\t\t\n\t\t\t}\n\t\t\telse $htmlList = \"<li data-value='-1' class='disabled'><a href='#'>No tags</a></li>\";\n\t\t}\n\t\t$htmlList = \"<ul class='dropdown-menu' role='menu'>\".$htmlList.\"</ul>\";\n\t\tbreak;\n\t\t\n\t\tbreak;\n\t\tdefault:\n\t\t\t$htmlList = \"<option disabled value='-1'>No data</option>\";\t\n\t\t}\n\treturn $htmlList;\t\n\n\t}", "function get_folders_list_ajax() {\n\t\t$path = str_replace( '\\\\\\\\', DIRECTORY_SEPARATOR, $_POST['path'] );\n\t\t$path = $path . DIRECTORY_SEPARATOR;\n\t\t$list = $this->get_folders_list( $path );\n\t\t$output = [];\n\t\t$output['path'] = $path;\n\t\t$output['folders'] = '';\n\t\t$output['files'] = '';\n\t\tob_start();\n\t\tif ( $list ) {\n\t\t\t$output['folders'] .= '<option>' . NONE_ELEMENT . '</option>';\n\t\t\tforeach ( $list as $item ) {\n\t\t\t\t$output['folders'] .= '<option>' . substr( $item, strripos( $item, DIRECTORY_SEPARATOR ) + 1 ) . '</option>';\n\t\t\t}\n\t\t}\n\t\t$available_files = get_all_available_files( $path );\n\t\tif ( $available_files ) {\n\t\t\t$output['files'] = edde_dispay_available_files( $available_files );\n\t\t}\n\t\tob_end_clean();\n\t\techo json_encode( $output );\n\t\twp_die();\n\t}", "public static function renderSelect();", "public function action_ajax_doc_as_option()\n\t{\n\n\t\t$option_list = NULL;\n\t\t$id = $this->request->query('c_id');\n\t\t$inner_directory = $this->request->query('inner_directory');\n\t\t$selected = $this->request->query('selected');\n\t\t$selected = explode(',', $selected);\n\n\t\t// Check to see if the directory structure is in place for this client\n\t\tself::quick_directory_check_autonomous($id);\n\n\t\t// Gets all the documents from KT for a given user\n\t\t$question_data = self::doc_acquire_documents($id, $inner_directory);\n\n\t\tif (!empty($question_data))\n\t\t{\n\t\t\t// Creates an array for the database\n\t\t\t$doc_array = self::document_table_builder($question_data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$doc_array = NULL;\n\t\t}\n\t\t// Check to see if there are any documents\n\t\tif (empty($doc_array))\n\t\t{\n\t\t\t$option_list = \"<option>No Documents</option>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($doc_array['document'] as $id => $doc)\n\t\t\t{\n\t\t\t\tif (in_array($doc['id'], $selected))\n\t\t\t\t{\n\t\t\t\t\t$option_list .= '<option value=\"'.$doc['id'].'\" selected>'.$doc['filename'].'</option>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$option_list .= '<option value=\"'.$doc['id'].'\">'.$doc['filename'].'</option>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo $option_list;\n\t}", "public function render()\n {\n return view('components.admin.form-fields.select');\n }", "function idrws_get_files(){\n\t\t$posts_array = idrws_get_pdf_files();\n\t\techo \"<select name='idrws_selected_pdf' id='idrws_available_pdfs' size='10'>\";\n\t\tforeach ($posts_array as $value) {\n\t\t\techo \"<option value='\".$value->ID.\"' >\" . $value->post_title;\n\t\t}\n\t\techo \"</select>\";\n\t}", "public function render()\n {\n $fromListTree = array();\n $this->getFromListTree($fromListTree);\n $style = $this->getStyle();\n $func = $this->getFunction();\n $valueList = array(); $valueArray = array();\n $this->getFromList($valueList, $this->getSelectedList());\n foreach ($valueList as $vl) {\n $valueArray[] = $vl['val'];\n }\n $sHTML = \"<script>\n \t\t\t\tvar \".$this->m_Name.\"_optlist = new Array(); \n \t\t\t\tvar \".$this->m_Name.\"_optlist_default = new Array();\n \t\t\t</script>\";\n $sHTML .= \"<div name=\\\"\" . $this->m_Name . \"\\\" ID=\\\"\" . $this->m_Name .\"\\\" $this->m_HTMLAttr $style>\";\n\t\t$sHTML .= \"<ul>\";\n\t\t$i = 0;\n foreach ($fromListTree as $treeNode)\n {\n\n //$sHTML .= \"<input type=\\\"checkbox\\\" name=\\\"\".$this->m_Name.\"[]\\\" VALUE=\\\"\" . $option['val'] . \"\\\" $selectedStr></input>\" . $option['txt'] . \"<br/>\";\n $sHTML .= \"<li style=\\\"padding-top:10px;\\\">\".str_repeat(\"-&nbsp;-&nbsp;\", $treeNode[\"level\"]).\"<strong>\".$treeNode['txt'].\"</strong>\".\"</li>\";\n $sublist = array();\n $this->getDOFromList($sublist, $this->getSelectFrom().\",[folder_id]='\".$treeNode['id'].\"'\");\n foreach($sublist as $option){\n $test = array_search($option['val'], $valueArray);\n\t if ($test === false)\n\t {\n\t $selectedStr = '';\n\t }\n\t else\n\t {\n\t $selectedStr = \"CHECKED\";\n\t $sHTML .= \"<script>\".$this->m_Name.\"_optlist_default.push('\".$this->m_Name.\"_\".$i.\"'); </script>\";\n\t } \t\n \t$sHTML .= \"<li><label style=\\\"float:none;color:#888888;display:inline;\\\">\".str_repeat(\"-&nbsp;-&nbsp;\", $treeNode[\"level\"]).\"<input type=\\\"checkbox\\\" id=\\\"\".$this->m_Name.\"_\".$i.\"\\\" name=\\\"\".$this->m_Name.\"[]\\\" VALUE=\\\"\" . $option['val'] . \"\\\" $selectedStr></input>\" . $option['txt'] . \"</label></li>\";\n \t$sHTML .= \"<script>\".$this->m_Name.\"_optlist.push('\".$this->m_Name.\"_\".$i.\"'); </script>\";\n \t$i++;\n }\n \n }\n $sHTML .= \"</ul></div>\";\n return $sHTML;\n }", "public function render()\n {\n return view('livewire.vault.folder.delete-folder');\n }", "public function renderDirectories() {\r\n\t\t$treeData = array();\r\n\t\tlist($name, $id) = $this->resolveNameID();\r\n\t\t$htmlOptions = array(\r\n\t\t\t\"class\" => \"filetree\",\r\n\t\t\t\"id\" => $id.\"-directories\"\r\n\t\t);\r\n\t\t\r\n\t\tforeach((is_array($this->basePath) ? $this->basePath : array($this->basePath)) as $path) {\r\n\t\t\t$item = array(\r\n\t\t\t\t\"text\" => \"<span class='folder'>\".basename($path).\"</span>\",\r\n\t\t\t\t\"id\" => md5($path),\r\n\t\t\t\t\"children\" => $this->directoryTreeviewData($path),\r\n\t\t\t\t\"expanded\" => false,\r\n\t\t\t);\r\n\t\t\t$checkboxId = $this->getId().\"_\".$item['id'];\r\n\t\t\t$item['text'] = CHtml::tag(\r\n\t\t\t\t\t\t\"span\",\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t\"class\" => \"folder\"\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t($this->multiple ? \r\n\t\t\t\t\t\t\tCHtml::activeCheckbox($this->model,$this->attribute.\"[\".$item['id'].\"]\",array(\"id\" => $checkboxId))\r\n\t\t\t\t\t\t\t:\r\n\t\t\t\t\t\t\tCHtml::activeRadioButton($this->model,$this->attribute,array(\"id\" => $checkboxId, \"value\" => $item['id']))\r\n\t\t\t\t\t\t).\r\n\t\t\t\t\t\tCHtml::label(basename($path),$checkboxId)\r\n\t\t\t\t\t);\r\n\t\t\t$treeData[] = $item;\r\n\t\t\t\r\n\t\t}\r\n\t\tob_start();\r\n\t\t$this->widget(\"CTreeView\",array(\r\n\t\t\t\"htmlOptions\" => $htmlOptions,\r\n\t\t\t\"data\" => $treeData\r\n\t\t));\r\n\t\t$html = ob_get_clean();\r\n\t\treturn $html;\r\n\t}", "public function render()\n {\n return view('components.select');\n }", "function ShowShareFolder($folderId)\n {\n $html =\"\";\n\n //Recherche d'utilisateur\n $tbContact = new AutoCompleteBox(\"tbContact\", $this->Core);\n $tbContact->PlaceHolder = $this->Core->GetCode(\"SearchUser\");\n $tbContact->Entity = \"User\";\n $tbContact->Methode = \"SearchUser\";\n $tbContact->Parameter = \"AddAction=FileAction.SelectUser(\".$folderId.\")\";\n\n $html .= $tbContact->Show();\n\n $html .= $this->GetUser($folderId);\n\n return $html;\n }", "function minorite_menu_tree__links(array $variables) {\n return '<select onchange=\"window.open(this.options[this.selectedIndex].value);\"><option>' . t('Select a site...') . '</option>' . $variables['tree'] . '</select>';\n}", "function renderFileTypeList($filetype) {\n\t\tif (trim($filetype) == '') $filetype = 'noselection';\n\t\t// TODO: use DAM - functions - there are much more file types possible\n\t\t$this->pi_loadLL();\n\n\t\t$filetypeArray = $this->conf['filterView.']['filetypes.'];\n\t\t$filetypeArray['noselection'] = 'noselection';\n\n\t\t$content = '<select name=\"filetype\">';\n\t\tforeach ($filetypeArray as $type => $arr) {\n\t\t\t# do only take ts options that are at root level\n\t\t\tif (!is_array($arr)) {\n\t\t\t\t$filetype == $type ? $sel = ' selected=\"selected\"' : $sel = '';\n\t\t\t\tif ($type == 'noselection') $type = '';\n\t\t\t\t$content .= '<option value=\"' . $type . '\"' . $sel . '>' . $this->pi_getLL($arr) . '</option>';\n\t\t\t}\n\t\t}\n\t\t$content .= '</select>';\n\t\treturn $content;\n\t}", "function clients_importDisplaySelectFile() {\n\tglobal $gSession;\n\t\n\t$current_group = intval($_GET['group']);\n\t\n\t## setup the template\n\t$select_template = new Template();\n\t$select_template->set_templatefile(array(\"body\" => ENGINE.\"modules/clients/interface/fileupload.tpl\"));\n\n\t$select_template->set_var('language_inputhead','<b>'.LANG_MODULE_CLIENTS_ImportSelectFile.'</b>');\n\t$select_template->set_var('language_inputbody',LANG_MODULE_CLIENTS_ImportSelectFileDesc.'<br>');\n\t\n\t$select_template->set_var('update',LANG_MODULE_CLIENTS_ImportUpdate);\n\t$select_template->set_var('explain_update',LANG_MODULE_CLIENTS_ImportUpdateDesc);\n\t\n\t$select_template->set_var('element_desc','Click the \\'Browse\\' button to locate the text file<br> containing the subscribers on your computer.');\n\t\n\t$targetURL = \"module.php?cmd=import&step=1&group=\".$current_group;\n\t$targetURL = $gSession->url($targetURL);\n\t$select_template->set_var('actionURL',$targetURL);\t\n\t\n\t$select_template->pfill_block(\"body\");\n\t\n}", "public static function drawProjectSelector()\n {\n $projects = EcrProjectHelper::getProjectList();\n $projectTypes = EcrProjectHelper::getProjectTypes();\n $ecr_project = JRequest::getCmd('ecr_project');\n\n $class = '';\n\n if($ecr_project == 'ecr_new_project')\n {\n $class = 'img3 icon-16-add';\n }\n else if($ecr_project == 'ecr_register_project')\n {\n $class = 'img3 icon-16-import';\n }\n else if($ecr_project)\n {\n try\n {\n $project = EcrProjectHelper::getProject();\n\n $class = 'img3 icon-12-'.$project->type;\n }\n catch(Exception $e)\n {\n echo '';//-- To satisfy the sniffer - aka: do nothing.\n }//try\n }\n\n echo '<span class=\"'.$class.'\">';\n echo NL.'<select style=\"font-size: 1.2em;\" name=\"ecr_project\" id=\"ecr_project\" onchange=\"switchProject();\">';\n echo NL.'<option value=\"\">'.jgettext('Project').'...</option>';\n\n $selected =($ecr_project == 'ecr_new_project') ? ' selected=\"selected\"' : '';\n $class = ' class=\"img3 icon-16-add\"';\n echo NL.'<option'.$class.' value=\"ecr_new_project\"'.$selected.'>'.jgettext('New Project').'</option>';\n\n $selected =($ecr_project == 'ecr_register_project') ? ' selected=\"selected\"' : '';\n $class = ' class=\"img3 icon-16-import\"';\n echo NL.'<option'.$class.' value=\"ecr_register_project\"'.$selected.'>'.jgettext('Register Project').'</option>';\n\n foreach($projectTypes as $comType => $display)\n {\n if(isset($projects[$comType])\n && count($projects[$comType]))\n {\n echo NL.'<optgroup label=\"'.$display.'\">';\n\n foreach($projects[$comType] as $project)\n {\n $displayName = $project->name;\n\n if($project->scope)\n $displayName .= ' ('.$project->scope.')';\n\n $selected =($project->fileName == $ecr_project) ? ' selected=\"selected\"' : '';\n $class = ' class=\"img12 icon-12-'.$comType.'\"';\n echo NL.'<option'.$class.' value=\"'.$project->fileName.'\" label=\"'.$project->name.'\"'.$selected.'>'\n .$displayName.'</option>';\n }//foreach\n\n echo NL.'</optgroup>';\n }\n }//foreach\n echo NL.'</select></span>';\n }", "public function render(){\n\t\t$this->clearAttribute(\"value\");\n\t\t$inner = \"\\n\";\n\t\tforeach($this->options as $value => $option){\n\t\t\tif(in_array($value, $this->selected)){\n\t\t\t\t$option->addAttribute(\"selected\", \"selected\");\n\t\t\t}\n\t\t\t$inner .= \"\\t\" . $option->render() . \"\\n\";\n\t\t}\n\t\t$this->setInnerText($inner);\n\t\treturn parent::render();\n\t}", "function rdisplay()\r\n\t{\r\n\t\t$select = $this->open_select().\"\\n\";\r\n\t\tforeach ($this->m_array_options as $options )\r\n\t\t{\r\n\t\t\t\t$selected = ($options['selected'] == true ) ? \"selected\" : \"\";\r\n\t\t\t\t\r\n\t\t\t\t$select .= \"<option value=\\\"\".$options['value'].\"\\\" $selected >\".$options['text'].\"</option> \\n\";\r\n\t\t}\r\n\t\t$select .= $this->close_select().\"\\n\";\r\n\t\treturn $select;\r\n\t}", "function lang_dropdown()\n{\n $currentlang = pnUserGetLang();\n echo \"<select name=\\\"alanguage\\\" class=\\\"pn-text\\\" id=\\\"language\\\">\";\n $lang = languagelist();\n print \"<option value=\\\"\\\">\" . _ALL . '</option>';\n $handle = opendir('language');\n while (false !== ($f = readdir($handle))) {\n if (is_dir(\"language/$f\") && @$lang[$f]) {\n $langlist[$f] = $lang[$f];\n } \n } \n asort($langlist);\n foreach ($langlist as $k => $v) {\n echo '<option value=\"' . $k . '\"';\n if ($currentlang == $k) {\n echo ' selected=\"selected\"';\n } \n echo '>' . pnVarPrepForDisplay($v) . '</option> ';\n } \n echo \"</select>\";\n}", "public function indexAction() {\n // Get list of all computers\n\n $this->context->render(\"Ajaxplorer/pages/SharedFoldersList.twig\", array());\n }", "function displayFilterOptions() {\n\n if ($this->isPageType()) { \n\n $templates = $this->getAllPageTemplates(); \n\n echo '<select name=\"template\">';\n echo '<option value=\"\">Show all</option>';\n \n $currTemplate = isset($_GET['template'])? $_GET['template']:'';\n\n foreach ($templates as $template) {\n echo \"<option value={$template} \";\n if($template == $currTemplate) { echo 'selected=\"selected\"'; }\n echo \">\" . $template .\"</option>\"; \n }\n \n echo '</select>'; \n }\n }", "public function _settings_field_dropbox_display() {\n global $zendesk_support;\n ?>\n <select name=\"zendesk-settings[dropbox_display]\" id=\"zendesk_dropbox_display\">\n <option\n value=\"none\" <?php selected( $zendesk_support->settings['dropbox_display'] == 'none' ); ?> ><?php _e( 'Do not display the Zendesk dropbox anywhere', 'zendesk' ); ?></option>\n <option\n value=\"auto\" <?php selected( $zendesk_support->settings['dropbox_display'] == 'auto' ); ?> ><?php _e( 'Display the Zendesk dropbox on all posts and pages', 'zendesk' ); ?></option>\n <option\n value=\"manual\" <?php selected( $zendesk_support->settings['dropbox_display'] == 'manual' ); ?> ><?php _e( 'I will decide where the Zendesk dropbox displays using a template tag', 'zendesk' ); ?></option>\n </select>\n\n <?php\n }", "public function dropDownMediaAccess($selected = \"\")\n{\n $name = 'media_access';\n\n $media_access = array('public' => 'Public', 'private' => 'Private');\n\n if($selected != '') {\n \n $selected = $selected;\n\n }\n\n return dropdown($name, $media_access, $selected);\n\n}", "public function render_options_page() {\r\n\r\n\t\tinclude( Views::load_view( TBSC_OPTIONS_PLUGIN_DIR . 'src/views/options-page/options-page.php' ) );\r\n\r\n\t}", "public function ajax_show_package_select(){\n\t\t$ml = self::print_package_select_options($_POST['service']);\n\t\techo $ml;\n\t}", "public function render()\n {\n return view('components.dropdown-component');\n }", "function getServiceTypesTree_selectBox($select_name, $current_servicetype_id)\n {\n //echo '$current_category_id = '.$current_category_id;\n $service_type_array = $this->getServiceTypeTree_array(0, 0);\n $level = 1;\n $rs = '';\n $rs .= '<div id=\"parent_id_div\">';\n $rs .= '<select name=\"' . $select_name . '\">';\n $rs .= '<option value=\"0\">..</option>';\n\n $rs .= $this->getServiceTypesTree_optionItems($service_type_array, $current_servicetype_id);\n $rs .= '</select>';\n $rs .= '</div>';\n return $rs;\n }", "function skin_select($name = 'skin', $selected = null) {\n echo '<select id=\"'.$name.'\" name=\"'.$name.'\">';\n foreach (get_sorted_files(\"skins/\") as $skin) {\n // Skip the svn directory\n if (in_array($skin, array('.svn')))\n continue;\n // Ignore non-directories\n if (!is_dir(\"skins/$skin\"))\n continue;\n // Print the option\n echo '<option value=\"'.html_entities($skin).'\"';\n if ($selected == $skin)\n echo ' SELECTED';\n echo '>'.html_entities(str_replace('_', ' ', $skin)).'</option>';\n }\n echo '</select>';\n }", "public function selectAction()\n {\n $this->loadLayout();\n $this->renderLayout();\n }", "public function getDivisionSelect($project_id)\n\t{\t\t\n\t $app = JFactory::getApplication();\n $db = sportsmanagementHelper::getDBConnection(); \n $query = $db->getQuery(true);\n$options = array();\n\n\t\t$query = ' SELECT d.id AS value, d.name AS text ' \n\t\t . ' FROM #__sportsmanagement_division AS d ' \n\t\t . ' WHERE d.project_id = ' . $project_id \n\t\t . ($this->getParam(\"show_only_subdivisions\", 0) ? ' AND parent_id > 0' : '') \n\t\t ;\n\t\t$this->_db->setQuery($query);\n\t\t$res = $this->_db->loadObjectList();\n\t\tif ($res) \n {\n $options = array(JHTML::_('select.option', 0, JText::_($this->getParam('divisions_text'))));\n\t\t$options = array_merge($options, $res);\n\t\t}\n//\t\treturn JHTML::_('select.genericlist', $options, 'd', 'class=\"jlnav-division\"', 'value', 'text', $this->getDivisionId());\n return $options;\n\t}", "function render() {\n switch($this->getAttribute('plugin')) {\n case 'drop':\n default:\n $rendered = '<input type=\"hidden\" name=\"tmp_upload_dir\" value=\"[ATTRIBUTE|name=tmp_files_dir]\" />' . '<div class=\"upload-files\"><div class=\"drop\">Drop here files<a>or press here</a><input type=\"file\" name=\"' . $this->getName() . '\" id=\"' . $this->getId() . '\" multiple /></div></div>';\n break;\n }\n return $rendered;\n }", "protected function renderSimulateUserSelectAndLabel() {}", "function index(){\n\t\t// $data['list_status_publish'] \t= selectlist2(array('table'=>'status_publish','title'=>'All Status','selected'=>$data['id_status_publish']));\n\t\t$data['list_languages'] \t\t= selectlist2(array('table'=>'language','title'=>'Select Language','where'=>'is_delete = 0','name'=>'name'));\n\t\trender('apps/editors_choice/index',$data,'apps');\n\t}", "public function getFsSelection() {}", "function ahr_render_select_redirection( $data ) {\r\n \r\n ahr_render_tpl( '/templates/select-redirection-type.tpl', $data );\r\n \r\n}", "private function _listFolder($val) {\n\t\t$path = g($val, 'path');\n\t\t$name = g($val, 'name');\n\t\t\t\n\t\t$mypath = $this->_sanitize($path . '/' . $name);\n\t\t\n\t\treturn '\n\t\t\t\t<li class=\"cfind-item-folder\">\n\t\t\t\t\t<a href=\"'.$this->_url(['path' => $mypath]).'\" title=\"'.htmlspecialchars($name).'\">\n\t\t\t\t\t\t<figure></figure>\n\t\t\t\t\t\t<span>'.htmlspecialchars($name).'</span>\n\t\t\t\t\t</a>\n\t\t\t\t</li>';\n\t}", "public function render()\n {\n return view('components.form.select-group');\n }", "public function ProjectDashboard() {\n //This return one project selected \n return $this->render('enterprise/project/project_dash.html.twig', array(\n 'type_connection' => 'user'\n ));\n }", "function pqrc_display_select_field()\n {\n global $pqrc_countries;\n $option = get_option('pqrc_select');\n\n printf('<select id=\"%s\" name=\"%s\">', 'pqrc_select', 'pqrc_select');\n foreach ($pqrc_countries as $country) {\n $selected = '';\n if ($option == $country) {\n $selected = 'selected';\n }\n printf('<option value=\"%s\" %s>%s</option>', $country, $selected, $country);\n }\n echo \"</select>\";\n }", "private function printSelectionPage() {\n\t\techo '<ul data-role=\"listview\" data-inset=\"true\">';\n\t\t$dir = new DirectoryIterator ( $this::filesPath );\n\t\tforeach ( $dir as $fileinfo ) {\n\t\t\tif (! $fileinfo->isDot ()) {\n\t\t\t\t$fileName = pathinfo ( $fileinfo->getFilename (), PATHINFO_FILENAME );\n\t\t\t\t$fileFullPath = $fileinfo->getPath () . '/' . $fileinfo;\n\t\t\t\t$lection = fgets ( fopen ( $fileFullPath, 'r' ) );\n\t\t\t\tif (strcmp ( \"-stat\", substr ( $fileName, - 5 ) ) != 0) {\n\t\t\t\t\techo '<li>\n\t\t\t\t\t\t<a class=\"ui-btn ui-btn-icon-right ui-icon-carat-r\" data-form=\"ui-btn-up-a\" href=\"?q=lesson&l=', $fileName, '\">', $lection, '</a>\n\t\t\t\t\t\t</li>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo '</ul>';\n\t}", "function ninja_forms_list_field_type_dropdown( $selected ){\r\n\t$output = '<option value=\"\" disabled>' . __( 'List', 'ninja-forms-style' ) . '</option>';\r\n\r\n\tif ( $selected == '_list-dropdown' ) {\r\n\t\t$select = 'selected=\"selected\"';\r\n\t} else {\r\n\t\t$select = '';\r\n\t}\r\n\t$output .= '<option value=\"_list-dropdown\" '.$select.'>&nbsp;&nbsp;&nbsp;&nbsp;' . __( 'Dropdown (Select)', 'ninja-forms-style' ) . '</option>';\r\n\r\n\tif ( $selected == '_list-radio' ) {\r\n\t\t$select = 'selected=\"selected\"';\r\n\t} else {\r\n\t\t$select = '';\r\n\t}\r\n\t$output .= '<option value=\"_list-radio\" '.$select.'>&nbsp;&nbsp;&nbsp;&nbsp;' . __( 'Radio', 'ninja-forms-style' ) . '</option>';\r\n\r\n\tif ( $selected == '_list-checkbox' ) {\r\n\t\t$select = 'selected=\"selected\"';\r\n\t} else {\r\n\t\t$select = '';\r\n\t}\r\n\t$output .= '<option value=\"_list-checkbox\" '.$select.'>&nbsp;&nbsp;&nbsp;&nbsp;' . __( 'Checkboxes', 'ninja-forms-style' ) . '</option>';\r\n\r\n\tif ( $selected == '_list-multi' ) {\r\n\t\t$select = 'selected=\"selected\"';\r\n\t} else {\r\n\t\t$select = '';\r\n\t}\r\n\t$output .= '<option value=\"_list-multi\" '.$select.'>&nbsp;&nbsp;&nbsp;&nbsp;' . __( 'Multi-Select', 'ninja-forms-style' ) . '</option>';\r\n\r\n\treturn $output;\r\n}", "function PMA_getFileSelectOptions($dir, $extensions = '', $active = '')\n{\n $list = PMA_getDirContent($dir, $extensions);\n if ($list === FALSE) {\n return FALSE;\n }\n $result = '';\n foreach ($list as $key => $val) {\n $result .= '<option value=\"'. htmlspecialchars($val) . '\"';\n if ($val == $active) {\n $result .= ' selected=\"selected\"';\n }\n $result .= '>' . htmlspecialchars($val) . '</option>' . \"\\n\";\n }\n return $result;\n}", "function theme_select(&$item) {\n\n\t\t$class = array('form-select');\n\t\t_form_set_class($item, $class);\n\n\t\t$size = $item['#size'] ? ' size=\"' . $item['#size'] . '\"' : '';\n\t\t$multiple = isset($item['#multiple']) && $item['#multiple'];\n\n\t\t$retval .= '<select name=\"'\n\t\t\t. $item['#name'] . ''. ($multiple ? '[]' : '') . '\"' \n\t\t\t. ($multiple ? ' multiple=\"multiple\" ' : '') \n\t\t\t. drupal_attributes($item['#attributes']) \n\t\t\t. ' id=\"' . $item['#id'] . '\" ' . $size . '>' \n\t\t\t. form_select_options($item) . '</select>';\n\t\treturn($retval);\n\n\t}", "public function getDropDown() {}", "public function getDropDown() {}", "public function render() {\n $this->checkValue();\n $html = NULL;\n\n $html .= '<select id=\"'.$this->id.'\" name=\"'.$this->name.'\"';\n $html .= (bool)$this->multiple ? ' multiple' : NULL;\n $html .= (bool)$this->size ? ' size=\"'.$this->size.'\"' : NULL;\n $html .= \">\\n\";\n\n foreach($this->options as $option) {\n $html .= '<option value=\"'.$option['optionValue'].'\"';\n\n if($this->form->isSubmitted()) {\n $html .= ($_REQUEST[$this->name] == $option['optionValue']) ? ' selected' : NULL;\n } else {\n $html .= (isset($option['selected']) && (bool)$option['selected']) ? ' selected' : NULL;\n }\n\n $html .= '>'.$option['optionTitle'].\"</option>\\n\";\n }\n\n if($this->required\n && $this->form->isSubmitted()\n && !$this->checkValue()) {\n $this->error = TRUE;\n }\n\n $html .= '</select>';\n $this->html = $this->wrap($html);\n }", "public function get_select() {\r\n\t\t$html = '';\r\n\t\tforeach ( $this->taxonomies as $tax ) {\r\n\t\t\t$options = sprintf( '<option value=\"\">%s %s</option>', __('View All', 'themify-portfolio-posts'),\r\n\t\t\tget_taxonomy($tax)->label );\r\n\t\t\t$class = is_taxonomy_hierarchical( $tax ) ? ' class=\"level-0\"' : '';\r\n\t\t\tforeach ( get_terms( $tax ) as $taxon ) {\r\n\t\t\t\t$options .= sprintf( '<option %s%s value=\"%s\">%s%s</option>', isset( $_GET[$tax] ) ? selected( $taxon->slug, $_GET[$tax], false ) : '', '0' !== $taxon->parent ? ' class=\"level-1\"' : $class, $taxon->slug, '0' !== $taxon->parent ? str_repeat( '&nbsp;', 3 ) : '', \"{$taxon->name} ({$taxon->count})\" );\r\n\t\t\t}\r\n\t\t\t$html .= sprintf( '<select name=\"%s\" id=\"%s\" class=\"postform\">%s</select>', esc_attr( $tax ), esc_attr( $tax ), $options );\r\n\t\t}\r\n\t\techo $html;\r\n\t}", "public function hookAdminItemsSearch()\n {\n $formSelect = get_view()->formSelect(\n 'zotero_item_type', null, null,\n label_table_options(self::getZoteroItemTypes())\n );\n echo '\n <div class=\"field\">\n <div class=\"two columns alpha\">\n <label for=\"zotero_item_type\">Zotero Item Type</label>\n </div>\n <div class=\"five columns omega inputs\">';\n echo $formSelect;\n echo '\n </div>\n </div>';\n }", "public function run() {\n $this->htmlOptions['multiple'] = true;\n if($this->model) {\n $name_id = $this->resolveNameID();\n $input_id = $name_id[1];\n $select_html = CHtml::activeDropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions);\n } else {\n $input_id = $this->attribute;\n $select_html = CHtml::dropDownList($this->attribute, $this->value, $this->data, $this->htmlOptions);\n }\n \n $options=CJavaScript::encode($this->options);\n Yii::app()->clientScript->registerScript('kendoui-multiselect-'.$input_id,\n 'var '.$input_id.' = jQuery(\"#'.$input_id.'\").kendoMultiSelect('.$options.').data(\"kendoMultiSelect\");'\n );\n \n echo $select_html;\n }", "public function render_admin_page() {\n $option_name = $this->name; \n include_once( dirname( __FILE__ ) . '/views/admin-page.php' );\n }", "public function view_option_page() {\n\t\tinclude_once plugin_dir_path( __FILE__ ) . 'options.php';\n\t}", "public function optionList()\n {\n return array(\n 'file:', // The template file to be rendered\n );\n }", "function ffw_port_select_callback($args) {\n global $ffw_port_settings;\n\n if ( isset( $ffw_port_settings[ $args['id'] ] ) )\n $value = $ffw_port_settings[ $args['id'] ];\n else\n $value = isset( $args['std'] ) ? $args['std'] : '';\n\n $html = '<select id=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" name=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\"/>';\n\n foreach ( $args['options'] as $option => $name ) :\n $selected = selected( $option, $value, false );\n $html .= '<option value=\"' . $option . '\" ' . $selected . '>' . $name . '</option>';\n endforeach;\n\n $html .= '</select>';\n $html .= '<label for=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\"> ' . $args['desc'] . '</label>';\n\n echo $html;\n}", "public static function drawFileSelector($pathToDir, $task)\n {\n if( ! $pathToDir || ! is_dir($pathToDir))\n {\n return jgettext('Invalid path');\n }\n\n //--just for highlighting\n $the_file = JRequest::getVar('file', NULL);\n\n //--get the file list\n $files = JFolder::files($pathToDir);\n\n echo NL.'<div id=\"ecr_filebutton\">';\n echo NL.'<ul>';\n foreach($files as $file)\n {\n $style = '';\n if( $file == $the_file )//highlight ?\n {\n $style = ' style=\"color: red; font-weight: bold;\"';\n }\n\n echo NL.'<li><a '.$style.'href=\"#\" onclick=\"document.adminForm.file.value=\\''\n .$file.'\\'; submitbutton(\\''.$task.'\\');\">'.$file.'</a></li>';\n }\n\n echo NL.'<ul>';\n echo NL.'</div>';\n }", "public function selection()\n {\n return view('site_preparation.selection');\n }", "function get_folder_view_screen_content($properties)\r\n{ \r\n $current_page_id = $properties['current_page_id'];\r\n $include_pages = $properties['pages'];\r\n $include_files = $properties['files'];\r\n\r\n include_once('liveform.class.php');\r\n $liveform = new liveform('folder_view');\r\n\r\n $output_my_start_page = '';\r\n\r\n // If the user has a start page and it is not this folder view page, then continue to check if we should output start page.\r\n if (\r\n (USER_START_PAGE_ID != 0)\r\n && (USER_START_PAGE_ID != $current_page_id)\r\n ) {\r\n // Get start page name.\r\n $start_page_name = get_page_name(USER_START_PAGE_ID);\r\n \r\n // If a start page name was found, then the page still exists, so prepare to output start page link.\r\n if ($start_page_name != '') {\r\n $output_my_start_page = '<div class=\"my_start_page\" style=\"margin-bottom: 1em\"><a class=\"software_button_tiny_secondary\" href=\"' . OUTPUT_PATH . h(encode_url_path($start_page_name)) .'\">My Start Page</a></div>';\r\n }\r\n }\r\n\r\n $output_folder_view_tree = '';\r\n\r\n // If neither pages nor files is selected to be included, then output error, because no content can be displayed.\r\n if (\r\n ($include_pages == 0)\r\n && ($include_files == 0)\r\n ) {\r\n $liveform->mark_error('', 'Sorry, neither Pages nor Files are selected to be included in this Folder View, so there is nothing to display.');\r\n\r\n // Otherwise pages and/or files are selected to be included, so get folder view tree\r\n } else {\r\n $folder_id = db_value(\"SELECT page_folder AS folder_id FROM page WHERE page_id = '$current_page_id'\");\r\n $output_folder_view_tree = get_folder_view_tree($folder_id, $include_pages, $include_files, $current_page_id);\r\n\r\n // If there is no content for folder view tree, then output message.\r\n if ($output_folder_view_tree == '') {\r\n // If both pages and files are included then prepare message for that.\r\n if (\r\n ($include_pages == 1)\r\n && ($include_files == 1)\r\n ) {\r\n $output_items = 'pages or files';\r\n\r\n // Otherwise if pages are included, then prepare message for that.\r\n } else if ($include_pages == 1) {\r\n $output_items = 'pages';\r\n\r\n // Otherwise files are only included, so prepare message for that.\r\n } else {\r\n $output_items = 'files';\r\n }\r\n\r\n $output_folder_view_tree = '<p class=\"no_items_message\">Sorry, we could not find any ' . $output_items . ' that you have access to, for this view.</p>';\r\n }\r\n }\r\n\r\n $output =\r\n '<div class=\"software_folder_view\">\r\n ' . $liveform->output_errors() . '\r\n ' . $liveform->output_notices() . '\r\n ' . $output_my_start_page . '\r\n <div class=\"folder_view_tree\">\r\n ' . $output_folder_view_tree . '\r\n </div>\r\n </div>';\r\n\r\n $liveform->remove_form('folder_view');\r\n\r\n return $output;\r\n}", "function language_select() {\n echo '<select name=\"language\">';\n foreach (Translate::$Languages as $lang => $details) {\n // Print the option\n echo '<option value=\"'.html_entities($lang).'\"';\n if ($_SESSION['language'] == $lang)\n echo ' SELECTED';\n echo '>'.$details[0].'</option>';\n }\n echo '</select>';\n }", "private function _prep_folders() \n\t{\n\t\t \n\t\t// Prep folders for Image selection\n\t\t// Load Files Module\n\t\t$this->load->library('files/files');\n\t\t$this->load->model('files/file_folders_m');\n\t\t \n\t\t// Set up the Dropdown Array for edit and create\n\t\t$folders = array(0 => lang('global:select-pick'));\n\t\t \n\t\t// Get All folders\n\t\t$tree = $this->file_folders_m->order_by('parent_id', 'ASC')->order_by('id', 'ASC')->get_all();\n\t\t \n\t\t// Build the Folder Tree\n\t\tforeach ($tree as $folder) \n\t\t{\n\t\t\t$id = $folder->id;\n\t\t\tif ($folder->parent_id != 0) \n\t\t\t{\n\t\t\t\t$folders[$id] = $folders[$folder->parent_id] . ' &raquo; ' . $folder->name;\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\t$folders[$id] = $folder->name;\n\t\t\t}\n\t\t}\n\t\t \n\t\treturn $folders;\n\t\t \n\t}", "public function index()\n {\n $info=Options::where('key','lp_filesystem')->first();\n $info=json_decode($info->value);\n return view('admin.filesystem.index',compact('info'));\n }", "function user_folders($userid,$conn){\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t\t//$dhandle = opendir('./cloud/'.$_SESSION['SESS_USER_ID'].'/');\r\n\t\t\t\t// define an array to hold the folders in the user's directory\r\n\t\t\t\t\t$folders = array();\r\n\t\t\t\t\t$files = array();\r\n\t\t\t\t\r\n\t\t\t\t// open the user's directory\r\n\t\t\t\t$path = './cloud/'.$_SESSION['SESS_USER_ID'].'/'; // '.' for current\r\n\t\t\t\tforeach (new DirectoryIterator($path) as $file) {\r\n\t\t\t\t\tif (($file != '.') && ($file != '..') &&\r\n\t\t\t\t\t ($file != basename($_SERVER['PHP_SELF']))) {\r\n\t\t\t\t\t if ($file->isDir()) {\r\n\t\t\t\t\t $folders[] = $file->getFilename();\r\n\t\t\t\t\t }\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\t// Now loop through the folders, echoing out a new select option for each one\r\n\t\t\t\t\tforeach( $folders as $fname )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t printf('\r\n\t\t\t \t<div class=\"col-lg-3 col-md-3 col-sm-3\">\r\n\t\t\t\t\t\t\t\t<a id=\"uf\" href=\"dir.php?folder='.$fname.'\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"card btn-sm waves-attach\">\r\n\t\t\t\t\t\t\t\t\t\t<aside class=\"pull-left\">\r\n\t\t\t\t\t\t\t\t\t\t\t<i class=\"icon icon-5x text-center\">folder_open</i>\r\n\t\t\t\t\t\t\t\t\t\t</aside>\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"card-main\">\r\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"card-inner\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"\">'.$fname.'</p>\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t</div>'\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t}", "public function sublistcombo()\n\t{\n\t\techo'\n\t\t\t<select name=\"sublistcombo\" style=\"width: 180px;\">\n\t\t\t\t\t\n\t\t\t <option value=\"None\">None</option>\n\t\t\t <option value=\"Hindi\">Hindi</option>\n\t\t\t <option value=\"English\">English</option>\n\t\t\t <option value=\"Maths\">Maths</option>\n\t\t\t <option value=\"Social Science\">Social Science</option>\n\t\t\t <option value=\"General Science\">General Science</option>\n\t\t\t <option value=\"Sanscrit\">Sanscrit</option>\n\t\t\t <option value=\"Computer Science\">Computer Science</option>\n\t\t\t <option value=\"Physics\">Physics</option>\n\t\t\t <option value=\"Chemistry\">Chemistry</option>\n\t\t\t <option value=\"Higher Math\">Higher Math</option>\n\t\t\t <option value=\"Biology\">Biology</option>\n\t\t\t <option value=\"Sociology\">Sociology</option>\n\t\t\t <option value=\"Economics\">Economics</option>\n\t\t\t <option value=\"Accounts\">Accounts</option>\n\t\t\t <option value=\"History\">History</option>\n\t\t\t <option value=\"Finance\">Finance</option>\n\t\t\t <option value=\"Statistics\">Statistics</option>\n\t\t\t <option value=\"Civics\">Civics</option>\n\t\t\t <option value=\"Music\">Music</option>\n\t\t\t</select>\n\n\n\t\t';\n\t}", "public function render()\n {\n $fromList = array();\n $this->getFromList($fromList);\n $value = $this->getValue()!==null?$this->getValue():$this->getDefaultValue();\n $valueArray = explode(',', $value);\n \n $disabledStr = ($this->getEnabled() == \"N\") ? \"DISABLED=\\\"true\\\"\" : \"\";\n $style = $this->getStyle();\n $func = $this->getFunction();\n\n //$sHTML = \"<SELECT NAME=\\\"\" . $this->objectName . \"[]\\\" ID=\\\"\" . $this->objectName .\"\\\" $disabledStr $this->htmlAttr $style $func>\";\n $sHTML = \"<SELECT NAME=\\\"\" . $this->objectName . \"\\\" ID=\\\"\" . $this->objectName .\"\\\" $disabledStr $this->htmlAttr $style $func>\";\n\n if ($this->blankOption) // ADD a blank option\n {\n $entry = explode(\",\",$this->blankOption);\n $text = $entry[0];\n $value = ($entry[1]!= \"\") ? $entry[1] : null;\n $entryList = array(array(\"val\" => $value, \"txt\" => $text ));\n $fromList = array_merge($entryList, $fromList);\n }\n\n $defaultValue = null;\n foreach ($fromList as $option)\n {\n $test = array_search($option['val'], $valueArray);\n if ($test === false)\n {\n $selectedStr = '';\n }\n else\n {\n $selectedStr = \"SELECTED\";\n $defaultValue = $option['val']; \n }\n $sHTML .= \"<OPTION VALUE=\\\"\" . $option['val'] . \"\\\" $selectedStr>\" . $option['txt'] . \"</OPTION>\";\n }\n if($defaultValue == null){\n \t$defaultOpt = array_shift($fromList);\n \t$defaultValue = $defaultOpt['val'];\n \tarray_unshift($fromList,$defaultOpt);\n }\n \n \n $this->setValue($defaultValue);\n $sHTML .= \"</SELECT>\";\n return $sHTML;\n }", "public function index()\n {\n $folders = Folder::query()->where('status', 1)->where('parent_id', null)->get();\n $categories = Category::query()->where('status', 1)->get();\n $languages = Language::query()->get();\n $types = Type::query()->get();\n\n $title = null;\n $author = null;\n $category_selected = null;\n $type_selected = null;\n $document_number = null;\n $language_selected = null;\n\n return view('folders.index', [\n 'folders' => $folders,\n 'categories' => $categories,\n 'languages' => $languages,\n 'types' => $types,\n 'title' => $title,\n 'author' => $author,\n 'category_selected' => $category_selected,\n 'type_selected' => $type_selected,\n 'document_number' => $document_number,\n 'language_selected' => $language_selected\n ]);\n }", "function albumselect($id=\"album\")\r\n{\r\n global $xoopsDB, $myts;\r\n static $select = \"\";\r\n\r\n if ($select == \"\"){\r\n $sql = \"SELECT aid, title, category \".\r\n \"FROM \".$xoopsDB->prefix(\"xcgal_albums\").\" \".\r\n \"ORDER BY title\";\r\n $result = $xoopsDB->query($sql);\r\n $user_handler =& xoops_gethandler('member');\r\n while ($row = $xoopsDB->fetchArray($result)) {\r\n $alb_owner =& $user_handler->getUser($row['category']-FIRST_USER_CAT);\r\n if (is_object ($alb_owner)) $row[\"title\"]= \"- (\".$alb_owner->uname().\")\".$row[\"title\"];\r\n $select .= \"<option value=\\\"\" . $row[\"aid\"] . \"\\\">\" . $myts->makeTboxData4Show($row[\"title\"]) . \"</option>\";\r\n }\r\n $xoopsDB->freeRecordSet($result);\r\n }\r\n\r\n return \"<select name=\\\"$id\\\" class=\\\"listbox\\\">\".$select.\"</select>\";\r\n}", "function getDropDown() ;", "function fsf_cms_getStatsPages_dropDown()\n {\n $fsfcms_api_options = array();\n $fsfcms_api_options['apiFile'] = \"fsf.cms.getStatsPages.php\";\n\n $fsfcms_stats_pages_json = fsf_cms_accessAPI($fsfcms_api_options);\n $fsfcms_stats_pages = json_decode($fsfcms_stats_pages_json,TRUE);\n \n if(array_pop($fsfcms_stats_pages) == 200)\n {\n $fsfcms_statsPages_select .= \"<select name=\\\"statsPages\\\" onchange=\\\"self.location.href=this.options[this.selectedIndex].value;\\\">\";\n $fsfcms_statsPages_select .= \"<option value=\\\"\\\">SELECT AN OPTION...</option>\";\n\n foreach($fsfcms_stats_pages as $fsfcms_page_name => $fsfcms_page_slug)\n {\n $fsfcms_statsPages_select .= \"<option value=\\\"/statistics/\" . $fsfcms_page_slug . \"\\\">\" . strtoupper($fsfcms_page_name) . \"</option>\"; \n }\n $fsfcms_statsPages_select .= \"</select>\";\n }\n \n return $fsfcms_statsPages_select; \n }", "public static function defaultSelectionLabel(): string\n {\n return Craft::t('app', 'Select organization');\n }", "public function render_content()\n {\n ?>\n <label>\n\t\t\t<select <?php $this->link(); ?>>\n\t\t\t\t<?php\n\t\t\t\tprintf('<option value=\"%s\" %s>%s</option>', 'none', selected($this->value(), 'none', false), 'none');\n\t\t\t\tprintf('<option value=\"%s\" %s>%s</option>', 'capitalize', selected($this->value(), 'capitalize', false), 'capitalize');\n\t\t\t\tprintf('<option value=\"%s\" %s>%s</option>', 'uppercase', selected($this->value(), 'uppercase', false), 'uppercase');\n\t\t\t\tprintf('<option value=\"%s\" %s>%s</option>', 'lowercase', selected($this->value(), 'lowercase', false), 'lowercase');\n\t\t\t\t?>\n </select>\n\t\t\t<p class=\"description\"><?php echo esc_html( $this->label ); ?></p>\n </label>\n <?php\n }", "public function render()\n {\n return view('laravel-bootstrap::components.dropdown-item');\n }", "function buildSkinList()\r\n\t{\r\n\t\tglobal $uname;\r\n\t\techo \"<select name='uskin'>\\n\";\r\n\t\t$start=\"image/skin/\";\r\n\t\tif($dir=opendir($start))\r\n\t\t{\r\n\t\t\twhile (($file=readdir($dir))==TRUE)\r\n\t\t\t{\r\n\t\t\t\tif ($file!=\".\" and $file!=\"..\")\r\n\t\t\t\t{\r\n\t\t\t\t\techo \"<option value='\" . $file . \"' \";\r\n\t\t\t\t\tif (getFile(\"users/\" . $uname . \".skin\")==$file) echo \"Selected\";\r\n\t\t\t\t\techo \"> \" . $file . \"\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tclosedir($dir);\r\n\t\t}\r\n\t\techo \"</select>\\n\";\r\n\t}", "function buildLanguageMenu($inheritselection, $alanguage)\n{\n if (pnConfigGetVar('multilingual')) {\n if($inheritselection==true) { // && !empty($alanguage)){ Fix preventing alanguage staying chosen after preview.\n $lang = languagelist();\n if (!$alanguage) {\n $sel_lang[0] = ' selected=\"selected\"';\n } else {\n $sel_lang[0] = '';\n $sel_lang[$alanguage] = ' selected=\"selected\"';\n }\n print '<br /><strong>'._LANGUAGE.': </strong>' /* ML Dropdown with available languages to update */\n .'<select name=\"alanguage\">'\n .'<option value=\"\" '.$sel_lang[0].'>'._ALL.'</option>' ;\n $handle = opendir('language');\n while ($f = readdir($handle)) {\n if (is_dir(\"language/$f\") && (!empty($lang[$f]))) {\n $langlist[$f] = $lang[$f];\n }\n }\n asort($langlist);\n // a bit ugly, but it works in E_ALL conditions (Andy Varganov)\n foreach ($langlist as $k=>$v) {\n echo '<option value=\"'.$k.'\"';\n if (isset($sel_lang[$k])) {\n echo ' selected=\"selected\"';\n }\n echo '>'. $v . '</option>';\n }\n echo '</select>';\n } else {\n print '<br /><strong>'._LANGUAGE.': </strong>&nbsp;';\n lang_dropdown();\n }\n } else {\n echo '<input type=\"hidden\" name=\"alanguage\" value=\"\" />';\n }\n\n}", "public function renderCategoriesSelectHTML()\n {\n static $categories;\n\n if (! is_array($categories)) {\n $categories = Category::all();\n }\n\n $list_items = [];\n\n foreach ($categories as $category) {\n // always start only from the top parent categories in the tree\n if (0 === $category->category_parent_id) {\n $list_items[] = $this->renderCategorySelectHTML($category);\n }\n }\n\n $list_items = implode('', $list_items);\n\n if ('' === trim($list_items)) {\n return '';\n }\n\n return '<select id=\"select21\" class=\"form-control\" name=\"parent_category\">' . $list_items . '</select>';\n }", "public function drawSelectFileList($path, $filematch, $showtag, $preselectedvalue, $addblank, $translateoptions, $fieldtype = \"set\")\n {\n $keys = array();\n $keys[] = \"\";\n\n if ($showtag) {\n $showtag = \"_\" . $showtag;\n }\n\n if (is_dir($this->query->reports_path)) {\n $testpath = $this->query->reports_path;\n } else {\n $testpath = ReporticoUtility::findBestLocationInIncludePath($this->query->reports_path);\n }\n\n if (is_dir($testpath)) {\n if ($dh = opendir($testpath)) {\n while (($file = readdir($dh)) !== false) {\n if (preg_match($filematch, $file)) {\n $keys[] = $file;\n }\n\n }\n closedir($dh);\n }\n } else {\n trigger_error(ReporticoLang::templateXlate(\"NOOPENDIR\") . $this->query->reports_path, E_USER_NOTICE);\n }\n\n $text = $this->drawArrayDropdown($fieldtype . \"_\" . $this->id . $showtag, $keys, $preselectedvalue, true, false);\n return $text;\n }", "function SetupListOptions() {\n\t\tglobal $Security, $Language;\n\n\t\t// Add group option item\n\t\t$item = &$this->ListOptions->Add($this->ListOptions->GroupOptionName);\n\t\t$item->Body = \"\";\n\t\t$item->OnLeft = TRUE;\n\t\t$item->Visible = FALSE;\n\n\t\t// \"view\"\n\t\t$item = &$this->ListOptions->Add(\"view\");\n\t\t$item->CssStyle = \"white-space: nowrap;\";\n\t\t$item->Visible = $Security->CanView();\n\t\t$item->OnLeft = TRUE;\n\n\t\t// \"edit\"\n\t\t$item = &$this->ListOptions->Add(\"edit\");\n\t\t$item->CssStyle = \"white-space: nowrap;\";\n\t\t$item->Visible = $Security->CanEdit();\n\t\t$item->OnLeft = TRUE;\n\n\t\t// \"copy\"\n\t\t$item = &$this->ListOptions->Add(\"copy\");\n\t\t$item->CssStyle = \"white-space: nowrap;\";\n\t\t$item->Visible = $Security->CanAdd();\n\t\t$item->OnLeft = TRUE;\n\n\t\t// \"delete\"\n\t\t$item = &$this->ListOptions->Add(\"delete\");\n\t\t$item->CssStyle = \"white-space: nowrap;\";\n\t\t$item->Visible = $Security->CanDelete();\n\t\t$item->OnLeft = TRUE;\n\n\t\t// List actions\n\t\t$item = &$this->ListOptions->Add(\"listactions\");\n\t\t$item->CssStyle = \"white-space: nowrap;\";\n\t\t$item->OnLeft = TRUE;\n\t\t$item->Visible = FALSE;\n\t\t$item->ShowInButtonGroup = FALSE;\n\t\t$item->ShowInDropDown = FALSE;\n\n\t\t// \"checkbox\"\n\t\t$item = &$this->ListOptions->Add(\"checkbox\");\n\t\t$item->Visible = FALSE;\n\t\t$item->OnLeft = TRUE;\n\t\t$item->Header = \"<input type=\\\"checkbox\\\" name=\\\"key\\\" id=\\\"key\\\" onclick=\\\"ew_SelectAllKey(this);\\\">\";\n\t\t$item->MoveTo(0);\n\t\t$item->ShowInDropDown = FALSE;\n\t\t$item->ShowInButtonGroup = FALSE;\n\n\t\t// Drop down button for ListOptions\n\t\t$this->ListOptions->UseImageAndText = TRUE;\n\t\t$this->ListOptions->UseDropDownButton = FALSE;\n\t\t$this->ListOptions->DropDownButtonPhrase = $Language->Phrase(\"ButtonListOptions\");\n\t\t$this->ListOptions->UseButtonGroup = TRUE;\n\t\tif ($this->ListOptions->UseButtonGroup && ew_IsMobile())\n\t\t\t$this->ListOptions->UseDropDownButton = TRUE;\n\t\t$this->ListOptions->ButtonClass = \"btn-sm\"; // Class for button group\n\n\t\t// Call ListOptions_Load event\n\t\t$this->ListOptions_Load();\n\t\t$this->SetupListOptionsExt();\n\t\t$item = &$this->ListOptions->GetItem($this->ListOptions->GroupOptionName);\n\t\t$item->Visible = $this->ListOptions->GroupOptionVisible();\n\t}", "function _formPathHTML($templateName = \"neueVorlage\", $myid = 0)\n\t{\n\t\tglobal $l_we_class;\n\t\t\n\t\tinclude_once ($_SERVER[\"DOCUMENT_ROOT\"] . \"/webEdition/we/include/we_classes/weSuggest.class.inc.php\");\n\t\t\n\t\t$path = id_to_path($myid, TEMPLATES_TABLE);\n\t\t$we_button = new we_button();\n\t\t$table = TEMPLATES_TABLE;\n\t\t$textname = 'templateDirName';\n\t\t$idname = 'templateParentID';\n\t\t\n\t\t$button = $we_button->create_button(\n\t\t\t\t\"select\", \n\t\t\t\t\"javascript:we_cmd('openDirselector',document.forms['we_form'].elements['$idname'].value,'$table','document.forms[\\\\'we_form\\\\'].elements[\\\\'$idname\\\\'].value','document.forms[\\\\'we_form\\\\'].elements[\\\\'$textname\\\\'].value','','\" . session_id() . \"')\");\n\t\t\n\t\t$yuiSuggest = & weSuggest::getInstance();\n\t\t$yuiSuggest->setAcId(\"TplPath\");\n\t\t$yuiSuggest->setContentType(\"folder\");\n\t\t$yuiSuggest->setInput($textname, $path);\n\t\t$yuiSuggest->setResult($idname, 0);\n\t\t$yuiSuggest->setLabel($l_we_class[\"dir\"]);\n\t\t$yuiSuggest->setMaxResults(20);\n\t\t$yuiSuggest->setMayBeEmpty(1);\n\t\t$yuiSuggest->setWidth(320);\n\t\t$yuiSuggest->setTable($table);\n\t\t$yuiSuggest->setSelector(\"Dirselector\");\n\t\t$yuiSuggest->setSelectButton($button);\n\t\t$dirChooser = $yuiSuggest->getYuiFiles() . $yuiSuggest->getHTML() . $yuiSuggest->getYuiCode();\n\t\t\n\t\t/*\n\t\t\n\t\t$dirChooser = htmlFormElementTable(htmlTextInput($textname,30,$path,\"\",' readonly',\"text\",320,0),\n\t\t\t$l_we_class[\"dir\"],\n\t\t\t\"left\",\n\t\t\t\"defaultfont\",\n\t\t\thidden($idname,0),\n\t\t\tgetPixel(20,4),\n\t\t\t$button);\n*/\n\t\t\n\t\t$content = '\n\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin-top:10px;\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t' . htmlFormElementTable(\n\t\t\t\thtmlTextInput(\"templateName\", 30, $templateName, 255, \"\", \"text\", 320), \n\t\t\t\t$GLOBALS[\"l_siteimport\"][\"nameOfTemplate\"]) . '</td>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t' . htmlFormElementTable(\n\t\t\t\t'<span class=\"defaultfont\"><b>.tmpl</b></span>', \n\t\t\t\t$l_we_class[\"extension\"]) . '</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t' . getPixel(20, 4) . '</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t' . getPixel(20, 2) . '</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t' . getPixel(100, 2) . '</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"3\">\n\t\t\t\t\t\t' . $dirChooser . '</td>\n\t\t\t\t</tr>\n\t\t\t</table>';\n\t\treturn $content;\n\t}", "static function getTypeMenuoptions($selected='')\n {\n if (empty(self::$arrExtensions2Mimetypes)) self::init();\n $strMenuoptions = '';\n foreach (self::$arrExtensions2Mimetypes as $extension => $arrType) {\n $mimetype = $arrType['mimetype'];\n $strMenuoptions .=\n '<option value=\"'.$mimetype.'\"'.\n ($selected == $mimetype ? ' selected=\"selected\"' : '').\n \">$mimetype ($extension)</option>\\n\";\n }\n return $strMenuoptions;\n }", "public function dropDownMediaStatus($selected = \"\")\n{\n $name = 'media_status';\n\n $media_status = array('Enabled', 'Disabled');\n\n if ($selected) {\n\n $selected = $selected;\n\n }\n\n return dropdown($name, $media_status, $selected);\n\n}", "function _getMediaTypeMenu($name, $selectedType, $attrs)\r\n {\r\n global $_ARRAYLANG, $_CORELANG;\r\n\r\n $menu = \"<select name=\\\"\".$name.\"\\\" \".$attrs.\">\";\r\n foreach ($this->_arrMediaTypes as $type => $text) {\r\n if (!$this->_checkForModule($type)) {\r\n continue;\r\n }\r\n $text = $_ARRAYLANG[$text];\r\n if (empty($text)) {\r\n $text = $_CORELANG[$text];\r\n }\r\n $menu .= \"<option value=\\\"\".$type.\"\\\"\".($selectedType == $type ? \" selected=\\\"selected\\\"\" : \"\").\">\".$text.\"</option>\\n\";\r\n }\r\n $menu .= \"</select>\";\r\n return $menu;\r\n }", "function getFilesPanel() {\n $result = '';\n\n if ($this->params['filter_mode'] == 'tags' && isset($this->params['tag_id'])) {\n $files = $this->getFilesByTag(\n $this->params['tag_id'],\n $this->params['limit_files'],\n $this->params['offset_files'],\n $this->params['file_sort'],\n $this->params['file_order']\n );\n $tag = $this->getBaseTags()->getTags(\n $this->params['tag_id'],\n $this->lngSelect->currentLanguageId\n );\n $title = sprintf($this->_gt('Files by tag \"%s\"'), $tag[$this->params['tag_id']]['tag_title']);\n } elseif ($this->params['filter_mode'] == 'search') {\n if (isset($this->params['search']['q'])) {\n $this->params['search']['q'] = trim($this->params['search']['q']);\n } else {\n $this->params['search']['q'] = '';\n }\n $files = $this->findFiles(\n $this->params['search'],\n $this->params['limit_files'],\n $this->params['offset_files'],\n $this->params['file_sort'],\n $this->params['file_order']\n );\n $title = $this->_gt('Files for search');\n } elseif (isset($this->params['folder_id'])) {\n $files = $this->getFiles(\n $this->params['folder_id'],\n $this->params['limit_files'],\n $this->params['offset_files'],\n $this->params['file_sort'],\n $this->params['file_order']\n );\n if ($this->params['folder_id'] == 0) {\n $title = $this->_gt('Desktop');\n } else {\n $title = $this->currentFolder['folder_name'];\n }\n }\n\n if (isset($files) && is_array($files) && count($files) > 0) {\n $viewMode = 'list';\n if (isset($this->params['mode_view'])) {\n switch ($this->params['mode_view']) {\n case 'tile' :\n case 'list' :\n case 'thumbs' :\n $viewMode = $this->params['mode_view'];\n break;\n }\n }\n $result .= sprintf(\n '<dialog title=\"%s\" action=\"%s#top\" id=\"mediaFilesList\">'.LF,\n papaya_strings::escapeHTMLChars($title),\n papaya_strings::escapeHTMLChars($this->getBaseLink())\n );\n $result .= sprintf(\n '<listview mode=\"%s\">'.LF,\n papaya_strings::escapeHTMLChars($viewMode)\n );\n\n $result .= $this->getFilesPagingBar(\n $this->absCount, $this->params['limit_files'], $this->params['offset_files']\n );\n\n if (is_array($files) && count($files) > 0) {\n if ($this->params['file_sort'] == 'date') {\n if ($this->params['file_order'] == 'asc') {\n $sortLinkDateParams = array('file_sort' => 'date', 'file_order' => 'desc');\n $sortImageDate = 'asc';\n } else {\n $sortLinkDateParams = array('file_sort' => 'date', 'file_order' => 'asc');\n $sortImageDate = 'desc';\n }\n $sortImageName = 'none';\n $sortImageSize = 'none';\n $sortLinkNameParams = array('file_sort' => 'name', 'file_order' => 'asc');\n $sortLinkSizeParams = array('file_sort' => 'size', 'file_order' => 'asc');\n } elseif ($this->params['file_sort'] == 'name') {\n if ($this->params['file_order'] == 'asc') {\n $sortLinkNameParams = array('file_sort' => 'name', 'file_order' => 'desc');\n $sortImageName = 'asc';\n } else {\n $sortLinkNameParams = array('file_sort' => 'name', 'file_order' => 'asc');\n $sortImageName = 'desc';\n }\n $sortImageDate = 'none';\n $sortImageSize = 'none';\n $sortLinkDateParams = array('file_sort' => 'date', 'file_order' => 'asc');\n $sortLinkSizeParams = array('file_sort' => 'size', 'file_order' => 'asc');\n } else {\n if ($this->params['file_order'] == 'asc') {\n $sortLinkSizeParams = array('file_sort' => 'size', 'file_order' => 'desc');\n $sortImageSize = 'asc';\n } else {\n $sortLinkSizeParams = array('file_sort' => 'size', 'file_order' => 'asc');\n $sortImageSize = 'desc';\n }\n $sortImageDate = 'none';\n $sortImageName = 'none';\n $sortLinkDateParams = array('file_sort' => 'date', 'file_order' => 'asc');\n $sortLinkNameParams = array('file_sort' => 'name', 'file_order' => 'asc');\n }\n\n $result .= '<cols>'.LF;\n if ($viewMode != 'tile') {\n $result .= '<col />'.LF;\n $result .= '<col />'.LF;\n }\n $result .= sprintf(\n '<col href=\"%s\" sort=\"%s\">%s</col>'.LF,\n papaya_strings::escapeHTMLChars($this->getLink($sortLinkNameParams)),\n papaya_strings::escapeHTMLChars($sortImageName),\n papaya_strings::escapeHTMLChars($this->_gt('Filename'))\n );\n $result .= sprintf(\n '<col href=\"%s\" sort=\"%s\">%s</col>'.LF,\n papaya_strings::escapeHTMLChars($this->getLink($sortLinkDateParams)),\n papaya_strings::escapeHTMLChars($sortImageDate),\n papaya_strings::escapeHTMLChars($this->_gt('Uploaded'))\n );\n $result .= sprintf(\n '<col href=\"%s\" sort=\"%s\">%s</col>'.LF,\n papaya_strings::escapeHTMLChars($this->getLink($sortLinkSizeParams)),\n papaya_strings::escapeHTMLChars($sortImageSize),\n papaya_strings::escapeHTMLChars($this->_gt('Filesize'))\n );\n $result .= '</cols>'.LF;\n $result .= '<items>'.LF;\n foreach ($files as $fileId => $file) {\n $editLink = $this->getLink(array('cmd' => 'edit_file', 'file_id' => $fileId));\n if ($file['mimetype_icon'] != '') {\n $icon = $file['mimetype_icon'];\n } else {\n $icon = $this->defaultTypeIcon;\n }\n $selected = (isset($this->params['file_id']) && $this->params['file_id'] == $fileId)\n ? ' selected=\"selected\"' : '';\n if (strlen($file['file_name']) > 30) {\n $name = papaya_strings::escapeHTMLChars(\n papaya_strings::truncate(\n $file['file_name'], 30, '', '...'.substr($file['file_name'], -7)\n )\n );\n } else {\n $name = papaya_strings::escapeHTMLChars($file['file_name']);\n }\n $hint = papaya_strings::escapeHTMLChars($file['file_name']);\n if (in_array($viewMode, array('tile', 'thumbs'))) {\n $icon = $this->mimeObj->getMimeTypeIcon($icon);\n if (in_array($file['mimetype'], $this->imageMimeTypes)) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_thumbnail.php');\n $thumbnail = new base_thumbnail;\n $thumbFile = $thumbnail->getThumbnail(\n $file['file_id'],\n $file['current_version_id'],\n ($viewMode == 'thumbs') ? 100 : 48,\n ($viewMode == 'thumbs') ? 80 : 48\n );\n if ($thumbFile) {\n $icon = $this->getWebMediaLink(\n $thumbFile, 'thumb', $name\n );\n }\n }\n $result .= sprintf(\n '<listitem href=\"%s\" image=\"%s\" title=\"%s\" subtitle=\"%s\" hint=\"%s\" %s>'.LF,\n papaya_strings::escapeHTMLChars($editLink),\n papaya_strings::escapeHTMLChars($icon),\n papaya_strings::escapeHTMLChars($name),\n date('Y-m-d H:i', $file['file_date']),\n papaya_strings::escapeHTMLChars($hint),\n $selected\n );\n $checked = (isset($this->params['batch_files'][$fileId])) ? ' checked=\"checked\"' : '';\n $idName = 'mdb_batch_files_'.$fileId;\n $result .= sprintf(\n '<subitem align=\"center\"><input type=\"checkbox\" name=\"%s[batch_files][%s]\"'.\n ' id=\"%s\" value=\"1\" %s/></subitem>'.LF,\n papaya_strings::escapeHTMLChars($this->paramName),\n papaya_strings::escapeHTMLChars($fileId),\n papaya_strings::escapeHTMLChars($idName),\n $checked\n );\n $result .= '</listitem>'.LF;\n } else {\n $result .= sprintf(\n '<listitem href=\"%s\" image=\"%s\" %s>'.LF,\n papaya_strings::escapeHTMLChars($editLink),\n papaya_strings::escapeHTMLChars($this->mimeObj->getMimeTypeIcon($icon)),\n $selected\n );\n $checked = (isset($this->params['batch_files'][$fileId])) ? ' checked=\"checked\"' : '';\n $idName = 'mdb_batch_files_'.$fileId;\n $result .= sprintf(\n '<subitem align=\"center\"><input type=\"checkbox\" name=\"%s[batch_files][%s]\"'.\n ' id=\"%s\" value=\"1\" %s/></subitem>'.LF,\n papaya_strings::escapeHTMLChars($this->paramName),\n papaya_strings::escapeHTMLChars($fileId),\n papaya_strings::escapeHTMLChars($idName),\n $checked\n );\n $result .= sprintf(\n '<subitem overflow=\"hidden\"><a href=\"%s\" title=\"%s\"'.\n ' style=\"display: block; overflow: hidden;\">%s</a></subitem>'.LF,\n papaya_strings::escapeHTMLChars($editLink),\n papaya_strings::escapeHTMLChars($hint),\n papaya_strings::escapeHTMLChars($name)\n );\n $result .= sprintf(\n '<subitem align=\"center\" wrap=\"nowrap\">%s</subitem>'.LF,\n date('Y-m-d H:i', $file['file_date'])\n );\n $result .= sprintf(\n '<subitem align=\"center\" wrap=\"nowrap\">%s</subitem>'.LF,\n papaya_strings::escapeHTMLChars($this->formatFileSize($file['file_size']))\n );\n $result .= '</listitem>'.LF;\n }\n }\n $result .= '</items>'.LF;\n }\n $result .= '</listview>'.LF;\n if ($viewMode != 'thumbs') {\n $result .= sprintf(\n '<dlgbutton type=\"button\" caption=\"%s\" hint=\"%s\"'.\n ' onclick=\"invertCheckBoxes(this);\" image=\"%s\"/>'.LF,\n papaya_strings::escapeHTMLChars($this->_gt('Invert Selection')),\n papaya_strings::escapeHTMLChars($this->_gt('Invert Selection')),\n papaya_strings::escapeHTMLChars($this->images['status-node-checked'])\n );\n $result .= sprintf(\n '<dlgbutton name=\"%s[batch_cmd][cut]\" value=\"1\" caption=\"%s\" hint=\"%s\" image=\"%s\"/>'.LF,\n papaya_strings::escapeHTMLChars($this->paramName),\n papaya_strings::escapeHTMLChars($this->_gt('Cut')),\n papaya_strings::escapeHTMLChars($this->_gt('Cut')),\n papaya_strings::escapeHTMLChars($this->images['actions-edit-cut'])\n );\n $result .= sprintf(\n '<dlgbutton name=\"%s[batch_cmd][move]\" value=\"1\" caption=\"%s\" hint=\"%s\" image=\"%s\"/>'.LF,\n papaya_strings::escapeHTMLChars($this->paramName),\n papaya_strings::escapeHTMLChars($this->_gt('Move')),\n papaya_strings::escapeHTMLChars($this->_gt('Move')),\n papaya_strings::escapeHTMLChars($this->images['actions-page-move'])\n );\n $result .= sprintf(\n '<dlgbutton name=\"%s[batch_cmd][delete]\" value=\"1\" caption=\"%s\"'.\n ' hint=\"%s\" image=\"%s\"/>'.LF,\n papaya_strings::escapeHTMLChars($this->paramName),\n papaya_strings::escapeHTMLChars($this->_gt('Delete')),\n papaya_strings::escapeHTMLChars($this->_gt('Delete')),\n papaya_strings::escapeHTMLChars($this->images['places-trash'])\n );\n $result .= sprintf(\n '<dlgbutton name=\"%s[batch_cmd][tags]\" value=\"1\" caption=\"%s\" hint=\"%s\" image=\"%s\"/>'.LF,\n papaya_strings::escapeHTMLChars($this->paramName),\n papaya_strings::escapeHTMLChars($this->_gt('Tag')),\n papaya_strings::escapeHTMLChars($this->_gt('Tag')),\n papaya_strings::escapeHTMLChars($this->images['items-tag'])\n );\n }\n $result .= '</dialog>'.LF;\n }\n return $result;\n }", "public function callback_select( $args ) {\n\n $name_id = $args['name_id'];\n if ($args['parent']) {\n $value = $this->get_option( $args['parent']['id'], $args['section'], $args['std'], $args['global'] );\n $value = isset($value[$args['id']]) ? $value[$args['id']] : $args['std'];\n $args['disable'] = (isset( $args['parent']['disable'])) ? $args['parent']['disable'] : false;\n }else {\n $value = $this->get_option( $args['id'], $args['section'], $args['std'], $args['global'] );\n }\n\n $disable = (isset( $args['disable'] ) && $args['disable'] === true) ? 'disabled' : '';\n $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';\n $html = sprintf( '<select class=\"%1$s\" name=\"%2$s\" id=\"%2$s\" %3$s>', $size, $name_id, $disable );\n\n foreach ( $args['options'] as $key => $label ) {\n $html .= sprintf( '<option value=\"%s\" %s>%s</option>', $key, selected( $value, $key, false ), $label );\n }\n\n $html .= sprintf( '</select>' );\n $html .= $this->get_field_description( $args );\n\n echo $html;\n }", "function ntg_theme_settings_style_box() {\n $style = genesis_get_option('style_selection') ? genesis_get_option('style_selection') : 'style.css';\n?>\n\n <p><label><?php _e('Style Sheet', 'gsselect'); ?>: \n <select name=\"<?php echo GENESIS_SETTINGS_FIELD; ?>[style_selection]\">\n <?php\n foreach ( glob(CHILD_DIR . \"/*.css\") as $file ) {\n $file = str_replace( CHILD_DIR . '/', '', $file );\n \n if( ! genesis_style_check( $file, 'genesis' )){\n continue;\n }\n \n ?>\n \n <option style=\"padding-right:10px;\" value=\"<?php echo esc_attr( $file ); ?>\" <?php selected($file, $style); ?>><?php echo esc_html( $file ); ?></option>\n \n <?php } ?>\n </select>\n </label></p>\n <p><span class=\"description\">Please select your desired <b>Style Sheet</b> from the drop down list and save your settings.</span></p>\n <p><span class=\"description\"><b>Note:</b> Only Genesis style sheets in the Child theme directory will be included in the list.</span></p>\n<?php\n}", "public function render()\n {\n return view('components.user-dropdown');\n }", "function getLodDropDown($PROJECT, $FORM_ITEM_NAME, $MULTIPLE_SELECT) {\n $SCM_SCRIPTS_DIR = \"/opt/build/scm/scripts/buildServer/groovy\";\n\t//echo $SCM_SCRIPTS_DIR;\n $SOURCE_INFO = \"source /opt/cvbuild/.bash_profile 2>&1\";\n // get an array for each branch\n $lods = array();\n// $getLodCmd = $SOURCE_INFO . ' 2>&1 && cd ' .$SCM_SCRIPTS_DIR . ' 2>&1 && bin/eval.sh groovy scm.groovy -c GetLodsForProject --log_level=' . $LOG_LEVEL . ' --project=' . $PROJECT . ' --path_to_project=' . $PATH_TO_PROJECT; \n $getLodCmd = 'bash -c \"'. $SOURCE_INFO . ' 2>&1 && cd ' .$SCM_SCRIPTS_DIR . ' 2>&1 && bin/eval.sh groovy scm.groovy -c GetLodsForProject --log_level=INFO --project=' . $PROJECT . ' --path_to_project=/opt/checkouts\"'; \n// $getLodCmd = 'bash -c \"'. $SOURCE_INFO . ' 2>&1 && cd ' .$SCM_SCRIPTS_DIR . ' 2>&1 && bin/eval.sh groovy scm.groovy -c GetTagsForProject --log_level=INFO --project=' . $PROJECT . ' --path_to_project=/opt/checkouts\"';\n exec($getLodCmd . ' | egrep -e \"^br_*\"', $lods);\n// exec($getLodCmd . ' | egrep -e \"^r_*\"', $lods);\n usort($lods, 'lodWLevelCompare');\n $lods = array_reverse($lods);\n\n if($MULTIPLE_SELECT == 'true') {\n $output = '<select name=\"' . $FORM_ITEM_NAME . '\" ' . 'multiple=\"multiple\" size=\"5\">';\n }\n else {\n $output = '<select name=\"' . $FORM_ITEM_NAME . '\">';\n }\n foreach ($lods as $lod) {\n $lod = str_replace('/','',$lod);\n $output = $output . '<option value=\"' . $lod . '\">' . $lod . '</option>';\n }\n $output = $output. '</select>';\n return $output;\n}", "function pdl_selector($uid,$current=\"\") {\n\n\t$o = '';\n\n\t// You can use anybody's Comanche layouts on this site that haven't been protected in some way\n\n\t$sql_extra = item_permissions_sql($uid);\n\n\t// By default order by title (therefore at this time pdl's need a unique title across this system), \n\t// though future work may allow categorisation\n\t// based on taxonomy terms\n\n\t$r = q(\"select title, mid from item where (item_restrict & %d) $sql_extra order by title\",\n\t\tintval(ITEM_PDL)\n\t);\n\n\t$arr = array('channel_id' => $uid, 'current' => $current, 'entries' => $r);\n\tcall_hooks('pdl_selector',$arr);\n\n\t$entries = $arr['entries'];\n\t$current = $arr['current'];\t\t\n \n\t$o .= \"<select name=\\\"pdl_select\\\" id=\\\"pdl_select\\\" size=\\\"1\\\" >\";\n\t$entries[] = array('title' => t('Default'), 'mid' => '');\n\tforeach($entries as $selection) {\n\t\t$selected = (($selection == $current) ? ' selected=\"selected\" ' : '');\n\t\t$o .= \"<option value=\\\"{$selection['mid']}\\\" $selected >{$selection['title']}</option>\";\n\t}\n\n\t$o .= '</select>';\n\treturn $o;\n}", "public function dropdownOption(): array\n {\n return [\n 'icon' => 'image',\n 'text' => $this->model->filename(),\n ] + parent::dropdownOption();\n }", "protected function templatesSelectList(){\n $selectList = array('' => 'Default (Vertical List)');\n foreach( $this->templateAndDirectoryList() AS $fileSystemHandle => $path ){\n if( strpos($fileSystemHandle, '.') !== false ){\n $selectList[ $fileSystemHandle ] = substr($this->getHelper('text')->unhandle($fileSystemHandle), 0, strrpos($fileSystemHandle, '.'));\n }else{\n $selectList[ $fileSystemHandle ] = $this->getHelper('text')->unhandle($fileSystemHandle);\n }\n }\n return $selectList;\n }", "public function optionsPage()\r\n {\r\n $this->updateOptions();\r\n include_once($this->path . '/views/options.php');\r\n }", "function WfsLists($path = \"uploads\", $value = null, $selected = '', $size = 1, $emptyselect = 0, $type = 0, $prefix = '', $suffix = '')\r\n {\r\n $this->value = $value;\r\n $this->selection = $selected;\r\n $this->path = $path;\r\n $this->size = intval($size);\r\n $this->emptyselect = ($emptyselect) ? 0 : 1;\r\n $this->type = $type;\r\n }", "public function degreelist(){\n\t\t\t$pgcatname = $this->input->post('stu_prgcate');\n\t\t\t$list = $this->commodel->get_listspfic2('program','','prg_name,prg_id,prg_branch','prg_category',$pgcatname,'prg_name,prg_branch');\n\t\techo \"<select>\";\n\t\techo \"<option disabled selcted>Select Programe</option>\";\n\t\tforeach($list as $datas): \n \t\t \techo \"<option id='degree' value='$datas->prg_id'> \" .\"$datas->prg_name\".'('.$datas->prg_branch.')'.\"</option>\";\n \t\tendforeach;\n\t\techo \"</select>\";\n\t }", "function sfe_language_select_callback() {\n\n\t\tglobal $sfpp_options;\n\n\t\t$sfpp_options['language'] = isset( $sfpp_options['language'] ) && ! empty( $sfpp_options['language'] ) ? $sfpp_options['language'] : 'en_US';\n\n\t\t?>\n\n\t\t<select id=\"sfpp_settings[language]\" class=\"chosen-select\" name=\"sfpp_settings[language]\" title=\"<?php esc_attr__( 'Select language', SIMPLE_FACEBOOK_EMBED_I18N ) ?>\">\n\t\t\t<option value=\"af_ZA\" <?php selected( $sfpp_options['language'], 'af_ZA' ); ?>>Afrikaans</option>\n\t\t\t<option value=\"ak_GH\" <?php selected( $sfpp_options['language'], 'ak_GH' ); ?>>Akan</option>\n\t\t\t<option value=\"am_ET\" <?php selected( $sfpp_options['language'], 'am_ET' ); ?>>Amharic</option>\n\t\t\t<option value=\"ar_AR\" <?php selected( $sfpp_options['language'], 'ar_AR' ); ?>>Arabic</option>\n\t\t\t<option value=\"as_IN\" <?php selected( $sfpp_options['language'], 'as_IN' ); ?>>Assamese</option>\n\t\t\t<option value=\"ay_BO\" <?php selected( $sfpp_options['language'], 'ay_BO' ); ?>>Aymara</option>\n\t\t\t<option value=\"az_AZ\" <?php selected( $sfpp_options['language'], 'az_AZ' ); ?>>Azerbaijani</option>\n\t\t\t<option value=\"be_BY\" <?php selected( $sfpp_options['language'], 'be_BY' ); ?>>Belarusian</option>\n\t\t\t<option value=\"bg_BG\" <?php selected( $sfpp_options['language'], 'bg_BG' ); ?>>Bulgarian</option>\n\t\t\t<option value=\"bn_IN\" <?php selected( $sfpp_options['language'], 'bn_IN' ); ?>>Bengali</option>\n\t\t\t<option value=\"br_FR\" <?php selected( $sfpp_options['language'], 'br_FR' ); ?>>Breton</option>\n\t\t\t<option value=\"bs_BA\" <?php selected( $sfpp_options['language'], 'bs_BA' ); ?>>Bosnian</option>\n\t\t\t<option value=\"ca_ES\" <?php selected( $sfpp_options['language'], 'ca_ES' ); ?>>Catalan</option>\n\t\t\t<option value=\"cb_IQ\" <?php selected( $sfpp_options['language'], 'cb_IQ' ); ?>>Sorani Kurdish</option>\n\t\t\t<option value=\"ck_US\" <?php selected( $sfpp_options['language'], 'ck_US' ); ?>>Cherokee</option>\n\t\t\t<option value=\"co_FR\" <?php selected( $sfpp_options['language'], 'co_FR' ); ?>>Corsican</option>\n\t\t\t<option value=\"cs_CZ\" <?php selected( $sfpp_options['language'], 'cs_CZ' ); ?>>Czech</option>\n\t\t\t<option value=\"cx_PH\" <?php selected( $sfpp_options['language'], 'cx_PH' ); ?>>Cebuano</option>\n\t\t\t<option value=\"cy_GB\" <?php selected( $sfpp_options['language'], 'cy_GB' ); ?>>Welsh</option>\n\t\t\t<option value=\"da_DK\" <?php selected( $sfpp_options['language'], 'da_DK' ); ?>>Danish</option>\n\t\t\t<option value=\"de_DE\" <?php selected( $sfpp_options['language'], 'de_DE' ); ?>>German</option>\n\t\t\t<option value=\"el_GR\" <?php selected( $sfpp_options['language'], 'el_GR' ); ?>>Greek</option>\n\t\t\t<option value=\"en_GB\" <?php selected( $sfpp_options['language'], 'en_GB' ); ?>>English (UK)</option>\n\t\t\t<option value=\"en_IN\" <?php selected( $sfpp_options['language'], 'en_IN' ); ?>>English (India)</option>\n\t\t\t<option value=\"en_PI\" <?php selected( $sfpp_options['language'], 'en_PI' ); ?>>English (Pirate)</option>\n\t\t\t<option value=\"en_UD\" <?php selected( $sfpp_options['language'], 'en_UD' ); ?>>English (Upside Down)</option>\n\t\t\t<option value=\"en_US\" <?php selected( $sfpp_options['language'], 'en_US' ); ?>>English (US)</option>\n\t\t\t<option value=\"eo_EO\" <?php selected( $sfpp_options['language'], 'eo_EO' ); ?>>Esperanto</option>\n\t\t\t<option value=\"es_CO\" <?php selected( $sfpp_options['language'], 'es_CO' ); ?>>Spanish (Colombia)</option>\n\t\t\t<option value=\"es_ES\" <?php selected( $sfpp_options['language'], 'es_ES' ); ?>>Spanish (Spain)</option>\n\t\t\t<option value=\"es_LA\" <?php selected( $sfpp_options['language'], 'es_LA' ); ?>>Spanish</option>\n\t\t\t<option value=\"et_EE\" <?php selected( $sfpp_options['language'], 'et_EE' ); ?>>Estonian</option>\n\t\t\t<option value=\"eu_ES\" <?php selected( $sfpp_options['language'], 'eu_ES' ); ?>>Basque</option>\n\t\t\t<option value=\"fa_IR\" <?php selected( $sfpp_options['language'], 'fa_IR' ); ?>>Persian</option>\n\t\t\t<option value=\"fb_LT\" <?php selected( $sfpp_options['language'], 'fb_LT' ); ?>>Leet Speak</option>\n\t\t\t<option value=\"ff_NG\" <?php selected( $sfpp_options['language'], 'ff_NG' ); ?>>Fulah</option>\n\t\t\t<option value=\"fi_FI\" <?php selected( $sfpp_options['language'], 'fi_FI' ); ?>>Finnish</option>\n\t\t\t<option value=\"fo_FO\" <?php selected( $sfpp_options['language'], 'fo_FO' ); ?>>Faroese</option>\n\t\t\t<option value=\"fr_CA\" <?php selected( $sfpp_options['language'], 'fr_CA' ); ?>>French (Canada)</option>\n\t\t\t<option value=\"fr_FR\" <?php selected( $sfpp_options['language'], 'fr_FR' ); ?>>French (France)</option>\n\t\t\t<option value=\"fy_NL\" <?php selected( $sfpp_options['language'], 'fy_NL' ); ?>>Frisian</option>\n\t\t\t<option value=\"ga_IE\" <?php selected( $sfpp_options['language'], 'ga_IE' ); ?>>Irish</option>\n\t\t\t<option value=\"gl_ES\" <?php selected( $sfpp_options['language'], 'gl_ES' ); ?>>Galician</option>\n\t\t\t<option value=\"gn_PY\" <?php selected( $sfpp_options['language'], 'gn_PY' ); ?>>Guarani</option>\n\t\t\t<option value=\"gu_IN\" <?php selected( $sfpp_options['language'], 'gu_IN' ); ?>>Gujarati</option>\n\t\t\t<option value=\"gx_GR\" <?php selected( $sfpp_options['language'], 'gx_GR' ); ?>>Classical Greek</option>\n\t\t\t<option value=\"ha_NG\" <?php selected( $sfpp_options['language'], 'ha_NG' ); ?>>Hausa</option>\n\t\t\t<option value=\"he_IL\" <?php selected( $sfpp_options['language'], 'he_IL' ); ?>>Hebrew</option>\n\t\t\t<option value=\"hi_IN\" <?php selected( $sfpp_options['language'], 'hi_IN' ); ?>>Hindi</option>\n\t\t\t<option value=\"hr_HR\" <?php selected( $sfpp_options['language'], 'hr_HR' ); ?>>Croatian</option>\n\t\t\t<option value=\"hu_HU\" <?php selected( $sfpp_options['language'], 'hu_HU' ); ?>>Hungarian</option>\n\t\t\t<option value=\"hy_AM\" <?php selected( $sfpp_options['language'], 'hy_AM' ); ?>>Armenian</option>\n\t\t\t<option value=\"id_ID\" <?php selected( $sfpp_options['language'], 'id_ID' ); ?>>Indonesian</option>\n\t\t\t<option value=\"ig_NG\" <?php selected( $sfpp_options['language'], 'ig_NG' ); ?>>Igbo</option>\n\t\t\t<option value=\"is_IS\" <?php selected( $sfpp_options['language'], 'is_IS' ); ?>>Icelandic</option>\n\t\t\t<option value=\"it_IT\" <?php selected( $sfpp_options['language'], 'it_IT' ); ?>>Italian</option>\n\t\t\t<option value=\"ja_JP\" <?php selected( $sfpp_options['language'], 'ja_JP' ); ?>>Japanese</option>\n\t\t\t<option value=\"ja_KS\" <?php selected( $sfpp_options['language'], 'ja_KS' ); ?>>Japanese (Kansai)</option>\n\t\t\t<option value=\"jv_ID\" <?php selected( $sfpp_options['language'], 'jv_ID' ); ?>>Javanese</option>\n\t\t\t<option value=\"ka_GE\" <?php selected( $sfpp_options['language'], 'ka_GE' ); ?>>Georgian</option>\n\t\t\t<option value=\"kk_KZ\" <?php selected( $sfpp_options['language'], 'kk_KZ' ); ?>>Kazakh</option>\n\t\t\t<option value=\"km_KH\" <?php selected( $sfpp_options['language'], 'km_KH' ); ?>>Khmer</option>\n\t\t\t<option value=\"kn_IN\" <?php selected( $sfpp_options['language'], 'kn_IN' ); ?>>Kannada</option>\n\t\t\t<option value=\"ko_KR\" <?php selected( $sfpp_options['language'], 'ko_KR' ); ?>>Korean</option>\n\t\t\t<option value=\"ku_TR\" <?php selected( $sfpp_options['language'], 'ku_TR' ); ?>>Kurdish (Kurmanji)</option>\n\t\t\t<option value=\"la_VA\" <?php selected( $sfpp_options['language'], 'la_VA' ); ?>>Latin</option>\n\t\t\t<option value=\"lg_UG\" <?php selected( $sfpp_options['language'], 'lg_UG' ); ?>>Ganda</option>\n\t\t\t<option value=\"li_NL\" <?php selected( $sfpp_options['language'], 'li_NL' ); ?>>Limburgish</option>\n\t\t\t<option value=\"ln_CD\" <?php selected( $sfpp_options['language'], 'ln_CD' ); ?>>Lingala</option>\n\t\t\t<option value=\"lo_LA\" <?php selected( $sfpp_options['language'], 'lo_LA' ); ?>>Lao</option>\n\t\t\t<option value=\"lt_LT\" <?php selected( $sfpp_options['language'], 'lt_LT' ); ?>>Lithuanian</option>\n\t\t\t<option value=\"lv_LV\" <?php selected( $sfpp_options['language'], 'lv_LV' ); ?>>Latvian</option>\n\t\t\t<option value=\"mg_MG\" <?php selected( $sfpp_options['language'], 'mg_MG' ); ?>>Malagasy</option>\n\t\t\t<option value=\"mk_MK\" <?php selected( $sfpp_options['language'], 'mk_MK' ); ?>>Macedonian</option>\n\t\t\t<option value=\"ml_IN\" <?php selected( $sfpp_options['language'], 'ml_IN' ); ?>>Malayalam</option>\n\t\t\t<option value=\"mn_MN\" <?php selected( $sfpp_options['language'], 'mn_MN' ); ?>>Mongolian</option>\n\t\t\t<option value=\"mr_IN\" <?php selected( $sfpp_options['language'], 'mr_IN' ); ?>>Marathi</option>\n\t\t\t<option value=\"ms_MY\" <?php selected( $sfpp_options['language'], 'ms_MY' ); ?>>Malay</option>\n\t\t\t<option value=\"mt_MT\" <?php selected( $sfpp_options['language'], 'mt_MT' ); ?>>Maltese</option>\n\t\t\t<option value=\"my_MM\" <?php selected( $sfpp_options['language'], 'my_MM' ); ?>>Burmese</option>\n\t\t\t<option value=\"nb_NO\" <?php selected( $sfpp_options['language'], 'nb_NO' ); ?>>Norwegian (bokmal)</option>\n\t\t\t<option value=\"nd_ZW\" <?php selected( $sfpp_options['language'], 'nd_ZW' ); ?>>Ndebele</option>\n\t\t\t<option value=\"ne_NP\" <?php selected( $sfpp_options['language'], 'ne_NP' ); ?>>Nepali</option>\n\t\t\t<option value=\"nl_BE\" <?php selected( $sfpp_options['language'], 'nl_BE' ); ?>>Dutch (België)</option>\n\t\t\t<option value=\"nl_NL\" <?php selected( $sfpp_options['language'], 'nl_NL' ); ?>>Dutch</option>\n\t\t\t<option value=\"nn_NO\" <?php selected( $sfpp_options['language'], 'nn_NO' ); ?>>Norwegian (nynorsk)</option>\n\t\t\t<option value=\"ny_MW\" <?php selected( $sfpp_options['language'], 'ny_MW' ); ?>>Chewa</option>\n\t\t\t<option value=\"or_IN\" <?php selected( $sfpp_options['language'], 'or_IN' ); ?>>Oriya</option>\n\t\t\t<option value=\"pa_IN\" <?php selected( $sfpp_options['language'], 'pa_IN' ); ?>>Punjabi</option>\n\t\t\t<option value=\"pl_PL\" <?php selected( $sfpp_options['language'], 'pl_PL' ); ?>>Polish</option>\n\t\t\t<option value=\"ps_AF\" <?php selected( $sfpp_options['language'], 'ps_AF' ); ?>>Pashto</option>\n\t\t\t<option value=\"pt_BR\" <?php selected( $sfpp_options['language'], 'pt_BR' ); ?>>Portuguese (Brazil)</option>\n\t\t\t<option value=\"pt_PT\" <?php selected( $sfpp_options['language'], 'pt_PT' ); ?>>Portuguese (Portugal)</option>\n\t\t\t<option value=\"qu_PE\" <?php selected( $sfpp_options['language'], 'qu_PE' ); ?>>Quechua</option>\n\t\t\t<option value=\"rm_CH\" <?php selected( $sfpp_options['language'], 'rm_CH' ); ?>>Romansh</option>\n\t\t\t<option value=\"ro_RO\" <?php selected( $sfpp_options['language'], 'ro_RO' ); ?>>Romanian</option>\n\t\t\t<option value=\"ru_RU\" <?php selected( $sfpp_options['language'], 'ru_RU' ); ?>>Russian</option>\n\t\t\t<option value=\"rw_RW\" <?php selected( $sfpp_options['language'], 'rw_RW' ); ?>>Kinyarwanda</option>\n\t\t\t<option value=\"sa_IN\" <?php selected( $sfpp_options['language'], 'sa_IN' ); ?>>Sanskrit</option>\n\t\t\t<option value=\"sc_IT\" <?php selected( $sfpp_options['language'], 'sc_IT' ); ?>>Sardinian</option>\n\t\t\t<option value=\"se_NO\" <?php selected( $sfpp_options['language'], 'se_NO' ); ?>>Northern Sámi</option>\n\t\t\t<option value=\"si_LK\" <?php selected( $sfpp_options['language'], 'si_LK' ); ?>>Sinhala</option>\n\t\t\t<option value=\"sk_SK\" <?php selected( $sfpp_options['language'], 'sk_SK' ); ?>>Slovak</option>\n\t\t\t<option value=\"sl_SI\" <?php selected( $sfpp_options['language'], 'sl_SI' ); ?>>Slovenian</option>\n\t\t\t<option value=\"sn_ZW\" <?php selected( $sfpp_options['language'], 'sn_ZW' ); ?>>Shona</option>\n\t\t\t<option value=\"so_SO\" <?php selected( $sfpp_options['language'], 'so_SO' ); ?>>Somali</option>\n\t\t\t<option value=\"sq_AL\" <?php selected( $sfpp_options['language'], 'sq_AL' ); ?>>Albanian</option>\n\t\t\t<option value=\"sr_RS\" <?php selected( $sfpp_options['language'], 'sr_RS' ); ?>>Serbian</option>\n\t\t\t<option value=\"sv_SE\" <?php selected( $sfpp_options['language'], 'sv_SE' ); ?>>Swedish</option>\n\t\t\t<option value=\"sw_KE\" <?php selected( $sfpp_options['language'], 'sw_KE' ); ?>>Swahili</option>\n\t\t\t<option value=\"sy_SY\" <?php selected( $sfpp_options['language'], 'sy_SY' ); ?>>Syriac</option>\n\t\t\t<option value=\"sz_PL\" <?php selected( $sfpp_options['language'], 'sz_PL' ); ?>>Silesian</option>\n\t\t\t<option value=\"ta_IN\" <?php selected( $sfpp_options['language'], 'ta_IN' ); ?>>Tamil</option>\n\t\t\t<option value=\"te_IN\" <?php selected( $sfpp_options['language'], 'te_IN' ); ?>>Telugu</option>\n\t\t\t<option value=\"tg_TJ\" <?php selected( $sfpp_options['language'], 'tg_TJ' ); ?>>Tajik</option>\n\t\t\t<option value=\"th_TH\" <?php selected( $sfpp_options['language'], 'th_TH' ); ?>>Thai</option>\n\t\t\t<option value=\"tk_TM\" <?php selected( $sfpp_options['language'], 'tk_TM' ); ?>>Turkmen</option>\n\t\t\t<option value=\"tl_PH\" <?php selected( $sfpp_options['language'], 'tl_PH' ); ?>>Filipino</option>\n\t\t\t<option value=\"tl_ST\" <?php selected( $sfpp_options['language'], 'tl_ST' ); ?>>Klingon</option>\n\t\t\t<option value=\"tr_TR\" <?php selected( $sfpp_options['language'], 'tr_TR' ); ?>>Turkish</option>\n\t\t\t<option value=\"tt_RU\" <?php selected( $sfpp_options['language'], 'tt_RU' ); ?>>Tatar</option>\n\t\t\t<option value=\"tz_MA\" <?php selected( $sfpp_options['language'], 'tz_MA' ); ?>>Tamazight</option>\n\t\t\t<option value=\"uk_UA\" <?php selected( $sfpp_options['language'], 'uk_UA' ); ?>>Ukrainian</option>\n\t\t\t<option value=\"ur_PK\" <?php selected( $sfpp_options['language'], 'ur_PK' ); ?>>Urdu</option>\n\t\t\t<option value=\"uz_UZ\" <?php selected( $sfpp_options['language'], 'uz_UZ' ); ?>>Uzbek</option>\n\t\t\t<option value=\"vi_VN\" <?php selected( $sfpp_options['language'], 'vi_VN' ); ?>>Vietnamese</option>\n\t\t\t<option value=\"wo_SN\" <?php selected( $sfpp_options['language'], 'wo_SN' ); ?>>Wolof</option>\n\t\t\t<option value=\"xh_ZA\" <?php selected( $sfpp_options['language'], 'xh_ZA' ); ?>>Xhosa</option>\n\t\t\t<option value=\"yi_DE\" <?php selected( $sfpp_options['language'], 'yi_DE' ); ?>>Yiddish</option>\n\t\t\t<option value=\"yo_NG\" <?php selected( $sfpp_options['language'], 'yo_NG' ); ?>>Yoruba</option>\n\t\t\t<option value=\"zh_CN\" <?php selected( $sfpp_options['language'], 'zh_CN' ); ?>>Simplified Chinese (China)</option>\n\t\t\t<option value=\"zh_HK\" <?php selected( $sfpp_options['language'], 'zh_HK' ); ?>>Traditional Chinese (Hong Kong)</option>\n\t\t\t<option value=\"zh_TW\" <?php selected( $sfpp_options['language'], 'zh_TW' ); ?>>Traditional Chinese (Taiwan)</option>\n\t\t\t<option value=\"zu_ZA\" <?php selected( $sfpp_options['language'], 'zu_ZA' ); ?>>Zulu</option>\n\t\t\t<option value=\"zz_TR\" <?php selected( $sfpp_options['language'], 'zz_TR' ); ?>>Zazaki</option>\n\t\t</select>\n\n\t<?php\n\t}", "public function dropDownPostStatus($selected = \"\")\n{\n \n $name = 'post_status';\n \n $posts_status = array('publish' => 'Publish', 'draft' => 'Draft');\n \t\n if ($selected != '') {\n \n $selected = $selected;\n\n }\n \t\n return dropdown($name, $posts_status, $selected);\n \t\n}", "private function _select_v1()\n\t{\n\t\t// load custom language file\n\t\t$this->lang->load('select_v1');\n\n\t\t// set default template layout\n\t\t$this->template->set_layout('sales_funnel');\n\n\t\t// set default title\n\t\t$this->template->title($this->lang->line('hosting_title'));\n\n\t\t// prepend javascript and video\n\t\t$this->template->prepend_footermeta('\n\n\t\t\t<script type=\"text/javascript\" src=\"/resources/modules/domain/assets/js/domain_spin.js\"></script>\n\n\t\t\t<script type=\"text/javascript\" src=\"/resources/brainhost/js/flowplayer/flowplayer-3.2.10.min.js\"></script>\n\t\t\t<!-- this will install flowplayer inside previous A- tag. -->\n\t\t\t<script>\n\t\t\t\tflowplayer(\"player\", \"/resources/brainhost/js/flowplayer/flowplayer-3.2.5.swf\", {\n\t\t\t\t\tplugins: {\n\t\t\t\t\t\tcontrols: null,\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t</script>\n\t\t');\n\n\t\t$data['errors'] = $this->_errors;\n\t\t$this->template->build('select_v1', $data);\n\t}" ]
[ "0.6200747", "0.6182637", "0.61314505", "0.5855188", "0.5854801", "0.578314", "0.5747833", "0.5719784", "0.56854737", "0.56847996", "0.56728536", "0.56643105", "0.5659013", "0.5648083", "0.5641837", "0.5625889", "0.5616844", "0.5613469", "0.5562949", "0.5558662", "0.5546904", "0.5525452", "0.55239636", "0.55069745", "0.550697", "0.5504792", "0.5488836", "0.5478122", "0.5455933", "0.54365975", "0.5420794", "0.5418181", "0.5414859", "0.5414322", "0.54133564", "0.54108244", "0.5408406", "0.54020137", "0.540003", "0.53650844", "0.53627557", "0.5353692", "0.53523993", "0.5347824", "0.5326489", "0.53184307", "0.5309294", "0.53016007", "0.5288799", "0.52866757", "0.5286036", "0.5285742", "0.5285742", "0.52820575", "0.52699125", "0.5267416", "0.5265146", "0.52543116", "0.5248383", "0.52303016", "0.52288437", "0.52216864", "0.5200962", "0.5199334", "0.5198287", "0.5197266", "0.51932514", "0.5191257", "0.51780915", "0.51780003", "0.51438856", "0.51399964", "0.51366293", "0.513322", "0.51115465", "0.5109243", "0.5108942", "0.5106479", "0.50976723", "0.50949556", "0.50915855", "0.5084549", "0.50819457", "0.50801563", "0.50801253", "0.5072565", "0.50631976", "0.5058194", "0.50551724", "0.50508213", "0.50502944", "0.5049085", "0.5041138", "0.5035199", "0.5028713", "0.50270617", "0.5026433", "0.5022606", "0.50213003", "0.5020983" ]
0.5717434
8
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'name' => 'required', 'trip_id' => 'required', 'supervisors' => 'required', 'going_date' => 'required|date', 'flight_days_no' => 'required', 'flight_hours_no' => 'required', 'from_country' => 'required', 'from_city' => 'required', 'from_place' => 'required', 'to_country' => 'required', 'to_city' => 'required', 'to_place' => 'required', 'program_notes' => 'required', 'launching_notes' => 'required', 'arriving_notes' => 'required', 'launch_hour' => 'required', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => 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'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\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'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\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}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\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 static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\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\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
Tiene muchos Post atravez (hasManyThrough) de usuarios
public function posts() { return $this->hasManyThrough(Post::class, User::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function posts()\n {\n \treturn $this->hasMany(Post::class);\n \t//Con esto podemos acceder a todos los posts de un usuario\n \t//$posts = User::find(1)->comments()->where()->first()\n \t//Para acceder al usuario de un post debemos definir la relacion inversa\n }", "public function posts() {\n // LARAVEL IS AUTOMATICALLY LOOKING FOR COUNTRY ID\n return $this->hasManyThrough('App\\Post', 'App\\User');\n }", "public function getSiguiendo()\n {\n return $this->hasMany(Follow::className(), ['user_id' => 'id'])->inverseOf('usuario');\n }", "public function user()\n {\n //un perfil puede tener muchas usuarios\n return $this->hasMany(User::class);\n }", "public function getPosts()\n {\n return $this->hasMany(Post::className(), ['usuario_id' => 'id'])->inverseOf('usuario');\n }", "public function posts() {\n return $this->hasMany('App\\Post','user_id', 'id');\n }", "public function usuarios(){\n return $this->hasMany('App\\Models\\User');\n }", "public function getSeguidoresUser()\n {\n return $this->hasMany(User::className(), ['id' => 'user_id'])->via('seguidores');\n }", "public function usuarios(){\n \treturn $this->hasMany(PerfilUsuario::class, 'id_perfil', 'id_perfil')->where('bo_activo', true)->where('bo_estado', 1);//->orderBy('email');\n }", "public function getPosts()\n {\n return $this->hasMany(Post::class, ['author_id' => 'id'])->inverseOf('user');\n }", "public function getUsuariosVotos()\n {\n return $this->hasMany(User::className(), ['id' => 'usuario_id'])->via('votos');\n }", "public function posts()\n {\n //hasMany(Modelo a comparar) ira a buscar todos los post que concuerden con el id del usuario en la tabla posts\n return $this->hasMany('App\\Models\\Post', 'user_id', 'id');\n\n //return $this->hasMany('Modelo a cruzar con el actual', 'llave foranea a comprar', 'llave del modelo actual');\n }", "public function usuarios(){\n return $this->belongsToMany('App\\Usuarios','perfiles_usuarios','perfil_fk_pu', 'usuario_fk_pu');\n }", "public function posts()\n\t{\n\t\t// drugi argument stupac u bazi preko kojeg radimo relaciju\n\t\treturn $this->hasMany(static::$postModel, 'user_id');\n\t}", "public function getSiguiendoUser()\n {\n return $this->hasMany(User::className(), ['id' => 'follow_id'])->via('siguiendo');\n }", "public function posts(){\n // get all the posts by this user\n return $this->hasMany('cms\\Post');\n }", "public function following(){\n return $this->belongsToMany('User', 'followers', 'user_id', 'follow_id')->withTimestamps();\n }", "public function user()\n {\n return $this->belongsTo(User::class);//relacionamento da ordem 1\n }", "public function followedBy(){\n return $this->belongsToMany('App\\User', 'follows', 'dog_id', 'user_id');\n }", "public function getSeguidores()\n {\n return $this->hasMany(Follow::className(), ['follow_id' => 'id'])->inverseOf('follow');\n }", "public function followers(){\n return $this->belongsToMany('User', 'followers', 'follow_id', 'user_id')->withTimestamps();\n }", "public function profesor(){\r\n return $this->hasMany('profesor','escuela_id');\r\n }", "public function user()\n\t{\n\t\treturn $this->belongsToMany('Trip');\n\t}", "public function users(){\n\t\treturn $this->belongsToMany('Alsaudi\\\\Eloquent\\\\UserRelation',\n\t\t\t'trip_user','trip_id','user_id');\n\t}", "public function Followers()\n {\n return $this->belongsToMany('App\\User', 'user_following', 'following_id', 'user_id' );\n }", "public function followers() {\n return $this->belongsToMany(User::class);\n }", "public function usuarios() \n {\n \treturn $this->belongsToMany('App\\Usuario',\n 'artistas_favoritos', \n 'artista_id', \n 'usuario_id')\n ->withPivot('fecha'); // Comprobar si se debe añadir 'id'.\n }", "public function user(){\n return $this->hasMany('App\\User');//un rol puede pertenecer a varios usuarios\n }", "public function user() {\n return $this->hasMany(User::class); //devolverá un arreglo de objetos relacionados\n }", "public function followers(){\n return $this->hasMany('App\\Models\\Follow','user_id_follower');\n }", "public function productos()\n {\n return $this->hasMany(User::class);\n }", "public function usuarios()\n {\n return $this->hasMany('App\\Usuario', 'empresa_id', 'id');\n }", "public function getPostsVotados()\n {\n return $this->hasMany(Post::className(), ['id' => 'post_id'])->via('votos');\n }", "public function posts()\n {\n return $this->hasMany(Post::class, 'owner_id');\n }", "public function usuarios()\n {\n \treturn $this->hasMany(reciclausers::class, 'perfilId', 'id');\n \t// nombre del modelo con el que se relaciona, llave foranea, llave de la tabla.\n }", "public function usuarios()\n {\n return $this->belongsTo('App\\Usuario');\n }", "public function posts(){\n // Will go the posts table and get all posts that have the user ud in a column named `user_id`\n // This will also work: `$this->hasMany('App\\Post', 'user_id');`\n return $this->hasMany('App\\Post');\n }", "public function viajes(){\n return $this->hasMany(Traveler::class);\n }", "public function follows() {\n return $this->belongsToMany(User::class, 'follows', 'user_id', 'following_user_id');\n }", "public function Usuarios()\n {\n return $this->belongsToMany('App\\Models\\Users', 'users_empresas');\n }", "public function posts()\n {\n return $this->hasMany(Post::class, 'created_by');\n }", "public function users()\n {\n /** @var \\UserFrosting\\Sprinkle\\Core\\Util\\ClassMapper $classMapper */\n $classMapper = static::$ci->classMapper;\n\n return $this->belongsToManyThrough(\n $classMapper->getClassMapping('user'),\n $classMapper->getClassMapping('role'),\n 'permission_roles',\n 'permission_id',\n 'role_id',\n 'role_users',\n 'role_id',\n 'user_id'\n );\n }", "public function follows(){\n return $this->belongsToMany('App\\Dog', 'follows', 'user_id', 'dog_id');\n }", "public function following() {\n // Need to explicitly state table name follows or else the table will look for user_users\n return $this->belongsToMany(User::class, 'follows');\n }", "public function from_user()\n {\n return $this->hasMany(\\App\\User::class, 'id', 'from_user');\n }", "public function Pago_ordendepago(){\n return $this->hasMany(Pago_ordendepago::class);\n }", "public function userJoin() {\n return $this->belongsToMany('App\\Model\\User', 'trip_users');\n }", "public function getVotos()\n {\n return $this->hasMany(Voto::className(), ['usuario_id' => 'id'])->inverseOf('usuario');\n }", "public function adeudos() {\r\n\t\treturn $this->hasMany('App\\Adeudo');\r\n\t}", "public function lovedBy()\n {\n return $this->belongsToMany(User::class, 'love');\n }", "public function follows(){\n\n return $this->belongsToMany(Question::class,'user_question')->withTimestamps();\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 dados()\n {\n\n return $this->belongsTo('App\\User','user_id');\n \n }", "public function following()\n {\n return $this->belongsTo(User::class);\n }", "public function likes(){\n return $this->belongsToMany(User::class)->withTimestamps();\n }", "public function posts() {\n return $this->hasMany('Marcosricardoss\\Restful\\Model\\Post', 'created_by');\n }", "public function followers()\n {\n return $this->belongsToMany(User::class, 'followers', 'follower_id', 'user_id')->withTimestamps();\n }", "public function pacientes()\n {\n return $this->belongsToMany(Paciente::class)->using(Paciente_Utilizador::class);\n }", "public function authored_posts() {\n return $this->hasMany(Post::class, 'user_id');\n }", "public function posts()\n {\n return $this->hasMany(Post::class, 'post_author');\n }", "public function getAllPostWithUserId(){\n $query = Post::orderBy('id','desc')->with('user')->paginate(5);\n return $query;\n }", "public function participants()\n{\n\treturn $this->belongsToMany(User::class);\n}", "public function getUsuarios()\n {\n return $this->hasMany(Usuario::className(), ['perfil_cod_fk' => 'perfil_cod_pk']);\n }", "public function usuario(){\n return $this->belongsTo('App\\Personal','user_id');\n }", "public function pautas()\n {\n return $this->hasMany('App\\Pauta');\n }", "public function user()\n {\n \treturn $this->hasMany(User::class);\n }", "public function users()\n {\n return $this->hasManyThrough(User::class, UserConfig::class);\n }", "public function posts()\n {\n return $this->hasMany('App\\Post', 'author_id', 'id');\n }", "public function user()\n {\n \treturn $this->hasMany('App\\User');\n }", "public function post(){\n return $this->hasMany(Post::class);\n \n }", "public function obras()\n {\n return $this->belongsToMany(Obra::class, 'usuarios_obras', 'usuario', 'id_obra');\n }", "public function users() {\n return $this -> belongsToMany(Author::class);\n }", "public function utilisateur() {\n $relation = $this->belongsTo(\"Utilisateur\");\n return $relation;\n }", "public function postulanteR()\n {\n \treturn $this->belongsTo('App\\Postulante','postulante'); //Id local\n }", "public function users() {\n \treturn $this->belongsToMany('App\\User')->withPivot('vote')->withTimestamps();\n }", "public function autorPedido()\n {\n return $this->belongsTo(User::class, 'user_id'); // FK de esta tabla\n }", "public function users(): BelongsToMany\n {\n return $this->belongsToMany(User::class)->using(AchievementUser::class)->withTimestamps();\n }", "public function victimas (){\n return $this->hasMany('App\\Victima');\n }", "public function user(){\n return $this->hasMany('App\\Models\\User');\n }", "public function equipos(){\r\n\t\treturn $this->hasMany('Equipo','id_usuario');\r\n\t}", "public function petugas() {\n\t\treturn $this->hasMany('Petugas', 'id_hak_akses');\n\t}", "public function usuariosComentaristas() \n {\n return $this->belongsToMany('App\\Usuario',\n 'comentarios_artistas', \n 'artista_id', \n 'usuario_id')\n ->withPivot('descripcion', 'fecha'); // Comprobar si se debe añadir 'id'.\n }", "public function candidatos(): HasMany\n {\n return $this->hasMany(VotosModel::class, 'votacao_id', 'id')\n ->select('votos.candidato_id', 'votos.id as voto_id', 'votos.votacao_id', 'users.id as user_id', 'users.name')\n ->join('users', function($j) {\n return $j->on('votos.candidato_id', '=', 'users.id');\n })->orderBy('users.name', 'ASC');\n }", "public function post(){\n return $this->hasMany('App\\Post');\n }", "public function ptws() {\n return $this->hasMany(Ptw::class,'created_by');\n }", "public function permissoes()\n {\n \treturn $this->belongsToMany(Permissao::class);\n }", "public function posts() {\n return $this->belongsTo('Post','likes')\n ->withTimestamps();\n }", "public function usuario() {\n return $this->belongsTo(User::class, 'user_id');\n }", "public function user(){\n return $this->hasMany('App\\User');\n }", "public function posts() {\n return $this->hasMany('App\\Post');\n }", "public function users(){\n return $this->belongsToMany(Config::get('auth.providers.users.model'), Config::get('entrust.role_user_table'),Config::get('entrust.role_foreign_key'),Config::get('entrust.user_foreign_key'));\n // return $this->belongsToMany(Config::get('auth.model'), Config::get('entrust.role_user_table'));\n }", "public function users(){\n \n return $this->hasMany('App\\User');\n\n }", "public function usuario(){\n return $this->belongsTo(User::class, 'user_id');\n }", "public function followers()\n {\n return $this->belongsTo('App\\Models\\User','userid','id');\n }", "public function post(){\n return $this->hasMany(Post::class);\n }", "public function asignaturas()\n {\n \treturn $this->belongsToMany('App\\Asignatura');\n }", "public function users(){\n\t\treturn $this->belongsTo('\\\\bundles\\\\lincko\\\\api\\\\models\\\\data\\\\Users', 'parent_id');\n\t}", "public function users(){\n\t\t//no usa el namespace\n return $this->hasMany('App\\User');\n }", "public function users()\r\n {\r\n return $this->belongsToMany(config('bootstrap-menu.models.user'), config('bootstrap-menu.relations.permission_user'))->withTimestamps();\r\n }", "public function FollowingList()\n {\n return $this->belongsToMany('App\\User', 'user_following', 'user_id', 'following_id' );\n }" ]
[ "0.6778668", "0.6754631", "0.6658929", "0.665259", "0.6620675", "0.661627", "0.6594387", "0.6563938", "0.6543209", "0.65389717", "0.64678735", "0.64118534", "0.64065987", "0.63933486", "0.63669914", "0.63547105", "0.63339067", "0.6293543", "0.6288058", "0.6276787", "0.626379", "0.6263039", "0.6247682", "0.62270975", "0.6220486", "0.6212716", "0.6207155", "0.6187043", "0.6186226", "0.618448", "0.6166513", "0.6163954", "0.6159895", "0.6146853", "0.613265", "0.6130417", "0.61299455", "0.61159945", "0.60880095", "0.6084963", "0.60693115", "0.6065432", "0.6063838", "0.60626227", "0.6038828", "0.6034139", "0.6033151", "0.6029699", "0.601916", "0.59889036", "0.59888774", "0.5982371", "0.59813", "0.59799826", "0.5968386", "0.5966181", "0.5951669", "0.59299904", "0.59284145", "0.592525", "0.5908896", "0.5902411", "0.5897902", "0.589555", "0.58922356", "0.58873546", "0.5885004", "0.5881222", "0.5879152", "0.58789825", "0.5877991", "0.5871656", "0.58687496", "0.5865932", "0.5864645", "0.5861262", "0.5858756", "0.585571", "0.5855025", "0.5848031", "0.58459467", "0.5844315", "0.5843729", "0.58377266", "0.5830827", "0.58227915", "0.5821489", "0.58182925", "0.5818144", "0.5817158", "0.5814422", "0.5813649", "0.5812719", "0.5812591", "0.5810554", "0.5807749", "0.58039975", "0.5803853", "0.5798384", "0.5797873" ]
0.72227097
0
Returns the static model of the specified AR class.
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model() {\n return parent::model(get_called_class());\n }", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "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 {\n return CActiveRecord::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 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__) {\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__) {\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__) {\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__) {\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__) {\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__) {\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__) {\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 }" ]
[ "0.74850124", "0.73803526", "0.7154113", "0.71401674", "0.70629025", "0.703232", "0.69285315", "0.69285315", "0.6925706", "0.6902751", "0.6894916", "0.6894916", "0.68900806", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424" ]
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('kode_anggota',$this->kode_anggota); $criteria->compare('tgl_aktivasi_anggota',$this->tgl_aktivasi_anggota,true); $criteria->compare('tgl_exp_anggota',$this->tgl_exp_anggota,true); $criteria->compare('perpanjangan_exp',$this->perpanjangan_exp,true); $criteria->compare('biaya_perpanjangan',$this->biaya_perpanjangan,true); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "public function getModels()\n\t{\n\t\t$scope = $this->scopeName;\n\t\treturn CActiveRecord::model($this->baseModel)->$scope()->findAll();\n\t}", "protected function findModel()\n {\n $class = $this->model;\n $query = $class::query();\n\n foreach ($this->input as $key => $value) {\n $where = is_array($value) ? 'whereIn' : 'where';\n $query->$where($key, $value);\n }\n\n return $query->get();\n }", "public function modelScans()\n {\n if ($this->scanEverything) {\n return $this->getAllClasses();\n }\n\n return $this->scanModels;\n }", "public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }", "public function getModelsForIndex()\n {\n $models = [];\n $all_models = $this->getAllModels();\n\n foreach ($all_models as $model) {\n //parse model\n $pieces = explode('.', $model);\n if (count($pieces) != 2) {\n throw new Exception('Parse error in AppModelList');\n }\n //check form match\n $app_model = $pieces[1];\n $link = $this->convertModelToLink($app_model);\n\n // add to actions\n $models[$app_model]['GET'] = [\n [\n 'action' => 'index',\n 'description' => 'List & filter all ' . $app_model . ' resources.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link\n ],\n [\n 'action' => 'show',\n 'description' => 'Show the ' . $app_model . ' that has the matching {id} from the route.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link . '/{id}'\n ]\n ];\n }\n return $models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function getModels()\n {\n $this->prepare();\n\n return $this->_models;\n }", "public function searchableBy()\n {\n return [];\n }", "public function all($model){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n $stmt = $this->pdo->prepare('select * from ' . $table);\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public static function find($model, $conditions = null, $orderby = null){\n\t\t$sql = \"SELECT * FROM \" . self::table_for($model);\n\t\tif ($conditions) $sql .= \" WHERE \" . self::make_conditions($conditions);\n\t\tif ($orderby)\t$sql .= \" ORDER BY \" . $orderby;\n\t\t\n\t\t$resultset = self::do_query($sql);\n\t\treturn self::get_results($resultset, $model);\n\t}", "function get_model_list($where=\"1\",$where_array,$sort_by=\"\"){\n\t\t$data= $this->select_query(\"make_model\",\"id,name,del_status\",$where,$where_array,$sort_by);\n\t\treturn $data;\n\t}", "public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }", "public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }", "public function getList()\n {\n $this->db->order_by(\"id\", 'desc');\n $this->db->where('status', 1);\n return $this->db->get($this->model);\n }", "public function findAll()\n {\n $fields = $options = [];\n //$options['debug'] = 1;\n $options['enablefieldsfe'] = 1;\n\n return $this->search($fields, $options);\n }", "public function get_multiple()\n\t{\n\t\t$options = array_merge(array(\n\t\t\t'offset' => 0,\n\t\t\t'limit' => 20,\n\t\t\t'sort_by' => 'name',\n\t\t\t'order' => 'ASC'\n\t\t), Input::all(), $this->options);\n\n\t\t// Preparing our query\n\t\t$results = $this->model->with($this->includes);\n\n\t\tif(count($this->join) > 0)\n\t\t{\n\t\t\tforeach ($this->join as $table => $settings) {\n\t\t\t\t$results = $results->join($table, $settings['join'][0], $settings['join'][1], $settings['join'][2]);\n\t\t\t\tif($settings['columns'])\n\t\t\t\t{\n\t\t\t\t\t$options['sort_by'] = (in_array($options['sort_by'], $settings['columns']) ? $table : $this->model->table()).'.'.$options['sort_by'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(stripos($options['sort_by'], '.') === 0)\n\t\t{\n\t\t\t$options['sort_by'] = $this->model->table().'.' . $options['sort_by'];\n\t\t}\n\t\t\n\t\t// Add where's to our query\n\t\tif(array_key_exists('search', $options))\n\t\t{\n\t\t\tforeach($options['search']['columns'] as $column)\n\t\t\t{\n\t\t\t\t$results = $results->or_where($column, '~*', $options['search']['string']);\n\t\t\t}\n\t\t}\n\n\t\t$total = (int) $results->count();\n\n\t\t// Add order_by, skip & take to our results query\n\t\t$results = $results->order_by($options['sort_by'], $options['order'])->skip($options['offset'])->take($options['limit'])->get();\n\n\t\t$response = array(\n\t\t\t'results' => to_array($results),\n\t\t\t'total' => $total,\n\t\t\t'pages' => ceil($total / $options['limit'])\n\t\t);\n\n\t\treturn Response::json($response);\n\t}", "public function findAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }", "public function filter($params) {\n $model = $this->model;\n $keyword = isset($params['keyword'])?$params['keyword']:'';\n $sort = isset($params['sort'])?$params['sort']:''; \n if ($sort == 'name') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('name'); \n }\n else if ($sort == 'newest') {\n $query = $model->where('name','LIKE','%'.$keyword.'%')->orderBy('updated_at','desc'); \n }\n else {\n $query = $model->where('name','LIKE','%'.$keyword.'%'); \n }\n /** filter by class_id */ \n if (isset($params['byclass']) && isset($params['bysubject'])) {\n $query = $model->listClass($params['byclass'], $params['bysubject']);\n return $query; \n }\n else if (isset($params['byclass'])) { \n $query = $model->listClass($params['byclass']);\n return $query;\n }\n else if (isset($params['bysubject'])) {\n $query = $model->listClass(0,$params['bysubject']);\n return $query;\n }\n /** filter by course status */\n if (isset($params['incomming'])) {\n $query = $model->listCourse('incomming');\n return $query;\n }\n else if (isset($params['upcomming'])) {\n $query = $model->listCourse('upcomming');\n return $query;\n }\n $result = $query->paginate(10); \n return $result; \n }", "public function getAll($model, $filters = array())\n {\n $repo = $this->getRepository($model);\n\n return $repo->getAll($filters);\n }", "public function filters(Model $model): array\n {\n return [];\n }", "public function getResults()\n {\n if($this->search) {\n foreach ($this->filters as $field) {\n $field = array_filter(explode('.', $field));\n if(count($field) == 2) {\n $this->query->whereHas($field[0], function ($q) use ($field) {\n $q->where($field[1], 'ilike', \"%{$this->search}%\");\n });\n }\n if(count($field) == 1) {\n $this->query->orWhere($field[0], 'ilike', \"%{$this->search}%\");\n }\n }\n }\n\n if($this->where) {\n foreach ($this->where as $field => $value) {\n $this->query->where($field, $value);\n }\n }\n\n if ($this->whereBetween) {\n foreach ($this->whereBetween as $field => $value)\n $this->query->whereBetween($field, $value);\n }\n// dd($this->query->toSql());\n return $this->query->paginate($this->per_page);\n }", "protected function _searchInModel(Model $model, Builder $items){\n foreach($model->searchable as $param){\n if($param != 'id'){\n if(isset($this->request[$param]))\n $items = $items->where($param, $this->request[$param]);\n if(isset($this->request[$param.'_like']))\n $items = $items->where($param, 'like', '%'.$this->request[$param.'_like'].'%');\n }else{\n if(isset($this->request['id'])){\n $ids = explode(',', $this->request['id']);\n $items = $items->whereIn('id', $ids);\n }\n }\n }\n\n return $items;\n }", "public function getAll($model)\n {\n $sql = \"SELECT * FROM {$this->table}\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_CLASS,get_class($this->model));\n }", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function findAll()\n {\n return $this->driver->findAll($this->model);\n }", "public function getAllFilters();", "public function GetAll()\n {\n return $this->model->all();\n }", "public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function findWhere($model, $conditions, $limit = 0){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n\n $sql = 'select * from ' . $table . ' where ';\n $values = [];\n $counter = 1;\n\n foreach ($conditions as $key => $value) {\n if($counter > 1)\n $sql .= ' AND ';\n\n $sql .= $key . '=?';\n $values[] = $value; \n $counter++;\n }\n\n if($limit > 0)\n $sql .= ' LIMIT ' . $limit;\n \n $stmt = $this->pdo->prepare($sql);\n $stmt->execute($values);\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public function search() {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('type', $this->type);\n\n return $criteria;\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getModels()\n {\n return $this->_models;\n }", "public function getSearchFields();", "public function all()\n {\n return $this->model->get();\n }", "public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "public function getAll()\n {\n return $this->fetchAll($this->searchQuery(0));\n }", "public function listAction() {\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$select = null;\n\t\t\n\t\tif ($this->_request->getParam('data')) {\n\t\t\t\n\t\t\t$data = unserialize($this->_request->getParam('data'));\n\t\t\t$aWhere = array();\n\t\t\t$searchText = array();\n\t\t\t\n\t\t\tforeach ($data['query'] as $key => $q) {\n\t\t\t\n\t\t\t\tif (isset($data['fields'][$key]) && !empty($data['fields'][$key])) {\n\t\t\t\t\n\t\t\t\t\t$func = addslashes($data['func'][$key]);\n\t\t\t\t\t$q =\taddslashes($q);\n\t\t\t\t\t$tmpWhere = array();\n\t\t\t\t\t$searchText[] = implode(' OU ', $data['fields'][$key]) . ' ' . $this->view->func[$func] . ' \"' . stripslashes($q) . '\"';\n\t\t\t\t\t\n\t\t\t\t\tforeach ($data['fields'][$key] as $field) {\n\t\t\t\t\t\n\t\t\t\t\t\t$field\t=\taddslashes($field);\n\t\t\t\t\t\tswitch ($func) {\n\t\t\t\t\t\t\tcase 'LIKE':\n\t\t\t\t\t\t\tcase 'NOT LIKE':\n\t\t\t\t\t\t\tcase '=':\n\t\t\t\t\t\t\tcase '!=':\n\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\tcase '>=':\n\t\t\t\t\t\t\tcase '<':\n\t\t\t\t\t\t\tcase '<=':\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' ' . $func . ' \\'' . $q . '\\''; }\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"= ''\":\n\t\t\t\t\t\t\tcase \"!= ''\":\n\t\t\t\t\t\t\tcase 'IS NULL':\n\t\t\t\t\t\t\tcase 'IS NOT NULL':\n\t\t\t\t\t\t\t\t$tmpWhere[] = $field . ' ' . stripslashes($func);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tif (trim($q) != '') { $tmpWhere[] = $field . ' LIKE \\'%' . $q . '%\\''; }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$aWhere[] = '(' . implode(' OR ', $tmpWhere) . ')';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($aWhere)) { $select = $model->select()->where(implode(' AND ', $aWhere)); }\n\t\t\t$this->view->searchText = $searchText;\n\t\t}\n\t\t$this->view->model = $modelName;\n\t\t$this->view->allData = $model->fetchAll($select);\n\t\t$this->view->data = Zend_Paginator::factory($this->view->allData)\n\t\t\t\t\t\t\t->setCurrentPageNumber($this->_getParam('page', 1));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function index(Request $request)\n {\n $this->validate($request, [\n 'type' => 'required',\n 'searched' => 'required',\n ]);\n\n try {\n if ($request->type == 'Categories') {\n return Category::search($request->searched)->take(20)->get();\n }\n\n if ($request->type == 'Submissions') {\n return $this->sugarFilter(Submission::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Comments') {\n return $this->withoutChildren(Comment::search($request->searched)->take(20)->get());\n }\n\n if ($request->type == 'Users') {\n return User::search($request->searched)->take(20)->get();\n }\n } catch (\\Exception $exception) {\n app('sentry')->captureException($exception);\n\n return [];\n }\n }", "public function getReturnModels(){\r\n return array_values($this->models);\r\n }", "public function findAll()\n {\n $models = $this->getDoctrineRepository()->findAll();\n $this->events()->trigger(__FUNCTION__ . '.post', $this, array(\n 'model' => $models,\n 'om' => $this->getObjectManager())\n );\n return $models;\n }", "public function models();", "public function search($conditions)\n\t{\n\t\t$limit = (isset($conditions['limit']) && $conditions['limit'] !== null ? $conditions['limit'] : 10);\n\t\t$result = array();\n\t\t$alphabets = [];\n\n\t\tDB::enableQueryLog();\n\n\t\t$mem = new Memcached();\n\t\t$mem->addServer(env('memcached_server'), env('memcached_port'));\n\n\t\t/* Get Default Logo Link on setting_object table */\n\t\t$logoMem = $mem->get('logo_course');\n\n\t\tif ($logoMem)\n\t\t{\n\t\t\t$default_logo = $logoMem;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$default_logo = $this->getDefaultLogo();\n\t\t\t$mem->set('logo_course', $default_logo);\n\t\t}\n\n\t\tif (isset($conditions['alphabet']) && $conditions['alphabet'] !== null && sizeof($conditions['alphabet']) > 0) {\n\t\t\tforeach ($conditions['alphabet'] as $item) {\n\t\t\t\t$alphabets[] = \"lower(entity.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t\t$alphabets[] = \"lower(curriculum.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t}\n\t\t}\n\n\t\t$extraGroup = (isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : '' );\n\t\t$extraGroup = str_replace(' ASC', '',$extraGroup);\n\t\t$extraGroup = str_replace(' DESC', '',$extraGroup);\n\n\t\t$searchData = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->limit($limit)\n\t\t\t->offset(isset($conditions['page']) && $conditions['page'] !== null ? ($conditions['page']-1) * $limit : 0)\n\t\t\t->get();\n\n\t\t$searchAll = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t//->groupBy('course.course_id','schedule.instructor_id','curriculum.curriculum_id','entity.logo', 'course.day_of_week','entity.name','curriculum.name','course.time_start', 'course.time_end','event_type.name')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->get();\n\n\t\t//echo(\"<br>Total : \" . sizeof($searchData) . \" records\");\n\t\tforeach ($searchData as $data) {\n\t\t\t/*echo('<br>' . $data->program_id . '|' . $data->program_name . '|'. $data->activity_id . '|' . $data->provider_name . '|' . $data->location_name);*/\n\t\t\t//echo('<br>' . $data->provider_id . '|' . $data->provider_name . '|' . $data->location_name);\n\n\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\n\n\t\t\t//echo('<br>' . $data->course_id . \"~\" . $data->program_name . '#'.$day->name. \"|\". date('h:i',strtotime($data->time_start)) . '-' .date('h:i',strtotime($data->time_end)));\n\t\t\t$item = ['course_id' => $data->course_id,\n\t\t\t\t'entity_logo' => ($data->entity_logo ? $data->entity_logo : $default_logo),\n\t\t\t\t'entity_name' => $data->entity_name,\n\t\t\t\t'curriculum_name' => $data->curriculum_name,\n\t\t\t\t'day_name' => $day->name,\n\t\t\t\t'time_start' => date('H:i',strtotime($data->time_start)),\n\t\t\t\t'time_end' => date('H:i',strtotime($data->time_end))];\n\n\t\t\t/*$schedules = DB::table('schedule')\n\t\t\t\t->select('schedule.schedule_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\tforeach ($schedules as $schedule) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t}*/\n\n\t\t\t$programs = DB::table('curriculum')\n\t\t\t\t->select('program.program_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\t$searchActivities = [];\n\t\t\tforeach ($programs as $program) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t\t$activities = DB::table('program')\n\t\t\t\t\t->select('activity.logo', 'program.provider_id', DB::raw('program.name program_name'))\n\t\t\t\t\t->join('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t\t\t->leftjoin('activity_classification', 'activity.activity_classification_id', 'activity_classification.activity_classification_id')\n\t\t\t\t\t->where('program.program_id', $program->program_id)\n\t\t\t\t\t->whereRaw(\n\t\t\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\t\t\t\t\t\t('program.status = 0')\n\t\t\t\t\t)\n\t\t\t\t\t//->groupBy('activity.logo')\n\t\t\t\t\t->get();\n\n\t\t\t\tforeach ($activities as $activity) {\n\t\t\t\t\t//echo('<img src=\"' . $activity->logo . '\" style=\"width:2%;\" alt=\"' . $activity->program_name . '\" title=\"' . $activity->program_name . '\">');\n\t\t\t\t\t$searchActivity = [\n\t\t\t\t\t\t'logo' => $activity->logo,\n\t\t\t\t\t\t'name' => $activity->program_name,\n\t\t\t\t\t];\n\t\t\t\t\tarray_push($searchActivities, $searchActivity);\n\t\t\t\t}\n\t\t\t}\n\t\t\tarray_push($result, array('item' => $item, 'activity' => $searchActivities));\n\t\t}\n\n\t\t$final = array('totalPage' => ceil(sizeof($searchAll)/$limit), 'total' => ( sizeof($searchAll) > 0 ? sizeof($searchAll) : 0), 'result' => $result, 'debug' => DB::getQueryLog()[0]['query']);\n\t\treturn $final;\n\t}", "public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}", "public function all()\n {\n return $this->model->get();\n }", "public function master_search() {\r\n $this->db->join(\r\n '__Vehicles', \r\n '__Vehicles.__ContactId = ' . $this->table_name. '.' . $this->contactId_fieldname ,\r\n 'left outer'\r\n ); \r\n return $this->get();\r\n }", "public function getItemsBy($params = false)\n {\n $query = $this->model->query();\n\n /*== RELATIONSHIPS ==*/\n if (in_array('*', $params->include)) {//If Request all relationships\n $query->with([]);\n } else {//Especific relationships\n $includeDefault = [];//Default relationships\n if (isset($params->include))//merge relations with default relationships\n $includeDefault = array_merge($includeDefault, $params->include);\n $query->with($includeDefault);//Add Relationships to query\n }\n\n /*== FILTERS ==*/\n if (isset($params->filter)) {\n $filter = $params->filter;//Short filter\n\n //Filter by date\n if (isset($filter->date)) {\n $date = $filter->date;//Short filter date\n $date->field = $date->field ?? 'created_at';\n if (isset($date->from))//From a date\n $query->whereDate($date->field, '>=', $date->from);\n if (isset($date->to))//to a date\n $query->whereDate($date->field, '<=', $date->to);\n }\n\n //Order by\n if (isset($filter->order)) {\n $orderByField = $filter->order->field ?? 'position';//Default field\n $orderWay = $filter->order->way ?? 'desc';//Default way\n $query->orderBy($orderByField, $orderWay);//Add order to query\n }\n\n // Filter By Menu\n if (isset($filter->menu)) {\n $query->where('menu_id', $filter->menu);\n }\n\n //add filter by search\n if (isset($filter->search)) {\n //find search in columns\n $query->where(function ($query) use ($filter) {\n $query->whereHas('translations', function ($query) use ($filter) {\n $query->where('locale', $filter->locale)\n ->where('title', 'like', '%' . $filter->search . '%');\n })->orWhere('id', 'like', '%' . $filter->search . '%')\n ->orWhere('updated_at', 'like', '%' . $filter->search . '%')\n ->orWhere('created_at', 'like', '%' . $filter->search . '%');\n });\n }\n\n }\n\n /*== FIELDS ==*/\n if (isset($params->fields) && count($params->fields))\n $query->select($params->fields);\n\n /*== REQUEST ==*/\n if (isset($params->page) && $params->page) {\n return $query->paginate($params->take);\n } else {\n $params->take ? $query->take($params->take) : false;//Take\n return $query->get();\n }\n }", "public function findBy(array $filters);", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getList()\n {\n return $this->model->getList();\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getList($params = [])\n {\n $model = $this->prepareModel();\n return $model::all();\n }", "abstract protected function getSearchModelName(): string;", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "public function getFilters();", "public function getSearch();", "public static function getList(array $filters){\n return self::model()->findAllByAttributes($filters);\n }", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }", "public function actionList() {\n switch ($_GET['model']) {\n case 'Product':\n $models = Product::model()->findAll();\n break;\n case 'Vendor':\n $models = Vendor::model()->findAll();\n break;\n case 'FavoriteProduct':\n $models = FavoriteProduct::model()->findAll();\n break;\n case 'Order':\n $models = Order::model()->findAll();\n break;\n case 'Rating':\n $models = Rating::model()->findAll();\n break;\n case 'Review':\n $models = Review::model()->findAll();\n break;\n case 'UserAddress':\n $models = UserAddress::model()->findAll();\n break;\n case 'OrderDetail':\n $models = OrderDetail::model()->findAll();\n break;\n default:\n $this->_sendResponse(0, 'You have pass invalid modal name');\n Yii::app()->end();\n }\n // Did we get some results?\n if (empty($models)) {\n // No\n $this->_sendResponse(0, 'No Record found ');\n } else {\n // Prepare response\n $rows = array();\n $i = 0;\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n if ($_GET['model'] == 'Order') {\n $rows[$i]['cart_items'] = Product::model()->getProducts($model->product_id);\n $rows[$i]['order_detail'] = OrderDetail::model()->findAll(array('condition' => 'order_id ='.$model->id));\n }\n $i = $i + 1;\n }\n // Send the response\n $this->_sendResponse(1, '', $rows);\n }\n }", "static public function filterData($model_name)\n {\n $query = \"{$model_name}Query\";\n $objects = $query::create()->find();\n \n if ($objects != null) {\n\n $array = array();\n foreach ($objects as $object) {\n $array[$object->getId()] = $object->__toString();\n }\n\n return $array;\n } else {\n return array();\n }\n }", "public static function getList(string $filter='')\n {\n $query = self::with(['product','insuredPerson','agency'])->whereNotNull('n_OwnerId_FK');\n\n $filterArray = json_decode(request('filter'));\n\n if (is_object($filterArray)) {\n foreach($filterArray as $key=>$value) {\n if (empty($value)) {\n continue;\n }\n if (is_array($value)) {\n $query->whereIn($key, $value);\n continue;\n }\n $query->where($key, 'like', \"%$value%\");\n }\n }\n return $query;\n }", "public function getCriteria();", "public static function getSearchable()\n {\n return [\n 'columns' => [],\n 'joins' => [\n \n ]\n ];\n }", "static function filter($model) {\n $cond = Session::get('filter', strtolower($model->source));\n $param = array(\n /* Relaciones */\n 'rel' => array(\n '=' => 'Igual',\n 'LIKE' => 'Parecido',\n '<>' => 'Diferente',\n '<' => 'Menor',\n '>' => 'Mayor'\n ),\n 'col' => array_diff($model->fields, $model->_at, $model->_in, $model->primary_key),\n 'model' => $model,\n 'cond' => $cond\n );\n ob_start();\n View::partial('backend/filter', false, $param);\n return ob_get_clean();\n }", "public function findByModelName($model_name);", "abstract public function getFieldsSearchable();", "function _get_by_related($model, $arguments = array())\r\n\t{\r\n\t\tif ( ! empty($model))\r\n\t\t{\r\n\t\t\t// Add model to start of arguments\r\n\t\t\t$arguments = array_merge(array($model), $arguments);\r\n\t\t}\r\n\r\n\t\t$this->_related('where', $arguments);\r\n\r\n\t\treturn $this->get();\r\n\t}", "public static function getModels()\n\t{\n\t\t$result = [];\n\t\t$path = __DIR__ . DIRECTORY_SEPARATOR . 'model' . DIRECTORY_SEPARATOR;\n\t\t$Iterator = new RecursiveDirectoryIterator($path);\n\t\t$objects = new RecursiveIteratorIterator($Iterator, RecursiveIteratorIterator::SELF_FIRST);\n\t\tforeach ($objects as $name => $object)\n\t\t{\n\t\t\tif (strtolower(substr($name, -4) != '.php'))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$name = strtolower(str_replace($path, '', substr($name, 0, strlen($name) - 4)));\n\t\t\t$name = str_replace(DIRECTORY_SEPARATOR, '\\\\', $name);\n\t\t\t$name = 'Model\\\\' . ucwords($name, '\\\\');\n\t\t\tif (class_exists($name))\n\t\t\t{\n\t\t\t\t$result[]= $name;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }", "public function getListQuery();", "public function search($model, $request)\n {\n $search = filter_var($request->get('search'), FILTER_SANITIZE_STRING);\n\n // Get optional filters\n // FILTER: GEOLOCATION\n if($request->input('location')) {\n $location = filter_var($request->get('location'), FILTER_SANITIZE_STRING);\n }\n if($request->input('geo_lat')) {\n $geo_lat = filter_var($request->get('geo_lat'), FILTER_SANITIZE_STRING);\n $geo_lng = filter_var($request->get('geo_lng'), FILTER_SANITIZE_STRING);\n }\n\n /**\n * Get current page number for location manual Pagination\n */\n $page = $request->get('page') ? $request->get('page') : 1;\n\n\n // Location first, since it's a special query\n if(isset($geo_lat) && isset($geo_lng)) {\n \n $location_data = Posts::location($geo_lat, $geo_lng, $search, 25, 100); \n\n // Hard and dirty search function through collection\n // since search with location method doesn't work still\n if($search !== '') {\n $location_data = $location_data->filter(function ($item) use ($search) {\n return stripos($item->name, $search) !== false;\n });\n }\n\n // Paginate results because location method can't\n $paginate = new Paginate;\n return $paginate->paginate($location_data, 15, $page, [\n 'path' => '/search/'\n ]);\n\n } \n // Section selection handler (brands/shops/prods/strains)\n elseif($search)\n {\n return $model->where('name', 'like', \"%$search%\");\n }\n\n }", "public function getWorkFlowModels()\n {\n return $this->postRequest('GetWorkFlowModels');\n }", "public function getList()\n {\n $filter = $this->getEvent()->getRouteMatch()->getParam('filter', null);\n return $this->getService()\n ->getList($filter);\n }", "private function _getAllModels(): array {\n\t\t$models = Array();\n\t\t$folder = Environment::$dirs->models;\n\t\t$files = array_diff(scandir($folder), array('.', '..'));\n\t\tforeach ($files as $fileName) {\n\t\t\tinclude_once($folder.DIRECTORY_SEPARATOR.$fileName);\n\t\t\t$className = basename($fileName, \".php\");\n\t\t\t$classNameNamespaced = \"\\\\Jeff\\\\Api\\\\Models\\\\\" . ucfirst($className);\n\t\t\t$model = new $classNameNamespaced($this->db, $this->account);\n\t\t\t$models[$model->modelNamePlural] = $model;\n\t\t}\n\t\treturn $models;\n\t}", "function getAll(){\n\n\t\t\t$this->db->order_by(\"status\", \"asc\");\n\t\t\t$query = $this->db->get_where($this->table);\n\t\t\treturn $query;\n\t\t}", "public function actionViewModelList($modelName)\n\t{\n\t\t$pageSize = BaseModel::PAGE_SIZE;\n\t\tif ($_POST[\"sortBy\"]) {\n\t\t\t$order = $_POST[\"sortBy\"];\n\t\t}\n\t\t//echo $order;\n\t\t/*if (!$modelName) {\n\t\t\t\n\t\t}*/\n\t\t$sess_data = Yii::app()->session->get($modelName.'search');\n\t\t$searchId = $_GET[\"search_id\"];\n\t\t$fromSearchId = TriggerValues::model() -> decodeSearchId($searchId);\n\t\t//print_r($fromSearchId);\n\t\t//echo \"<br/>\";\n\t\t//Если задан $_POST/GET с формы, то сливаем его с массивом из searchId с приоритетом у searchId\n\t\tif ($_POST[$modelName.'SearchForm'])\n\t\t{\n\t\t\t$fromPage = array_merge($_POST[$modelName.'SearchForm'], $fromSearchId);\n\t\t} else {\n\t\t\t//Если же он не задан, то все данные берем из searchId\n\t\t\t$fromPage = $fromSearchId;\n\t\t}\n\t\t//print_r($fromPage);\n\t\tif ((!$fromPage)&&(!$sess_data))\n\t\t{\n\t\t\t//Если никаких критереев не задано, то выдаем все модели.\n\t\t\t$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t} else {\n\t\t\tif ($_GET[\"clear\"]==1)\n\t\t\t{\n\t\t\t\t//Если критерии заданы, но мы хотим их сбросить, то снова выдаем все и обнуляем нужную сессию\n\t\t\t\tYii::app()->session->remove($modelName.'search');\n\t\t\t\t$page = 1;\n\t\t\t\t//was://$searched = $modelName::model() -> userSearch(array(),$order);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromSearchId,$order);\n\t\t\t} else {\n\t\t\t\t//Если же заданы какие-то критерии, но не со страницы, то вместо них подаем данные из сессии\n\t\t\t\tif (!$fromPage)\n\t\t\t\t{\n\t\t\t\t\t$fromPage = $sess_data;\n\t\t\t\t\t//echo \"from session\";\n\t\t\t\t}\n\t\t\t\t//Адаптируем критерии под специализацию. Если для данной специализации нет какого-то критерия, а он где-то сохранен, то убираем его.\n\t\t\t\t$fromPage = Filters::model() -> FilterSearchCriteria($fromPage, $modelName);\n\t\t\t\t//Если критерии заданы и обнулять их не нужно, то запускаем поиск и сохраняем его критерии в сессию.\n\t\t\t\tYii::app()->session->add($modelName.'search',$fromPage);\n\t\t\t\t$searched = $modelName::model() -> userSearch($fromPage,$order);\n\t\t\t}\n\t\t}\n\t\t//делаем из массива объектов dataProvider\n $dataProvider = new CArrayDataProvider($searched['objects'],\n array( 'keyField' =>'id'\n ));\n\t\t$this -> layout = 'layoutNoForm';\n\t\t//Определяем страницу.\n\t\t$maxPage = ceil(count($searched['objects'])/$pageSize);\n\t\tif ($_GET[\"page\"]) {\n\t\t\t$_POST[\"page\"] = $_GET[\"page\"];\n\t\t}\n\t\t$page = $_POST[\"page\"] ? $_POST[\"page\"] : 1;\n\t\t$page = (($page >= 1)&&($page <= $maxPage)) ? $page : 1;\n\t\t$_POST[$modelName.'SearchForm'] = $fromPage;\n\t\t$this->render('show_list', array(\n\t\t\t'objects' => array_slice($searched['objects'],($page - 1) * $pageSize, $pageSize),\n\t\t\t'modelName' => $modelName,\n\t\t\t'filterForm' => $modelName::model() -> giveFilterForm($fromPage),\n\t\t\t'fromPage' => $fromPage,\n\t\t\t'description' => $searched['description'],\n\t\t\t'specialities' => Filters::model() -> giveSpecialities(),\n\t\t\t'page' => $page,\n\t\t\t'maxPage' => $maxPage,\n\t\t\t'total' => count($searched['objects'])\n\t\t));\n\t\t\n\t}", "public function search_through(Request $request)\n {\n $reports = Payment::query();\n\n if (!empty($request->query())) {\n foreach ($request->query() as $key => $value) {\n if ($key == 'date') {\n $reports->whereDate('created_at', '>=', $value);\n } else {\n $reports->where($key, $value);\n }\n }\n }\n\n return $reports->get();\n }", "public function models($query, array $options = [])\n {\n $hits = $this->run($query);\n list($models, $totalCount) = $this->search->config()->models($hits, $options);\n // Remember total number of results.\n $this->setCachedCount($query, $totalCount);\n\n return Collection::make($models);\n }", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n return $this->repository->all();\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function queryset(){\n return $this->_get_queryset();\n }", "public function index(Request $request)\n {\n $keyword = $request->get('search');\n $perPage = $request->get('limit');\n $perPage = empty($perPage) ? 25 : $perPage;\n\n if (!empty($keyword)) {\n $filters = Filter::where('sl_gender', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_color', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_occasion', 'LIKE', \"%$keyword%\")\n ->orWhere('sl_style', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_age', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_min_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_max_price', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_from', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_date_to', 'LIKE', \"%$keyword%\")\n ->orWhere('wg_city_id', 'LIKE', \"%$keyword%\")\n ->orWhere('user_id', 'LIKE', \"%$keyword%\")\n ->paginate($perPage);\n } else {\n $filters = Filter::paginate($perPage);\n }\n\n return $filters;\n }", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getSearchCriterias()\n {\n return $this->_searchCriterias;\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "private function getSearchConditions()\n {\n $searchConditions = [];\n\n $userIds = $this->request->get('ids') ?? [];\n if ($userIds) {\n $searchConditions['id'] = $userIds;\n }\n\n $email = $this->request->get('email') ?? '';\n if ($email) {\n $searchConditions['email'] = $email;\n }\n\n return $searchConditions;\n }", "public function findAllAction();", "public function search(Request $request)\n {\n if(!$request->has('query')) {\n return response()->json(['message' => 'Please type a keyword.']);\n }\n\n $userTenant = Auth::userTenant();\n $user = Auth::user();\n\n $searchableModelNameSpace = 'App\\\\Models\\\\';\n $result = [];\n // Loop through the searchable models.\n foreach (config('scout.searchableModels') as $model) {\n $modelClass = $searchableModelNameSpace.$model;\n $modelService = app($model.'Ser');\n\n if($model == 'Task') {\n $allowedModels = $modelService->searchForUserTenant($userTenant, $request->get('query'))->get();\n } else {\n $foundModels = $modelClass::search($request->get('query'))->get();\n if ($model === 'Comment') {\n $foundModels->where('groupId', '!=', null)->toArray();\n }\n $policy = app()->make('App\\Policies\\V2\\\\' . $model . 'Policy');\n $allowedModels = $foundModels->filter(function(BaseModel $foundModel) use($user, $policy) {\n return $policy->getAccess($user, $foundModel);\n });\n }\n\n $result[Str::lower($model) . 's'] = $allowedModels;\n }\n\n $responseData = ['message' => 'Keyword(s) matched!', 'results' => $result, 'pagination' => ['more' => false]];\n $responseHeader = Response::HTTP_OK;\n if (!count($result)) {\n $responseData = ['message' => 'No results found, please try with different keywords.'];\n $responseHeader = Response::HTTP_NOT_FOUND;\n }\n\n return response()->json($responseData, $responseHeader);\n }", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sSavedFilterList = \"\";\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\" && isset($UserProfile))\n\t\t\t$sSavedFilterList = $UserProfile->GetSearchFilters(CurrentUserName(), \"fsolicitudlistsrch\");\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id->AdvancedSearch->ToJson(), \",\"); // Field id\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nombre_contacto->AdvancedSearch->ToJson(), \",\"); // Field nombre_contacto\n\t\t$sFilterList = ew_Concat($sFilterList, $this->name->AdvancedSearch->ToJson(), \",\"); // Field name\n\t\t$sFilterList = ew_Concat($sFilterList, $this->lastname->AdvancedSearch->ToJson(), \",\"); // Field lastname\n\t\t$sFilterList = ew_Concat($sFilterList, $this->_email->AdvancedSearch->ToJson(), \",\"); // Field email\n\t\t$sFilterList = ew_Concat($sFilterList, $this->address->AdvancedSearch->ToJson(), \",\"); // Field address\n\t\t$sFilterList = ew_Concat($sFilterList, $this->phone->AdvancedSearch->ToJson(), \",\"); // Field phone\n\t\t$sFilterList = ew_Concat($sFilterList, $this->cell->AdvancedSearch->ToJson(), \",\"); // Field cell\n\t\t$sFilterList = ew_Concat($sFilterList, $this->created_at->AdvancedSearch->ToJson(), \",\"); // Field created_at\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_sucursal->AdvancedSearch->ToJson(), \",\"); // Field id_sucursal\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoinmueble->AdvancedSearch->ToJson(), \",\"); // Field tipoinmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_inmueble->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_inmueble\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipovehiculo->AdvancedSearch->ToJson(), \",\"); // Field tipovehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_vehiculo->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_vehiculo\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomaquinaria->AdvancedSearch->ToJson(), \",\"); // Field tipomaquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_ciudad_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_ciudad_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_provincia_maquinaria->AdvancedSearch->ToJson(), \",\"); // Field id_provincia_maquinaria\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipomercaderia->AdvancedSearch->ToJson(), \",\"); // Field tipomercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->documento_mercaderia->AdvancedSearch->ToJson(), \",\"); // Field documento_mercaderia\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tipoespecial->AdvancedSearch->ToJson(), \",\"); // Field tipoespecial\n\t\t$sFilterList = ew_Concat($sFilterList, $this->email_contacto->AdvancedSearch->ToJson(), \",\"); // Field email_contacto\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "public function getAndFilter() {\n\t\treturn $this->db->getAndFilter();\n\t}" ]
[ "0.6743169", "0.6743169", "0.660761", "0.6479806", "0.63798267", "0.63454884", "0.6310211", "0.630157", "0.6253882", "0.62494963", "0.62494963", "0.6111013", "0.6077699", "0.60734916", "0.604629", "0.60349816", "0.60323626", "0.6014135", "0.5981404", "0.5979577", "0.59790176", "0.59686154", "0.5932365", "0.59278476", "0.59224707", "0.58915573", "0.5889474", "0.5850065", "0.5846599", "0.58258194", "0.58169955", "0.5811794", "0.58071834", "0.5792253", "0.5776716", "0.5769704", "0.5762866", "0.5762595", "0.5750857", "0.5740329", "0.5738501", "0.5727578", "0.57241714", "0.57224226", "0.57219917", "0.57193714", "0.5717115", "0.5713116", "0.57129574", "0.57069343", "0.56932455", "0.56813276", "0.5671539", "0.56690705", "0.5668895", "0.5668895", "0.5668895", "0.5668847", "0.56679785", "0.56638783", "0.56562364", "0.56505203", "0.5649221", "0.56414455", "0.56334", "0.56329614", "0.5631676", "0.562298", "0.56168723", "0.5612008", "0.5608453", "0.55940604", "0.5580047", "0.5572055", "0.55555546", "0.55500674", "0.5547689", "0.5547594", "0.55458593", "0.55359334", "0.553295", "0.55324304", "0.5530852", "0.5525286", "0.552028", "0.5517957", "0.5513443", "0.55082744", "0.5506695", "0.5499769", "0.5499749", "0.54954296", "0.54954296", "0.54954296", "0.5494633", "0.54934925", "0.54930055", "0.5491269", "0.54898334", "0.5489441", "0.5484841" ]
0.0
-1
Show the form for creating a new resource.
public function create() { $roles = Role::pluck('name','name')->all(); $teams = Team::pluck('name','id')->all(); $teams = Arr::add($teams, "", "no team"); $positions = [ "0"=>"Team leader", "1"=>"Senior team member", "2"=>"Junior team member", null=>"no position" ]; return view('users.create',compact('roles', 'teams', 'positions')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $this->validate($request, [ 'name' => ['required', 'string', 'max:255'], 'lastname' => ['nullable', 'string', 'max:255'], 'username' => ['required', 'string', 'max:255', 'unique:users'], 'telephone' => ['required', 'numeric'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => ['required', 'min:8', 'same:confirm-password'], 'roles' => 'required', 'team_id' => 'nullable', 'position' => 'nullable' ]); $input = $request->all(); $input['password'] = Hash::make($input['password']); $user = User::create($input); $user->assignRole($request->input('roles')); return redirect()->route('users.index') ->with('success','User created successfully'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { $user = User::find($id); return view('users.show',compact('user')); }
{ "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) { $user = User::find($id); $roles = Role::pluck('name','name')->all(); $userRole = $user->roles->pluck('name','name')->all(); $teams = Team::pluck('name','id')->all(); $teams = Arr::add($teams, "", "no team"); $userTeam = $user->team_id; $positions = [ "0"=>"Team leader", "1"=>"Senior team member", "2"=>"Junior team member", null=>"no position" ]; $userPosition = $user->position; return view('users.edit',compact('user','roles','userRole', 'teams', 'userTeam', 'positions', 'userPosition')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $this->validate($request, [ 'name' => ['required', 'string', 'max:255'], 'lastname' => ['nullable', 'string', 'max:255'], // 'username' => ['required', 'string', 'max:255', 'unique:users'], 'telephone' => ['required', 'numeric'], // 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => 'same:confirm-password', 'roles' => 'required', 'team_id' => 'nullable', 'position' => 'nullable' ]); $input = $request->all(); if(!empty($input['password'])){ $input['password'] = Hash::make($input['password']); }else{ $input = Arr::except($input,array('password')); } $user = User::find($id); $user->update($input); DB::table('model_has_roles')->where('model_id',$id)->delete(); $user->assignRole($request->input('roles')); return redirect()->route('users.index') ->with('success','User updated successfully'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { User::find($id)->delete(); return redirect()->route('users.index') ->with('success','User deleted successfully'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Get the divisions associated with the company.
public function division(){ return $this->hasOne(Division::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function divisions(): array { return $this->divisions; }", "public function get_division()\n\t\t{\n\t\t\treturn $this->obj->find()->getBasics();\n\t\t}", "public function getDivisions(){\n $result_arr=[];\n $query=\"SELECT * FROM division ORDER BY div_name ASC\";\n $result=$this->connection->query($query);\n while($row=$result->fetch_assoc()){\n array_push($result_arr,[$row['div_id'],$row['div_name']]);\n }\n return $result_arr;\n }", "public function companies(): Collection\n {\n return Company::all();\n }", "public function getCoDivision()\n\t{\n\t\treturn $this->co_division;\n\t}", "public function getCompany() {\n return Companies::findById($this->company_id);\n }", "public function get_division_data($company_id)\n\t{\n\t\t\tif ($this->file_maintenance_model->check_division_value($company_id)) \n\t\t\t{\n\t\t\t\t$this->data['options'] = 'division';\n\t\t\t\t$this->data['divisionList'] = $this->file_maintenance_model->divisionList($company_id);\n\t\t\t\t$this->load->view('app/administrator/file_maintenance/result_checkbox',$this->data);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->data['options'] = 'department';\n\t\t\t\t$this->data['divisionList'] = '';\n\t\t\t\t$this->data['departmentList'] = $this->file_maintenance_model->deptList($company_id);\n\t\t\t\t$this->load->view('app/administrator/file_maintenance/result_checkbox',$this->data);\n\t\t\t}\n\t}", "public function company()\n {\n return $this->business();\n }", "public function getCompany();", "function getConveyancingCompanies(){\n \n $conveyancingCompanies = array();\n \n $conveyancingLeadTypeCatIds = unserialize(CONVEYANCING_LEAD_TYPE_CATEGORY_IDS);\n foreach($conveyancingLeadTypeCatIds as $id){\n \n $leadTypeCat = new Models_LeadTypeCategory($id);\n $companies = $leadTypeCat->getCompanies();\n \n foreach($companies as $company){\n $conveyancingCompanies[$company[\"id\"]] = trim($company[\"companyName\"]);\n }\n }\n \n natcasesort($conveyancingCompanies);\n \n return $conveyancingCompanies;\n}", "public function allCompanies()\n {\n return Company::all();\n }", "function getDividers() {\n return $this->dividers;\n }", "function Companies(){\n\t\t\t\treturn $this->companies;\n\t\t\t}", "public function getDivision()\n {\n return $this->division;\n }", "private function getDivision() {\n\t\t$return = NULL;\n\t\t$sql = 'SELECT `#__Division`.* FROM `#__Division` LEFT JOIN `#__Division_User` ON `#__Division_User`.`division_id` = `#__Division`.`id` WHERE `#__Division_User`.`user_id` = ?';\n\t\t$result = $this->execute($sql, $this->id);\n\n\t\tif (count($result) > 0) {\n\t\t\t$return[$result[0]['id']] = $result[0];\n\t\t}\n\t\treturn $return;\n\t}", "public function company()\n {\n return ($this->entity_type == 'c') ? $this->belongsTo('App\\Models\\Company\\Company', 'entity_id') : null;\n }", "public static function getDivision() \n {\n return CHtml::ListData(self::model()->findAllBySql(\"SELECT * FROM division ORDER BY name;\"),\"id\",\"name\"); \n }", "public function getDivs(){\n $divs = new \\stdClass();\n\n return $divs;\n }", "public function getCompany() {}", "public function put_division()\n\t\t{\n\t\t\t$retArr = array();\n \n\t\t\t// Scaffolding Code For Single:\n\t\t\t$retArr = $this->obj->getBasics();\n\n\t\t\treturn $retArr;\n\t\t}", "function get_companies_or_group_of_companies($post_type_indicator) {\n\t/**\n\t * Arguments for get posts:\n\t */\n\t$args = array(\n\t\t'orderby'\t\t =>\t'title',\n\t\t'order'\t\t\t =>\t'ASC',\n\t\t'post_type' => $post_type_indicator,\n\t\t'post_status' => 'publish',\n\t\t'posts_per_page' => -1\n\t);\n\tif ($post_type_indicator == 'companies') {\n\t\t$companies = get_posts($args);\n\t\t?>\n\t\t<div class=\"company-isotope\">\n\t\t\t<?php\n\t\t\tforeach ($companies as $company) {\n\t\t\t\t$company_url = get_permalink($company->ID);\n\t\t\t\t$company_title = $company->post_title;\n\t\t\t\t$company_title_length = strlen($company_title);\n\t\t\t\t$company_logo_url = get_field('company_logo', $company->ID);\n\t\t\t\t?>\n\t\t\t\t<a href=\"<?php echo $company_url ?>\" class=\"company-box col-xs-12 col-sm-6 col-md-4\">\n\t\t\t\t\t<div class=\"item-card\">\n\t\t\t\t\t\t<div class=\"item-card-thumbnail\">\n\t\t\t\t\t\t\t<img src=\"<?php echo $company_logo_url; ?>\" class=\"item-card-image\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"item-card-title purple-bg\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ($company_title_length <= 32) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<span class=\"item-title white-text\"><?php echo $company_title; ?></span>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<span class=\"item-title white-text\" style=\"font-size:16px!important\"><?php echo $company_title; ?></span>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\tif ($post_type_indicator == 'group_of_companies') {\n\t\t$group_of_companies = get_posts($args);\n\t\t?>\n\t\t<div class=\"group-of-companies-isotope\">\n\t\t\t<?php\n\t\t\tforeach ($group_of_companies as $group_of_company) {\n\t\t\t\t$group_of_companies_url = get_permalink($group_of_company->ID);\n\t\t\t\t$group_of_companies_title = $group_of_company->post_title;\n\t\t\t\t$group_of_companies_title_length = strlen($group_of_companies_title);\n\t\t\t\t$group_of_companies_logo_url = get_field('group_of_companies_logo', $group_of_company->ID);\n\t\t\t\t?>\n\t\t\t\t<a href=\"<?php echo $group_of_companies_url ?>\" class=\"group-of-companies-box col-xs-12 col-sm-6 col-md-4\">\n\t\t\t\t\t<div class=\"item-card\">\n\t\t\t\t\t\t<div class=\"item-card-thumbnail\">\n\t\t\t\t\t\t\t<img src=\"<?php echo $group_of_companies_logo_url; ?>\" class=\"item-card-image\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"item-card-title turquoise-bg\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tif ($group_of_companies_title_length <= 32) {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<span class=\"item-title white-text\"><?php echo $group_of_companies_title; ?></span>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<span class=\"item-title white-text\" style=\"font-size:16px!important\"><?php echo $group_of_companies_title; ?></span>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\telse {\n\t\t// do nothing\n\t}\n}", "protected function getCommodities() {\n\t\t$db = JFactory::getDBO();\n\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName(array('a.id', 'a.category_id')));\n\t\t$query->select('CONCAT('.$db->quoteName('a.name').', \" (\",'.$db->quoteName('a.denomination').', \")\") name');\n\t\t$query->from($db->quoteName('#__gtpihps_commodities', 'a'));\n\t\t\n\t\t$query->where($db->quoteName('a.published') . ' = 1');\n\t\t$query->where($db->quoteName('a.short_name') . ' IS NOT NULL');\n\t\t$query->order($db->quoteName('a.id'));\n\t\t\n\t\t$db->setQuery($query);\n\t\t$raw = $db->loadObjectList();\n\t\t$data = array();\n\t\tforeach ($raw as $item) {\n\t\t\t$data[$item->category_id][$item->id] = $item->name;\n\t\t}\n\n\t\treturn $data;\n\t}", "public function getCompany() {\n if(!$this->department || !$this->department->department || !$this->department->department->division || !$this->department->department->division->company)\n return false;\n\n return $this->department->department->division->company;\n }", "public function index()\n {\n return Division::all();\n }", "function get_companies_linked_to_group_of_company() {\n\tglobal $post;\n\t/**\n\t * Check if there are companies linked to the post:\n\t */\n\tif (get_post_meta($post->ID, 'company_checkbox_meta', true)) {\n\t\t/**\n\t\t * Arguments for get posts:\n\t\t */\n\t\t$args = array(\n\t\t\t'orderby'\t\t =>\t'title',\n\t\t\t'order'\t\t\t =>\t'ASC',\n\t\t\t'post_type' => 'companies',\n\t\t\t'post_status' => 'publish',\n\t\t\t'posts_per_page' => -1\n\t\t);\n\t\t$companies = get_posts($args);\n\t\t$linked_companies_ids = get_post_meta($post->ID, 'company_checkbox_meta', true);\n\t\t?>\n\t\t<div class=\"company-isotope\">\n\t\t\t<?php\n\t\t\t/**\n\t\t\t * Go through all the posts:\n\t\t\t */\n\t\t\tforeach ($companies as $company) {\n\t\t\t\t/**\n\t\t\t\t * Go through all the linked id's\n\t\t\t\t */\n\t\t\t\tforeach ($linked_companies_ids as $linked_company_id) {\n\t\t\t\t\t/**\n\t\t\t\t\t * if linked company id == company id, then generate company card.\n\t\t\t\t\t */\n\t\t\t\t\tif ($linked_company_id == $company->ID) {\n\t\t\t\t\t\t$company_url = get_permalink($company->ID);\n\t\t\t\t\t\t$company_title = $company->post_title;\n\t\t\t\t\t\t$company_logo_url = get_field('company_logo', $company->ID);\n\t\t\t\t\t\t$company_title_length = strlen($company_title);\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<a href=\"<?php echo $company_url ?>\" class=\"company-box col-xs-12 col-sm-6 col-md-4\">\n\t\t\t\t\t\t\t<div class=\"item-card\">\n\t\t\t\t\t\t\t\t<div class=\"item-card-thumbnail\">\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo $company_logo_url; ?>\" class=\"item-card-image\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"item-card-title white-bg\">\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ($company_title_length <= 32) {\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<span class=\"item-title black-text\"><?php echo $company_title; ?></span>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<span class=\"item-title black-text\" style=\"font-size:16px!important\"><?php echo $company_title; ?></span>\n\t\t\t\t\t\t\t\t\t\t<?php\n\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</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// do nothing.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}\n\t/**\n\t * If there are no linked companies\n\t */\n\telse {\n\t\t// do nothing.\n\t}\n}", "public function allCompanies()\n {\n\n $companies = $this->core_companies;\n\n $items = [];\n foreach ($companies as $company) {\n\n $companyItem = new CompanyCardItem();\n $companyItem->id = $company->id;\n $companyItem->name = $company->name;\n //$companyItem->amount = $catalog->amount;\n $companyItem->title = $company->title;\n if (\\Dash\\count($company->photo))\n $companyItem->image = '/uploaz/eyuf/UserCompany/photo/' . $company->id . '/' . $company->photo[0];\n $companyItem->url = ZUrl::to([\n 'customer/markets/show',\n 'id' => $company->id\n ]);\n $companyItem->distence = \"12km\";\n //$companyItem->image = $catalog->price;\n //$companyItem->price = $catalog->price_old;\n //$companyItem->currency = \"$\";\n //$companyItem->cart_amount = 0;\n\n $items[] = $companyItem;\n }\n return $items;\n }", "public function getAvailableCompanies()\n {\n return $this->createQuery('c')\n ->select('c.*')\n ->addSelect(\n \"(SELECT ROUND(AVG(r.rating), 2)\n FROM Companies_Model_Review r\n WHERE r.status = '\" . Companies_Model_Review::STATUS_PUBLISHED . \"'\n AND r.company_id = c.id) as rating\"\n )\n ->addSelect(\"(SELECT COUNT(rc.id)\n FROM Companies_Model_Review rc\n WHERE rc.status = '\" . Companies_Model_Review::STATUS_PUBLISHED . \"'\n AND rc.company_id = c.id) as review_count\")\n ->whereIn('c.status', Companies_Model_Company::getActiveStatuses())\n ->orderBy('rating DESC')\n ->execute();\n }", "public function getCompanyEmployees();", "public function getCompaniesReport() : CompaniesReport\n\t{\n\t\t$response = $this->execute('Empresa');\n\t\t\n\t\t$companiesByArea = [];\n\t\tforeach($response['e'] as $areaPool){\n\t\t\t$i = $areaPool['a'];\n\t\t\tforeach($areaPool['e'] as $company){\n\t\t\t\t$companiesByArea[$i][]=new Company(\n\t\t\t\t\t$company['a'],\n\t\t\t\t\t$company['c'],\n\t\t\t\t\t$company['n']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn new CompaniesReport($response['hr'],$companiesByArea);\n\t}", "function GetCompetitors()\n\t{\n\t\t$result = $this->sendRequest(\"GetCompetitors\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function getCommodities() {\n\t\t$db\t\t= $this->_db;\n\t\t\n\t\t// Create a new query object.\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->select($db->quoteName(array('a.id', 'a.category_id', 'a.source_id', 'a.name', 'a.denomination')));\n\t\t$query->from($db->quoteName('#__gtpihpssurvey_ref_commodities', 'a'));\n\t\t$query->order($db->quoteName('a.id') . ' asc');\n\t\t$query->where($db->quoteName('a.published') . ' = 1');\n\t\t//echo nl2br(str_replace('#__','pihps_',$query));\n\t\t$db->setQuery($query);\n\t\t$data = $db->loadObjectList('id');\n\n\t\tforeach ($data as &$item) {\n\t\t\t$item->name = trim($item->name);\n\t\t}\n\n\t\treturn $data;\n\t}", "public function companies()\n {\n return $this->morphedByMany('App\\Company', 'taggable');\n }", "public function index()\n {\n $company = $this->repository->all();\n return $company;\n }", "public function getCompany()\n {\n return $this->company;\n }", "public static function excelDivisionsHeadings()\n {\n return [\n 'Divisions',\n 'Sub-Divisions',\n ];\n }", "public function findCompanies(){\n $data = SCompany::select('id_company', 'name')\n ->get();\n return response()->json($data);\n }", "public function get_company() \n {\n return $this->company;\n }", "public function division(){\n\t\t//$this->data['companyList']\t= $this->file_maintenance_model->get_comp_w_div();\n\t\t$this->load->view('app/administrator/file_maintenance/division', $this->data);\n\t}", "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 GetDomainCompetitors($domain){\r\n\r\n $url=\"http://widget.semrush.com/widget.php?action=report&type=organic_organic&db=co.in&domain=$domain\";\r\n $google_search = file_get_contents($url);\r\n $seo_data=json_decode($google_search,true);\r\n\r\n $c_array=array();\r\n\r\n if (is_array($seo_data['organic_organic']['data']))\r\n {\r\n foreach ($seo_data['organic_organic']['data'] as $key=>$value)\r\n {\r\n $com=$seo_data['organic_organic']['data'][$key]['Dn'];\r\n array_push($c_array, $com);\r\n\r\n }\r\n return $c_array;\r\n }\r\n return false;\r\n }", "public function check_div()\n\t{\n\t\t$company_id = $this->input->post('company_id');\n\t\tif($this->reports->check_div($company_id))\n\t\t{\n\t\t\t$data['div'] = $this->reports->getDivision($company_id);\n\t\t\t$data['class'] = $this->reports->getClassification($company_id);\n\t\t\techo json_encode($data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['dept'] = $this->reports->getDepartment($company_id);\n\t\t\t$data['class'] = $this->reports->getClassification($company_id);\n\t\t\techo json_encode($data);\n\t\t}\n\t}", "public function getCompanyWithUsers();", "public function getOriginCompanies () {\n $corp = $this->perteneceCorporacion();\n\n if ($corp) {\n return new ArrayObjectList([$corp, $this]);\n }\n\n return new ArrayObjectList([$this]);\n }", "function GetDivision () {\n return new Division ($this->hunt_division, $this->roster_coder);\n }", "public function getCompany()\n\t{\n\t\tif (!isset($this->_r_company)) {\n\t\t\t$filters = [];\n\t\t\tif(!is_null($v = $this->getCompanyId())){\n\t\t\t\t$filters['company_id'] = $v;\n\t\t\t}\n\t\t\tif (empty($filters)){\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$m = new DYCompaniesControllerRealR();\n\t\t\t$this->_r_company = $m->getItem($filters);\n\t\t}\n\n\t\treturn $this->_r_company;\n\t}", "public function getDivision() { \n if(!$this->department || !$this->department->department || !$this->department->department->division)\n return false;\n\n return $this->department->department->division;\n }", "function GetCompanies()\n{\n\t$CompArr=array();\n\t$Query = \"SELECT * FROM \".PFX.\"_tracker_client ORDER BY NAME ASC\";\n\t$Sql = new Query($Query);\n\twhile ($Row=$Sql->Row()) {\n\t\t$CompArr[$Sql->Position]['Name']=htmlspecialchars(stripslashes($Row->NAME));\n\t\t$CompArr[$Sql->Position]['Value']=$Row->ID;\n\t}\n\treturn $CompArr;\n}", "public function actionDividers() {\n\n // # Cache result forever\n $cached = Cache::rememberForever( 'actionDividers', function () {\n \n // # Container init\n $grouped = [];\n\n // loop through all dividers and group them by depth\n foreach ( Divider::all( ['id','sku','width','length','depth','imageH','imageV','color','border','texture','description','textureH','textureV','image3d','textureImg','model3d','baseTexture'] ) as $curDivider ) {\n\n // # TODO COMMENT\n $curSecondaryKey = $curDivider['width'].'X'.$curDivider['length'];\n $grouped[$curDivider['depth']][$curSecondaryKey]['items'][]=$curDivider;\n $grouped[$curDivider['depth']][$curSecondaryKey]['imageH']=$curDivider['imageH'];\n $grouped[$curDivider['depth']][$curSecondaryKey]['imageV']=$curDivider['imageV'];\n $grouped[$curDivider['depth']][$curSecondaryKey]['image3d']=$curDivider['image3d'];\n $grouped[$curDivider['depth']][$curSecondaryKey]['width']=$curDivider['width'];\n $grouped[$curDivider['depth']][$curSecondaryKey]['length']=$curDivider['length'];\n $grouped[$curDivider['depth']][$curSecondaryKey]['sku']=$curDivider['sku'];\n }\n\n // # toJson\n return json_encode( [ 'dividersCategories' => array_keys( $grouped ), 'dividers'=>$grouped ] );\n });\n\n\n // # Extract the dividers depth (Array keys) and build an array to transform in json\n return response()->make( $cached );\n }", "function competitors($domain) {\n $parameters = array(\n 'method' => __FUNCTION__,\n 'domain' => $domain\n );\n return $this->get_data($parameters);\n }", "public function getCompanyUnderMaintenanceVehicles($id_company = null) {\n\t\ttry {\n\t\t\tglobal $con;\t\t\t\n\t\t\t/* Statement declaration */\n\t\t\t$sql = \t\"SELECT * \".\n\t\t\t\t\t\"FROM vehicles v, kinds k, brands b, states s, categories c, energies en, models m, sites si, currencies cu \".\n\t\t\t\t\t\"WHERE v.id_energy = en.id_energy \".\n\t\t\t\t\t\t\"AND v.id_model = m.id_model \".\n\t\t\t\t\t\t\"AND v.id_kind = k.id_kind \".\n\t\t\t\t\t\t\"AND v.id_category = c.id_category \".\n\t\t\t\t\t\t\"AND v.id_state = s.id_state \".\n\t\t\t\t\t\t\"AND v.id_currency = cu.id_currency \".\n\t\t\t\t\t\t\"AND v.id_site = si.id_site \".\n\t\t\t\t\t\t\"AND si.id_company = :id_company \".\n\t\t\t\t\t\t\"AND m.id_brand = b.id_brand \".\n\t\t\t\t\t\t\"AND (v.id_vehicle IN (SELECT id_vehicle FROM maintenance WHERE date_endmaintenance > NOW()) \".\n\t\t\t\t\t\t\"OR v.id_vehicle IN (SELECT id_vehicle FROM maintenance WHERE date_endmaintenance = '0000-00-00'));\";\n\t\t\t\t\t\n\t\t\t/* Statement values & execution */\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindParam(':id_company', $id_company);\n\t\t\t\n\t\t\t/* Statement execution */\n\t\t\t$stmt->execute();\n\t\t\t\n\t\t\t/* Handle errors */\n\t\t\tif ($stmt->errno)\n\t\t\t throw new PDOException($stmt->error);\n\t\t\telse\n\t\t\t return $stmt->fetchAll(PDO::FETCH_OBJ);\n\t\t\t\n\t\t\t/* Close statement */\n\t\t\t$stmt->close();\n\t\t} catch(PDOException $e) {\n\t\t\treturn array(\"error\" => $e->getMessage());\n\t\t}\n }", "public function getSalesCenterAndCommodity(Request $request) {\n $client = Client::find($request->client_id);\n if (!empty($client)) {\n /* check user access level */\n if(Auth::check() && Auth::user()->hasAccessLevels('salescenter')) {\n $salesCenters = getAllSalesCenter();\n } else {\n $salesCenters = $client->salesCenters()->orderBy('name')->get();\n }\n $commodity = $client->commodity()->orderBy('name')->get();\n\n return response()->json([\n \"status\" => true,\n \"data\" => [\n 'sales_centers' => $salesCenters,\n 'commodity' => $commodity\n ]\n ]);\n } else {\n $salesCenters = getAllSalesCenter();\n $commodity = Commodity::orderBy('name')->get();\n return response()->json([\n\n \"status\" => true,\n \"data\" => [\n 'sales_centers' => $salesCenters,\n 'commodity' => $commodity\n ]\n ]);\n }\n }", "public function getCompaniesCrmSearchUrl()\n {\n $type = 'company' ;\n return $this->getEntitiesCrmSearchUrl( $type ) ;\n }", "public function index()\n {\n return Company::all();\n }", "public function index()\n {\n return Company::all();\n }", "public function company() \n\t{\n\t\treturn $this->belongsTo('Company', 'object_id')->where('soft_deleted', 0);\n\t}", "public function getContracts()\n {\n return $this->hasMany(Contracts::className(), ['company_id' => 'id']);\n }", "private function getCompanyCredits ()\n {\n $content = Utils::getContent($this->_strUrl . \"companycredits\");\n\n // get the uls order\n $order = [];\n foreach ($content->find(\"#company_credits_content h4\") as $title) {\n $order[] = $title->attr(\"id\");\n }\n\n $ulList = $content->find(\"#company_credits_content ul\");\n\n // get the uls order\n foreach ($order as $pos => $type)\n {\n foreach ($ulList[$pos]->find(\"li\") as $company)\n {\n $a = $company->find(\"a\")[0];\n\n preg_match(\"/\\/company\\/co([0-9]+)\\?/\", $a->attr(\"href\"), $matches);\n\n if (isset($matches[1]) && !empty($matches[1]))\n {\n $basicData = [\n \"id\" => $matches[1],\n \"name\" => $a->text(),\n ];\n\n if ($type == \"distributors\")\n {\n // Hispano Foxfilms S.A.E. (2009) (Spain) (theatrical) => (2009) (Spain) (theatrical)\n $remainingText = str_replace($basicData[\"name\"], \"\", $company->text());\n\n preg_match(\"/\\(([0-9]{4})-?\\) \\(([A-Za-z0-9_.]+)\\) \\((?:theatrical|TV)\\)/\", $remainingText, $matches);\n\n if (!empty($matches)) {\n $basicData[\"year\"] = (int)$matches[1];\n $basicData[\"country\"] = $matches[2];\n $this->{$type}[] = $basicData;\n }\n } else {\n $this->{$type}[] = $basicData;\n }\n }\n }\n }\n }", "public function getCompanyId()\n {\n return $this->company_id;\n }", "public function getCompanyId()\n {\n return $this->company_id;\n }", "public function check_div()\n\t{\n\t\t$company_id = $this->input->post('company_id');\n\t\tif ($company_id == 'All') \n\t\t{\n\t\t\t$data['div'] = $this->file_maintenance_model->getDivision($company_id);\n\t\t\techo json_encode($data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($this->file_maintenance_model->check_div($company_id))\n\t\t\t{\n\t\t\t\tif ($this->file_maintenance_model->check_div_value($company_id)) \n\t\t\t\t{\n\t\t\t\t\t$data['div'] = $this->file_maintenance_model->getDivision($company_id);\n\t\t\t\t\techo json_encode($data);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['div'] = null;\n\t\t\t\t\techo json_encode($data);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($this->file_maintenance_model->check_dept_value($company_id)) \n\t\t\t\t{\n\t\t\t\t\t$data['dept'] = $this->file_maintenance_model->getDepartment($company_id);\n\t\t\t\t\techo json_encode($data);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['dept'] = null;\n\t\t\t\t\techo json_encode($data);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function get_company() {\n\t\t\treturn $this->belongsTo(Company::class);\n\t}", "public function getCompany(Company $company)\n {\n return TimelineResource::collection($company->timeline()->paginate());\n }", "public function getOperatingCompany()\n {\n return $this->operatingCompany;\n }", "public static function information(Company $company): array\n {\n $teams = $company->teams->count();\n $employees = $company->employees()->notLocked()->count();\n\n return [\n 'number_of_teams' => $teams,\n 'number_of_employees' => $employees,\n 'logo' => $company->logo ? ImageHelper::getImage($company->logo, 75, 75) : null,\n 'founded_at' => $company->founded_at ? $company->founded_at->year : null,\n ];\n }", "function GetDivisionID () {\n return $this->hunt_division;\n }", "public function index($company)\n {\n $result = Uniformer::where('company', '=', $company)\n ->groupBy('uniform_id', 'date', 'personnel')\n ->selectRaw('uniform_id, date, personnel, sum(quantity) as quantity')\n ->orderby('date', 'DESC')\n ->get();\n\n return $result;\n }", "public function companies()\n {\n return $this->hasMany('App\\Company');\n }", "public function company()\n {\n return $this->belongsTo(\\Fleetbase\\Models\\Company::class);\n }", "public function actionGetCompanyInfo()\n {\n if (Yii::app()->request->isAjaxRequest && isset($_POST['comId'])) {\n $comId = intval($_POST['comId']);\n if ($comId > 0) {\n $company = Companies::model()->with('adreses', 'client')->findByPk($comId);\n $client = $company->client;\n $adress = $company->adreses[0];\n\n $condition = UsersClientList::getClientAdminCondition($client->Client_ID);\n $clientAdmins = UsersClientList::model()->find($condition);\n\n $adminPerson = '';\n if ($clientAdmins) {\n $clientAdmin = Users::model()->with('person')->findByPk($clientAdmins->User_ID);\n $adminPerson = $clientAdmin->person;\n }\n\n $lastDocument = W9::getCompanyW9Doc($client->Client_ID);\n\n $this->renderPartial('company_info_block', array(\n 'company' => $company,\n 'adress' => $adress,\n 'adminPerson' => $adminPerson,\n 'lastDocument' => $lastDocument,\n ));\n }\n }\n }", "function get_internships_by_company($id) {\n return get_view_data_where('internships', $id);\n}", "public static function retrieveAll(){\n\n $myDataAccess = aContentAreaDataAccess::getInstance();\n\n $myDataAccess->connectToDB();\n\n $myDataAccess->selectDivs();\n\n $numberOfRecords = 0;\n\n while($row = $myDataAccess->fetchDivs())\n {\n $currentDiv = new self(\n $myDataAccess->fetchAlias($row),\n //$myDataAccess->fetchCreated($row),\n //$myDataAccess->fetchCreatedBy($row),\n $myDataAccess->fetchDescription($row),\n $myDataAccess->fetchDivId($row),\n $myDataAccess->fetchDivOrder($row),\n //$myDataAccess->fetchLastModified($row),\n //$myDataAccess->fetchModifiedBy($row),\n $myDataAccess->fetchName($row)\n );\n\n $arrayOfDivs[] = $currentDiv;\n\n }\n\n $myDataAccess->closeDB();\n\n return $arrayOfDivs;\n }", "public function getCompany() {\n return $this->belongsTo(Company::class);\n }", "public function run($company = null)\n {\n \tSchema::connection('service')->disableForeignKeyConstraints();\n\n $service = DB::table('admin_services')->where('admin_service', 'SERVICE')->first();\n\n $Electrician_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Electrician')->first()->id;\n $Plumber_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Plumber')->first()->id;\n $Tutors_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Tutors')->first()->id;\n $Carpenter_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Carpenter')->first()->id;\n $Mechanic_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Mechanic')->first()->id;\n $Beautician_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Beautician')->first()->id;\n $DJ_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'DJ')->first()->id;\n $Massage_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Massage')->first()->id;\n $Tow_Truck_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Tow Truck')->first()->id;\n $Painting_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Painting')->first()->id;\n $Car_Wash_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Car Wash')->first()->id;\n $PhotoGraphy_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'PhotoGraphy')->first()->id;\n $Doctors_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Doctors')->first()->id;\n $Dog_Walking_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Dog Walking')->first()->id;\n $Baby_Sitting_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Baby Sitting')->first()->id;\n $Fitness_Coach_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Fitness Coach')->first()->id;\n $Maids_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Maids')->first()->id;\n $Pest_Control_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Pest Control')->first()->id;\n $Home_Painting_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Home Painting')->first()->id;\n $PhysioTheraphy_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'PhysioTheraphy')->first()->id;\n $Catering_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Catering')->first()->id;\n $Dog_Gromming_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Dog Grooming')->first()->id;\n $Vet_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Vet')->first()->id;\n $Snow_Plows_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Snow Plows')->first()->id;\n $Workers_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Workers')->first()->id;\n $Lock_Smith_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Lock Smith')->first()->id;\n $Travel_Agent_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Travel Agent')->first()->id;\n $Tour_Guide_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Tour Guide')->first()->id;\n $Insurance_Agent_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Insurance Agent')->first()->id;\n $Security_Guard_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Security Guard')->first()->id;\n $Fuel_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Fuel')->first()->id;\n $Law_Mowing_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Lawn Mowing')->first()->id;\n $Barber_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Barber')->first()->id;\n $Interior_Decorator_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Interior Decorator')->first()->id;\n $Lawn_Care_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Lawn Care')->first()->id;\n $Carpet_Repairer_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Carpet Repairer')->first()->id;\n $Computer_Repairer_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Computer Repairer')->first()->id;\n $Cuddling_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Cuddling')->first()->id;\n $Fire_Fighters_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Fire Fighters')->first()->id;\n $Helpers_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Helpers')->first()->id;\n $Lawyers_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Lawyers')->first()->id;\n $Mobile_Technician_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Mobile Technician')->first()->id;\n $Office_Cleaning_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Office Cleaning')->first()->id;\n $Party_Cleaning_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Party Cleaning')->first()->id;\n $Psychologist_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Psychologist')->first()->id;\n $Road_Assistance_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Road Assistance')->first()->id;\n $Sofa_Repairer_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Sofa Repairer')->first()->id;\n $Spa_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Spa')->first()->id;\n $Translator_category = DB::connection('service')->table('service_categories')->where('company_id', $company)->where('service_category_name', 'Translator')->first()->id;\n\n\n\n $Wiring = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Electrician_category)->where('company_id', $company)->where('service_subcategory_name', 'Wiring')->first()->id;\n$Blocks_and_Leakage = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Plumber_category)->where('company_id', $company)->where('service_subcategory_name', 'Blocks and Leakage')->first()->id;\n$Maths = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Tutors_category)->where('company_id', $company)->where('service_subcategory_name', 'Maths')->first()->id;\n$Science = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Tutors_category)->where('company_id', $company)->where('service_subcategory_name', 'Science')->first()->id;\n$Bolt_Latch = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Carpenter_category)->where('company_id', $company)->where('service_subcategory_name', 'Bolt Latch')->first()->id;\n$Furniture_Installation = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Carpenter_category)->where('company_id', $company)->where('service_subcategory_name', 'Furniture Installation')->first()->id;\n$Carpentry_Work = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Carpenter_category)->where('company_id', $company)->where('service_subcategory_name', 'Carpentry Work')->first()->id;\n$General_Mechanic = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Mechanic_category)->where('company_id', $company)->where('service_subcategory_name', 'General Mechanic')->first()->id;\n$Car_Mechanic = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Mechanic_category)->where('company_id', $company)->where('service_subcategory_name', 'Car Mechanic')->first()->id;\n$Bike_Mechanic = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Mechanic_category)->where('company_id', $company)->where('service_subcategory_name', 'Bike Mechanic')->first()->id;\n$Hair_Style = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Beautician_category)->where('company_id', $company)->where('service_subcategory_name', 'Hair Style')->first()->id;\n$Makeup = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Beautician_category)->where('company_id', $company)->where('service_subcategory_name', 'Makeup')->first()->id;\n$BlowOut = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Beautician_category)->where('company_id', $company)->where('service_subcategory_name', 'BlowOut')->first()->id;\n$Facial = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Beautician_category)->where('company_id', $company)->where('service_subcategory_name', 'Facial')->first()->id;\n$Weddings = DB::connection('service')->table('service_subcategories')->where('service_category_id', $DJ_category)->where('company_id', $company)->where('service_subcategory_name', 'Weddings')->first()->id;\n$Parties = DB::connection('service')->table('service_subcategories')->where('service_category_id', $DJ_category)->where('company_id', $company)->where('service_subcategory_name', 'Parties')->first()->id;\n$Deep_Tissue_Massage = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Massage_category)->where('company_id', $company)->where('service_subcategory_name', 'Deep Tissue Massage')->first()->id;\n$Thai_Massage = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Massage_category)->where('company_id', $company)->where('service_subcategory_name', 'Thai Massage')->first()->id;\n$Swedish_Massage = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Massage_category)->where('company_id', $company)->where('service_subcategory_name', 'Swedish Massage')->first()->id;\n$Flat_Tier = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Tow_Truck_category)->where('company_id', $company)->where('service_subcategory_name', 'Flat Tier')->first()->id;\n$Towing = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Tow_Truck_category)->where('company_id', $company)->where('service_subcategory_name', 'Towing')->first()->id;\n$Key_Lock_Out = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Tow_Truck_category)->where('company_id', $company)->where('service_subcategory_name', 'Key Lock Out')->first()->id;\n$Interior_Painting = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Painting_category)->where('company_id', $company)->where('service_subcategory_name', 'Interior Painting')->first()->id;\n$Exterior_Painting = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Painting_category)->where('company_id', $company)->where('service_subcategory_name', 'Exterior Painting')->first()->id;\n$Wedding = DB::connection('service')->table('service_subcategories')->where('service_category_id', $PhotoGraphy_category)->where('company_id', $company)->where('service_subcategory_name', 'Wedding')->first()->id;\n$Tap_and_wash_basin = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Plumber_category)->where('company_id', $company)->where('service_subcategory_name', 'Tap and wash basin')->first()->id;\n$Fans = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Electrician_category)->where('company_id', $company)->where('service_subcategory_name', 'Fans')->first()->id;\n$Switches_and_Meters = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Electrician_category)->where('company_id', $company)->where('service_subcategory_name', 'Switches and Meters')->first()->id;\n$Lights = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Electrician_category)->where('company_id', $company)->where('service_subcategory_name', 'Lights')->first()->id;\n$Others = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Electrician_category)->where('company_id', $company)->where('service_subcategory_name', 'Others')->first()->id;\n$Toilet = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Plumber_category)->where('company_id', $company)->where('service_subcategory_name', 'Toilet')->first()->id;\n$Bathroom_Fitting = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Plumber_category)->where('company_id', $company)->where('service_subcategory_name', 'Bathroom Fitting')->first()->id;\n$Water_Tank = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Plumber_category)->where('company_id', $company)->where('service_subcategory_name', 'Water Tank')->first()->id;\n$Walking = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Dog_Walking_category)->where('company_id', $company)->where('service_subcategory_name', 'Walking')->first()->id;\n$Day_Care = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Baby_Sitting_category)->where('company_id', $company)->where('service_subcategory_name', 'Day Care')->first()->id;\n$English = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Tutors_category)->where('company_id', $company)->where('service_subcategory_name', 'English')->first()->id;\n$Social_Science = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Tutors_category)->where('company_id', $company)->where('service_subcategory_name', 'Social Science')->first()->id;\n$Computer = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Tutors_category)->where('company_id', $company)->where('service_subcategory_name', 'Computer')->first()->id;\n$Hatchback = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Car_Wash_category)->where('company_id', $company)->where('service_subcategory_name', 'Hatchback')->first()->id;\n$Sedan = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Car_Wash_category)->where('company_id', $company)->where('service_subcategory_name', 'Sedan')->first()->id;\n$SUV = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Car_Wash_category)->where('company_id', $company)->where('service_subcategory_name', 'SUV')->first()->id;\n$Photoshoot = DB::connection('service')->table('service_subcategories')->where('service_category_id', $PhotoGraphy_category)->where('company_id', $company)->where('service_subcategory_name', 'Photoshoot')->first()->id;\n$General_Physician = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Doctors_category)->where('company_id', $company)->where('service_subcategory_name', 'General Physician')->first()->id;\n$Cardiologist = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Doctors_category)->where('company_id', $company)->where('service_subcategory_name', 'Cardiologist')->first()->id;\n$Dermatologist = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Doctors_category)->where('company_id', $company)->where('service_subcategory_name', 'Dermatologist')->first()->id;\n$After_School_Sitters = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Baby_Sitting_category)->where('company_id', $company)->where('service_subcategory_name', 'After School Sitters')->first()->id;\n$Date_Night_sitters = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Baby_Sitting_category)->where('company_id', $company)->where('service_subcategory_name', 'Date Night sitters')->first()->id;\n$Tutoring_and_lessons = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Baby_Sitting_category)->where('company_id', $company)->where('service_subcategory_name', 'Tutoring and lessons')->first()->id;\n$Aerobic_Exercise = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Fitness_Coach_category)->where('company_id', $company)->where('service_subcategory_name', 'Aerobic Exercise')->first()->id;\n$Resistance_Exercise = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Fitness_Coach_category)->where('company_id', $company)->where('service_subcategory_name', 'Resistance Exercise')->first()->id;\n$Flexibility_Training = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Fitness_Coach_category)->where('company_id', $company)->where('service_subcategory_name', 'Flexibility Training')->first()->id;\n$Full_Home_Deep_Cleaning = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Maids_category)->where('company_id', $company)->where('service_subcategory_name', 'Full Home Deep Cleaning')->first()->id;\n$Post_Party_Cleaning = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Maids_category)->where('company_id', $company)->where('service_subcategory_name', 'Party Cleaning')->first()->id;\n$Office_Cleaning = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Maids_category)->where('company_id', $company)->where('service_subcategory_name', 'Office Cleaning')->first()->id;\n$Water_Tank_Storage_Cleaning = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Maids_category)->where('company_id', $company)->where('service_subcategory_name', 'Water Tank Storage Cleaning')->first()->id;\n$Termite_Cleaning = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Pest_Control_category)->where('company_id', $company)->where('service_subcategory_name', 'Termite Cleaning')->first()->id;\n$Cockroach_Treatment = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Pest_Control_category)->where('company_id', $company)->where('service_subcategory_name', 'Cockroach Treatment')->first()->id;\n$Bed_Bugs_Treatment = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Pest_Control_category)->where('company_id', $company)->where('service_subcategory_name', 'Bed Bugs Treatment')->first()->id;\n$Mosquito_Treatment = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Pest_Control_category)->where('company_id', $company)->where('service_subcategory_name', 'Mosquito Treatment')->first()->id;\n$Muscle_and_Joint_Pain = DB::connection('service')->table('service_subcategories')->where('service_category_id', $PhysioTheraphy_category)->where('company_id', $company)->where('service_subcategory_name', 'Muscle and Joint Pain')->first()->id;\n$Knee_Pain = DB::connection('service')->table('service_subcategories')->where('service_category_id', $PhysioTheraphy_category)->where('company_id', $company)->where('service_subcategory_name', 'Knee Pain')->first()->id;\n$sciatica = DB::connection('service')->table('service_subcategories')->where('service_category_id', $PhysioTheraphy_category)->where('company_id', $company)->where('service_subcategory_name', 'sciatica')->first()->id;\n$Lunch_Meetings = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Catering_category)->where('company_id', $company)->where('service_subcategory_name', 'Lunch Meetings')->first()->id;\n$Wedding_Catering = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Catering_category)->where('company_id', $company)->where('service_subcategory_name', 'Wedding Catering')->first()->id;\n$Event_Catering = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Catering_category)->where('company_id', $company)->where('service_subcategory_name', 'Event Catering')->first()->id;\n$Office_Catering = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Catering_category)->where('company_id', $company)->where('service_subcategory_name', 'Office Catering')->first()->id;\n$Clippers_and_Scissors = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Dog_Gromming_category)->where('company_id', $company)->where('service_subcategory_name', 'Clippers and Scissors')->first()->id;\n$Nail_Clippers = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Dog_Gromming_category)->where('company_id', $company)->where('service_subcategory_name', 'Nail Clippers')->first()->id;\n$Brushes_and_Combs = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Dog_Gromming_category)->where('company_id', $company)->where('service_subcategory_name', 'Brushes and Combs')->first()->id;\n$Surgery = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Vet_category)->where('company_id', $company)->where('service_subcategory_name', 'Surgery')->first()->id;\n$Vaccine = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Vet_category)->where('company_id', $company)->where('service_subcategory_name', 'Vaccine')->first()->id;\n$Disease = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Vet_category)->where('company_id', $company)->where('service_subcategory_name', 'Disease')->first()->id;\n$Plow_Category_1 = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Snow_Plows_category)->where('company_id', $company)->where('service_subcategory_name', 'Plow Category 1')->first()->id;\n$Plow_Category_2 = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Snow_Plows_category)->where('company_id', $company)->where('service_subcategory_name', 'Plow Category 2')->first()->id;\n$Home_Work = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Workers_category)->where('company_id', $company)->where('service_subcategory_name', 'Home Work')->first()->id;\n$Office_Work = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Workers_category)->where('company_id', $company)->where('service_subcategory_name', 'Office Work')->first()->id;\n$Residential = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Lock_Smith_category)->where('company_id', $company)->where('service_subcategory_name', 'Residential')->first()->id;\n$Commercial = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Lock_Smith_category)->where('company_id', $company)->where('service_subcategory_name', 'Commercial')->first()->id;\n$Automobile = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Lock_Smith_category)->where('company_id', $company)->where('service_subcategory_name', 'Automobile')->first()->id;\n$Ticket_Booking = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Travel_Agent_category)->where('company_id', $company)->where('service_subcategory_name', 'Ticket Booking')->first()->id;\n$Hotel_Booking = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Travel_Agent_category)->where('company_id', $company)->where('service_subcategory_name', 'Hotel Booking')->first()->id;\n$Sight_Seeing = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Tour_Guide_category)->where('company_id', $company)->where('service_subcategory_name', 'Sight Seeing')->first()->id;\n$Trekking = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Tour_Guide_category)->where('company_id', $company)->where('service_subcategory_name', 'Trekking')->first()->id;\n$Walking_Tour = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Tour_Guide_category)->where('company_id', $company)->where('service_subcategory_name', 'Walking Tour')->first()->id;\n$Health_Insurance_Agent = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Insurance_Agent_category)->where('company_id', $company)->where('service_subcategory_name', 'Health Insurance Agent')->first()->id;\n$Mutual_Fund_Agent = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Insurance_Agent_category)->where('company_id', $company)->where('service_subcategory_name', 'Mutual Fund Agent')->first()->id;\n$Personal_Security = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Security_Guard_category)->where('company_id', $company)->where('service_subcategory_name', 'Personal Security')->first()->id;\n$Commercial_Security = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Security_Guard_category)->where('company_id', $company)->where('service_subcategory_name', 'Commercial Security')->first()->id;\n$Residential_Category = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Security_Guard_category)->where('company_id', $company)->where('service_subcategory_name', 'Residential Category')->first()->id;\n$Petrol = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Fuel_category)->where('company_id', $company)->where('service_subcategory_name', 'Petrol')->first()->id;\n$Diesel = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Fuel_category)->where('company_id', $company)->where('service_subcategory_name', 'Diesel')->first()->id;\n$LPG = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Fuel_category)->where('company_id', $company)->where('service_subcategory_name', 'LPG')->first()->id;\n$_to_2000_Sqft_Lawn = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Law_Mowing_category)->where('company_id', $company)->where('service_subcategory_name', '0 to 2000 Sqft Lawn')->first()->id;\n$_to_4000_Sqft_Lawn = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Law_Mowing_category)->where('company_id', $company)->where('service_subcategory_name', '2000 to 4000 Sqft Lawn')->first()->id;\n$_to_6000_Sqft_Lawn = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Law_Mowing_category)->where('company_id', $company)->where('service_subcategory_name', '4000 to 6000 Sqft Lawn')->first()->id;\n$Hair_Cutting = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Barber_category)->where('company_id', $company)->where('service_subcategory_name', 'Hair Cutting')->first()->id;\n$Hair_Dressing = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Barber_category)->where('company_id', $company)->where('service_subcategory_name', 'Hair Dressing')->first()->id;\n$Shaving = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Barber_category)->where('company_id', $company)->where('service_subcategory_name', 'Shaving')->first()->id;\n$Home_Interior = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Interior_Decorator_category)->where('company_id', $company)->where('service_subcategory_name', 'Home Interior')->first()->id;\n$Office_Interior = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Interior_Decorator_category)->where('company_id', $company)->where('service_subcategory_name', 'Office Interior')->first()->id; \n$Pest_Control = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Lawn_Care_category)->where('company_id', $company)->where('service_subcategory_name', 'Pest Control')->first()->id;\n$Mosquito_Treatment = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Lawn_Care_category)->where('company_id', $company)->where('service_subcategory_name', 'Mosquito Treatment')->first()->id;\n$Bed_Bug_Treatment = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Lawn_Care_category)->where('company_id', $company)->where('service_subcategory_name', 'Bed Bug Treatment')->first()->id;\n$Sofa_Cleaning_Services = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Carpet_Repairer_category)->where('company_id', $company)->where('service_subcategory_name', 'Sofa Cleaning Services')->first()->id;\n$Carpet_Shampooing_Services = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Carpet_Repairer_category)->where('company_id', $company)->where('service_subcategory_name', 'Carpet Shampooing Services')->first()->id;\n$Commercial_Carpet_Cleaning = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Carpet_Repairer_category)->where('company_id', $company)->where('service_subcategory_name', 'Commercial Carpet Cleaning')->first()->id;\n$Laptop = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Computer_Repairer_category)->where('company_id', $company)->where('service_subcategory_name', 'Laptop')->first()->id;\n$Desktop = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Computer_Repairer_category)->where('company_id', $company)->where('service_subcategory_name', 'Desktop')->first()->id;\n$Mac = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Computer_Repairer_category)->where('company_id', $company)->where('service_subcategory_name', 'Mac')->first()->id;\n$Category_Cuddling_1 = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Cuddling_category)->where('company_id', $company)->where('service_subcategory_name', 'Category 1')->first()->id;\n$Category_Cuddling_2 = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Cuddling_category)->where('company_id', $company)->where('service_subcategory_name', 'Category 2')->first()->id;\n$Water_Pumps_and_hoses = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Fire_Fighters_category)->where('company_id', $company)->where('service_subcategory_name', 'Water Pumps and hoses')->first()->id;\n$Fire_Extinguishers = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Fire_Fighters_category)->where('company_id', $company)->where('service_subcategory_name', 'Fire Extinguishers')->first()->id;\n$Category_1 = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Helpers_category)->where('company_id', $company)->where('service_subcategory_name', 'Category 1')->first()->id;\n$Category_2 = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Helpers_category)->where('company_id', $company)->where('service_subcategory_name', 'Category 2')->first()->id;\n$Civil_Lawyers = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Lawyers_category)->where('company_id', $company)->where('service_subcategory_name', 'Civil Lawyers')->first()->id;\n$Lawyers_for_Property_Case = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Lawyers_category)->where('company_id', $company)->where('service_subcategory_name', 'Lawyers for Property Case')->first()->id;\n$Mobile = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Mobile_Technician_category)->where('company_id', $company)->where('service_subcategory_name', 'Mobile')->first()->id;\n$Vacuum_All_Floors = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Office_Cleaning_category)->where('company_id', $company)->where('service_subcategory_name', 'Vacuum All Floors')->first()->id;\n$Clean_and_Replace_bins = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Office_Cleaning_category)->where('company_id', $company)->where('service_subcategory_name', 'Clean and Replace bins')->first()->id;\n$Lobby_and_Workplace = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Office_Cleaning_category)->where('company_id', $company)->where('service_subcategory_name', 'Lobby and Workplace')->first()->id;\n$Dinning_Washout = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Party_Cleaning_category)->where('company_id', $company)->where('service_subcategory_name', 'Dinning Washout')->first()->id;\n$Table_Cleaning = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Party_Cleaning_category)->where('company_id', $company)->where('service_subcategory_name', 'Table Cleaning')->first()->id;\n$Counselors = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Psychologist_category)->where('company_id', $company)->where('service_subcategory_name', 'Counselors')->first()->id;\n$Child_Psychologist = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Psychologist_category)->where('company_id', $company)->where('service_subcategory_name', 'Child Psychologist')->first()->id;\n$Cognitive_Behavioral_Therapists = DB::connection('service')->table('service_subcategories')->where('company_id', $company)->where('service_category_id', $Psychologist_category)->where('service_subcategory_name', 'Cognitive Behavioral Therapists')->first()->id;\n$Vehicle_Breakdown = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Road_Assistance_category)->where('company_id', $company)->where('service_subcategory_name', 'Vehicle Breakdown')->first()->id;\n$Towing = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Road_Assistance_category)->where('company_id', $company)->where('service_subcategory_name', 'Towing')->first()->id;\n$Battery_Service = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Road_Assistance_category)->where('company_id', $company)->where('service_subcategory_name', 'Battery Service')->first()->id;\n$Furniture_Repair = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Sofa_Repairer_category)->where('company_id', $company)->where('service_subcategory_name', 'Furniture Repair')->first()->id;\n$Chair_Repair = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Sofa_Repairer_category)->where('company_id', $company)->where('service_subcategory_name', 'Chair Repair')->first()->id;\n$Furniture_Upholstery = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Sofa_Repairer_category)->where('company_id', $company)->where('service_subcategory_name', 'Furniture Upholstery')->first()->id;\n$Aromatherapy_Massage = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Spa_category)->where('company_id', $company)->where('service_subcategory_name', 'Aromatherapy Massage')->first()->id;\n$Balinese_Massage = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Spa_category)->where('company_id', $company)->where('service_subcategory_name', 'Balinese Massage')->first()->id;\n$Swedish_Massage = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Spa_category)->where('company_id', $company)->where('service_subcategory_name', 'Swedish Massage')->first()->id;\n$Category_1 = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Translator_category)->where('company_id', $company)->where('service_subcategory_name', 'Category 1')->first()->id;\n$Category_2 = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Translator_category)->where('company_id', $company)->where('service_subcategory_name', 'Category 2')->first()->id;\n$Fridge = DB::connection('service')->table('service_subcategories')->where('service_category_id', $Mechanic_category)->where('company_id', $company)->where('service_subcategory_name', 'Fridge')->first()->id;\n\n $services = [\n \n ['service_category_id' => $Electrician_category, 'service_subcategory_id' => $Wiring, 'company_id' => $company, 'service_name' => 'Repair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Plumber_category, 'service_subcategory_id' => $Blocks_and_Leakage, 'company_id' => $company, 'service_name' => 'Fitting or Installation', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $Maths, 'company_id' => $company, 'service_name' => 'Algebra', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $Maths, 'company_id' => $company, 'service_name' => 'Calculus and Analysis', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $Maths, 'company_id' => $company, 'service_name' => 'Geometry', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $Science, 'company_id' => $company, 'service_name' => 'Physics', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $Science, 'company_id' => $company, 'service_name' => 'Chemistry', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $Science, 'company_id' => $company, 'service_name' => 'Biology', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Carpenter_category, 'service_subcategory_id' => $Bolt_Latch, 'company_id' => $company, 'service_name' => 'Door Stopper', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Carpenter_category, 'service_subcategory_id' => $Bolt_Latch, 'company_id' => $company, 'service_name' => 'Door Handle', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Carpenter_category, 'service_subcategory_id' => $Furniture_Installation, 'company_id' => $company, 'service_name' => 'Lock and Others', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Carpenter_category, 'service_subcategory_id' => $Carpentry_Work, 'company_id' => $company, 'service_name' => 'Wooden Partion', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Carpenter_category, 'service_subcategory_id' => $Carpentry_Work, 'company_id' => $company, 'service_name' => 'Wooden Partition', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Mechanic_category, 'service_subcategory_id' => $General_Mechanic, 'company_id' => $company, 'service_name' => 'Oil change', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Mechanic_category, 'service_subcategory_id' => $General_Mechanic, 'company_id' => $company, 'service_name' => 'General Service', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Mechanic_category, 'service_subcategory_id' => $Car_Mechanic, 'company_id' => $company, 'service_name' => 'Oil Change', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Mechanic_category, 'service_subcategory_id' => $Car_Mechanic, 'company_id' => $company, 'service_name' => 'General Service', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Mechanic_category, 'service_subcategory_id' => $Bike_Mechanic, 'company_id' => $company, 'service_name' => 'Oil Change', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Beautician_category, 'service_subcategory_id' => $Hair_Style, 'company_id' => $company, 'service_name' => 'Long Hair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Beautician_category, 'service_subcategory_id' => $Hair_Style, 'company_id' => $company, 'service_name' => 'Medium Hair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Beautician_category, 'service_subcategory_id' => $Hair_Style, 'company_id' => $company, 'service_name' => 'Short Hair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Beautician_category, 'service_subcategory_id' => $Makeup, 'company_id' => $company, 'service_name' => 'Bridal Makeup', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Beautician_category, 'service_subcategory_id' => $Makeup, 'company_id' => $company, 'service_name' => 'Party Makeup', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Beautician_category, 'service_subcategory_id' => $Makeup, 'company_id' => $company, 'service_name' => 'PhotoShoot', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Beautician_category, 'service_subcategory_id' => $BlowOut, 'company_id' => $company, 'service_name' => 'Curly Hair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Beautician_category, 'service_subcategory_id' => $BlowOut, 'company_id' => $company, 'service_name' => 'Long Hair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Beautician_category, 'service_subcategory_id' => $Facial, 'company_id' => $company, 'service_name' => 'Back Facial', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $DJ_category, 'service_subcategory_id' => $Weddings, 'company_id' => $company, 'service_name' => 'Pop', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $DJ_category, 'service_subcategory_id' => $Weddings, 'company_id' => $company, 'service_name' => 'Jazz', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $DJ_category, 'service_subcategory_id' => $Weddings, 'company_id' => $company, 'service_name' => 'Classical', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $DJ_category, 'service_subcategory_id' => $Parties, 'company_id' => $company, 'service_name' => 'Folk', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $DJ_category, 'service_subcategory_id' => $Parties, 'company_id' => $company, 'service_name' => 'Jazz', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $DJ_category, 'service_subcategory_id' => $Parties, 'company_id' => $company, 'service_name' => 'Classical', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Massage_category, 'service_subcategory_id' => $Deep_Tissue_Massage, 'company_id' => $company, 'service_name' => '30 Min', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Massage_category, 'service_subcategory_id' => $Deep_Tissue_Massage, 'company_id' => $company, 'service_name' => '45 Min', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Massage_category, 'service_subcategory_id' => $Thai_Massage, 'company_id' => $company, 'service_name' => '30 Min', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Massage_category, 'service_subcategory_id' => $Thai_Massage, 'company_id' => $company, 'service_name' => '60 Min', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Massage_category, 'service_subcategory_id' => $Swedish_Massage, 'company_id' => $company, 'service_name' => '30 Min', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Massage_category, 'service_subcategory_id' => $Swedish_Massage, 'company_id' => $company, 'service_name' => '45 Min', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tow_Truck_category, 'service_subcategory_id' => $Flat_Tier, 'company_id' => $company, 'service_name' => 'Single Tier', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tow_Truck_category, 'service_subcategory_id' => $Key_Lock_Out, 'company_id' => $company, 'service_name' => 'Key Lock Out', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tow_Truck_category, 'service_subcategory_id' => $Towing, 'company_id' => $company, 'service_name' => 'Load Truck', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Painting_category, 'service_subcategory_id' => $Interior_Painting, 'company_id' => $company, 'service_name' => 'Repainting', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Painting_category, 'service_subcategory_id' => $Interior_Painting, 'company_id' => $company, 'service_name' => 'Fresh Painting', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Painting_category, 'service_subcategory_id' => $Exterior_Painting, 'company_id' => $company, 'service_name' => 'Repainting', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Painting_category, 'service_subcategory_id' => $Exterior_Painting, 'company_id' => $company, 'service_name' => 'Fresh Painting', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $PhotoGraphy_category, 'service_subcategory_id' => $Wedding, 'company_id' => $company, 'service_name' => 'Canon', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $Maths, 'company_id' => $company, 'service_name' => 'Probability', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Electrician_category, 'service_subcategory_id' => $Fans, 'company_id' => $company, 'service_name' => 'Wiring', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Electrician_category, 'service_subcategory_id' => $Fans, 'company_id' => $company, 'service_name' => 'Installation', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Electrician_category, 'service_subcategory_id' => $Wiring, 'company_id' => $company, 'service_name' => 'Installation', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Electrician_category, 'service_subcategory_id' => $Switches_and_Meters, 'company_id' => $company, 'service_name' => 'Repair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Electrician_category, 'service_subcategory_id' => $Switches_and_Meters, 'company_id' => $company, 'service_name' => 'Installation', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Electrician_category, 'service_subcategory_id' => $Lights, 'company_id' => $company, 'service_name' => 'Repair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Electrician_category, 'service_subcategory_id' => $Others, 'company_id' => $company, 'service_name' => 'Fuse Repair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Electrician_category, 'service_subcategory_id' => $Others, 'company_id' => $company, 'service_name' => 'AC Installation', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Plumber_category, 'service_subcategory_id' => $Tap_and_wash_basin, 'company_id' => $company, 'service_name' => 'Fitting or Installation', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Plumber_category, 'service_subcategory_id' => $Tap_and_wash_basin, 'company_id' => $company, 'service_name' => 'Repair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Plumber_category, 'service_subcategory_id' => $Toilet, 'company_id' => $company, 'service_name' => 'Fitting or Installtion', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Plumber_category, 'service_subcategory_id' => $Toilet, 'company_id' => $company, 'service_name' => 'Repair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Plumber_category, 'service_subcategory_id' => $Blocks_and_Leakage, 'company_id' => $company, 'service_name' => 'Repair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Plumber_category, 'service_subcategory_id' => $Bathroom_Fitting, 'company_id' => $company, 'service_name' => 'Repair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Plumber_category, 'service_subcategory_id' => $Bathroom_Fitting, 'company_id' => $company, 'service_name' => 'Fitting or Installtion', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Plumber_category, 'service_subcategory_id' => $Water_Tank, 'company_id' => $company, 'service_name' => 'Repair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Plumber_category, 'service_subcategory_id' => $Water_Tank, 'company_id' => $company, 'service_name' => 'Fitting or Installtion', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $Maths, 'company_id' => $company, 'service_name' => 'Trignometry', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $English, 'company_id' => $company, 'service_name' => 'Poetry', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $English, 'company_id' => $company, 'service_name' => 'Drama', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $English, 'company_id' => $company, 'service_name' => 'Literature', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $Social_Science, 'company_id' => $company, 'service_name' => 'History', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $Social_Science, 'company_id' => $company, 'service_name' => 'Civics', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $Social_Science, 'company_id' => $company, 'service_name' => 'Geography', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $Computer, 'company_id' => $company, 'service_name' => 'Fundamental Programming', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $Computer, 'company_id' => $company, 'service_name' => 'Networks', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tutors_category, 'service_subcategory_id' => $Computer, 'company_id' => $company, 'service_name' => 'Web Development', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tow_Truck_category, 'service_subcategory_id' => $Flat_Tier, 'company_id' => $company, 'service_name' => '2 tier', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tow_Truck_category, 'service_subcategory_id' => $Towing, 'company_id' => $company, 'service_name' => 'Tow truck for Buses', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tow_Truck_category, 'service_subcategory_id' => $Towing, 'company_id' => $company, 'service_name' => 'Wheel Lift', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Car_Wash_category, 'service_subcategory_id' => $Hatchback, 'company_id' => $company, 'service_name' => 'Economic Wash', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Car_Wash_category, 'service_subcategory_id' => $Hatchback, 'company_id' => $company, 'service_name' => 'Standard Wash', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Car_Wash_category, 'service_subcategory_id' => $Hatchback, 'company_id' => $company, 'service_name' => 'Premium Wash', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Car_Wash_category, 'service_subcategory_id' => $Sedan, 'company_id' => $company, 'service_name' => 'Economic Wash', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Car_Wash_category, 'service_subcategory_id' => $Sedan, 'company_id' => $company, 'service_name' => 'Standard Wash', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Car_Wash_category, 'service_subcategory_id' => $Sedan, 'company_id' => $company, 'service_name' => 'Premium Wash', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Car_Wash_category, 'service_subcategory_id' => $SUV, 'company_id' => $company, 'service_name' => 'Economic Wash', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Car_Wash_category, 'service_subcategory_id' => $SUV, 'company_id' => $company, 'service_name' => 'Standard Wash', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Car_Wash_category, 'service_subcategory_id' => $SUV, 'company_id' => $company, 'service_name' => 'Premium Wash', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $PhotoGraphy_category, 'service_subcategory_id' => $Wedding, 'company_id' => $company, 'service_name' => 'Pre Wedding', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $PhotoGraphy_category, 'service_subcategory_id' => $Wedding, 'company_id' => $company, 'service_name' => 'Post Wedding', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $PhotoGraphy_category, 'service_subcategory_id' => $Photoshoot, 'company_id' => $company, 'service_name' => 'Baby Photoshoot', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $PhotoGraphy_category, 'service_subcategory_id' => $Photoshoot, 'company_id' => $company, 'service_name' => 'Party Photo shoot', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $PhotoGraphy_category, 'service_subcategory_id' => $Photoshoot, 'company_id' => $company, 'service_name' => 'Outdoor Shoot', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Doctors_category, 'service_subcategory_id' => $Dermatologist, 'company_id' => $company, 'service_name' => 'Skin Care', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Doctors_category, 'service_subcategory_id' => $Dermatologist, 'company_id' => $company, 'service_name' => 'Skin Infection', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Doctors_category, 'service_subcategory_id' => $Dermatologist, 'company_id' => $company, 'service_name' => 'Mole removal Treatment', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Doctors_category, 'service_subcategory_id' => $Dermatologist, 'company_id' => $company, 'service_name' => 'Skin Biopsy', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Doctors_category, 'service_subcategory_id' => $Cardiologist, 'company_id' => $company, 'service_name' => 'ECG', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Doctors_category, 'service_subcategory_id' => $Cardiologist, 'company_id' => $company, 'service_name' => 'Angioplasty', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Doctors_category, 'service_subcategory_id' => $Cardiologist, 'company_id' => $company, 'service_name' => 'Heart catheterizations', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Doctors_category, 'service_subcategory_id' => $General_Physician, 'company_id' => $company, 'service_name' => 'Fever', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n \n['service_category_id' => $Doctors_category, 'service_subcategory_id' => $General_Physician, 'company_id' => $company, 'service_name' => 'Stomach Ache', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Doctors_category, 'service_subcategory_id' => $General_Physician, 'company_id' => $company, 'service_name' => 'General Checkup', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Dog_Walking_category, 'service_subcategory_id' => $Walking, 'company_id' => $company, 'service_name' => '1 Hour walking', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Dog_Walking_category, 'service_subcategory_id' => $Walking, 'company_id' => $company, 'service_name' => '2 Hours Walking', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Dog_Walking_category, 'service_subcategory_id' => $Walking, 'company_id' => $company, 'service_name' => '30 Min walking', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Baby_Sitting_category, 'service_subcategory_id' => $Day_Care, 'company_id' => $company, 'service_name' => 'Part Time', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Baby_Sitting_category, 'service_subcategory_id' => $Day_Care, 'company_id' => $company, 'service_name' => 'Full Time', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Baby_Sitting_category, 'service_subcategory_id' => $Date_Night_sitters, 'company_id' => $company, 'service_name' => '60 Mins', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Baby_Sitting_category, 'service_subcategory_id' => $Date_Night_sitters, 'company_id' => $company, 'service_name' => '120 Mins', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Baby_Sitting_category, 'service_subcategory_id' => $After_School_Sitters, 'company_id' => $company, 'service_name' => '1 Hour', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Baby_Sitting_category, 'service_subcategory_id' => $After_School_Sitters, 'company_id' => $company, 'service_name' => '2 Hours', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Baby_Sitting_category, 'service_subcategory_id' => $Tutoring_and_lessons, 'company_id' => $company, 'service_name' => '1 hour', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Baby_Sitting_category, 'service_subcategory_id' => $Tutoring_and_lessons, 'company_id' => $company, 'service_name' => '2 Hours', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fitness_Coach_category, 'service_subcategory_id' => $Aerobic_Exercise, 'company_id' => $company, 'service_name' => 'Basic Plan', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fitness_Coach_category, 'service_subcategory_id' => $Aerobic_Exercise, 'company_id' => $company, 'service_name' => 'Advanced Plan', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fitness_Coach_category, 'service_subcategory_id' => $Resistance_Exercise, 'company_id' => $company, 'service_name' => 'Basic Plan', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fitness_Coach_category, 'service_subcategory_id' => $Resistance_Exercise, 'company_id' => $company, 'service_name' => 'Advanced Plan', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fitness_Coach_category, 'service_subcategory_id' => $Flexibility_Training, 'company_id' => $company, 'service_name' => 'Basic Plan', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fitness_Coach_category, 'service_subcategory_id' => $Flexibility_Training, 'company_id' => $company, 'service_name' => 'Advanced Plan', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Maids_category, 'service_subcategory_id' => $Full_Home_Deep_Cleaning, 'company_id' => $company, 'service_name' => 'Bathroom Deep Cleaning', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Maids_category, 'service_subcategory_id' => $Full_Home_Deep_Cleaning, 'company_id' => $company, 'service_name' => 'Bedroom Deep Cleaning', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Maids_category, 'service_subcategory_id' => $Full_Home_Deep_Cleaning, 'company_id' => $company, 'service_name' => 'Kitchen Deep Cleaning', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Maids_category, 'service_subcategory_id' => $Post_Party_Cleaning, 'company_id' => $company, 'service_name' => 'Apartment', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Maids_category, 'service_subcategory_id' => $Post_Party_Cleaning, 'company_id' => $company, 'service_name' => 'Bunglow or Villa', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Maids_category, 'service_subcategory_id' => $Office_Cleaning, 'company_id' => $company, 'service_name' => 'Apartment', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Maids_category, 'service_subcategory_id' => $Office_Cleaning, 'company_id' => $company, 'service_name' => 'Bunglow or Villa', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Maids_category, 'service_subcategory_id' => $Water_Tank_Storage_Cleaning, 'company_id' => $company, 'service_name' => '1000 to 2000 ltrs', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Maids_category, 'service_subcategory_id' => $Water_Tank_Storage_Cleaning, 'company_id' => $company, 'service_name' => '2000 to 5000 ltrs', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Maids_category, 'service_subcategory_id' => $Water_Tank_Storage_Cleaning, 'company_id' => $company, 'service_name' => '5000 ltrs', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Pest_Control_category, 'service_subcategory_id' => $Termite_Cleaning, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Pest_Control_category, 'service_subcategory_id' => $Termite_Cleaning, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Pest_Control_category, 'service_subcategory_id' => $Cockroach_Treatment, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Pest_Control_category, 'service_subcategory_id' => $Cockroach_Treatment, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Pest_Control_category, 'service_subcategory_id' => $Bed_Bugs_Treatment, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Pest_Control_category, 'service_subcategory_id' => $Bed_Bugs_Treatment, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Pest_Control_category, 'service_subcategory_id' => $Mosquito_Treatment, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Pest_Control_category, 'service_subcategory_id' => $Mosquito_Treatment, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $PhysioTheraphy_category, 'service_subcategory_id' => $Muscle_and_Joint_Pain, 'company_id' => $company, 'service_name' => '30 Min Theraphy', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $PhysioTheraphy_category, 'service_subcategory_id' => $Muscle_and_Joint_Pain, 'company_id' => $company, 'service_name' => '60 Min Therapy', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $PhysioTheraphy_category, 'service_subcategory_id' => $Knee_Pain, 'company_id' => $company, 'service_name' => '30 Min Therapy', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $PhysioTheraphy_category, 'service_subcategory_id' => $Knee_Pain, 'company_id' => $company, 'service_name' => '60 Mins Therapy', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $PhysioTheraphy_category, 'service_subcategory_id' => $sciatica, 'company_id' => $company, 'service_name' => '30 Min Therapy', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $PhysioTheraphy_category, 'service_subcategory_id' => $sciatica, 'company_id' => $company, 'service_name' => '60 Mins Therapy', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Catering_category, 'service_subcategory_id' => $Lunch_Meetings, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Catering_category, 'service_subcategory_id' => $Lunch_Meetings, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Catering_category, 'service_subcategory_id' => $Wedding_Catering, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Catering_category, 'service_subcategory_id' => $Wedding_Catering, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Catering_category, 'service_subcategory_id' => $Event_Catering, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Catering_category, 'service_subcategory_id' => $Event_Catering, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Catering_category, 'service_subcategory_id' => $Office_Catering, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Catering_category, 'service_subcategory_id' => $Office_Catering, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Dog_Gromming_category, 'service_subcategory_id' => $Clippers_and_Scissors, 'company_id' => $company, 'service_name' => 'Small Dog', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Dog_Gromming_category, 'service_subcategory_id' => $Clippers_and_Scissors, 'company_id' => $company, 'service_name' => 'Medium Dog', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Dog_Gromming_category, 'service_subcategory_id' => $Clippers_and_Scissors, 'company_id' => $company, 'service_name' => 'Large Dog', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Dog_Gromming_category, 'service_subcategory_id' => $Nail_Clippers, 'company_id' => $company, 'service_name' => 'Small Dog', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Dog_Gromming_category, 'service_subcategory_id' => $Nail_Clippers, 'company_id' => $company, 'service_name' => 'Medium Dog', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Dog_Gromming_category, 'service_subcategory_id' => $Nail_Clippers, 'company_id' => $company, 'service_name' => 'Large Dog', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Dog_Gromming_category, 'service_subcategory_id' => $Brushes_and_Combs, 'company_id' => $company, 'service_name' => 'Small Dog', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Dog_Gromming_category, 'service_subcategory_id' => $Brushes_and_Combs, 'company_id' => $company, 'service_name' => 'Medium Dog', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Dog_Gromming_category, 'service_subcategory_id' => $Brushes_and_Combs, 'company_id' => $company, 'service_name' => 'Large Dog', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Vet_category, 'service_subcategory_id' => $Surgery, 'company_id' => $company, 'service_name' => 'Dog', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Vet_category, 'service_subcategory_id' => $Surgery, 'company_id' => $company, 'service_name' => 'Cow', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Vet_category, 'service_subcategory_id' => $Vaccine, 'company_id' => $company, 'service_name' => 'Dog', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Vet_category, 'service_subcategory_id' => $Vaccine, 'company_id' => $company, 'service_name' => 'Cow', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Vet_category, 'service_subcategory_id' => $Disease, 'company_id' => $company, 'service_name' => 'Dog', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Vet_category, 'service_subcategory_id' => $Disease, 'company_id' => $company, 'service_name' => 'Cow', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Snow_Plows_category, 'service_subcategory_id' => $Plow_Category_1, 'company_id' => $company, 'service_name' => 'Plow Subcategory 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Snow_Plows_category, 'service_subcategory_id' => $Plow_Category_1, 'company_id' => $company, 'service_name' => 'Plow Subcategory 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Snow_Plows_category, 'service_subcategory_id' => $Plow_Category_2, 'company_id' => $company, 'service_name' => 'Plow Subcategory 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Snow_Plows_category, 'service_subcategory_id' => $Plow_Category_2, 'company_id' => $company, 'service_name' => 'Plow Subcategory 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Workers_category, 'service_subcategory_id' => $Home_Work, 'company_id' => $company, 'service_name' => 'Deep Street Cleaning Work', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Workers_category, 'service_subcategory_id' => $Home_Work, 'company_id' => $company, 'service_name' => 'Home Cleaning work', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Workers_category, 'service_subcategory_id' => $Office_Work, 'company_id' => $company, 'service_name' => 'Office Dinning Work', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Workers_category, 'service_subcategory_id' => $Office_Work, 'company_id' => $company, 'service_name' => 'Office Drainage Work', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lock_Smith_category, 'service_subcategory_id' => $Residential, 'company_id' => $company, 'service_name' => 'New Locking Setup', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lock_Smith_category, 'service_subcategory_id' => $Residential, 'company_id' => $company, 'service_name' => 'Repair Locks', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lock_Smith_category, 'service_subcategory_id' => $Residential, 'company_id' => $company, 'service_name' => 'Key Cutting Service', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lock_Smith_category, 'service_subcategory_id' => $Commercial, 'company_id' => $company, 'service_name' => 'New Locking Setup', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lock_Smith_category, 'service_subcategory_id' => $Commercial, 'company_id' => $company, 'service_name' => 'Repair Locks', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lock_Smith_category, 'service_subcategory_id' => $Commercial, 'company_id' => $company, 'service_name' => 'Key Cutting Service', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lock_Smith_category, 'service_subcategory_id' => $Automobile, 'company_id' => $company, 'service_name' => 'New Locking Setup', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lock_Smith_category, 'service_subcategory_id' => $Automobile, 'company_id' => $company, 'service_name' => 'Repair Locks', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lock_Smith_category, 'service_subcategory_id' => $Automobile, 'company_id' => $company, 'service_name' => 'Key Cutting Service', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Travel_Agent_category, 'service_subcategory_id' => $Ticket_Booking, 'company_id' => $company, 'service_name' => 'Train Ticket Booking', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Travel_Agent_category, 'service_subcategory_id' => $Ticket_Booking, 'company_id' => $company, 'service_name' => 'Bus Ticket Booking', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Travel_Agent_category, 'service_subcategory_id' => $Ticket_Booking, 'company_id' => $company, 'service_name' => 'Bus Ticket Booking', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Travel_Agent_category, 'service_subcategory_id' => $Hotel_Booking, 'company_id' => $company, 'service_name' => '1 day', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Travel_Agent_category, 'service_subcategory_id' => $Hotel_Booking, 'company_id' => $company, 'service_name' => 'Tour Guide', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tour_Guide_category, 'service_subcategory_id' => $Sight_Seeing, 'company_id' => $company, 'service_name' => 'Sight Seeing subcategory 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tour_Guide_category, 'service_subcategory_id' => $Sight_Seeing, 'company_id' => $company, 'service_name' => 'Sight Seeing Subcategory 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tour_Guide_category, 'service_subcategory_id' => $Walking_Tour, 'company_id' => $company, 'service_name' => 'Walking Tour Subcategory 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tour_Guide_category, 'service_subcategory_id' => $Walking_Tour, 'company_id' => $company, 'service_name' => 'Walking Tour Subcategory 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tour_Guide_category, 'service_subcategory_id' => $Trekking, 'company_id' => $company, 'service_name' => 'Trekking Subcategory 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Tour_Guide_category, 'service_subcategory_id' => $Trekking, 'company_id' => $company, 'service_name' => 'Trekking Subcategory 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Insurance_Agent_category, 'service_subcategory_id' => $Health_Insurance_Agent, 'company_id' => $company, 'service_name' => 'Health insurance Document', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Insurance_Agent_category, 'service_subcategory_id' => $Mutual_Fund_Agent, 'company_id' => $company, 'service_name' => 'Mutual Fund Document', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Security_Guard_category, 'service_subcategory_id' => $Personal_Security, 'company_id' => $company, 'service_name' => 'Day Duty', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Security_Guard_category, 'service_subcategory_id' => $Personal_Security, 'company_id' => $company, 'service_name' => 'Night Duty', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Security_Guard_category, 'service_subcategory_id' => $Commercial_Security, 'company_id' => $company, 'service_name' => 'Day Duty', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Security_Guard_category, 'service_subcategory_id' => $Commercial_Security, 'company_id' => $company, 'service_name' => 'Night Duty', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1], \n['service_category_id' => $Security_Guard_category, 'service_subcategory_id' => $Residential_Category, 'company_id' => $company, 'service_name' => 'Day Duty', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Security_Guard_category, 'service_subcategory_id' => $Residential_Category, 'company_id' => $company, 'service_name' => 'Night Duty', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fuel_category, 'service_subcategory_id' => $Petrol, 'company_id' => $company, 'service_name' => '5 Gallon', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fuel_category, 'service_subcategory_id' => $Petrol, 'company_id' => $company, 'service_name' => '7 Gallon', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fuel_category, 'service_subcategory_id' => $Diesel, 'company_id' => $company, 'service_name' => '5 Gallon', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fuel_category, 'service_subcategory_id' => $Diesel, 'company_id' => $company, 'service_name' => '7 Gallon', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fuel_category, 'service_subcategory_id' => $LPG, 'company_id' => $company, 'service_name' => 'LPG Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fuel_category, 'service_subcategory_id' => $LPG, 'company_id' => $company, 'service_name' => 'LPG Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Law_Mowing_category, 'service_subcategory_id' => $_to_2000_Sqft_Lawn, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Law_Mowing_category, 'service_subcategory_id' => $_to_2000_Sqft_Lawn, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Law_Mowing_category, 'service_subcategory_id' => $_to_4000_Sqft_Lawn, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Law_Mowing_category, 'service_subcategory_id' => $_to_4000_Sqft_Lawn, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Law_Mowing_category, 'service_subcategory_id' => $_to_4000_Sqft_Lawn, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Law_Mowing_category, 'service_subcategory_id' => $_to_6000_Sqft_Lawn, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Law_Mowing_category, 'service_subcategory_id' => $_to_6000_Sqft_Lawn, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Barber_category, 'service_subcategory_id' => $Hair_Cutting, 'company_id' => $company, 'service_name' => 'Kids Haircut', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Barber_category, 'service_subcategory_id' => $Hair_Cutting, 'company_id' => $company, 'service_name' => 'Long Haircut', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Barber_category, 'service_subcategory_id' => $Hair_Cutting, 'company_id' => $company, 'service_name' => 'Short Hair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Barber_category, 'service_subcategory_id' => $Hair_Dressing, 'company_id' => $company, 'service_name' => 'Short Hair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Barber_category, 'service_subcategory_id' => $Hair_Dressing, 'company_id' => $company, 'service_name' => 'Long Hair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Barber_category, 'service_subcategory_id' => $Shaving, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Barber_category, 'service_subcategory_id' => $Shaving, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Interior_Decorator_category, 'service_subcategory_id' => $Home_Interior, 'company_id' => $company, 'service_name' => 'Modular Kitchen', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Interior_Decorator_category, 'service_subcategory_id' => $Home_Interior, 'company_id' => $company, 'service_name' => 'Wardrobe Design', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Interior_Decorator_category, 'service_subcategory_id' => $Office_Interior, 'company_id' => $company, 'service_name' => '3D Design', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Interior_Decorator_category, 'service_subcategory_id' => $Office_Interior, 'company_id' => $company, 'service_name' => 'Furniture and Table Design', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lawn_Care_category, 'service_subcategory_id' => $Pest_Control, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lawn_Care_category, 'service_subcategory_id' => $Pest_Control, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lawn_Care_category, 'service_subcategory_id' => $Mosquito_Treatment, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lawn_Care_category, 'service_subcategory_id' => $Mosquito_Treatment, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lawn_Care_category, 'service_subcategory_id' => $Bed_Bug_Treatment, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lawn_Care_category, 'service_subcategory_id' => $Bed_Bug_Treatment, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Carpet_Repairer_category, 'service_subcategory_id' => $Sofa_Cleaning_Services, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Carpet_Repairer_category, 'service_subcategory_id' => $Sofa_Cleaning_Services, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Carpet_Repairer_category, 'service_subcategory_id' => $Carpet_Shampooing_Services, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Carpet_Repairer_category, 'service_subcategory_id' => $Carpet_Shampooing_Services, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Carpet_Repairer_category, 'service_subcategory_id' => $Commercial_Carpet_Cleaning, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Carpet_Repairer_category, 'service_subcategory_id' => $Commercial_Carpet_Cleaning, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Computer_Repairer_category, 'service_subcategory_id' => $Laptop, 'company_id' => $company, 'service_name' => 'OS Installation', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Computer_Repairer_category, 'service_subcategory_id' => $Laptop, 'company_id' => $company, 'service_name' => 'Motherboard Problem', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Computer_Repairer_category, 'service_subcategory_id' => $Laptop, 'company_id' => $company, 'service_name' => 'Monitor or Display', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Computer_Repairer_category, 'service_subcategory_id' => $Desktop, 'company_id' => $company, 'service_name' => 'Data Recovery', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Computer_Repairer_category, 'service_subcategory_id' => $Desktop, 'company_id' => $company, 'service_name' => 'Not Working', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Computer_Repairer_category, 'service_subcategory_id' => $Desktop, 'company_id' => $company, 'service_name' => 'Monitor and Display', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Computer_Repairer_category, 'service_subcategory_id' => $Mac, 'company_id' => $company, 'service_name' => 'Charger', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Computer_Repairer_category, 'service_subcategory_id' => $Mac, 'company_id' => $company, 'service_name' => 'Chip Level Servicing', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Computer_Repairer_category, 'service_subcategory_id' => $Mac, 'company_id' => $company, 'service_name' => 'Not Working', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Cuddling_category, 'service_subcategory_id' => $Category_Cuddling_1, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Cuddling_category, 'service_subcategory_id' => $Category_Cuddling_1, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Cuddling_category, 'service_subcategory_id' => $Category_Cuddling_2, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Cuddling_category, 'service_subcategory_id' => $Category_Cuddling_2, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fire_Fighters_category, 'service_subcategory_id' => $Water_Pumps_and_hoses, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fire_Fighters_category, 'service_subcategory_id' => $Water_Pumps_and_hoses, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fire_Fighters_category, 'service_subcategory_id' => $Fire_Extinguishers, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Fire_Fighters_category, 'service_subcategory_id' => $Fire_Extinguishers, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Helpers_category, 'service_subcategory_id' => $Category_1, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Helpers_category, 'service_subcategory_id' => $Category_1, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Helpers_category, 'service_subcategory_id' => $Category_2, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Helpers_category, 'service_subcategory_id' => $Category_2, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lawyers_category, 'service_subcategory_id' => $Civil_Lawyers, 'company_id' => $company, 'service_name' => 'Equality Case', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lawyers_category, 'service_subcategory_id' => $Civil_Lawyers, 'company_id' => $company, 'service_name' => 'Human RIghts', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lawyers_category, 'service_subcategory_id' => $Civil_Lawyers, 'company_id' => $company, 'service_name' => 'Social Freedom', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lawyers_category, 'service_subcategory_id' => $Lawyers_for_Property_Case, 'company_id' => $company, 'service_name' => 'Insurance and Environmental Issues', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Lawyers_category, 'service_subcategory_id' => $Lawyers_for_Property_Case, 'company_id' => $company, 'service_name' => 'Real Estate Transaction', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Mobile_Technician_category, 'service_subcategory_id' => $Mobile, 'company_id' => $company, 'service_name' => 'Motorola', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Mobile_Technician_category, 'service_subcategory_id' => $Mobile, 'company_id' => $company, 'service_name' => 'LG', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Mobile_Technician_category, 'service_subcategory_id' => $Mobile, 'company_id' => $company, 'service_name' => 'Samsung', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Mobile_Technician_category, 'service_subcategory_id' => $Mobile, 'company_id' => $company, 'service_name' => 'Others', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Office_Cleaning_category, 'service_subcategory_id' => $Vacuum_All_Floors, 'company_id' => $company, 'service_name' => 'Daily Duty', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Office_Cleaning_category, 'service_subcategory_id' => $Vacuum_All_Floors, 'company_id' => $company, 'service_name' => 'Weekly Duty', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Office_Cleaning_category, 'service_subcategory_id' => $Clean_and_Replace_bins, 'company_id' => $company, 'service_name' => 'Daily Duty', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Office_Cleaning_category, 'service_subcategory_id' => $Lobby_and_Workplace, 'company_id' => $company, 'service_name' => 'Daily Duty', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Office_Cleaning_category, 'service_subcategory_id' => $Lobby_and_Workplace, 'company_id' => $company, 'service_name' => 'Weekly Duty', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Party_Cleaning_category, 'service_subcategory_id' => $Dinning_Washout, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Party_Cleaning_category, 'service_subcategory_id' => $Dinning_Washout, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Party_Cleaning_category, 'service_subcategory_id' => $Table_Cleaning, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Party_Cleaning_category, 'service_subcategory_id' => $Table_Cleaning, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Psychologist_category, 'service_subcategory_id' => $Counselors, 'company_id' => $company, 'service_name' => 'Treatment', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Psychologist_category, 'service_subcategory_id' => $Counselors, 'company_id' => $company, 'service_name' => 'Counselling', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Psychologist_category, 'service_subcategory_id' => $Child_Psychologist, 'company_id' => $company, 'service_name' => 'Treatment', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Psychologist_category, 'service_subcategory_id' => $Child_Psychologist, 'company_id' => $company, 'service_name' => 'Counselling', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Psychologist_category, 'service_subcategory_id' => $Cognitive_Behavioral_Therapists, 'company_id' => $company, 'service_name' => 'Treatment', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Psychologist_category, 'service_subcategory_id' => $Cognitive_Behavioral_Therapists, 'company_id' => $company, 'service_name' => 'Counselling', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Road_Assistance_category, 'service_subcategory_id' => $Vehicle_Breakdown, 'company_id' => $company, 'service_name' => 'Car', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Road_Assistance_category, 'service_subcategory_id' => $Vehicle_Breakdown, 'company_id' => $company, 'service_name' => 'Lorry', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Road_Assistance_category, 'service_subcategory_id' => $Towing, 'company_id' => $company, 'service_name' => 'Car', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Road_Assistance_category, 'service_subcategory_id' => $Towing, 'company_id' => $company, 'service_name' => '2 Wheelers', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Road_Assistance_category, 'service_subcategory_id' => $Battery_Service, 'company_id' => $company, 'service_name' => 'Car', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Road_Assistance_category, 'service_subcategory_id' => $Battery_Service, 'company_id' => $company, 'service_name' => 'Bike', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Sofa_Repairer_category, 'service_subcategory_id' => $Furniture_Repair, 'company_id' => $company, 'service_name' => 'Furniture Repair Subcategory 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Sofa_Repairer_category, 'service_subcategory_id' => $Furniture_Repair, 'company_id' => $company, 'service_name' => 'Furniture Repair Subcategory 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Sofa_Repairer_category, 'service_subcategory_id' => $Chair_Repair, 'company_id' => $company, 'service_name' => 'Chair Repair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Sofa_Repairer_category, 'service_subcategory_id' => $Chair_Repair, 'company_id' => $company, 'service_name' => 'Chair Repair Subcategory 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Sofa_Repairer_category, 'service_subcategory_id' => $Furniture_Upholstery, 'company_id' => $company, 'service_name' => 'Furniture Upholstery Subcategory 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Sofa_Repairer_category, 'service_subcategory_id' => $Furniture_Upholstery, 'company_id' => $company, 'service_name' => 'Furniture Upholstery Subcategory 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Spa_category, 'service_subcategory_id' => $Aromatherapy_Massage, 'company_id' => $company, 'service_name' => '30 Mins', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Spa_category, 'service_subcategory_id' => $Aromatherapy_Massage, 'company_id' => $company, 'service_name' => '60 Mins', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Spa_category, 'service_subcategory_id' => $Balinese_Massage, 'company_id' => $company, 'service_name' => '30 Min Therapy', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Spa_category, 'service_subcategory_id' => $Balinese_Massage, 'company_id' => $company, 'service_name' => '60 Mins', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Spa_category, 'service_subcategory_id' => $Swedish_Massage, 'company_id' => $company, 'service_name' => '30 Min Therapy', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1], \n['service_category_id' => $Spa_category, 'service_subcategory_id' => $Swedish_Massage, 'company_id' => $company, 'service_name' => '60 Mins Therapy', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Translator_category, 'service_subcategory_id' => $Category_1, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Translator_category, 'service_subcategory_id' => $Category_1, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Translator_category, 'service_subcategory_id' => $Category_2, 'company_id' => $company, 'service_name' => 'Sub Category 1', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Translator_category, 'service_subcategory_id' => $Category_2, 'company_id' => $company, 'service_name' => 'Sub Category 2', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1],\n['service_category_id' => $Mechanic_category, 'service_subcategory_id' => $Fridge, 'company_id' => $company, 'service_name' => 'Repair', 'picture' => '', 'allow_desc' => 0, 'allow_before_image' => 0, 'allow_after_image' => 0, 'is_professional' => 0, 'service_status' => 1]\n\n ];\n\n foreach (array_chunk($services,1000) as $service) {\n DB::connection('service')->table('services')->insert($service);\n }\n\n\n\t Schema::connection('service')->enableForeignKeyConstraints();\n }", "public function companylist() {\r\n $companies = $this->model->getCompanies();\r\n return $this->view('company/companylist', $companies);\r\n }", "public function getComercios(){\n\t\t$sql = \"SELECT ID_comercio, nombre, correo, telefono, responsable, FK_ID_estado_comercio FROM comercio ORDER BY nombre\";\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}", "public function getCompetitions() {\n if ($this->competitionsLoaded) return $this->competitions;\n\n // else load them from database\n $req = CompetitionDBClient::selectByTournamentId($this->getId());\n while ($comp = mysql_fetch_assoc($req)) {\n try {\n $this->competitions[] = Competition::getById($comp['id']);\n } catch (Exception $e) {\n // TODO use error log file\n echo $e->getMessage();\n }\n }\n\n $this->competitionsLoaded = true;\n return $this->competitions;\n }", "function get_companies_list() {\n return get_view_data('org_list');\n}", "public function company()\n {\n return $this->author()->company();\n }", "public function companies()\n {\n return $this->belongsToMany(Company::class);\n }", "public function getSeasonByCompanies(Request $request)\n {\n $company_id = $request->input('company_id');\n $seasons = DB::table('camp_season') \n ->join('camp_company', 'camp_company.id', '=', 'camp_season.company_id')\n ->select('camp_season.id','camp_season.season_name','camp_season.company_id','camp_company.company_name')->where('camp_season.company_id','=',$company_id)\n ->get(); \n if($seasons)\n {\n return response()->json($seasons);\n }else\n {\n return '';\n }\n \n }", "function getChildCompanies_1($company_id, $company_list=\"\") {\n if (empty($company_list))\n $company_list = $company_id;\n else\n $company_list.=\",\" . $company_id;\n\n $query = \"SELECT company_id FROM company WHERE parent_id in ($company_id)\";\n $res = $this->getDBRecords($query);\n\n if (count($res) > 0) {\n $str = \"\";\n for ($i = 0; $i < count($res); $i++) {\n if (!empty($str))\n $str.=\",\";\n $str.=$res[$i]['company_id'];\n }\n $company_list = $this->getChildCompanies_1($str, $company_list);\n }\n $company_list = explode(\",\", $company_list);\n $company_list = array_unique($company_list);\n sort($company_list);\n\n $list = implode(\",\", $company_list);\n return $list;\n }", "public function getCompaniesForSelect()\n {\n return Company::whereNull('deleted_at')->pluck('name', 'id');\n }", "function visibleCompanyIds() {\n if($this->visible_company_ids === false) {\n $this->visible_company_ids = Users::findVisibleCompanyIds($this);\n } // if\n return $this->visible_company_ids;\n }", "abstract protected function getCompanyInfo($companyId);", "public function recupererToutesLesCompetitions()\n {\n return $this->getAll('competition','Competition');\n }", "public static function employees(Company $company): array\n {\n // number of employees in total\n $totalNumberOfEmployees = $company->employees()->notLocked()->count();\n\n // 10 random employees\n $tenRandomEmployeesCollection = collect([]);\n $allEmployees = $company->employees()\n ->notLocked()\n ->with('picture')\n ->inRandomOrder()\n ->take(10)\n ->get();\n\n foreach ($allEmployees as $employee) {\n $tenRandomEmployeesCollection->push([\n 'id' => $employee->id,\n 'name' => $employee->name,\n 'avatar' => ImageHelper::getAvatar($employee, 32),\n 'url' => route('employees.show', [\n 'company' => $company,\n 'employee' => $employee,\n ]),\n ]);\n }\n\n // ten random employees\n\n // number of employees hired in the current year\n $employeesHiredInTheCurrentYear = $company->employees()\n ->notLocked()\n ->whereYear('hired_at', (string) Carbon::now()->year)\n ->count();\n\n return [\n 'employees_hired_in_the_current_year' => $employeesHiredInTheCurrentYear,\n 'ten_random_employees' => $tenRandomEmployeesCollection,\n 'number_of_employees_left' => $totalNumberOfEmployees - $tenRandomEmployeesCollection->count(),\n 'view_all_url' => route('employees.index', [\n 'company' => $company,\n ]),\n ];\n }", "public function getCompany() : \\App\\Domain\\Model\\Company\n {\n return $this->getRef('from__company_id__to__table__companies__columns__id', 'products');\n }", "public function getCompany()\n {\n return isset($this->company) ? $this->company : null;\n }", "public function commodities()\n {\n return $this->morphToMany(Commodity::class, 'commodityable');\n }", "public function companies()\n {\n return $this->belongsTo(Company::class, 'company_id','id');\n }", "public function getProductEmissionsByCompanyId( $companyId );", "private function loadDistributors() {\n\t\t\n\t\t\t$sql = \"SELECT dst_id FROM dst_cmp WHERE cmp_id='$companyID'\";\n\t\t\t\n\t\t\t$rawResult = $gremlin->query($sql);\n\t\t\t\n\t\t\tforeach($rawResult as $newCont) {\n\t\t\t\n\t\t\t\t$newDist = new Company($newCont);\n\t\t\t\n\t\t\t\t$this->distributors[] = $newDist;\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}", "public function getSubdivisionList();", "public function getFeaturedCovered(): CompanyCollection\n {\n return $this->featuredCovered;\n }", "public function show(Company $company)\n {\n return $company;\n }", "public function getTeamIdsByDiv(){\n\t\t$aByDiv = array();\n\t\t$aTms = $this->getTeams();\n\t\t\n\t\tforeach($aTms as $id => $team){\n\t\t\t\t\n\t\t\t$tc = $team->getProp('conference');\n\t\t\t$td = $team->getProp('division');\n\t\t\t\n\t\t\tif(!array_key_exists($tc,$aByDiv))\n\t\t\t\t$aByDiv[$tc] = array();\n\t\t\t\n\t\t\tif(!array_key_exists($td, $aByDiv[$tc]))\n\t\t\t\t$aByDiv[$tc][$td] = array();\n\t\t\t\n\t\t\t$aByDiv[$tc][$td][] = $team;\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tksort($aByDiv);\n\t\tforeach($aByDiv as $confId => $conf){\n\t\t\tksort($aByDiv[$confId]);\n\t\t\tforeach($conf as $divId => $div){\n\t\t\t\tusort($aByDiv[$confId][$divId], sortByCity);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $aByDiv;\n\t}", "public function getFeatured(): CompanyCollection\n {\n return $this->featured;\n }", "public function company(){\n\n\t\t// belongsTo(RelatedModel, foreignKey = company_id, keyOnRelatedModel = id)\n\t\treturn $this->belongsTo(Company::class);\n\t}", "public function companyOfUser(){\n\n $company = Auth::user()->companies;\n $location = Location::where('id', Auth::user()->company_location)->get();\n \n foreach($company as $c){\n $c['locations'] = $location;\n }\n\n return $company;\n }", "public function getFreeCompanies() { return $this->FreeCompanies; }" ]
[ "0.6746101", "0.6237434", "0.61890936", "0.6071855", "0.5963803", "0.5955723", "0.5888444", "0.58680296", "0.58475", "0.58084446", "0.57955754", "0.5790242", "0.57874036", "0.5723284", "0.5682274", "0.56602275", "0.5648566", "0.5638574", "0.56368625", "0.5608394", "0.5590801", "0.5492163", "0.54790026", "0.54731363", "0.54670596", "0.5460178", "0.54530394", "0.5436748", "0.54363483", "0.5419994", "0.5379779", "0.536418", "0.53409123", "0.5327094", "0.5316391", "0.5316119", "0.53073555", "0.5281029", "0.5276829", "0.52757555", "0.5273088", "0.52558607", "0.5239945", "0.5231552", "0.5215104", "0.5212447", "0.52075374", "0.51925904", "0.51881045", "0.51609933", "0.51520014", "0.5144915", "0.5143684", "0.5143684", "0.51308686", "0.51213163", "0.51099163", "0.5107594", "0.5107594", "0.5103882", "0.508968", "0.50879854", "0.507949", "0.50717676", "0.5068381", "0.50633824", "0.5061911", "0.5057728", "0.50502896", "0.5048853", "0.5040184", "0.50384057", "0.5036658", "0.50293005", "0.50292224", "0.50250226", "0.5014153", "0.4999484", "0.49889302", "0.4982601", "0.4980782", "0.49798802", "0.49796525", "0.49781206", "0.4975123", "0.4971119", "0.49709243", "0.4968366", "0.49555153", "0.49430192", "0.49365136", "0.49342364", "0.4930538", "0.4927829", "0.49212047", "0.4907337", "0.49066776", "0.4904504", "0.49022397", "0.4894303" ]
0.5077277
63
PHP doesn't honor lazy matches very well, apparently, so add newlines
function dtwp_extract_styles( $contents ) { $contents[ 'contents' ] = str_replace( '}', "}\r\n", $contents[ 'contents' ] ); preg_match_all( '#.c(?P<digit>\d+){(.*?)font-weight:bold(.*?)}#', $contents[ 'contents' ], $boldmatches ); preg_match_all('#.c(?P<digit>\d+){(.*?)font-style:italic(.*?)}#', $contents[ 'contents' ], $italicmatches); if( !empty( $boldmatches[ 'digit' ] ) ) { foreach( $boldmatches[ 'digit' ] as $boldclass ) { $contents[ 'contents' ] = preg_replace( '#<span class="(.*?)c' . $boldclass . '(.*?)">(.*?)</span>#s', '<span class="$1c' . $boldclass . '$2"><strong>$3</strong></span>', $contents[ 'contents' ] ); } } if( !empty( $italicmatches[ 'digit' ] ) ) { foreach( $italicmatches[ 'digit' ] as $italicclass ) { $contents[ 'contents' ] = preg_replace( '#<span class="(.*?)c' . $italicclass . '(.*?)">(.*?)</span>#s', '<span class="$1c' . $italicclass . '$2"><em>$3</em>', $contents[ 'contents' ] ); } } return $contents; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _autop_newline_preservation_helper($matches)\n {\n }", "function _autop_newline_preservation_helper( $matches ) {\n\t\t\treturn str_replace(\"\\n\", \"<WPPreserveNewline />\", $matches[0]);\n\t\t}", "public function testMatchingSubstringsWithMismatchedLineEndingsAmount( $expected ) {\n\t\techo 'The quick brown fox\n\n\njumps over the lazy dog';\n\n\t\t$this->expectOutputContains( $expected, true );\n\t}", "public function testMatchingSubstringsWithDifferentLineEndings( $expected ) {\n\t\techo 'The quick brown fox\njumps over the lazy dog';\n\n\t\t$this->expectOutputContains( $expected );\n\t}", "private function makeLines()\n\t{\n\t\t$line = 1;\n\t\t/** @var Token $token */\n\t\tforeach ($this->tokens as $token)\n\t\t{\n\t\t\t$token->line = $line;\n\t\t\tif (preg_match_all(\"/\\\\n/\", $token->text, $m))\n\t\t\t{\n\t\t\t\t$line += count($m[0]);\n\t\t\t}\n\t\t}\n\t}", "public function testRenderNewlines() {\n\t\t$result = $this->View->render('newlines');\n\t\t$expected = \"There should be a newline about here: \\n\";\n\t\t$expected .= \"And this should be on the next line.\\n\";\n\t\t$expected .= \"\\n\";\n\t\t$expected .= \"There should be a single new line after this\\n\";\n\n\t\t$this->assertSame(\n\t\t\t$expected,\n\t\t\t$result,\n\t\t\t'Tags at the end of a line should not swallow new lines when rendered',\n\t\t);\n\t}", "public function testNewlines() {\n $this->assertEquals(\"Testing\\rCarriage\\rReturns\", Sanitize::newlines(\"Testing\\rCarriage\\r\\rReturns\"));\n $this->assertEquals(\"Testing\\r\\rCarriage\\rReturns\", Sanitize::newlines(\"Testing\\r\\rCarriage\\r\\r\\rReturns\", array('limit' => 3)));\n $this->assertEquals(\"TestingCarriageReturns\", Sanitize::newlines(\"Testing\\r\\rCarriage\\r\\r\\rReturns\", array('limit' => 0)));\n\n $this->assertEquals(\"Testing\\nLine\\nFeeds\", Sanitize::newlines(\"Testing\\nLine\\n\\nFeeds\"));\n $this->assertEquals(\"Testing\\nLine\\n\\nFeeds\", Sanitize::newlines(\"Testing\\n\\n\\nLine\\n\\nFeeds\", array('limit' => 3)));\n $this->assertEquals(\"TestingLineFeeds\", Sanitize::newlines(\"Testing\\n\\nLine\\n\\nFeeds\", array('limit' => 0)));\n\n $this->assertEquals(\"Testing\\r\\nBoth\\r\\nLineFeeds\\r\\n\\r\\nAnd\\r\\nCarriageReturns\", Sanitize::newlines(\"Testing\\r\\nBoth\\r\\r\\n\\nLineFeeds\\r\\n\\r\\r\\n\\nAnd\\r\\nCarriageReturns\"));\n $this->assertEquals(\"Testing\\r\\nBoth\\r\\nLineFeeds\\r\\nAnd\\r\\nCarriageReturns\", Sanitize::newlines(\"Testing\\r\\nBoth\\r\\n\\r\\nLineFeeds\\r\\n\\r\\n\\r\\nAnd\\r\\nCarriageReturns\"));\n $this->assertEquals(\"Testing\\r\\nBoth\\r\\n\\r\\nLineFeeds\\r\\n\\r\\n\\r\\nAnd\\r\\nCarriageReturns\", Sanitize::newlines(\"Testing\\r\\nBoth\\r\\n\\r\\nLineFeeds\\r\\n\\r\\n\\r\\nAnd\\r\\nCarriageReturns\", array('crlf' => false)));\n }", "function testBugInternal1() \n {\n $sText = <<<SCRIPT\n<?php\n\\$a = <<<HEREDOC\nsdsdsds\nHEREDOC;\n?>\nSCRIPT;\n $this->setText($sText);\n $sActual = $this->oBeaut->get();\n $this->assertTrue(preg_match(\"/HEREDOC;\\n\\s*?\\?>/ms\", $sActual));\n }", "function __replaceWithNewlines() {\n\t\t$args = func_get_args();\n\t\t$numLineBreaks = count(explode(\"\\n\", $args[0][0]));\n\t\treturn str_pad('', $numLineBreaks - 1, \"\\n\");\n\t}", "function process_matches(&$output, &$match)\n\t{\n\t\tif (sizeof($match) > 0)\n\t\t{\n\t\t\t$data = implode(\"\\n\", $match);\n\t\t\tarray_unshift($output, new vB_Text_Diff_Entry($data, $data));\n\t\t}\n\n\t\t$match = array();\n\t}", "public function getPattern()\n {\n return '/\\{!!\\s*(.+?)\\s*!!\\s*\\}(\\r?\\n)?/s';\n }", "public function getUnicodeReplaceGreedy();", "public function test_linebreaks_removed() {\n\n\t\t$this->assertStringMatchesFormat(\n\t\t\t'%s'\n\t\t\t, $this->export_data['classes'][0]['doc']['long_description']\n\t\t);\n\t}", "function it_allows_for_new_line_delimiters_and_finds_the_sum_of_1_2_4()\n {\n $this->add('1,\\n2,4')->shouldEqual(7);\n }", "function infy_nl($count = 1)\n {\n return str_repeat(PHP_EOL, $count);\n }", "public function testMatchingSubstringContainingRegexMetachars() {\n\t\techo 'This will match (me). Will it ? And \\[not\\] break on regex metachars';\n\n\t\t$this->expectOutputContains( 'match (me). Will it ? And \\[' );\n\t}", "function it_allows_for_new_line_delimiters_and_finds_the_sum_of_1_2_3()\n {\n $this->add('1,\\n2,3')->shouldEqual(6);\n }", "function add_br(&$output)\n{\n\t$output = preg_replace(\"~\\n~\", \"<br />\\n\", $output);\n}", "public function testNewLinePrepend() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->append(\"Hello\")->newLine(false)->newLine(false)->append(\"World\");\n\n\t\t\t$this->assertEquals(\"\\n\\nHelloWorld\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}", "public function testNewLine()\n {\n $str = new Str($this->testString);\n $result = $str->newline();\n $this->assertTrue($result->value === 'The quick brown fox jumps over the lazy dog,\nSnowball');\n }", "public function testSendingOutputWithMismatchedLineEndings() {\n\t\t$test = new IncorrectOutputMismatchedLineEndingsTestCase( 'test' );\n\t\t$result = $test->run();\n\n\t\t$this->assertSame( 1, $result->failureCount() );\n\t\t$this->assertSame( 1, \\count( $result ) );\n\n\t\t$failures = $result->failures();\n\t\t$this->assertMatchesRegularExpression(\n\t\t\t\"`^Failed asserting that '[^']+' matches PCRE pattern \\\"#`\",\n\t\t\t$failures[0]->exceptionMessage()\n\t\t);\n\t}", "public function test_lineendings() {\n $string = <<<STRING\na\nb\nSTRING;\n $this->assertSame(\"a\\nb\", $string, 'Make sure all project files are checked out with unix line endings.');\n\n }", "public function testParse()\n {\n $source = array();\n $source[] = \"foo bar\";\n $source[] = \"\";\n $source[] = \"> line 1\";\n $source[] = \"> line 2\";\n $source[] = \"> \";\n $source[] = \"> line 3\";\n $source[] = \"> line 4\";\n $source[] = \"\";\n $source[] = \"baz dib\";\n $source = implode(\"\\n\", $source);\n \n $expect[] = \"foo bar\\n\";\n $expect[] = $this->_token . \"\\n\";\n $expect[] = \"baz dib\";\n $expect = implode(\"\\n\", $expect);\n \n $actual = $this->_plugin->parse($source);\n $this->assertRegex($actual, \"@$expect@\");\n }", "function rewrapHTMLCallback($match) {\n $width = 80;\n $break = '<span class=\"allowWrap\"> </span>';\n $words = preg_split('~(\\r\\n|\\n\\r|[\\r\\n\\s])~', $match[2]);\n $systemIncludePath = dirname(dirname(__FILE__));\n if (is_array($words)) {\n $result = '';\n foreach ($words as $word) {\n if (0 === strpos($word, PAPAYA_INCLUDE_PATH)) {\n $partWord = substr($word, strlen(PAPAYA_INCLUDE_PATH));\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>/'.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>/'.$partWord;\n }\n } elseif (isset($_SERVER['DOCUMENT_ROOT']) &&\n 0 === strpos($word, $_SERVER['DOCUMENT_ROOT'])) {\n $partWord = substr($word, strlen($_SERVER['DOCUMENT_ROOT']));\n if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') {\n $addSlash = '/';\n } else {\n $addSlash = '';\n }\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{DOCUMENT_ROOT}</em>'.$addSlash.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{DOCUMENT_ROOT}</em>'.$addSlash.$partWord;\n }\n } elseif (0 === strpos($word, $systemIncludePath)) {\n $partWord = substr($word, strlen($systemIncludePath));\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>'.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>'.$partWord;\n }\n } elseif (papaya_strings::strlen($word) > $width) {\n $result .= ' '.wordwrap($word, $width, $break, TRUE);\n } else {\n $result .= ' '.$word;\n }\n }\n return $match[1].substr($result, 1);\n } else {\n return $match[0];\n }\n }", "public function testExactMatchWithExpectationBeforeOutput() {\n\t\t$this->expectOutputContains( 'foobar' );\n\t\techo 'foobar';\n\t}", "function clean_pre($matches)\n {\n }", "public function wktGenerateMultilinestring();", "public function testLineIntrospectionWithCRLFLineEndings() {\n\t\t$tmpPath = Libraries::get(true, 'resources') . '/tmp/tests/inspector_crlf';\n\t\t$contents = implode(\"\\r\\n\", ['one', 'two', 'three', 'four', 'five']);\n\t\tfile_put_contents($tmpPath, $contents);\n\n\t\t$result = Inspector::lines($tmpPath, [2]);\n\t\t$expected = [2 => 'two'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$result = Inspector::lines($tmpPath, [1,5]);\n\t\t$expected = [1 => 'one', 5 => 'five'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$this->_cleanUp();\n\t}", "function get_the_line( $field )\n {\n return \"/\\(\\s*{$field}\\s+LIKE\\s+'.*?'\\)\\s*OR/\";\n }", "public function testNewLineAppend() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->append(\"Hello\")->newLine(true)->newLine(true)->append(\"World\");\n\n\t\t\t$this->assertEquals(\"Hello\\n\\nWorld\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}", "abstract public function use_hint($regex_hint_result);", "function yy_r12()\n {\n if ($this->strip) {\n $this->compiler->template_code->php('echo ')->string(preg_replace('![\\t ]*[\\r\\n]+[\\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor))->raw(\";\\n\");\n } else {\n $this->compiler->template_code->php('echo ')->string($this->yystack[$this->yyidx + 0]->minor)->raw(\";\\n\");\n }\n }", "public function testMultiline()\n {\n $doc = <<<DOC\n/**\n * Summery should be ignored.\n *\n * General description\n * spanning a few lines\n * of doc-comment. Should be ignored.\n *\n * @bar Some\n * bar value.\n * @foo This one\n * also has multiline\n * value.\n * @qux Single line value\n */\nDOC;\n $expected = [\n 'bar' => 'Some bar value.',\n 'foo' => 'This one also has multiline value.',\n 'qux' => 'Single line value'\n ];\n\n $this->tags['bar']->expects($this->once())->method('process')->with([], 'Some bar value.')->willReturn(['bar' => 'Some bar value.']);\n $this->tags['foo']->expects($this->once())->method('process')->with(['bar' => 'Some bar value.'], 'This one also has multiline value.')->willReturn([\n 'bar' => 'Some bar value.',\n 'foo' => 'This one also has multiline value.'\n ]);\n $this->tags['qux']->expects($this->once())->method('process')->with([\n 'bar' => 'Some bar value.',\n 'foo' => 'This one also has multiline value.'\n ], 'Single line value')->willReturn($expected);\n\n $result = $this->parser->parse($doc);\n\n $this->assertSame($expected, $result);\n }", "private static function html() : string\n {\n return '<(.|\\n)*?>';\n }", "function br2nl( $input ) {\n return preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $input);\n}", "public function provideSafeStrings() {\n yield ['MarkSafe() > value', 'value'];\n yield [\"MarkSafe() >\\n value\", 'value'];\n yield [\"MarkSafe() >\\nline1\\nline2\", \"line1\\nline2\"];\n }", "function something() {\n\t\t$this->add(\"(.+)\");\n\t\treturn $this;\n\t}", "function wp_kses_named_entities($matches)\n {\n }", "public static function lineBreakCorrectlyTransformedOnWayToRteProvider() {}", "function ab_backtickCallback2($matches){\n\t$r = '<div class=\"backtick\"><pre><code>'.$matches[1].'</code></pre></div>';\n\n\t// if this is a multi-line block of code, there might be </p><p> inside it. Let's get rid of those. Also, WP likes to turn newlines into <br />, so let's kill those too.\n\t$find = array('<p>', '</p>', '<br />');\n\t$replace = array(\"\\n\", '', '');\n\t$r = str_replace($find, $replace, $r);\n\n\treturn $r;\n}", "private function _inlineEscape($inline) {\n\t//--\n\t// There's gotta be a cleaner way to do this...\n\t// While pure sequences seem to be nesting just fine,\n\t// pure mappings and mappings with sequences inside can't go very\n\t// deep. This needs to be fixed.\n\t//--\n\t$seqs = array();\n\t$maps = array();\n\t$saved_strings = array();\n\t$saved_empties = array();\n\t//-- Check for empty strings fix from v.0.5.1\n\t$regex = '/(\"\")|(\\'\\')/';\n\tif(preg_match_all($regex, $inline, $strings)) {\n\t\t$saved_empties = $strings[0];\n\t\t$inline = preg_replace($regex, 'YAMLEmpty', $inline);\n\t} //end if\n\tunset($regex);\n\t//-- Check for strings\n\t$regex = '/(?:(\")|(?:\\'))((?(1)[^\"]+|[^\\']+))(?(1)\"|\\')/';\n\tif(preg_match_all($regex, $inline, $strings)) {\n\t\t$saved_strings = $strings[0];\n\t\t$inline = preg_replace($regex, 'YAMLString', $inline);\n\t} //end if\n\tunset($regex);\n\t//--\n\t$i = 0;\n\t$regex_seq = '/\\[([^{}\\[\\]]+)\\]/U';\n\t$regex_map = '/{([^\\[\\]{}]+)}/U';\n\tdo {\n\t\t// Check for sequences\n\t\twhile(preg_match($regex_seq, $inline, $matchseqs)) {\n\t\t\t$seqs[] = $matchseqs[0];\n\t\t\t$inline = preg_replace($regex_seq, ('YAMLSeq'.(Smart::array_size($seqs) - 1).'s'), $inline, 1);\n\t\t} //end while\n\t\t// Check for mappings\n\t\twhile(preg_match($regex_map, $inline, $matchmaps)) {\n\t\t\t$maps[] = $matchmaps[0];\n\t\t\t$inline = preg_replace($regex_map, ('YAMLMap'.(Smart::array_size($maps) - 1).'s'), $inline, 1);\n\t\t} //end while\n\t\tif($i++ >= 10) {\n\t\t\tbreak;\n\t\t} //end if\n\t} while(strpos($inline, '[') !== false || strpos($inline, '{') !== false);\n\tunset($regex_seq);\n\tunset($regex_map);\n\t//--\n\t$explode = explode(', ', $inline);\n\t$stringi = 0;\n\t$i = 0;\n\t//--\n\twhile(1) {\n\t\t//-- Re-add the sequences\n\t\tif(!empty($seqs)) {\n\t\t\tforeach ($explode as $key => $value) {\n\t\t\t\tif(strpos($value, 'YAMLSeq') !== false) {\n\t\t\t\t\tforeach($seqs as $seqk => $seq) {\n\t\t\t\t\t\t$explode[$key] = str_replace(('YAMLSeq'.$seqk.'s'), $seq, $value);\n\t\t\t\t\t\t$value = $explode[$key];\n\t\t\t\t\t} //end foreach\n\t\t\t\t} //end if\n\t\t\t} //end foreach\n\t\t} //end if\n\t\t//-- Re-add the mappings\n\t\tif(!empty($maps)) {\n\t\t\tforeach($explode as $key => $value) {\n\t\t\t\tif(strpos($value, 'YAMLMap') !== false) {\n\t\t\t\t\tforeach($maps as $mapk => $map) {\n\t\t\t\t\t\t$explode[$key] = str_replace(('YAMLMap'.$mapk.'s'), $map, $value);\n\t\t\t\t\t\t$value = $explode[$key];\n\t\t\t\t\t} //end foreach\n\t\t\t\t} //end if\n\t\t\t} //end foreach\n\t\t} //end if\n\t\t//-- Re-add the strings\n\t\tif(!empty($saved_strings)) {\n\t\t\tforeach ($explode as $key => $value) {\n\t\t\t\twhile(strpos($value, 'YAMLString') !== false) {\n\t\t\t\t\t$explode[$key] = preg_replace('/YAMLString/', $saved_strings[$stringi], $value, 1);\n\t\t\t\t\tunset($saved_strings[$stringi]);\n\t\t\t\t\t++$stringi;\n\t\t\t\t\t$value = $explode[$key];\n\t\t\t\t} //end while\n\t\t\t} //end foreach\n\t\t} //end if\n\t\t//-- Re-add the empty strings fix from v.0.5.1\n\t\tif(!empty($saved_empties)) {\n\t\t\tforeach ($explode as $key => $value) {\n\t\t\t\twhile (strpos($value,'YAMLEmpty') !== false) {\n\t\t\t\t\t$explode[$key] = preg_replace('/YAMLEmpty/', '', $value, 1);\n\t\t\t\t\t$value = $explode[$key];\n\t\t\t\t} //end while\n\t\t\t} //end foreach\n\t\t} //end if\n\t\t//--\n\t\t$finished = true;\n\t\tforeach($explode as $key => $value) {\n\t\t\tif(strpos($value, 'YAMLSeq') !== false) {\n\t\t\t\t$finished = false; break;\n\t\t\t} //end if\n\t\t\tif(strpos($value, 'YAMLMap') !== false) {\n\t\t\t\t$finished = false; break;\n\t\t\t} //end if\n\t\t\tif(strpos($value, 'YAMLString') !== false) {\n\t\t\t\t$finished = false; break;\n\t\t\t} //end if\n\t\t\tif(strpos($value,'YAMLEmpty') !== false) { // fix from v.0.5.1\n\t\t\t\t$finished = false; break;\n\t\t\t} //end if\n\t\t} //end foreach\n\t\tif($finished) {\n\t\t\tbreak;\n\t\t} //end if\n\t\t$i++;\n\t\tif($i > 10) {\n\t\t\tbreak; // Prevent infinite loops.\n\t\t} //end if\n\t\t//--\n\t} //end while\n\t//--\n\treturn $explode;\n\t//--\n}", "function add_paragraphs($str)\n{\n // Trim whitespace\n if (($str = trim($str)) === '') return '';\n\n // Standardize newlines\n $str = str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $str);\n\n // Trim whitespace on each line\n $str = preg_replace('~^[ \\t]+~m', '', $str);\n $str = preg_replace('~[ \\t]+$~m', '', $str);\n\n // The following regexes only need to be executed if the string contains html\n if ($html_found = (strpos($str, '<') !== FALSE)) {\n // Elements that should not be surrounded by p tags\n $no_p = '(?:p|div|article|header|aside|hgroup|canvas|output|progress|section|figcaption|audio|video|nav|figure|footer|video|details|main|menu|summary|h[1-6r]|ul|ol|li|blockquote|d[dlt]|pre|t[dhr]|t(?:able|body|foot|head)|c(?:aption|olgroup)|form|s(?:elect|tyle)|a(?:ddress|rea)|ma(?:p|th))';\n\n // Put at least two linebreaks before and after $no_p elements\n $str = preg_replace('~^<' . $no_p . '[^>]*+>~im', \"\\n$0\", $str);\n $str = preg_replace('~</' . $no_p . '\\s*+>$~im', \"$0\\n\", $str);\n }\n\n // Do the <p> magic!\n $str = '<p>' . trim($str) . '</p>';\n $str = preg_replace('~\\n{2,}~', \"</p>\\n\\n<p>\", $str);\n\n // The following regexes only need to be executed if the string contains html\n if ($html_found !== FALSE) {\n // Remove p tags around $no_p elements\n $str = preg_replace('~<p>(?=</?' . $no_p . '[^>]*+>)~i', '', $str);\n $str = preg_replace('~(</?' . $no_p . '[^>]*+>)</p>~i', '$1', $str);\n }\n\n // Convert single linebreaks to <br />\n $str = preg_replace('~(?<!\\n)\\n(?!\\n)~', \"<br>\\n\", $str);\n\n return $str;\n}", "public function testHighlightNoMatch()\n {\n $str = 'The quick brown fox jumps over the dog.';\n $this->assertEquals($str, $this->helper->highlight($str, 'black'));\n }", "function No_new_Line($string){\n \n return str_replace(\"'\",\"' + \" . '\"' . \"'\" . '\"' . \" + '\",str_replace(\"\\n\",\"\",$string));\n \n }", "public function getResultString()\n {\n return \"(match {$this->pattern})\" . ( $this->default !== null ? \" [{$this->default}]\" : \"\" );\n }", "public function nl() {\n $this->contexts[$this->current][self::TEXT] .= \"\\n\";\n return $this;\n }", "abstract protected function regexp(): string;", "function clean_for_aiml_match($text)\n{\n\t$otext = $text;\n\t$text= remove_allpuncutation($text); //was not all before\n\t$text= whitespace_clean($text);\n\t$text= captialise($text);\n\t\n\trunDebug( __FILE__, __FUNCTION__, __LINE__, \"In: $otext Out:$text\",3);\n\t\t\n\treturn $text;\n}", "public function testMissingNewLineCharException()\r\n\t{\r\n\t\tnew Delimiters(\"//abcde1abcde2\");\r\n\t}", "public function testExactMatchWithExpectationAfterOutput() {\n\t\techo 'foobar';\n\t\t$this->expectOutputContains( 'foobar' );\n\t}", "private function add_next_line($content) {\r\n\t\treturn $content . \"\\n\";\r\n\t}", "public function testSendingOutputWithMismatchedLineEndingAmount() {\n\t\t$test = new IncorrectOutputMismatchedLineEndingAmountTestCase( 'test' );\n\t\t$result = $test->run();\n\n\t\t$this->assertSame( 1, $result->failureCount() );\n\t\t$this->assertSame( 1, \\count( $result ) );\n\n\t\t$failures = $result->failures();\n\t\t$this->assertMatchesRegularExpression(\n\t\t\t\"`^Failed asserting that '[^']+' matches PCRE pattern \\\"#`\",\n\t\t\t$failures[0]->exceptionMessage()\n\t\t);\n\t}", "function br2nl ( $string )\r\n{\r\n return preg_replace('/\\<br(\\s*)?\\/?\\>/i', PHP_EOL, $string);\r\n}", "public function getNewline(): string;", "public function testPrependLinePrefix() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->prependLine(\"Hello\", false)->prependLine(\"World\", false);\n\n\t\t\t$this->assertEquals(\"\\nWorld\\nHello\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}", "protected function new_line()\n {\n }", "function _createLineRegEx() {\n\t\tswitch ($this->_listVersion) {\n\t\t\tcase 1:\n\t\t\t\t$this->_lineRegEx = '/^' . \n\t\t\t\t\timplode(preg_quote($this->_delim), array(\n\t\t\t\t\t\t'[dflcbpu]',\n\t\t\t\t\t\t'[0-9]{4}-[0-9]{2}-[0-9]{2}', // Date\n\t\t\t\t\t\t'[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?', // Time\n\t\t\t\t\t\t'[0-9]+', // Size\n\t\t\t\t\t\t'[0-9]+' // Depth\n\t\t\t\t\t)) . preg_quote($this->_delim) . '/';\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 2:\n\t\t\t\t$this->_lineRegEx = '/^' . \n\t\t\t\t\timplode(preg_quote($this->_delim), array(\n\t\t\t\t\t\t'[dflcbpus\\-]',\n\t\t\t\t\t\t'[0-9]{4}-[0-9]{2}-[0-9]{2}', // Date\n\t\t\t\t\t\t'[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?', // Time\n\t\t\t\t\t\t'[0-9]+', // Size\n\t\t\t\t\t)) . preg_quote($this->_delim) . '/';\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function testGetRegex() {\n $p = Process::runOk($this->cv('ang:module:list'));\n $this->assertRegexp(';crmUi.*civicrm/a.*crmResource;', $p->getOutput());\n\n $p = Process::runOk($this->cv('ang:module:list \";crm;\"'));\n $this->assertRegexp(';crmUi.*civicrm/a.*crmResource;', $p->getOutput());\n\n $p = Process::runOk($this->cv('ang:module:list \";foo;\"'));\n $this->assertNotRegexp(';crmUi.*civicrm/a.*crmResource;', $p->getOutput());\n }", "function when_match( $bool, $str = '', $otherwise_str = '', $echo = true ) {\n\t$str = trim( $bool ? $str : $otherwise_str );\n\n\tif ( $str ) {\n\t\t$str = ' ' . $str;\n\n\t\tif ( $echo ) {\n\t\t\techo esc_attr($str);\n\t\t\treturn '';\n\t\t}\n\t}\n\n\treturn $str;\n}", "public function testNextReturnsStringWhenNextChunkExistsInCurrentChunk(): void\n {\n $this->assertEquals('o', (new Text('foo'))->next());\n }", "protected function _format_newlines($str)\n\t{\n\t\tif ($str === '' OR (strpos($str, \"\\n\") === FALSE && ! in_array($this->last_block_element, $this->inner_block_required)))\n\t\t{\n\t\t\treturn $str;\n\t\t}\n\n\t\t// Convert two consecutive newlines to paragraphs\n\t\t$str = str_replace(\"\\n\\n\", \"</p>\\n\\n<p>\", $str);\n\n\t\t// Convert single spaces to <br /> tags\n\t\t$str = preg_replace(\"/([^\\n])(\\n)([^\\n])/\", '\\\\1<br />\\\\2\\\\3', $str);\n\n\t\t// Wrap the whole enchilada in enclosing paragraphs\n\t\tif ($str !== \"\\n\")\n\t\t{\n\t\t\t// We trim off the right-side new line so that the closing </p> tag\n\t\t\t// will be positioned immediately following the string, matching\n\t\t\t// the behavior of the opening <p> tag\n\t\t\t$str = '<p>'.rtrim($str).'</p>';\n\t\t}\n\n\t\t// Remove empty paragraphs if they are on the first line, as this\n\t\t// is a potential unintended consequence of the previous code\n\t\treturn preg_replace('/<p><\\/p>(.*)/', '\\\\1', $str, 1);\n\t}", "public function isMultiline() {}", "public function rule(): string\n {\n return '#^(?:\\0(.*?)\\0\\n)?( {4}|\\t)(.*?)$#m';\n }", "public function testNOTMatchingMultipleSubstrings() {\n\t\techo 'The quick brown fox jumps over the lazy dog';\n\n\t\t$this->expectOutputContains( 'brown dog' ); // Not failing.\n\t\t$this->expectOutputContains( 'lazy dog' );\n\t}", "private static function _escapeTagChar($matches) {}", "abstract protected function buildRegex(): Matcher;", "function rdf_newline( ) {\n echo \"\\n\";\n}", "static function pl($txt){\r\n $a = preg_split(\"/\\r?\\n/\", $txt);\r\n $padlen = strlen(strval(sizeof($a)));\r\n $cnt = 0;\r\n foreach ($a as $line) {\r\n self::p(self::zfill(++$cnt, $padlen) . ': ' . $line);\r\n }\r\n }", "function br2nl($html){\r\n\t\t$nl = preg_replace('#<br\\s*/?>#i', \"\\n\", $html);\r\n\t\treturn $nl;\r\n\t}", "function writeraw( $raw) {\r\n\t\t$raw=preg_replace(\"/\\r/\", \"\", $raw);\r\n\t\t$raw=preg_replace(\"/\\n/\", \" \", $raw);\r\n\t return $raw;\r\n }", "function read_one($regex, &$pos)\n{\n\t$state = \"read\";\n\t$newex = \"\";\n\t$empty = true;\n\t\n\twhile ($state !== \"fin\")\n\t{\n\t\t/*echo \"newex: $newex\\n\";*/\n\t\tswitch ($state)\n\t\t{\n\t\t\tcase \"read\":\t// pocatecni stav, ocekava znak nebo pocatek escape sekvence %\n\t\t\t\tif ($pos >= mb_strlen($regex))\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$aux = mb_substr($regex, $pos, 1);\n\t\t\t\tif (is_escape($aux))\t// pred znak je potreba vlozit \\ \n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$newex = $newex . \"\\\\\" . $aux;\n\t\t\t\t\t$empty = false;\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$state = \"fin\";\n\t\t\t\t}\n\t\t\t\telse if ($aux === \"%\")\t// pocatek escape sekvence\n\t\t\t\t{\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$state = \"escaped\";\n\t\t\t\t}\n\t\t\t\telse if ($aux !== \"+\" && $aux !== \"*\" && $aux !== \".\" && $aux !== \"|\" && $aux !== \")\") // symboly, ktere se nemohou za negaci vyskytnout\n\t\t\t\t{\n\t\t\t\t\t$newex = $newex . $aux;\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$empty = false;\n\t\t\t\t\t$state = \"fin\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tbreak;\t\t\t\t\n\t\t\t\t\n\t\t\tcase \"escaped\":\t// znaky vyskytujici se po escepe sekvenci a jejich prevody na format se kterym pracuje preg_match\n\t\t\t\tif ($pos >= mb_strlen($regex))\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (is_escape_2(mb_substr($regex, $pos, 1)))\n\t\t\t\t{\n\t\t\t\t\t$newex = $newex . \"\\\\\" . mb_substr($regex, $pos, 1);\n\t\t\t\t\t$empty = false;\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$state = \"fin\";\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if (mb_substr($regex, $pos, 1) === \"!\" || mb_substr($regex, $pos, 1) === \"%\")\n\t\t\t\t{\n\t\t\t\t\t$newex = $newex . mb_substr($regex, $pos, 1);\n\t\t\t\t\t$empty = false;\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$state = \"fin\";\n\t\t\t\t}\n\t\t\t\telse if (mb_substr($regex, $pos, 1) === \"t\")\n\t\t\t\t{\n\t\t\t\t\t$newex = $newex . \"\\\\t\";\n\t\t\t\t\t$empty = false;\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$state = \"fin\";\n\t\t\t\t}\n\t\t\t\telse if (mb_substr($regex, $pos, 1) === \"n\")\n\t\t\t\t{\n\t\t\t\t\t$newex = $newex . \"\\\\n\";\n\t\t\t\t\t$empty = false;\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$state = \"fin\";\n\t\t\t\t}\n\t\t\t\telse if (mb_substr($regex, $pos, 1) === \"s\")\n\t\t\t\t{\n\t\t\t\t\t$newex = $newex . \"\\s\";\n\t\t\t\t\t$empty = false;\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$state = \"fin\";\n\t\t\t\t}\n\t\t\t\telse if (mb_substr($regex, $pos, 1) === \"a\")\n\t\t\t\t{\n\t\t\t\t\t$newex = $newex . \"[\\s|\\S]\";\n\t\t\t\t\t$empty = false;\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$state = \"fin\";\n\t\t\t\t}\n\t\t\t\telse if (mb_substr($regex, $pos, 1) === \"d\")\n\t\t\t\t{\n\t\t\t\t\t$newex = $newex . \"\\d\";\n\t\t\t\t\t$empty = false;\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$state = \"fin\";\n\t\t\t\t}\n\t\t\t\telse if (mb_substr($regex, $pos, 1) === \"l\")\n\t\t\t\t{\n\t\t\t\t\t$newex = $newex . \"[a-z]\";\n\t\t\t\t\t$empty = false;\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$state = \"fin\";\n\t\t\t\t}\n\t\t\t\telse if (mb_substr($regex, $pos, 1) === \"L\")\n\t\t\t\t{\n\t\t\t\t\t$newex = $newex . \"[A-Z]\";\n\t\t\t\t\t$empty = false;\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$state = \"fin\";\n\t\t\t\t}\n\t\t\t\telse if (mb_substr($regex, $pos, 1) === \"w\")\n\t\t\t\t{\n\t\t\t\t\t$newex = $newex . \"[a-zA-Z]\";\n\t\t\t\t\t$empty = false;\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$state = \"fin\";\n\t\t\t\t}\n\t\t\t\telse if (mb_substr($regex, $pos, 1) === \"W\")\n\t\t\t\t{\n\t\t\t\t\t$newex = $newex . \"[a-zA-Z0-9]\";\n\t\t\t\t\t$empty = false;\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$state = \"fin\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tbreak;\t\t\t\n\t\t}\n\t}\n\treturn $newex;\n}", "public function testMatchingSingleSubstring() {\n\t\t$this->expectOutputContains( 'quick brown' );\n\t\techo 'The quick brown fox jumps over the lazy dog';\n\t}", "function style_fixing( $match ) {\r\n $match[0] = preg_replace_callback('/url\\s*\\(\\s*[\\'\\\"]?(.*?)\\s*[\\'\\\"]?\\s*\\)/is', \"style_url_replace\", $match[0]);\r\n //echo \"<pre>\".htmlspecialchars($match[0]).\"</pre>\";\r\n return $match[0];\r\n}", "function wp_wikipedia_excerpt_substitute($match){\n #Mike Lay of http://www.mikelay.com/ suggested query.\n return '<a href=\"http://www.wikipedia.org/search-redirect.php?language=en&go=Go&search='.urlencode($match[1]).'\">'.$match[1].'</a>';\n}", "function wp_rel_nofollow_callback($matches)\n {\n }", "function render($values) {\n return ereg_replace(\"(.{100})\",\"\\\\1<br>\",$values->feature_residues);\n\n }", "function linebreak() {\n $this->doc .= '<br/>'.DOKU_LF;\n }", "function string_display_line( $p_string ) \r\n{\r\n\t$p_string = string_strip_hrefs( $p_string );\r\n\t$p_string = string_html_specialchars( $p_string );\r\n\t$p_string = string_restore_valid_html_tags( $p_string, /* multiline = */ false );\r\n\t\r\n\treturn $p_string;\r\n}", "public function test_filter_extra_nl() {\n\t\t$this->lsconn->mock_query(\n\t\t\t\tarray(\n\t\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'total_count' => 0\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t\t'GET hosts',\n\t\t\t\t\t\t'OutputFormat: wrapped_json',\n\t\t\t\t\t\t'ResponseHeader: fixed16',\n\t\t\t\t\t\t'AuthUser: theusername',\n\t\t\t\t\t\t'Columns: name',\n\t\t\t\t\t\t'Line: 1',\n\t\t\t\t\t\t'Line: 2'\n\n\t\t\t\t)\n\t\t);\n\t\t$this->ls->query(\"hosts\", \"Line: 1\\nLine: 2\\n\\n\", array('name'), array(\n\t\t\t\t'auth' => new User_Model(array(\n\t\t\t\t\t\t'username' => 'theusername',\n\t\t\t\t\t\t'auth_data' => array()\n\t\t\t\t))\n\t\t));\n\t}", "public function isSingleLine(): bool;", "function _parse() {\n $txt = $this->_text;\n for($i=0; $i<count($txt); $i++) {\n $txt[$i] = preg_replace(\"@[{]([^}]+)[}]@e\", \"''.\\$this->_insert(\\\"\\\\1\\\").''\",$txt[$i]);\n }\n return join(\"\",$txt);\n }", "private function _wrap_inlinelinenos($inner)\n\t{\n $lines = $inner;\n $sp = $this->linenospecial;\n $st = $this->linenostep;\n $num = $this->linenostart;\n $mw = strlen((string)(count($lines) + $num - 1));\n $mw = str_repeat(' ', $mw);\t\n\n if($this->noclasses) {\n if($sp) {\n\t\t\t\tforeach($lines as $llines) {\n\t\t\t\t\tlist($t, $line) = $llines;\n if($num%$sp == 0) {\n $style = 'background-color: #ffffc0; padding: 0 5px 0 5px';\n } else {\n $style = 'background-color: #f0f0f0; padding: 0 5px 0 5px';\n\t\t\t\t\t}\n yield [1, sprintf('<span style=\"%s\">%s%s</span> ', \n $style, $mw, ($num%$st ? ' ' : $num)) . $line];\n $num += 1;\n\t\t\t\t}\n } else {\n\t\t\t\tforeach($lines as $llines) {\n\t\t\t\t\tlist($t, $line) = $llines;\n yield [1, sprintf('<span style=\"background-color: #f0f0f0; ' .\n 'padding: 0 5px 0 5px\">%s%s</span> ', \n $mw, ($num%$st ? ' ' : $num)) . $line];\n $num += 1;\n\t\t\t\t}\n\t\t\t}\n } elseif($sp) {\n\t\t\tforeach($lines as $llines) {\n\t\t\t\tlist($t, $line) = $llines;\n yield [1, sprintf('<span class=\"lineno%s\">%s%s</span> ',\n ($num%$sp == 0 ? ' special' : ''), $mw,\n ($num%$st ? ' ' : $num)) . $line];\n $num += 1;\n\t\t\t}\n } else {\n\t\t\tforeach($lines as $llines) {\n\t\t\t\tlist($t, $line) = $llines;\n yield [1, sprintf('<span class=\"lineno\">%s%s</span> ',\n $mw, ($num%$st ? ' ' : $num)) . $line];\n $num += 1;\t\n\t\t\t}\n\t\t}\n\t}", "protected function textMatch()\n {\n $string = 'matches expected JSON structure ';\n\n switch ($this->_matchType) {\n case self::MATCH_OR:\n $string .= 'at least in one element';\n break;\n case self::MATCH_EXACT:\n $string .= 'exactly';\n break;\n case self::MATCH_AND:\n default:\n $string .= 'in all expected elements';\n break;\n }\n\n return $string;\n }", "static function replace_newline($string,$spliter) {\r\n return (string)str_replace(array(\"\\r\", \"\\r\\n\", \"\\n\"), $spliter, $string);\r\n }", "public function testPrependLineTerminate() {\n\t\t\t$builder = new StringBuilder();\n\t\t\t$builder->setLineEnd(StringBuilder::LE_UNIX);\n\t\t\t$builder->prependLine(\"Hello\", true)->prependLine(\"World\", true);\n\n\t\t\t$this->assertEquals(\"World\\nHello\\n\", $builder->__toString());\n\t\t\tunset($builder);\n\t\t}", "public function testAddNewline(): void\n {\n $stringCalculator = new StringCalc();\n // The actual result of the method.\n $calcResult = $stringCalculator->Add(\"\\n1,2,5\");\n // Assert that the expected result matches the actual result.\n $this->assertEquals(DEFAULT_RESULT, $calcResult);\n }", "function convertlinebreaks ($str) {\r\n return preg_replace (\"/\\015\\012|\\015|\\012/\", \"\\n\", $str);\r\n}", "function mEOL(){\n try {\n // Tokenizer11.g:622:3: ( '\\\\n' | '\\\\r' ) \n // Tokenizer11.g: \n {\n if ( $this->input->LA(1)==$this->getToken('10')||$this->input->LA(1)==$this->getToken('13') ) {\n $this->input->consume();\n\n }\n else {\n $mse = new MismatchedSetException(null,$this->input);\n $this->recover($mse);\n throw $mse;}\n\n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }", "protected function getNL() {\n return PHP_EOL . PHP_EOL;\n }", "function pun_linebreaks2($str)\r\n{\r\n\treturn str_replace(\"\\r\", \"\\n\", str_replace(\"\\r\\n\", \"<br>\", $str));\r\n}", "public function isMultiLine(): bool;", "public function getReplacementText();", "private function calloutReplace($match) {\n // Match[1] is the \"left\" or \"right\" of the callout\n // alignment. Match[2] is the interior content of the <div>.\n // Extra spacings have been added in various places\n // for visual spacing. Remove them, or they'll throw\n // things off in the new callout component.\n $match[2] = preg_replace('|(<br>)+|is', '<br>', $match[2]);\n\n // Remove anything after the first '<br>',\n // as it is not in the same '<strong>' group\n // as the ones on the first line.\n $headline_match_string = preg_replace('%(<br>|<br \\/>|<br\\/>|<ul>).*%is', '', $match[2]);\n\n // Look for a headline to use in the callout, which are bolded strings\n // at the start of the callout. Also look for any additional\n // line breaks. Like before, here they are unnecessary.\n $headline = '';\n if (preg_match_all(\"|<strong>(.*?)<\\/strong>(<br>)*|is\", $headline_match_string, $headline_matches)) {\n // Build the headline if we found one.\n $headline_classes = implode(' ', [\n 'headline',\n 'block__headline',\n 'headline--serif',\n 'headline--underline',\n 'headline--center',\n ]);\n\n // If there are multiple <strong>'s, then we need to concatenate them.\n $headline_text = '';\n foreach ($headline_matches[1] as $value) {\n $headline_text .= $value;\n // If we're adding the headline separately,\n // remove it from the rest of the text, so we don't duplicate.\n $match[2] = str_replace('<strong>' . $value . '</strong>', '', $match[2]);\n };\n $headline = '<h4 class=\"' . $headline_classes . '\">';\n $headline .= '<span class=\"headline__heading\">';\n $headline .= $headline_text;\n $headline .= '</span></h4>';\n }\n\n // Remove all leading and trailing 'br' tags.\n $match[2] = preg_replace(\"%^(<br>|<br \\/>|<br\\/>\\s)*%is\", '', $match[2], 1);\n $match[2] = preg_replace(\"%(<br>|<br \\/>|<br\\/>$|\\s)*%is\", '', $match[2], 1);\n\n // Build the callout wrapper and return.\n // We're defaulting to medium size, but taking the\n // alignment from the source.\n $wrapper_classes = 'block--word-break callout bg--gray inline--size-small inline--align-' . $match[1];\n return '<div class=\"' . $wrapper_classes . '\">' . $headline . $match[2] . '</div>';\n }", "private static function _checkCommentLinesOfPluralLineToSkip($lines)\n {\n $phpFileData = implode('', $lines);\n $maxLineNumber = count($lines);\n $checkLinesToSkip = function ($startLine, $endLine, &$linesToSkip, &$state) {\n for ($count = $startLine; $count <= $endLine; $count++) {\n B::assert(array_key_exists($count, $linesToSkip));\n $linesToSkip[$count] = true;\n }\n $state = 'NONE';\n };\n\n $tokens = token_get_all($phpFileData);\n $state = 'NONE';\n $linesToSkip = array_fill(1, $maxLineNumber, false);\n $lineCount = 1;\n $semicolonCount = 0;\n foreach ($tokens as $token) {\n if (!is_array($token)) {\n if ($token === ';') {\n $semicolonCount++;\n if ($semicolonCount === 2) { // If plural syntax line.\n $checkLinesToSkip($lineCount, $lineCount, $linesToSkip, $dummy);\n }\n }\n continue;\n }\n if ($token[2] !== $lineCount) {\n $lineCount = $token[2];\n $semicolonCount = 0;\n }\n\n $tokenKind = $token[0];\n switch ($state) {\n case 'NONE':\n if ($tokenKind === T_START_HEREDOC) { // If \"Heredoc\" or \"Nowdoc\".\n $startLine = $token[2];\n $state = 'DOC_END_SEARCH';\n } else if (($tokenKind === T_DOC_COMMENT || $tokenKind === T_COMMENT) // If \"/**\", \"/*\" or \"//\".\n && strpos($token[1], '/*') === 0 // If \"/**\" or \"/*\".\n ) {\n $startLine = $token[2];\n $state = 'COMMENT_END_SEARCH';\n }\n break;\n case 'DOC_END_SEARCH':\n if ($tokenKind === T_END_HEREDOC) { // If end of \"Heredoc\" or \"Nowdoc\".\n $checkLinesToSkip($startLine, $token[2], $linesToSkip, $state);\n }\n break;\n case 'COMMENT_END_SEARCH':\n $checkLinesToSkip($startLine, $token[2], $linesToSkip, $state);\n break;\n default:\n B::assert(false);\n }\n }\n\n switch ($state) {\n case 'DOC_END_SEARCH':\n BW::throwErrorException('\"Heredoc\" or \"Nowdoc\" must be ended.');\n case 'COMMENT_END_SEARCH':\n $checkLinesToSkip($startLine, $maxLineNumber, $linesToSkip, $state);\n case 'NONE':\n break;\n default:\n B::assert(false);\n }\n\n return $linesToSkip;\n }", "function testDebugShow() {\n ob_start();\n Debug::out('Testing, testing, 123.');\n $output = ob_get_clean();\n $this->assertPattern('/<pre>Testing, testing, 123.<\\/pre>/is', $output);\n }", "function php_highlight(&$code)\n\n{\n\n if(preg_match('#^(\\s*)(\\<\\?(php|))#i', $code, $open_tag, PREG_OFFSET_CAPTURE))\n\n {\n\n $code = substr($code, strlen($open_tag[0][0]));\n\n $open_tag = $open_tag[1][0].'<span class=\"php_tag\">'.htmlspecialchars($open_tag[2][0]).'</span>';\n\n }\n\n if(preg_match('#(\\?\\>)(\\s*)$#', $code, $end_tag, PREG_OFFSET_CAPTURE))\n\n {\n\n $code = substr($code, 0, -strlen($end_tag[0][0]));\n\n $end_tag = '<span class=\"php_tag\">'.htmlspecialchars($end_tag[1][0]).'</span>'.$end_tag[2][0];\n\n }\n\n \n\n $blocks = array(\n\n array(\n\n 'pattern' => '#\\?\\>(.*?)(\\<\\?(php()|(\\s))|($()))#ise',\n\n 'replacement' => '\\'<span class=\"php_tag\">?&gt;</span>\\'.block_background(html_highlight(str_replace(\\'\\\\\\\\\\\\\\\\\"\\', \\'\"\\',\\'$1\\')), \\'php_html\\').\\'<span class=\"php_tag\">\\'.htmlspecialchars(\\'$2\\').\\'</span>\\'',\n\n 'keepsuffix' => 4\n\n ),\n\n array(\n\n 'pattern' => \"#'\".GENERAL_BACKSLASH_ESC_PREG.\"'#se\",\n\n 'replacement' => 'parse_php_string_simple(\\'$0\\')',\n\n //'prefix' => '<span class=\"php_string\">', \n\n //'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => '#\"'.GENERAL_BACKSLASH_ESC_PREG.'\"#se',\n\n 'replacement' => '\\'<span class=\"php_string_d\">&quot;\\'.parse_php_string(\\'$1\\').\\'&quot;</span>\\''\n\n ),\n\n array(\n\n 'pattern' => \"#\\<\\<\\<(.+?)([\\n\\r])(.*?)([\\n\\r]\\\\1)#se\",\n\n 'replacement' => '\\'<span class=\"php_string_h\">&lt;&lt;&lt;$1$2\\'.parse_php_string(\\'$3\\').\\'$4</span>\\''\n\n ),\n\n array(\n\n 'pattern' => \"#/\\\\*(.*?)\\\\*/#s\",\n\n 'prefix' => '<span class=\"php_blockcomment\">', \n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => \"#//(.*?)[\\n\\r]#\",\n\n 'prefix' => '<span class=\"php_linecomment\">', \n\n 'suffix' => '</span>'\n\n ),\n\n );\n\n \n\n $secondaries = array(\n\n array(\n\n 'pattern' => '#(\\W|^)(\\.?[0-9][0-9a-zA-Z.]*)#',\n\n 'replacement' => '<span class=\"php_number\">$2</span>',\n\n 'keepprefix' => 1\n\n ),\n\n array(\n\n 'pattern' => '#([,\\[\\]\\{\\};=\\+\\-!%\\^&\\*\\(\\)<>|@.~])#',\n\n 'prefix' => '<span class=\"php_symbol\">',\n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => '#\\$[a-zA-Z_][a-zA-Z0-9_]*#',\n\n 'prefix' => '<span class=\"php_var\">',\n\n 'suffix' => '</span>'\n\n )\n\n );\n\n \n\n $kw = array(\n\n array(\n\n 'prefix' => '<span '.get_placeholder(8).'=\"php_keyword\">',\n\n 'suffix' => '</span>',\n\n 'keywords' => array('and','or','xor','__file__','__line__','array','as','break','case','cfunction','class','const','continue','declare','default','die','do','echo','else','elseif','empty','enddeclare','endfor','endforeach','endif','endswitch','endwhile','eval','exit','extends','for','foreach','function','global','if','include','include_once','isset','list','new','old_function','print','require','require_once','return','static','switch','unset','use','var','while','__function__','__class__','php_version','php_os','default_include_path','pear_install_dir','pear_extension_dir','php_extension_dir','php_bindir','php_libdir','php_datadir','php_sysconfdir','php_localstatedir','php_config_file_path','php_output_handler_start','php_output_handler_cont','php_output_handler_end','e_error','e_warning','e_parse','e_notice','e_core_error','e_core_warning','e_compile_error','e_compile_warning','e_user_error','e_user_warning','e_user_notice','e_all','true','false','bool','boolean','int','integer','float','double','real','string','array','object','resource','null','class','extends','parent','stdclass','directory','__sleep','__wakeup','interface','implements','abstract','public','protected','private')\n\n )\n\n );\n\n $code = generic_highlight($code, $blocks, $secondaries, array(), $kw);\n\n // put back end/start tags if necessary\n\n if(isset($open_tag) && is_string($open_tag))\n\n $code = $open_tag.$code;\n\n if(isset($end_tag) && is_string($end_tag))\n\n $code .= $end_tag;\n\n \n\n return $code;\n\n}", "public function cropHtmlWorksWithLinebreaks() {}", "function getTaskResult_8($text){\n $textNoLineBreak = preg_replace('/\\n/', '/br', $text);\n $amountLines = substr_count($textNoLineBreak, '/br', 0, strlen($textNoLineBreak));\n $amountSpaces = substr_count($textNoLineBreak, ' ', 0, strlen($textNoLineBreak));\n $amountLetters = mb_strlen(preg_replace('/\\s/', '', $text), 'UTF-8');\n\n return '</br>Lines = ' . ($amountLines + 1) . '</br> Letters = ' . $amountLetters .\n '</br> Spaces = ' . $amountSpaces; \n }", "function _preparse()\n {\n $options = PEAR::getStaticProperty('HTML_BBCodeParser','_options');\n $o = $options['open'];\n $c = $options['close'];\n $oe = $options['open_esc'];\n $ce = $options['close_esc'];\n \n $pattern = array( \"!(^|\\s)([-a-z0-9_.+]+@[-a-z0-9.]+\\.[a-z]{2,4})!i\");\n \n $replace = array( \"\\\\1\".$o.\"a href=\\\"mailto:\\\\2\\\"\".$c.\"\\\\2\".$o.\"/a\".$c);\n \n $this->_preparsed = preg_replace($pattern, $replace, $this->_text);\n }", "function process(&$matches)\n {\n // the replacement text we will return\n $return = '';\n \n // the list of post-processing matches\n $list = array();\n \n // a stack of list-start and list-end types; we keep this\n // so that we know what kind of list we're working with\n // (bullet or number) and what indent level we're at.\n $stack = array();\n \n // the item count is the number of list items for any\n // given list-type on the stack\n $itemcount = array();\n \n // have we processed the very first list item?\n $pastFirst = false;\n \n // populate $list with this set of matches. $matches[1] is the\n // text matched as a list set by parse().\n preg_match_all(\n '=^( {0,})(\\*|#) (.*)$=Ums',\n $matches[1],\n $list,\n PREG_SET_ORDER\n );\n \n // loop through each list-item element.\n foreach ($list as $key => $val) {\n \n // $val[0] is the full matched list-item line\n // $val[1] is the number of initial spaces (indent level)\n // $val[2] is the list item type (* or #)\n // $val[3] is the list item text\n \n // how many levels are we indented? (1 means the \"root\"\n // list level, no indenting.)\n $level = strlen($val[1]) + 1;\n \n // get the list item type\n if ($val[2] == '*') {\n $type = 'bullet';\n } elseif ($val[2] == '#') {\n $type = 'number';\n } else {\n $type = 'unknown';\n }\n \n // get the text of the list item\n $text = $val[3];\n \n // add a level to the list?\n if ($level > count($stack)) {\n \n // the current indent level is greater than the\n // number of stack elements, so we must be starting\n // a new list. push the new list type onto the\n // stack...\n array_push($stack, $type);\n \n // ...and add a list-start token to the return.\n $return .= $this->wiki->addToken(\n $this->rule, \n array(\n 'type' => $type . '_list_start',\n 'level' => $level - 1\n )\n );\n }\n \n // remove a level from the list?\n while (count($stack) > $level) {\n \n // so we don't keep counting the stack, we set up a temp\n // var for the count. -1 becuase we're going to pop the\n // stack in the next command. $tmp will then equal the\n // current level of indent.\n $tmp = count($stack) - 1;\n \n // as long as the stack count is greater than the\n // current indent level, we need to end list types. \n // continue adding end-list tokens until the stack count\n // and the indent level are the same.\n $return .= $this->wiki->addToken(\n $this->rule, \n array (\n 'type' => array_pop($stack) . '_list_end',\n 'level' => $tmp\n )\n );\n \n // reset to the current (previous) list type so that\n // the new list item matches the proper list type.\n $type = $stack[$tmp - 1];\n \n // reset the item count for the popped indent level\n unset($itemcount[$tmp + 1]);\n }\n \n // add to the item count for this list (taking into account\n // which level we are at).\n if (! isset($itemcount[$level])) {\n // first count\n $itemcount[$level] = 0;\n } else {\n // increment count\n $itemcount[$level]++;\n }\n \n // is this the very first item in the list?\n if (! $pastFirst) {\n $first = true;\n $pastFirst = true;\n } else {\n $first = false;\n }\n \n // create a list-item starting token.\n $start = $this->wiki->addToken(\n $this->rule, \n array(\n 'type' => $type . '_item_start',\n 'level' => $level,\n 'count' => $itemcount[$level],\n 'first' => $first\n )\n );\n \n // create a list-item ending token.\n $end = $this->wiki->addToken(\n $this->rule, \n array(\n 'type' => $type . '_item_end',\n 'level' => $level,\n 'count' => $itemcount[$level]\n )\n );\n \n // add the starting token, list-item text, and ending token\n // to the return.\n $return .= $start . $val[3] . $end;\n }\n \n // the last list-item may have been indented. go through the\n // list-type stack and create end-list tokens until the stack\n // is empty.\n while (count($stack) > 0) {\n $return .= $this->wiki->addToken(\n $this->rule, \n array (\n 'type' => array_pop($stack) . '_list_end',\n 'level' => count($stack)\n )\n );\n }\n \n // we're done! send back the replacement text.\n return \"\\n\" . $return . \"\\n\\n\";\n }", "function crlf_endings(string $input) {\n\treturn str_replace(\"\\n\", \"\\r\\n\", $input);\n}" ]
[ "0.69772345", "0.5902786", "0.57552445", "0.56110317", "0.5601887", "0.55393374", "0.5503794", "0.54851204", "0.54764014", "0.5338859", "0.5321994", "0.52943504", "0.52696174", "0.51535815", "0.51488125", "0.51377285", "0.51341736", "0.512462", "0.5121618", "0.51114154", "0.5028008", "0.5011861", "0.5008173", "0.49711728", "0.4965486", "0.49540773", "0.48840523", "0.4879182", "0.4846624", "0.4841311", "0.48371026", "0.48347577", "0.48144263", "0.48081234", "0.47875547", "0.47843283", "0.47717574", "0.477157", "0.47701114", "0.47673228", "0.47544664", "0.47433883", "0.4742238", "0.47346854", "0.47327077", "0.47311506", "0.4729448", "0.47282174", "0.4718803", "0.47068065", "0.46979073", "0.46973324", "0.46964076", "0.4693495", "0.469157", "0.46900225", "0.4684945", "0.46817994", "0.4681135", "0.46802598", "0.46780694", "0.46760842", "0.46731773", "0.46644077", "0.46638578", "0.46629494", "0.4661778", "0.466076", "0.46577555", "0.46485564", "0.46484643", "0.46428186", "0.4634577", "0.4634402", "0.46295798", "0.46268046", "0.46249026", "0.46192056", "0.46103215", "0.46070743", "0.46032906", "0.46025574", "0.4597487", "0.45937943", "0.45850882", "0.4585033", "0.45785254", "0.4574411", "0.45710835", "0.45584834", "0.4556641", "0.45562553", "0.45509169", "0.45470572", "0.45455673", "0.45426208", "0.45411733", "0.45389515", "0.45343325", "0.45331767", "0.45324042" ]
0.0
-1
Display the comments meta box
function dtwp_comments_meta_box( $post ) { $gdocID = get_post_meta( $post->ID, '_gdocID', true ); if( !empty( $gdocID ) ) { ?> <h5><a href="http://docs.google.com/document/d/<?php echo $gdocID; ?>/edit" target=_blank>Edit this doc</a></h5> <?php } else { ?> <h5>No doc attached.</h5> <?php } $comments = get_post_meta( $post->ID, '_gdocs_comments', true ); echo apply_filters( 'the_content', $comments ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ubc_collab_comment_meta() {\n\techo apply_atomic_shortcode( 'comment_meta', '<div class=\"comment-meta comment-meta-data\"><cite>[comment-author]</cite> [comment-published] <span class=\"comment-action\">[comment-permalink before=\"\"] [comment-edit-link before=\"| \"] [comment-reply-link before=\"| \"]<span></div>' );\n}", "function post_comment_meta_box($post)\n {\n }", "function dp_facebook_comment_box() {\n\tglobal $options, $options_visual;\n\t// Facebook comment\n\tif ( get_post_meta(get_the_ID(), 'dp_hide_fb_comment', true) ) return;\n\n\tif ( ($options['facebookcomment'] && get_post_type() === 'post') || ($options['facebookcomment_page'] && is_page()) ) {\n\t\techo '<div class=\"dp_fb_comments_div\"><h3 class=\"inside-title\"><span class=\"title\">'.htmlspecialchars_decode($options['fb_comments_title']).'</span></h3><div class=\"fb-comments\" data-href=\"'.get_permalink ().'\" data-num-posts=\"'.$options['number_fb_comment'].'\" data-width=\"100%\"></div></div>';\n\t}\n}", "public function display_meta_box() {\n\t\t\n\t\tinclude_once( 'views/q-and-a-admin.php' );\n }", "function post_comment_status_meta_box($post)\n {\n }", "function cosmetics_post_meta() {\n?>\n\n <div class=\"site-post-meta\">\n <span class=\"site-post-author\">\n <?php echo esc_html__('Author:','cosmetics');?>\n <a href=\"<?php echo get_author_posts_url( get_the_author_meta('ID') );?>\">\n <?php the_author();?>\n </a>\n </span>\n\n <span class=\"site-post-date\">\n <?php esc_html_e( 'Post date: ','cosmetics' ); the_date(); ?>\n </span>\n\n <span class=\"site-post-comments\">\n <?php\n comments_popup_link( '0 '. esc_html__('Comment','cosmetics'),'1 '. esc_html__('Comment','cosmetics'), '% '. esc_html__('Comments','cosmetics') );\n ?>\n </span>\n </div>\n\n<?php\n }", "function thd_re_post_info_show_box() {\n\tthd_meta_box_callback(thd_re_post_meta_box_fields(), 'post');\n}", "public static function display_meta_box($post) {\r\n\t\t\t$force_hide = get_post_meta($post->ID, self::FORCE_HIDE_KEY, true);\r\n\t\t\t$moderation_url = self::_get_moderation_url($post->ID);\r\n\t\t\t$results_url = self::_get_results_url($post->ID);\r\n\r\n\t\t\tinclude('views/backend/meta-boxes/meta-box.php');\r\n\t\t}", "public function displayComments()\n {\n global $lexicon;\n $lexicon = new Lexicon(COMMENTIA_LEX_LOCALE);\n\n global $roles;\n $roles = new Roles();\n\n /**\n * Iterates through each comment recursively, and appends it to the var holding the HTML markup.\n *\n * @param array $comment An array containing all the comment data\n */\n\n foreach ($this->comments as $comment) {\n if (isset($this->comments['ucid-'.$comment['ucid']])) {\n $this->renderCommentView($comment['ucid']);\n unset($this->comments['ucid-'.$comment['ucid']]);\n }\n }\n\n if ($_SESSION['__COMMENTIA__']['member_is_logged_in']) {\n $this->html_output .= ('<div class=\"commentia-new_comment_area\">'.\"\\n\".'<h4>'.TITLES_NEW_COMMENT.'</h4>'.\"\\n\".'<textarea id=\"comment-box\" oninput=\"autoGrow(this);\"></textarea>'.\"\\n\".'<button id=\"post-comment-button\" onclick=\"postNewComment(this);\">'.COMMENT_CONTROLS_PUBLISH.'</button>'.\"\\n\".'</div>'.\"\\n\");\n }\n\n return $this->html_output;\n }", "function md_metadraft_comments_metabox($post){\n\n\t$metadraft = md_get_metadraft($post->ID);\n\t$source = md_get_source($post->ID);\n\n\techo \"<div id='md_comments_inner'>\";\n\n\t// Provide a hook to attach metabox content in discrete chunks\n\tdo_action('md_metadraft_comments_metabox', $post, $metadraft, $source);\n\n\techo \"</div>\";\n\n}", "function tempera_comments_on() {\nglobal $temperas;\nforeach ($temperas as $key => $value) { ${\"$key\"} = $value; }\t\n\tif ( comments_open() && ! post_password_required() && $tempera_blog_show['comments'] && ! is_single()) :\n\t\tprint '<div class=\"comments-link\"><i class=\"icon-comments icon-metas\" title=\"' . __('Comments', 'tempera') . '\"></i>';\n\t\tprintf ( comments_popup_link( __( '<b>0</b>', 'tempera' ), __( '<b>1</b>', 'tempera' ), __( '<b>%</b>', 'tempera' ),(''),__('<b>-</b>','tempera') ));\n\t\tprint '</div>';\n\tendif;\n}", "function cosmetics_comment_form() {\n\n if ( comments_open() || get_comments_number() ) :\n?>\n\n <div class=\"site-comments\">\n <?php comments_template( '', true ); ?>\n </div>\n\n<?php\n endif;\n}", "public function showAllComments()\n {\n foreach ($this->_commentsArray as $comment) {\n echo commentsTemplate($this->_view, $comment);\n }\n }", "function view_comment()\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\t$comment_id = $this->input->get('comment_id');\n\t\t$this->view_comments('', '', '', array($comment_id));\n\t}", "function wp_dashboard_recent_comments_control()\n {\n }", "function render_notes_meta() {\n\t\tglobal $post;\n\t\t$details = get_post_meta( $post->ID, 'country_details', true );\n\t\t?>\n\t\t<textarea cols=\"50\" rows=\"5\" name=\"country_details\"><?php echo $details; ?></textarea>\n\t\t<?php\n\t}", "public function render_meta_box_content( $post ) {\n\t\n\t\t// Add an nonce field so we can check for it later.\n\t\twp_nonce_field( 'question_author', 'question_author_nonce' );\n\n\t\t// Display the form, using the current value.\n\t\techo '<input type=\"text\" id=\"question_author\" name=\"question_author\" value=\"'.esc_attr(get_post_meta( $post->ID, 'question_author', true )).'\" />';\n\t\t//echo '&nbsp;<label for=\"question_author\">'.__( 'Autore domanda', 'piananotizie' ).'</label>';\n\t}", "function roots_entry_meta() {\n echo '<em class=\"meta-entry\"><i class=\"icon-calendar pull-left\"></i><time class=\"updated pull-left\" datetime=\"'. get_the_time('c') .'\" pubdate>'. sprintf(__('Posted on %s at %s.', 'roots'), get_the_date(), get_the_time()) .'</time><span class=\"pull-right\">' .comments_number( 'No comments', 'One comment', '% comment' ) .'</span></em>';\n\n //echo '<p class=\"byline author vcard\">'. __('Written by', 'roots') .' <a href=\"'. get_author_posts_url(get_the_author_meta('ID')) .'\" rel=\"author\" class=\"fn\">'. get_the_author() .'</a></p>';\n}", "function voyage_mikado_comments_title() {\n ?>\n\n <div class=\"mkdf-comment-number\">\n <div class=\"mkdf-comment-number-inner\">\n <h3><?php comments_number(esc_html__('No Comments', 'voyage'), ''.esc_html__(' Comment ', 'voyage'), ' '.esc_html__(' Comments: ', 'voyage')); ?></h3>\n </div>\n </div>\n\n <?php\n }", "function rs_meta_box()\n{\n add_meta_box('rs_focus', 'Destaque na home', 'rs_focus', 'post', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'post', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'post_region', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'event', 'side');\n}", "function thd_re_info_show_box() {\n\tthd_meta_box_callback(thd_re_meta_box_fields(), 'page');\n}", "public function comment_form() {\n\n\t\t/** Don't do anything if we are in the admin */\n\t\tif ( is_admin() )\n\t\t\treturn;\n\n\t\t/** Don't do anything unless the user has already logged in and selected a list */\n/*\t\tif ( empty( $tgm_mc_options['current_list_id'] ) )\n\t\t\treturn;\n*/\n\t\t$clear = CTCT_Settings::get('comment_form_clear') ? 'style=\"clear: both;\"' : '';\n\t\t$checked_status = ( ! empty( $_COOKIE['tgm_mc_checkbox_' . COOKIEHASH] ) && 'checked' == $_COOKIE['tgm_mc_checkbox_' . COOKIEHASH] ) ? true : false;\n\t\t$checked = $checked_status ? 'checked=\"checked\"' : '';\n\t\t$status = ''; //$this->get_viewer_status();\n\n\t\tif ( 'admin' == $status ) {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>' . CTCT_Settings::get('comment_form_admin_text') . '</p>';\n\t\t}\n\t\telseif ( 'subscribed' == $status ) {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>' . CTCT_Settings::get('comment_form_subscribed_text') . '</p>';\n\t\t}\n\t\telseif ( 'pending' == $status ) {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>' . CTCT_Settings::get('comment_form_pending_text') . '</p>';\n\t\t}\n\t\telse {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>';\n\n\t\t\t\techo sprintf('<label for=\"ctct-comment-subscribe\"><input type=\"checkbox\" name=\"ctct-subscribe\" id=\"ctct-comment-subscribe\" value=\"subscribe\" style=\"width: auto;\" %s /> %s</label>', $checked, CTCT_Settings::get('comment_form_check_text'));\n\t\t\techo '</p>';\n\t\t}\n\n\t}", "function _wb_universe_comments_displays(&$form, FormStateInterface $form_state)\n{\n $group = 'comments';\n $sous_group = 'displays';\n return $form['wb_universe_' . $group][$sous_group];\n}", "function get_comment_meta($comment_id, $key = '', $single = \\false)\n {\n }", "public function comments() {\n\t\t\t\t\t\t\n\t\t\t$output = '';\n\t\t\t$total = get_comments_number();\n\t\t\t\n\t\t\t$output['label'] = __('Show Comments', 'theme translation');\n\t\t\t$output['link'] = $total >= 1 ? ($total == 1 ? sprintf(__('%s Comment', 'theme translation'), get_comments_number()) : sprintf(__('%s Comments', 'theme translation'), get_comments_number())) : __('No Comments', 'theme translation');\n\t\t\t$output['url'] = get_permalink().'#comments';\n\t\t\t$output['total'] = $total;\n\n\t\t\treturn $output;\n\t\t}", "function doCommentDiv($p_commentTarget){\n\t\techo '<div class=\"fb-comments\" data-href=\"'. $p_commentTarget .'\" data-width=\"350\" data-numposts=\"3\" data-colorscheme=\"light\"></div>';\n\t}", "function register_block_core_post_comments_form()\n {\n }", "public function comments()\n {\n $comments = $this->comment->getAllComments();\n $this->buildView(array('comments' => $comments));\n }", "function wpb_author_info_box( $content ) {\n \n\tglobal $post;\n\t \n\t// Detect if it is a single post with a post author\n\tif ( is_single() && isset( $post->post_author ) ) {\n\t \n\t\t// Get author's display name \n\t\t$display_name = get_the_author_meta( 'display_name', $post->post_author );\n\t \n\t// If display name is not available then use nickname as display name\n\tif ( empty( $display_name ) )\n\t$display_name = get_the_author_meta( 'nickname', $post->post_author );\n\t \n\t\t// Get author's biographical information or description\n\t\t$user_description = get_the_author_meta( 'user_description', $post->post_author );\n\t\t \n\t\t// Get author's website URL \n\t\t$user_website = get_the_author_meta('url', $post->post_author);\n\t\t \n\t\t// Get link to the author archive page\n\t\t$user_posts = get_author_posts_url( get_the_author_meta( 'ID' , $post->post_author));\n\t \n\tif ( ! empty( $display_name ) )\n\n\t\t// If author has a biography, display the bio box...\n\t\tif (get_the_author_meta('description')) {\n\t\t\t\t$author_details = '<div class=\"panel-title\"><p class=\"author_name\">Posted by <a class=\"blue-color\" href=\"'. $user_posts .'\"> ' . $display_name . '</a></p></div>';\n\t \t\t}\n\n\tif ( ! empty( $user_description ) )\n\t\n\t\t// If author bio is not blank...\n\t\tif (get_the_author_meta('description')) {\n\t\t\t// Author avatar and bio\n\t\t\t$author_details .= '<p class=\"author_details\">' . get_avatar( get_the_author_meta('user_email') , 90 ) . nl2br( $user_description ). '</p>';\n\t\t}\n\n\t\t// If author bio is not blank... \n\t\t\tif (get_the_author_meta('description')) {\n\t\t\t\t// Pass all this info to post content \n\t\t\t\t$content = $content . '<footer class=\"author_bio_section\" >' . $author_details . '</footer>';\n\t\t\t}\n\t\t}\n\n\treturn $content;\n\n\t}", "public function comments()\n\t{\n\t\t$this->_crud->set_table('ent_cr_comments');\n\t\t$this->_crud->set_subject('Comment');\n\t\t$this->_crud->set_relation('ent_cr_recipes_id','ent_cr_recepies','title');\n\t\t$this->_crud->display_as('ent_cr_recepies_id', 'Recipe');\n\t\t$this->_crud->required_fields('name', 'email', 'comments', 'ent_cr_recipes_id');\n\t\tstatic::$data['name'] = 'crud';\n\t\tstatic::$data['content_replace'] = $this->_crud->render();\n\n\t\t$this->_crud_output('main', static::$data);\n\t}", "function greenfields_display_post_meta()\n{\n if (get_post_type() != 'post') {\n edit_post_link(__('Edit', \"greenfields\"), '<span class=\"glyphicon glyphicon-pencil\"></span> ', '');\n return false;\n }\n\n ?>\n <ul class=\"meta list-inline\">\n <li>\n <a href=\"<?php the_permalink() ?>\">\n <span class=\"glyphicon glyphicon-time\"></span>\n <?php the_date(); ?>\n </a>\n </li>\n <li>\n <a href=\"<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>\">\n <span class=\"glyphicon glyphicon-user\"></span>\n <?php the_author(); ?>\n </a>\n </li>\n <?php if (!post_password_required() && (comments_open() || get_comments_number())) : ?>\n <li>\n <?php\n $sp = '<span class=\"glyphicon glyphicon-comment\"></span> ';\n comments_popup_link($sp . __('Leave a comment', \"greenfields\"), $sp . __('1 Comment', \"greenfields\"), $sp . __('% Comments', \"greenfields\"));\n ?>\n </li>\n <?php endif; ?>\n <?php edit_post_link(__('Edit', \"greenfields\"), '<li><span class=\"glyphicon glyphicon-pencil\"></span> ', '</li>'); ?>\n </ul>\n\n <?php\n}", "function showComments()\n\t{\n $qry = mysql_query(\"SELECT * FROM `comments` \n WHERE '\" . $this->ytcode .\"' = `youtubecode`\n ORDER BY upload_date DESC\n LIMIT 0,4 \");//DEFAULT: Comments shown=3\n if (!$qry)\n die(\"FAIL: \" . mysql_error());\n\n $html = '';\n while($row = mysql_fetch_array($qry))\n {\n \n $com_user=$row['com_user'];\n $com_user = str_replace('\\\\','',$com_user);\n $comment_dis=$row['com_dis'];\n $comment_dis = str_replace('\\\\', '', $comment_dis);\n $date = new DateTime($row['upload_date']);\n\n $html .= '<p class=\"comment-p\">\n <span class=\"userName\">' . $com_user . '</span>\n <span class=\"divider\">//</span>\n <time datetime=\"' . $date->format('Y-m-d') .'\">'.\n $date->format('d/m/y g:i a')\n .'</time> : '. $comment_dis .'\n </p>'; \n }\n \n return $html;\n\t}", "function print_embed_comments_button()\n {\n }", "public function comments()\n {\n $task = $this->getTask();\n $commentSortingDirection = $this->userMetadataCacheDecorator->get(UserMetadataModel::KEY_COMMENT_SORTING_DIRECTION, 'ASC');\n\n $this->response->html($this->template->render('CommentTooltip:board/tooltip_comments', array(\n 'task' => $task,\n 'comments' => $this->commentModel->getAll($task['id'], $commentSortingDirection)\n )));\n }", "function meta_html($post)\n {\n $view = new Xby2BaseView(get_post_meta($post->ID));\n $view->addInput('text', 'link-label', 'Label: ', 'label', 'regular-text');\n $view->addInput('text', 'link-link', 'Link: ', 'link', 'large-text');\n $view->addInput('text', 'link-priority', 'Priority: ', 'priority', 'regular-text');\n $view->displayForm();\n }", "public function display_coupon_meta_box() {\n\t\tglobal $post;\n\n\t\tadd_filter( 'affwp_is_admin_page', '__return_true' );\n\t\taffwp_admin_scripts();\n\n\t\t$user_name = '';\n\t\t$user_id = '';\n\t\t$affiliate_id = get_post_meta( $post->ID, 'affwp_discount_affiliate', true );\n\n\t\tif ( $affiliate_id ) {\n\t\t\t$user_id = affwp_get_affiliate_user_id( $affiliate_id );\n\t\t\t$user = get_userdata( $user_id );\n\t\t\t$user_name = $user ? $user->user_login : '';\n\t\t}\n\n\t\t?>\n\t\t<p class=\"form-field affwp-jigoshop-coupon-field\">\n\t\t\t<label for=\"user_name\"><?php _e( 'If you would like to connect this discount to an affiliate, enter the name of the affiliate it belongs to.', 'affiliate-wp' ); ?></label>\n\t\t\t<span class=\"affwp-ajax-search-wrap\">\n\t\t\t\t<span class=\"affwp-jigoshop-coupon-input-wrap\">\n\t\t\t\t\t<input type=\"text\" name=\"user_name\" id=\"user_name\" value=\"<?php echo esc_attr( $user_name ); ?>\" class=\"affwp-user-search\" data-affwp-status=\"active\" autocomplete=\"off\" />\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</p>\n\t\t<?php\n\t}", "function thememount_entry_meta($echo = true) {\n\t$return = '';\n\t\n\tglobal $post;\n\t\n\tif( isset($post->post_type) && $post->post_type=='page' ){\n\t\treturn;\n\t}\n\t\n\t\n\t$postFormat = get_post_format();\n\t\n\t// Post author\n\t$categories_list = get_the_category_list( __( ', ', 'howes' ) ); // Translators: used between list items, there is a space after the comma.\n\t$tag_list = get_the_tag_list( '', __( ', ', 'howes' ) ); // Translators: used between list items, there is a space after the comma.\n\t$num_comments = get_comments_number();\n\t\n\t$return .= '<div class=\"thememount-meta-details\">';\n\t\t// Date\n\t\t$return .= '<span class=\"tm-date-wrapper\"><i class=\"tmicon-fa-clock-o\"></i> ' . get_the_date() . '</span>';\n\n\t\tif ( 'post' == get_post_type() ) {\n\t\t\tif( !is_single() ){\n\t\t\t\t$return .= sprintf( '<div class=\"thememount-post-user\"><span class=\"author vcard\"><i class=\"tmicon-fa-user\"></i> <a class=\"url fn n\" href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a></span></div>',\n\t\t\t\t\tesc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n\t\t\t\t\tesc_attr( sprintf( __( 'View all posts by %s', 'howes' ), get_the_author() ) ),\n\t\t\t\t\tget_the_author()\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif ( $tag_list ) { $return .= '<span class=\"tags-links\"><i class=\"tmicon-fa-tags\"></i> ' . $tag_list . '</span>'; };\n\t\tif ( $categories_list ) { $return .= '<span class=\"categories-links\"><i class=\"tmicon-fa-folder-open\"></i> ' . $categories_list . '</span>'; };\n\t\tif( !is_sticky() && comments_open() && ($num_comments>0) ){\n\t\t\t$return .= '<span class=\"comments\"><i class=\"tmicon-fa-comments\"></i> ';\n\t\t\t$return .= $num_comments;\n\t\t\t$return .= '</span>';\n\t\t}\n\n\t$return .= '</div>';\n\t\n\tif( $echo == true ){\n\t\techo $return;\n\t} else {\n\t\treturn $return;\n\t}\n\t\n\t\n}", "function wrapper(){\r\n\tadd_comments_page('Remarks', 'Remarks', 'manage_options', 'remarks', 'remarks_main');\r\n}", "public function showComments(){\n if (isset($_GET['id'])) {\n $postId = $_GET['id'];\n $postRepository = new PostRepository();\n //call to readById\n $post = $postRepository->readById($postId);\n $commentRepository = new CommentRepository();\n $commentlist = $commentRepository->getComments($postId);\n $this->commentView($post, $commentlist);\n }\n }", "public function linkages_meta_box() {\n\t\tglobal $post;\n\t\t\n\t\tif ( isset( $_GET['post'] ) )\n\t\t\t$post_ID = (int) $_GET['post'];\n\t\telse\n\t\t\t$post_ID = '';\n\t\t\n\t\techo '<input type=\"hidden\" name=\"_lingo_hidden\" id=\"_lingo_hidden\" value=\"1\" />';\n\t\t\n\t\tforeach( $this->post_meta as $key => $value ) {\n\t\t\techo '\n\t\t<p>\n\t\t\t<label for=\"' . $key . '\">' . $value . '</label>\n\t\t\t<br />\n\t\t\t<input type=\"text\" name=\"' . $key . '\" id=\"' . $key . '\" value=\"' . get_post_meta( $post_ID, $key, true ) . '\" />\n\t\t</p>';\n\t\t}\n\t\t?>\n\t\t<?php\n\t}", "function get_comments_popup_template()\n {\n }", "public static function add_meta_boxes() {\n\t\tadd_meta_box( 'replycontextdiv', __( 'Use post to reply to other articles?', 'reply_context' ), array( 'ReplyContextPlugin', 'reply_context_meta_box' ) );\n\t}", "function tempera_number_comments() { ?>\n\t\t\t<h3 id=\"comments-title\"><i class=\"icon-replies\" ></i>\n\t\t\t\t<?php printf( _n( 'One Comment:', '%1$s Comments:', get_comments_number(), 'tempera' ),\n\t\t\t\tnumber_format_i18n( get_comments_number() )); ?>\n\t\t\t</h3>\n<?php }", "function et_divi_post_meta() {\n\t\t$pages = array(\n\t\t\tintval( \\SermonManager::getOption( 'smp_archive_page', 0 ) ),\n\t\t\tintval( \\SermonManager::getOption( 'smp_tax_page', 0 ) ),\n\t\t);\n\t\tif ( in_array( get_the_ID(), $pages ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$postinfo = is_single() ? et_get_option( 'divi_postinfo2' ) : et_get_option( 'divi_postinfo1' );\n\n\t\tif ( $postinfo ) :\n\t\t\techo '<p class=\"post-meta\">';\n\t\t\techo et_pb_postinfo_meta( $postinfo, et_get_option( 'divi_date_format', 'M j, Y' ), esc_html__( '0 comments', 'Divi' ), esc_html__( '1 comment', 'Divi' ), '% ' . esc_html__( 'comments', 'Divi' ) );\n\t\t\techo '</p>';\n\t\tendif;\n\t}", "public function render_order_meta_box() {\n\t\tglobal $post_id;\n\n\t\t$order = \\wc_get_order( $post_id );\n\t\t$profile_picture = \\get_post_meta( $post_id, '_bwcpp_picture_id', true );\n\t\t?>\n\n\t\t<?php if ( ! empty( $profile_picture ) ) : ?>\n\n\t\t\t<?php $picture = wp_get_attachment_image_src( $profile_picture ); ?>\n\t\t\t<img src=\"<?php echo $picture[0]; ?>\" alt=\"\" width=\"100%\">\n\n\t\t<?php else : ?>\n\n\t\t\t<?php _e( 'User didn\\'t upload any image.', 'bwcpp' ); ?>\n\n\t\t<?php endif; ?>\n\n\t\t<?php if ( $order->get_user_id() ) : ?>\n\t\t\t<a href=\"<?php echo get_edit_user_link( $order->get_user_id() ); ?>\"><?php _e( 'View customer profile', 'bwcpp' ); ?> &rarr;</a>\n\t\t<?php endif; ?>\n\n\t\t<?php\n\t}", "public function the_comment()\n {\n }", "function antescomentarios(){\n add_filter( 'genesis_title_comments', '__return_false' );\n if(have_comments()){\n if(get_comments_number()==='1'){\n $mensaje = 'Ver un comentario en \"'.get_the_title().'\"';\n }else{\n $mensaje = 'Ver '.get_comments_number().' comentarios en \"'.get_the_title().'\"';\n }\n echo '\n <div class=\"coment_retina\">\n <div class=\"toggle\">\n <input type=\"checkbox\" value=\"selected\" id=\"colapsar_retina\" class=\"toggle-input\">\n <label for=\"colapsar_retina\" class=\"toggle-label titulo_comentarios\">'.$mensaje.'</label>\n <div role=\"toggle\" class=\"toggle-content\">';\n }\n \n}", "private function do_meta_box( $title = '', $contents = '' ) {\n\t\t?>\n\t\t<div class=\"postbox\">\n\t\t\t<h3 class=\"hndle\"><?php echo $title ?></h3>\n\t\t\t<div class=\"inside\">\n\t\t\t\t<?php echo $contents; ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}", "function show() {\n global $post;\n \t\t/**\n\t\t * Use nonce for verification.\n\t\t */\n echo '<input type=\"hidden\" name=\"weddingvendor_meta_box_nonce\" value=\"', wp_create_nonce(basename(__FILE__)), '\" />';\n echo '<table class=\"form-table\">';\n\t\t\n foreach ($this->_meta_box['fields'] as $field) { \n\t\t\t/**\n\t\t\t * get current post meta data.\n\t\t\t */\n $meta = get_post_meta($post->ID, $field['id'], true);\n\t\t\tif( isset( $field['desc'] ) ) {\n\t\t\t\t$meta_description = $field['desc'];\n\t\t\t}\n\t\t\t\n echo '<tr><th style=\"width:20%\"><label for=\"',esc_attr($field['id']), '\">', esc_html($field['name']), '</label></th><td>';\n\t\t\t\n switch ($field['type']) {\n\t\t\t /**\n\t\t\t\t * Meta-box Text Field.\n\t\t\t\t */\t\n case 'text':\n \t echo '<input type=\"text\" name=\"',esc_html($field['id']), '\" id=\"', esc_attr($field['id']), '\" value=\"', $meta ? $meta : $field['std'], '\" size=\"30\" style=\"width:97%\" />',\n '<br /><small>', $meta_description.'</small>';\n break;\t\n\t\n\n\t\t\t /**\n\t\t\t\t * Meta-box date Field.\n\t\t\t\t */\t\n case 'date':\n \t echo '<input type=\"text\" name=\"',esc_html($field['id']), '\" id=\"', esc_attr($field['id']), '\" value=\"', $meta ? $meta : $field['std'], '\" size=\"30\" style=\"width:97%\" class=\"check_date date\" />',\n '<br /><small>', $meta_description.'</small>';\n break;\t\t\t\t\t \t\t\t\t\n\t\t\t /**\n\t\t\t\t * Meta-box Color Field.\n\t\t\t\t */\t\n\t\t\t\tcase 'color':\n\t\t\t\t echo '<input class=\"color-field\" type=\"text\" name=\"',esc_html($field['id']), '\" id=\"', esc_attr($field['id']), '\" value=\"', $meta ? $meta : $field['std'], '\" />',\n '<br /><small>', $meta_description.'</small>';\n\t\t\t\tbreak;\n\t\t\t /**\n\t\t\t\t * Meta-box Textarea Field.\n\t\t\t\t */\t\n case 'textarea':\n echo '<textarea name=\"',esc_html($field['id']), '\" id=\"', esc_attr($field['id']), '\" cols=\"60\" rows=\"4\" style=\"width:97%\">', $meta ? $meta : $field['std'], '</textarea>',\n '<br /><small>', $meta_description.'</small>';\n break;\n\t\t\t /**\n\t\t\t\t * Meta-box Select Field.\n\t\t\t\t */\t\n\t\t\t\tcase 'select':\t\t\t\t\t\n\t\t\t\t\t echo '<select name=\"'.esc_attr($field['id']).'\" id=\"'.esc_attr($field['id']).'\">';\n\t\t\t\t\t\t foreach ($field['options'] as $option) {\n\t\t\t\t\t\t \t echo '<option', $meta == $option['value'] ? ' selected=\"selected\"' : '', ' value=\"'.$option['value'].'\">'.$option['label'].'</option>';\n\t\t\t\t\t \t } \n\t\t\t\t\t echo '</select><br /><span class=\"description\">'.$meta_description.'</span>';\n break;\n\t\t\t /**\n\t\t\t\t * Meta-box Radio Field.\n\t\t\t\t */\t\n\t\t\t\tcase 'radio':\n\t\t\t\t\t foreach ( $field['options'] as $option ) {\n\t\t\t\t\t\t echo '<input type=\"radio\" name=\"'.esc_attr($field['id']).'\" id=\"'.$option['value'].'\" \n\t\t\t\t\t\t\t value=\"'.$option['value'].'\" ',$meta == $option['value'] ? ' checked=\"checked\"' : '',' />\n\t\t\t\t\t\t\t <label for=\"'.$option['value'].'\">'.$option['name'].'</label><br />';\n\t\t\t\t\t }\n\t\t\t\t\t echo '<span class=\"description\">'.$meta_description.'</span>';\n\t\t\t\tbreak;\n\t\t\t /**\n\t\t\t\t * Meta-box Checkbox Field.\n\t\t\t\t */\t\n\t case 'checkbox':\n \t echo '<input type=\"checkbox\" name=\"',esc_html($field['id']), '\" id=\"', esc_attr($field['id']), '\"', $meta ? ' checked=\"checked\"' : '', ' />';\n\t\t\t\t\t echo '<span class=\"description\">'.$meta_description.'</span>';\n break;\n\t\t\t /**\n\t\t\t\t * Meta-box Checkbox-group Field.\n\t\t\t\t */\t\n\t\t\t case 'checkbox_group':\n\t\t\t\t\t foreach ($field['options'] as $option) {\n\t\t\t\t\t echo '<input type=\"checkbox\" value=\"',$option['value'],'\" name=\"',esc_html($field['id']),'[]\" \n\t\t\t\t\t\t id=\"',$option['value'],'\"',$meta && in_array($option['value'], $meta) ? ' checked=\"checked\"' : '',' />\n\t\t\t\t\t\t <label for=\"'.$option['value'].'\">'.$option['name'].'</label><br />';\n\t\t\t\t\t }\n\t\t\t\t\t echo '<span class=\"description\">'.$meta_description.'</span>';\n\t\t\t\t\tbreak;\n\t\t\t /**\n\t\t\t\t * Meta-box Image Field.\n\t\t\t\t */\t\n\t\t\t\tcase 'image':\n\t\t\t\t\t echo '<span class=\"upload\">';\n\t\t\t\t\t if( $meta ) {\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t echo '<input type=\"hidden\" name=\"',esc_html($field['id']), '\" id=\"', esc_attr($field['id']), '\" \n\t\t\t\t\t\t\t\t class=\"regular-text form-control text-upload\" value=\"',$meta,'\" />';\t\t\t\t\t\t\t\n\t\t\t\t\t\t echo '<img style=\"width:150px; display:block;\" src= \"'.$meta.'\" class=\"preview-upload\" />';\n\t\t\t\t\t\t echo '<input type=\"button\" class=\"button button-upload\" id=\"logo_upload\" value=\"'.esc_html__('Upload an image','weddingvendor').'\"/></br>';\t\t\n\t\t\t\t\t\t echo '<input type=\"button\" class=\"button-remove\" id=\"remove\" value=\"'.esc_html__('Remove','weddingvendor').'\" /> ';\n\t\t\t\t\t }else {\n\t\t\t\t\t\t echo '<input type=\"hidden\" name=\"',esc_html($field['id']), '\" id=\"', esc_attr($field['id']), '\" \n\t\t\t\t\t\t\t\t\tclass=\"regular-text form-control text-upload\" value=\"',$meta,'\" />';\t\t\t\t\t\t\t\n\t\t\t\t\t\t echo '<img style=\"\" src= \"'.$meta.'\" class=\"preview-upload\" />';\n\t\t\t\t\t\t echo '<input type=\"button\" class=\"button button-upload\" id=\"logo_upload\" value=\"'.esc_html__('Upload an image','weddingvendor').'\"/></br>';\t\t\n\t\t\t\t\t\t echo '<input type=\"button\" style=\"display:none;\" id=\"remove\" class=\"button-remove\" value=\"\" /> ';\n\t\t\t\t\t } echo '</span><span class=\"description\">'.$meta_description.'</span>';\t\t\n\t\t\t\tbreak;\n\t\t\t\t\t\n }\n echo '<td></tr>';\n }\n echo '</table>';\n }", "function newsdot_comments_link() {\n\t\tif ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {\n\t\t\techo '<span class=\"comments-link\">';\n\t\t\techo '<i class=\"far fa-comments mr-1\"></i>';\n\t\t\tcomments_popup_link(\n\t\t\t\tsprintf(\n\t\t\t\t\twp_kses(\n\t\t\t\t\t\t/* translators: %s: post title */\n\t\t\t\t\t\t__( 'Leave a Comment<span class=\"screen-reader-text\"> on %s</span>', 'newsdot' ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'span' => array(\n\t\t\t\t\t\t\t\t'class' => array(),\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\twp_kses_post( get_the_title() )\n\t\t\t\t)\n\t\t\t);\n\t\t\techo '</span>';\n\t\t}\n\t}", "function pantomime_author_box(){\n\tif ( is_single() ) :\n\t// Get the author email -> for Gravatar\n\t$author_email = get_the_author_meta('user_email');\n\t\t\n\t// Get the author description\n\t$author_description = get_the_author_meta('description');\t\n\t?>\n\n\t<div id=\"author-box\" class=\"emboss\">\n\t\t<h4 class=\"section-title\"><?php _e('About The Author', 'pantomime'); ?></h4>\n\t\t<?php\n\t\t\techo get_avatar($author_email, 50, '');\n\t\t\techo '<p>' . get_the_author_link() . ' - ' . $author_description . '</p>';\n\t\t?>\n\t</div>\n\t\n\t<?php\n\tendif;\n}", "function tp_comm_add_meta($comment_id) {\r\n\t$tw = tp_get_credentials();\r\n\tif ($tw) {\r\n\t\tupdate_comment_meta($comment_id, 'twuid', $tw->screen_name);\r\n\t}\r\n}", "public function showcommentsAction()\n {\n $comment_params=$this->_request->getParams();\n $ftvcontacts_obj = new Ep_Ftv_FtvContacts();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvcomments_obj = new Ep_Ftv_FtvComments();\n //$this->render(\"ftv_addcomment\"); exit;\n $request_id = $comment_params['request_id'];\n $this->_view->request_id=$request_id;\n $commentDetails=$ftvcomments_obj->getCommentsByRequests($request_id);\n\n /*$this->_view->commentDetails=$commentDetails;\n $commentsData='';\n if($commentDetails != 'NO')\n {\n $commentsData='';\n $cnt=0;\n foreach($commentDetails as $comment)\n {\n $commentsData.=\n '<li class=\"media\" id=\"comment_'.$comment['identifier'].'\">';\n $commentsData.='<div class=\"media-body\">\n <h4 class=\"media-heading\">\n <a href=\"#\" role=\"button\" data-toggle=\"modal\" data-target=\"#viewProfile-ajax\">'.utf8_encode($comment['first_name']).'</a></h4>\n '.utf8_encode(stripslashes($comment['comments'])).'\n <p class=\"muted\">'.$comment['created_at'].'</p>\n </div>\n </li>';\n }\n }*/\n $this->_view->ftvtype = \"chaine\";\n $this->_view->commentDetails = $commentDetails;\n\n $this->render(\"ftv_ftvaddcomment\");\n\n }", "function lightboxgallery_print_comment($comment, $context) {\n global $DB, $CFG, $COURSE, $OUTPUT;\n\n //TODO: Move to renderer!\n\n $user = $DB->get_record('user', array('id' => $comment->userid));\n\n $deleteurl = new moodle_url('/mod/lightboxgallery/comment.php', array('id' => $comment->gallery, 'delete' => $comment->id));\n\n echo '<table cellspacing=\"0\" width=\"50%\" class=\"boxaligncenter datacomment forumpost\">'.\n '<tr class=\"header\"><td class=\"picture left\">'.$OUTPUT->user_picture($user, array('courseid' => $COURSE->id)).'</td>'.\n '<td class=\"topic starter\" align=\"left\"><a name=\"c'.$comment->id.'\"></a><div class=\"author\">'.\n '<a href=\"'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$COURSE->id.'\">'.\n fullname($user, has_capability('moodle/site:viewfullnames', $context)).'</a> - '.userdate($comment->timemodified).\n '</div></td></tr>'.\n '<tr><td class=\"left side\">'.\n // TODO: user_group picture?\n '</td><td class=\"content\" align=\"left\">'.\n format_text($comment->comment, FORMAT_MOODLE).\n '<div class=\"commands\">'.\n (has_capability('mod/lightboxgallery:edit', $context) ? html_writer::link($deleteurl, get_string('delete')) : '').\n '</div>'.\n '</td></tr></table>';\n}", "function show( $object_id, $object_group = 'com_content', $object_title = '' )\r\n\t{\r\n\t\tglobal $mainframe;\r\n\r\n\t\t$object_id = (int) $object_id;\r\n\t\t$object_group = trim($object_group);\r\n\t\t$object_title = trim($object_title);\r\n\r\n\t\t$acl = & JCommentsFactory::getACL();\r\n\t\t$config = & JCommentsFactory::getConfig();\r\n\r\n\t\t$tmpl = & JCommentsFactory::getTemplate($object_id, $object_group);\r\n\t\t$tmpl->load('tpl_index');\r\n\r\n\t\tif ($config->getInt('object_locked', 0) == 1) {\r\n\t\t\t$config->set('enable_rss', 0);\r\n\t\t\t$tmpl->addVar('tpl_index', 'comments-form-locked', 1);\r\n\t\t}\r\n\r\n\t\tif (JCOMMENTS_JVERSION == '1.5') {\r\n\t\t\t$document = & JFactory::getDocument();\r\n\t\t}\r\n\t\r\n\t\tif (!defined('JCOMMENTS_CSS')) {\r\n\t\t\tinclude_once (JCOMMENTS_HELPERS . DS . 'system.php');\r\n\t\t\tif ($mainframe->isAdmin()) {\r\n\t\t\t\t$tmpl->addVar('tpl_index', 'comments-css', 1);\r\n\t\t\t} else {\r\n\t\t\t\t$link = JCommentsSystemPluginHelper::getCSS();\r\n\t\t\t\tif (JCOMMENTS_JVERSION == '1.5') {\r\n\t\t\t\t\t$document->addStyleSheet($link);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$mainframe->addCustomHeadTag('<link href=\"' . $link . '\" rel=\"stylesheet\" type=\"text/css\" />');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!defined('JCOMMENTS_JS')) {\r\n\t\t\tinclude_once (JCOMMENTS_HELPERS . DS . 'system.php');\r\n\t\t\tif ($config->getInt('gzip_js') == 1) {\r\n\t\t\t\tif (JCOMMENTS_JVERSION == '1.5') {\r\n\t\t\t\t\t$document->addScript(JCommentsSystemPluginHelper::getCompressedJS());\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$mainframe->addCustomHeadTag(JCommentsSystemPluginHelper::getCompressedJS(true));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (JCOMMENTS_JVERSION == '1.5') {\r\n\t\t\t\t\t$document->addScript(JCommentsSystemPluginHelper::getCoreJS());\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$mainframe->addCustomHeadTag(JCommentsSystemPluginHelper::getCoreJS(true));\r\n\t\t\t\t}\r\n \t\tif (!defined('JOOMLATUNE_AJAX_JS')) {\r\n\t\t\t\t\tif (JCOMMENTS_JVERSION == '1.5') {\r\n\t\t\t\t\t\t$document->addScript(JCommentsSystemPluginHelper::getAjaxJS());\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$mainframe->addCustomHeadTag(JCommentsSystemPluginHelper::getAjaxJS(true));\r\n\t\t\t\t\t}\r\n \t\tdefine('JOOMLATUNE_AJAX_JS', 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$tmpl->addVar('tpl_index', 'comments-form-captcha', $acl->check('enable_captcha'));\r\n\t\t$tmpl->addVar('tpl_index', 'comments-form-link', $config->getInt('form_show') ? 0 : 1);\r\n\r\n\t\tif ($config->getInt('enable_rss') == 1) {\r\n\t\t\t$link = JCommentsFactory::getLink('rss', $object_id, $object_group);\r\n\t\t\tif (JCOMMENTS_JVERSION == '1.5') {\r\n\t\t\t\t$attribs = array('type' => 'application/rss+xml', 'title' => strip_tags($object_title));\r\n\t\t\t\t$document->addHeadLink($link, 'alternate', 'rel', $attribs);\r\n\t\t\t} else {\r\n\t\t\t\t$html = '<link rel=\"alternate\" type=\"application/rss+xml\" title=\"' . strip_tags($object_title) . '\" href=\"' . $link . '\" />';\r\n\t\t\t\t$mainframe->addCustomHeadTag( $html );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$cacheEnabled = intval($mainframe->getCfg('caching')) == 1;\r\n\r\n\t\tif ($cacheEnabled == 0) {\r\n\t\t\t$jrecache = $mainframe->getCfg('absolute_path') . DS . 'components' . DS . 'com_jrecache' . DS . 'jrecache.config.php';\r\n\r\n\t\t\tif (is_file($jrecache)) {\r\n\t\t\t\t$cfg = new _JRECache_Config();\r\n\t\t\t\t$cacheEnabled = $cacheEnabled && $cfg->enable_cache;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$load_cached_comments = $config->getInt('load_cached_comments', 0);\r\n\r\n\t\tif ($cacheEnabled) {\r\n\t\t\t$tmpl->addVar('tpl_index', 'comments-anticache', 1);\r\n\t\t}\r\n\r\n\t\tif (!$cacheEnabled || $load_cached_comments === 1) {\r\n\t\t\tif ($config->get('template_view') == 'tree') {\r\n\t\t\t\t$tmpl->addVar('tpl_index', 'comments-list', JComments::getCommentsTree($object_id, $object_group));\r\n\t\t\t} else {\r\n\t\t\t\t$tmpl->addVar('tpl_index', 'comments-list', JComments::getCommentsList($object_id, $object_group));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$needScrollToComment = ($cacheEnabled || ($config->getInt('comments_per_page') > 0));\r\n\t\t$tmpl->addVar('tpl_index', 'comments-gotocomment', (int) $needScrollToComment);\r\n\t\t$tmpl->addVar('tpl_index', 'comments-form', JComments::getCommentsForm($object_id, $object_group, ($config->getInt('form_show') == 1)));\r\n\r\n\t\t$result = $tmpl->renderTemplate('tpl_index');\r\n\t\t$tmpl->freeAllTemplates();\r\n\r\n\t\treturn $result;\r\n\t}", "public function show(comment $comment)\n {\n //\n }", "function show_your_fields_meta_box() {\n\tglobal $post;\n\t\t$meta = get_post_meta( $post->ID, 'actu_fields', true ); ?>\n\n\t<input type=\"hidden\" name=\"actu_fb_link\" value=\"<?php echo wp_create_nonce( basename(__FILE__) ); ?>\">\n\n <p>\n\t<input type=\"text\" name=\"actu_fields[text]\" id=\"actu_fields[text]\" class=\"regular-text\" value=\"<?php if (is_array($meta) && isset($meta['text'])){ echo $meta['text']; } ?>\">\n</p>\n\n\t<?php }", "public function meta_box_display_forms() {\n\t?>\n\t\t<p><?php _e( 'Add forms to your Posts or Pages by locating the <strong>Add Form</strong> button in the area above your post/page editor.', 'visual-form-builder-pro' ); ?></p>\n \t<p><?php _e( 'You may also manually insert the shortcode into a post/page or the template tag into a template file.', 'visual-form-builder-pro' ); ?></p>\n \t<p>\n \t\t<?php _e( 'Shortcode', 'visual-form-builder-pro' ); ?>\n \t\t<input value=\"[vfb id='<?php echo (int) $_REQUEST['form']; ?>']\" readonly=\"readonly\" />\n \t</p>\n \t<p>\n \t\t<?php _e( 'Template Tag', 'visual-form-builder-pro' ); ?>\n \t\t<input value=\"&lt;?php vfb_pro( 'id=<?php echo (int) $_REQUEST['form']; ?>' ); ?&gt;\" readonly=\"readonly\"/>\n \t</p>\n\t<?php\n\t}", "function _display_unitinfo_meta( $post ) {\n\t\tinclude( 'includes/metaboxes/unit-info.php' );\n\t}", "public function show(Comment $comment) {\n //\n }", "public function show(Comment $comment)\n {\n \n }", "function fl_blog_post_meta() {\n\tif(is_page()) return; // don't do post-meta on pages\n?>\t\t\n<div class=\"content-bar iconfix\">\n\t<p class=\"meta\">\n\t\t<span><i class=\"icon-calendar\"></i><?php echo get_the_date(get_option('date_format')); ?></span>\n\t\t<span><i class=\"icon-folder-open\"></i><?php the_category(', '); ?></span>\n\t</p>\n\t<p class=\"comment-count\"><i class=\"icon-comments\"></i><?php comments_popup_link( __( '0 Comments', APP_TD ), __( '1 Comment', APP_TD ), __( '% Comments', APP_TD ) ); ?></p>\n</div>\n<?php\n}", "function addMeta() {\n\t\n\tif( class_exists('acf') ) {\n\n\t$meta_description = get_field('meta_description', 'option');\n\t$meta_keywords = get_field('meta_keywords', 'option');\n\t$meta_author = get_field('meta_author', 'option');\n\t$meta_og_image = get_field('meta_og_img', 'option');\n\t$meta_img_full = $meta_og_image['url'];\n\n\t}\n\n\tif ( $meta_description ) {\n\t\techo '<meta name=\"description\" content=\"'.$meta_description.'\">'; \n\t}\n\n\tif ( $meta_keywords ) {\n\t\techo '<meta name=\"keywords\" content=\"'.$meta_keywords.'\">'; \n\t}\n\n\tif ( $meta_author ) {\n\t\techo '<meta name=\"author\" content=\"'.$meta_author.'\">'; \n\t}\n\n\tif ( $meta_og_image ) {\n\t\techo '<meta name=\"twitter:card\" content=\"summary\" />';\n\t\techo '<meta property=\"og:image\" content=\"'.$meta_img_full.'\" />';\n\t}\n\n}", "function cmsmasters_post_comments($template_type = 'page', $show = true) {\n\t$out = '';\n\t\n\t\n\tif (comments_open()) {\n\t\tif ($template_type == 'page') {\n\t\t\t$out = cmsmasters_comments('cmsmasters_post_comments');\n\t\t} elseif ($template_type == 'post') {\n\t\t\t$cmsmasters_option = cmsmasters_get_global_options();\n\t\t\t\n\t\t\tif ($cmsmasters_option[CMSMASTERS_SHORTNAME . '_blog_post_comment']) {\n\t\t\t\t$out = cmsmasters_comments('cmsmasters_post_comments');\n\t\t\t}\n\t\t}\n\t}\n\t\n\t\n\tif ($show) {\n\t\techo $out;\n\t} else {\n\t\treturn $out;\n\t}\n}", "function render_meta_box_content( $post ) {\n $form_id = get_post_meta( $post->ID, '_wpuf_form_id', true );\n $user_analytics_info = get_post_meta( $post->ID, 'user_analytics_info', true ) ? get_post_meta( $post->ID, 'user_analytics_info', true ) : array();\n ?>\n <table class=\"form-table wpuf-user-analytics-listing\">\n <thead>\n <tr>\n <th><?php _e( 'User info title', 'wpuf-pro' ); ?></th>\n <th><?php _e( 'Value', 'wpuf-pro' ); ?></th>\n </tr>\n </thead>\n <tbody>\n <?php foreach ( $user_analytics_info as $key => $value ): ?>\n <tr>\n <td><strong><?php echo ucfirst( str_replace( '_', ' ', $key ) ); ?></strong></td>\n <td><?php echo $value; ?></td>\n </tr>\n <?php endforeach; ?>\n </tbody>\n </table>\n <style>\n .wpuf-user-analytics-listing td {\n font-size: 13px;\n }\n .wpuf-user-analytics-listing td, .wpuf-user-analytics-listing th {\n padding: 5px 8px;\n }\n </style>\n <?php\n }", "public static function add_meta_box() {\n\t\tadd_meta_box( 'sponsor-meta', __( 'Sponsor Meta', self::$text_domain ), array( __CLASS__, 'do_meta_box' ), self::$post_type_name , 'normal', 'high' );\n\t}", "function meta_box($post) {\r\n\t\t$map = get_post_meta($post->ID, '_mapp_map', true);\r\n\t\t$pois = get_post_meta($post->ID, '_mapp_pois', true);\r\n\r\n\t\t// Load the edit map\r\n\t\t// Note that mapTypes is hardcoded = TRUE (so user can change type, even if not displayed in blog)\r\n\t\t$map['maptypes'] = 1;\r\n\t\t$this->map($map, $pois, true);\r\n\r\n\t\t// The <div> will be filled in with the list of POIs\r\n\t\t//echo \"<div id='admin_poi_div'></div>\";\r\n\t}", "function register_block_core_comment_content()\n {\n }", "function gk_comment_form( $fields ) {\n ob_start();\n wp_editor( '', 'comment', array( 'teeny' => true ));\n $fields['comment_field'] = ob_get_clean();\n return $fields;\n}", "public function render_screen_meta()\n {\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "public function show(Comment $comment)\n {\n //\n }", "function projectpentagon_tastingnotes() {\n\t wp_nonce_field( plugin_basename( __FILE__ ), 'myplugin_noncename' );\n\t $post_idinhere\t=\t$_GET['post']; //GET THE ID OUTSIDE OF THE LOOP\n\t \n\t $get_field_name\t=\t get_option('projectpentagon-titleonpages');\n\t $meta_value_field = get_post_meta($post_idinhere, 'tasting-notes', true); \n\tif($meta_value_field1)\n\t\t{\n\t\t \t//echo \"we're at debut point a\";//debug\n\t\t \t$display1 = $meta_value_field1; \n\t\t}\n\telse \n\t\t{\n\t\t \t//echo \"we're at debut point b\". $meta_value_field1 .\"\";//debug\n\t\t \t$display1 = \"enter value here.\";\n\t\t}\n\n\t\t// we're not using _e because its user input text we're retrieving.\n\t // we'll assume that the user put it in the database in their preferred language\n\t\t\t echo '<label for=\"'. $get_field_name .'\">';\n\t\t\techo $get_field_name;\n\t\t \techo '</label> <br /> ';\n\t\t\techo '<textarea id=\"tasting-notes\" name=\"tasting-notes\" cols=\"60\" rows=\"4\" tabindex=\"30\" style=\"width: 97%;\">'. $meta_value_field .'</textarea>';\t\n}", "protected function comments_view(array $options = array()){\r\n\r\n\t\t/* Options */\r\n\t\tif (Utility::is_loopable($options)){\r\n\t\t\tforeach($options as $key => $value){\r\n\t\t\t\tswitch($key){\r\n\t\t\t\t\tcase 'type':\r\n\t\t\t\t\t\t$type = $value;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/* Get display data */\r\n\t\t$object = $this->get_commentable_object();\r\n\t\t$commentCount = count($object['comments']);\r\n\t\t\r\n\t\t/* Load template */\r\n\t\tinclude(BLUPATH_TEMPLATES.'/newcomments/wrapper.php');\r\n\r\n\t}", "public function renderCommentView($ucid) {\n global $lexicon;\n global $roles;\n\n $members = new Members();\n\n $comment_data = $this->comments['ucid-'.$ucid];\n $this->html_output .= ('<div class=\"commentia-comment\"'.' data-ucid=\"'.$comment_data['ucid'].'\">'.\"\\n\");\n $this->html_output .= ('<div class=\"commentia-comment-info\">'.\"\\n\");\n $this->html_output .= ('<img src='.$members->getMemberData($comment_data['creator_username'], 'avatar_file').' class=\"commentia-comment-info__member-avatar\">'.\"\\n\");\n $this->html_output .= ('<p class=\"commentia-comment-info__by\">'.COMMENT_INFO_COMMENT_BY.' '.($comment_data['creator_username']).', </p>'.\"\\n\");\n date_default_timezone_set(COMMENTIA_TIMEZONE);\n $this->html_output .= ('<p class=\"commentia-comment-info__timestamp\">'.COMMENT_INFO_POSTED_AT.' '.date(DATETIME_LOCALIZED,strtotime($comment_data['timestamp'])).'</p>'.\"\\n\");\n date_default_timezone_set('UTC');\n $this->html_output .= ('</div>'.\"\\n\");\n $this->html_output .= ('<div class=\"commentia-comment__content\">'.$comment_data['content'].'</div>'.\"\\n\");\n $this->html_output .= ('<div class=\"commentia-comment__edit-area\"></div>'.\"\\n\");\n\n if (!$comment_data['is_deleted']) {\n if ($_SESSION['__COMMENTIA__']['member_is_logged_in']) {\n $this->html_output .= ('<p class=\"commentia-comment-controls\">');\n $this->html_output .= ('<a href=\"javascript:void(0)\" onclick=\"showReplyArea(this)\">'.COMMENT_CONTROLS_REPLY.'</a>');\n if ($roles->memberHasUsername($comment_data['creator_username']) || $roles->memberIsAdmin()) {\n $this->html_output .= ('<a href=\"javascript:void(0)\" onclick=\"showEditArea(this)\">'.COMMENT_CONTROLS_EDIT.'</a>');\n $this->html_output .= ('<a href=\"javascript:void(0)\" onclick=\"deleteComment(this)\">'.COMMENT_CONTROLS_DELETE.'</a>');\n }\n $this->html_output .= ('</p>'.\"\\n\");\n }\n $this->html_output .= ('<div class=\"commentia-rating-controls\">');\n $this->html_output .= ('<a href=\"javascript:void(0)\" onclick=\"updateRating(this, \\'up\\')\" class=\"commentia-rating-controls__arrow commentia-rating-controls__arrow--up\"></a>');\n $this->html_output .= ('<a href=\"javascript:void(0)\" onclick=\"updateRating(this, \\'down\\')\" class=\"commentia-rating-controls__arrow commentia-rating-controls__arrow--down\"></a>');\n $this->html_output .= ('</div>');\n $this->html_output .= ('<span class=\"commentia-rating-indicator\">'.(int) $comment_data['rating'].'</span>');\n }\n\n $this->html_output .= ('<div class=\"commentia-comment__reply-area\"></div>'.\"\\n\");\n\n if ($comment_data['children']) {\n foreach($comment_data['children'] as $child) {\n if (isset($this->comments['ucid-'.$child])) {\n $this->renderCommentView($child);\n unset($this->comments['ucid-'.$child]);\n }\n }\n }\n\n $this->html_output .= ('</div>'.\"\\n\");\n\n }", "public function listComments()\n\t{\n\t\t$commentsManager = new Comments();\n\t\t$listComments = $commentsManager-> getListComments(); \n\t\trequire('view/ViewBackEnd/commentsAdminView.php');\n\t}", "public function render() {\n\n\t\tif(!$this->commentsField) return \"Unable to determine comments field\";\n\t\t$options = $this->options; \t\n\t\t$labels = $options['labels'];\n\t\t$attrs = $options['attrs'];\n\t\t$id = $attrs['id'];\n\t\t$submitKey = $id . \"_submit\";\n\t\t$honeypot = $options['requireHoneypotField'];\n\t\t$inputValues = array('cite' => '', 'email' => '', 'website' => '', 'stars' => '', 'text' => '', 'notify' => '');\n\t\tif($honeypot) $inputValues[$honeypot] = '';\n\t\t\n\t\t$user = $this->wire('user'); \n\n\t\tif($user->isLoggedin()) {\n\t\t\t$inputValues['cite'] = $user->name; \n\t\t\t$inputValues['email'] = $user->email;\n\t\t}\n\t\t\n\t\t$input = $this->wire('input'); \n\t\t$divClass = 'new';\n\t\t$class = trim(\"CommentForm \" . $attrs['class']); \n\t\t$note = '';\n\n\t\t/*\n\t\t * Removed because this is not cache safe! Converted to JS cookie. \n\t\t * \n\t\tif(is_array($this->session->CommentForm)) {\n\t\t\t// submission data available in the session\n\t\t\t$sessionValues = $this->session->CommentForm;\n\t\t\tforeach($inputValues as $key => $value) {\n\t\t\t\tif($key == 'text') continue; \n\t\t\t\tif(!isset($sessionValues[$key])) $sessionValues[$key] = '';\n\t\t\t\t$inputValues[$key] = htmlentities($sessionValues[$key], ENT_QUOTES, $this->options['encoding']); \n\t\t\t}\n\t\t\tunset($sessionValues);\n\t\t}\n\t\t*/\n\n\t\tforeach($options['presets'] as $key => $value) {\n\t\t\tif(!is_null($value)) $inputValues[$key] = $value; \n\t\t}\n\n\t\t$out = '';\n\t\t$showForm = true; \n\t\t\n\t\tif($options['processInput'] && $input->post->$submitKey == 1) {\n\t\t\t$comment = $this->processInput(); \n\t\t\tif($comment) { \n\t\t\t\t$out .= $this->renderSuccess($comment); // success, return\n\t\t\t} else {\n\t\t\t\t$inputValues = array_merge($inputValues, $this->inputValues);\n\t\t\t\tforeach($inputValues as $key => $value) {\n\t\t\t\t\t$inputValues[$key] = htmlentities($value, ENT_QUOTES, $this->options['encoding']);\n\t\t\t\t}\n\t\t\t\t$note = \"\\n\\t$options[errorMessage]\";\n\t\t\t\t$divClass = 'error';\n\t\t\t}\n\n\t\t} else if($this->options['redirectAfterPost'] && $input->get('comment_success') === \"1\") {\n\t\t\t$note = $this->renderSuccess();\n\t\t}\n\n\t\t$form = '';\n\t\tif($showForm) {\n\t\t\tif($this->options['depth'] > 0) {\n\t\t\t\t$form = $this->renderFormThread($id, $class, $attrs, $labels, $inputValues);\n\t\t\t} else {\n\t\t\t\t$form = $this->renderFormNormal($id, $class, $attrs, $labels, $inputValues); \n\t\t\t}\n\t\t\tif(!$options['presetsEditable']) {\n\t\t\t\tforeach($options['presets'] as $key => $value) {\n\t\t\t\t\tif(!is_null($value)) $form = str_replace(\" name='$key'\", \" name='$key' disabled='disabled'\", $form); \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$out .= \n\t\t\t\"\\n<div id='{$id}' class='{$id}_$divClass'>\" . \t\n\t\t\t\"\\n\" . $this->options['headline'] . $note . $form . \n\t\t\t\"\\n</div><!--/$id-->\";\n\n\n\t\treturn $out; \n\t}", "function starter_comment_block() {\n $items = array();\n $number = variable_get('comment_block_count', 10);\n\n foreach (comment_get_recent($number) as $comment) {\n //kpr($comment->changed);\n //print date('Y-m-d H:i', $comment->changed);\n $items[] =\n '<h3>' . l($comment->subject, 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid)) . '</h3>' .\n ' <time datetime=\"'.date('Y-m-d H:i', $comment->changed).'\">' . t('@time ago', array('@time' => format_interval(REQUEST_TIME - $comment->changed))) . '</time>';\n }\n\n if ($items) {\n return theme('item_list', array('items' => $items, 'daddy' => 'comments'));\n }\n else {\n return t('No comments available.');\n }\n}", "function show() {\n global $post;\n\n // Use nonce for verification\n echo '<input type=\"hidden\" name=\"mytheme_meta_box_nonce\" value=\"', wp_create_nonce(basename(__FILE__)), '\" />';\n\n echo '<table class=\"form-table\">';\n\n foreach ($this->_meta_box['fields'] as $field) {\n // get current post meta data\n $meta = get_post_meta($post->ID, $field['id'], true);\n\n echo '<tr>',\n '<th style=\"width:20%\"><label for=\"', $field['id'], '\">', $field['name'], '</label></th>',\n '<td>';\n switch ($field['type']) {\n case 'text':\n echo '<input type=\"text\" name=\"', $field['id'], '\" id=\"', $field['id'], '\" value=\"', $meta ? $meta : $field['std'], '\" size=\"30\" style=\"width:97%\" />',\n '<br />', $field['desc'];\n break;\n case 'textarea':\n echo '<textarea name=\"', $field['id'], '\" id=\"', $field['id'], '\" cols=\"60\" rows=\"4\" style=\"width:97%\">', $meta ? $meta : $field['std'], '</textarea>',\n '<br />', $field['desc'];\n break;\n case 'select':\n echo '<select name=\"', $field['id'], '\" id=\"', $field['id'], '\">';\n foreach ($field['options'] as $option) {\n echo '<option', $meta == $option ? ' selected=\"selected\"' : '', '>', $option, '</option>';\n }\n echo '</select>';\n break;\n case 'radio':\n foreach ($field['options'] as $option) {\n echo '<input type=\"radio\" name=\"', $field['id'], '\" value=\"', $option['value'], '\"', $meta == $option['value'] ? ' checked=\"checked\"' : '', ' />', $option['name'];\n }\n break;\n case 'checkbox':\n echo '<input type=\"checkbox\" name=\"', $field['id'], '\" id=\"', $field['id'], '\"', $meta ? ' checked=\"checked\"' : '', ' />';\n break;\n }\n echo '<td>',\n '</tr>';\n }\n\n echo '</table>';\n }", "function add_actus_meta_box() {\n\tadd_meta_box(\n\t\t'fb_link', // $id\n\t\t'Lien Facebook', // $title\n\t\t'show_your_fields_meta_box', // $callback\n\t\t'actus', // $screen\n\t\t'normal', // $context\n\t\t'high' // $priority\n\t);\n}", "function display_notes() {\n\t\t?>\n\t\t<style>\n\t #adminmenuwrap,\n\t #screen-meta,\n\t #screen-meta-links,\n\t #adminmenuback,\n\t #wpfooter,\n\t #wpadminbar{\n\t display: none !important;\n\t }\n\t #wpbody-content{\n\t \tpadding: 0;\n\t }\n\t html{\n\t padding-top: 0 !important;\n\t }\n\t #wpcontent{\n\t margin: 0 !important;\n\t }\n\t #wc-crm-page{\n\t margin: 15px !important;\n\t }\n </style>\n <input type=\"hidden\" id=\"customer_user\" name=\"customer_user\" value=\"<?php echo $this->user_id; ?>\">\n\t\t<div id=\"side-sortables\" class=\"meta-box-sortables\">\n\t\t\t\t<div class=\"postbox \" id=\"woocommerce-customer-notes\">\n\t\t\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t\t<ul class=\"order_notes\">\n\t\t\t\t\t\t\t<?php $notes = $this->get_customer_notes(); ?>\n\t\t\t\t\t\t\t\t\t<?php if ( $notes ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach( $notes as $note ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li rel=\"<?php echo absint( $note->comment_ID ) ; ?>\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"note_content\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo wpautop( wptexturize( wp_kses_post( $note->comment_content ) ) ); ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"meta\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<abbr class=\"exact-date\" title=\"<?php echo $note->comment_date_gmt; ?> GMT\"><?php printf( __( 'added %s ago', 'wc_customer_relationship_manager' ), human_time_diff( strtotime( $note->comment_date_gmt ), current_time( 'timestamp', 1 ) ) ); ?></abbr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( $note->comment_author !== __( 'WooCommerce', 'wc_customer_relationship_manager' ) ) printf( ' ' . __( 'by %s', 'wc_customer_relationship_manager' ), $note->comment_author ); ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"delete_customer_note\"><?php _e( 'Delete note', 'wc_customer_relationship_manager' ); ?></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\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} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<li>' . __( 'There are no notes for this customer yet.', 'wc_customer_relationship_manager' ) . '</li>';\n\t\t\t\t\t\t\t\t\t\t\t\t} ?>\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t<div class=\"add_note\">\n\t\t\t\t\t\t\t\t\t\t\t<h4>Add note</h4>\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<textarea rows=\"5\" cols=\"20\" class=\"input-text\" id=\"add_order_note\" name=\"order_note\" type=\"text\"></textarea>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<a class=\"add_note_customer button\" href=\"#\">Add</a>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}", "function _displayMetaMessage(&$event, $param)\n {\n\n if ($event->data == 'edit' || $event->data == 'preview') {\n\n $pluginInfo = $this->getInfo();\n\n ptln('<div class=\"alert alert-success ' . self::META_MESSAGE_BOX_CLASS . '\" role=\"alert\">');\n\n global $ID;\n $canonical = p_get_metadata($ID, action_plugin_webcomponent_metacanonical::CANONICAL_PROPERTY);\n if ($canonical) {\n print $canonical;\n } else {\n print \"No canonical\";\n }\n\n print '<div class=\"managerreference\">' . $this->lang['message_come_from'] . ' <a href=\"' . $pluginInfo['url'] . '\" class=\"urlextern\" title=\"' . $pluginInfo['desc'] . '\" rel=\"nofollow\">' . $pluginInfo['name'] . '</a>.</div>';\n print('</div>');\n\n }\n\n }", "public function comment()\n {\n $commentManager = new CommentManager();\n \n $comment = $commentManager->getComment($_GET['id']);\n \n require (__DIR__ . '/../view/frontend/commentView.php');\n }" ]
[ "0.7155159", "0.7092396", "0.70813", "0.69819075", "0.6650371", "0.66219574", "0.6549328", "0.6527401", "0.652701", "0.6492178", "0.6434591", "0.6390369", "0.63355786", "0.63287556", "0.6322764", "0.6295235", "0.62818354", "0.62800217", "0.62788796", "0.62673306", "0.6260664", "0.62383837", "0.62341154", "0.6224431", "0.6220154", "0.62147605", "0.61920446", "0.61912686", "0.6174725", "0.61526865", "0.61040735", "0.6092977", "0.6090938", "0.6087661", "0.60850906", "0.60731953", "0.6068549", "0.6068381", "0.60649264", "0.6057542", "0.60502803", "0.6047384", "0.6045645", "0.60284287", "0.6028118", "0.6015243", "0.6006825", "0.60053414", "0.5998832", "0.59972405", "0.59830517", "0.59737486", "0.5961707", "0.59417725", "0.59270024", "0.59244597", "0.5911743", "0.59105015", "0.58947885", "0.5889488", "0.5887024", "0.588463", "0.588384", "0.58806986", "0.58746326", "0.5874391", "0.58715177", "0.5856694", "0.58536255", "0.5852981", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.584641", "0.58440655", "0.58440346", "0.5837083", "0.5830914", "0.5828619", "0.5823076", "0.58168834", "0.5815763", "0.58156496", "0.58153665", "0.58122826" ]
0.7307501
0
Bib Generator from Database Have one specify database for one donation type running with Database Primary Key
public static function main(){ //do nothing }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toSql() // {{{\n {\n $out = \"\";\n $out .= \"-- This file was autogenerated by a Script With No Name\\n\";\n $out .= \"-- on \".date(\"Y-m-d\").\". It represents a set of BibTeX entries.\\n\\n\";\n $schema = $this->getParameterSet();\n $out .= \"-- Table schema\\n\";\n $out .= \"CREATE TABLE `\".Bibliography::$db_name.\"` (\\n\";\n $out .= \" `identifier` varchar(128) NOT NULL,\\n\";\n foreach ($schema as $p_name)\n {\n $type = Bibliography::guessType($p_name);\n $out .= \" `$p_name` $type DEFAULT NULL,\\n\";\n }\n $out .= \" PRIMARY KEY (`identifier`)\\n\";\n $out .= \") ENGINE=MyISAM DEFAULT CHARSET=utf8;\\n\\n\";\n $out .= \"-- Entry data\\n\";\n foreach ($this->m_entries as $bibtex_name => $bibtex_entry)\n {\n $first = true;\n $out .= \"INSERT INTO `\".Bibliography::$db_name.\"` SET `identifier` = '\".Bibliography::escapeSql($bibtex_name).\"'\";\n foreach ($bibtex_entry as $k => $v)\n {\n $out .= \", `$k` = '\".Bibliography::escapeSql($v).\"'\";\n }\n $out .= \";\\n\";\n }\n return $out;\n }", "abstract public function getDBDesc();", "static private function regenerate_database()\n {\n self::$quick = false; // Disable quick mode.\n\n self::greeting();\n self::database_backup(); // Backup database, just in case.\n\n if(self::check_duplicates()) {\n self::link_naked_arxiv(); // Link naked arXiv IDs.\n\n self::log(\"Initiating database regeneration from INSPIRE.\");\n $stats = self::inspire_regenerate(\"SELECT inspire FROM records WHERE (inspire != '' AND inspire IS NOT NULL)\");\n\n if (sizeof($stats->found) > 0)\n self::log(sizeof($stats->found) . \" records were regenerated.\");\n if (sizeof($stats->lost) > 0)\n self::log(sizeof($stats->lost) . \" records were not found on INSPIRE: \" . implode(\", \", $stats->lost) . \".\");\n\n self::fetch_missing_bibtex();\n }\n\n self::wrapup();\n }", "function bibTex() {\n\t\t$bibtex = '';\n\t\tforeach ($this->data as $entry) {\n\t\t\t//Intro\n\t\t\t$bibtex .= '@' . strtolower($entry['entryType']) . ' { ' . $entry['cite'] . \",\\n\";\n\t\t\t//Other fields except author\n\t\t\tforeach ($entry as $key => $val) {\n\t\t\t\tif ($this->_options['wordWrapWidth'] > 0) {\n\t\t\t\t\t$val = $this->_wordWrap($val);\n\t\t\t\t}\n\t\t\t\tif (!in_array($key, array('cite', 'entryType', 'author', 'editor'))) {\n\t\t\t\t\tif($key != 'url')\n\t\t\t\t\t\t$val = str_replace(array_keys($this->escapedChars), array_values($this->escapedChars), $val);\n\t\t\t\t\tif($key == 'pages')\n\t\t\t\t\t\t$val = str_replace('-', '--', $val);\n\n\t\t\t\t\t$bibtex .= \"\\t\" . $key . ' = {' . $val . \"},\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Author\n\t\t\t$author = '';\n\t\t\tif (array_key_exists('author', $entry)) {\n\t\t\t\tif ($this->_options['extractAuthors']) {\n\t\t\t\t\t$tmparray = array(); //In this array the authors are saved and the joind with an and\n\t\t\t\t\tforeach ($entry['author'] as $authorentry) {\n\t\t\t\t\t\t$tmparray[] = $this->_formatAuthor($authorentry);\n\t\t\t\t\t}\n\t\t\t\t\t$author = join(' and ', $tmparray);\n\t\t\t\t} else {\n\t\t\t\t\t$author = $entry['author'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$editor = '';\n\t\t\tif (array_key_exists('editor', $entry)) {\n\t\t\t\tif ($this->_options['extractAuthors']) {\n\t\t\t\t\t$tmparray = array(); //In this array the authors are saved and the joind with an and\n\t\t\t\t\tforeach ($entry['editor'] as $authorentry) {\n\t\t\t\t\t\t$tmparray[] = $this->_formatAuthor($authorentry);\n\t\t\t\t\t}\n\t\t\t\t\t$editor = join(' and ', $tmparray);\n\t\t\t\t} else {\n\t\t\t\t\t$editor = $entry['editor'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!empty($author))\n\t\t\t\t$bibtex .= \"\\tauthor = {\" . str_replace(array_keys($this->escapedChars), array_values($this->escapedChars), $author) . \"}\";\n\n\t\t\tif(!empty($editor))\n\t\t\t\t$bibtex .= \",\\n\\teditor = {\" . str_replace(array_keys($this->escapedChars), array_values($this->escapedChars), $editor) . \"}\";\n\t\t\t$bibtex.=\"\\n}\\n\\n\";\n\t\t}\n\t\treturn $bibtex;\n\t}", "function birthCitation($page, $idir, $type)\n{\t\n global $debug;\n\n if ($type == Citation::STYPE_BIRTH &&\n \t!is_null($idir))\n {\t\t // citation to birth\n \t// IDIME must be IDIR of individual\n \t$personid\t= new Person(array('idir' => $idir));\n \t$count\t = preg_match('/^([0-9]{4})-([0-9]+)$/',\n \t\t\t\t \t $page,\n \t\t\t\t\t $matches);\n \tif ($count == 1)\n \t{\t\t // detail matches pattern\n \t $regyear\t= $matches[1];\n \t $regnum\t = $matches[2];\n \t $birth\t = new Birth('CAON',\n \t\t\t\t\t \t $regyear,\n \t\t\t\t\t\t $regnum);\n \t $birth->set('idir', $idir);\n \t if (!($birth->isExisting()))\n \t {\t\t// new record\n \t\t\t$birth->set('surname', $personid->get('surname'));\n \t\t\t$birth->set('givennames',\n \t\t\t\t\t\t $personid->get('givenname'));\n \t\t\t$gender\t\t= $personid->get('gender');\n \t\t\tif ($gender == Person::MALE)\n \t\t\t $birth->set('sex', 'M');\n \t\t\telse\n \t\t\tif ($gender == Person::FEMALE)\n \t\t\t $birth->set('sex', 'F');\n \t\t\t$evBirth\t= $personid->getBirthEvent(true);\n \t\t\t$birth->set('birthdate', $evBirth->getDate());\n \t\t\t$birth->set('birthplace',\n \t\t\t\t\t\t $evBirth->getLocation()->toString());\n \t }\t\t// new record\n $result\t= $birth->save();\n if ($result)\n print \",\\n \\\"sqlcmd\" . __LINE__ . \"\\\" : \" . json_encode($birth->getLastSqlCmd());\n \t}\t\t // detail matches pattern\n }\t\t\t // citation to birth\n return;\n}", "public function createTable(){\n\t\t\t\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS `biblio_entries_inbook` (\n\t\t`id_publi` int(11) NOT NULL AUTO_INCREMENT,\t\n\t\t`chapter` varchar(150) NOT NULL,\n\t\t`pages` varchar(15) NOT NULL,\t\t\t\t\n\t\t`publisher` int(11) NOT NULL,\n\t\t`volume` int(11) NOT NULL,\t\t\n\t\t`series` varchar(20) NOT NULL,\n\t\t`address` varchar(50) NOT NULL,\n\t\t`edition` varchar(50) NOT NULL,\t\t\t\t\t\t\n\t\tPRIMARY KEY (`id_publi`)\n\t\t);\";\n\t\t$pdo = $this->runRequest($sql);\n\t\treturn $pdo;\n\t}", "function b_code($code){\n \t$re = new DbManager();\n \t$book = $re -> code_book($code);\n \treturn $book ;\n }", "public static function mappingBibtex($tableau)\n {\n $date = \"\";\n $date_display = \"\";\n $journal = \"\";\n $volume = \"\";\n $number = \"\";\n $pages = \"\";\n $note = \"\";\n $abstract = \"\";\n $keywords = \"\";\n $series = \"\";\n $localite = \"\";\n $publisher = \"\";\n $editor = \"\";\n $categorie = \"\";\n $date_display = \"\";\n\n \n\n\n\n\n var_dump($tableau);\n\n\n\n\n\n $entryType = utf8_encode($tableau[\"entryType\"]);\n // Champs obligatoire\n $reference = utf8_encode($tableau[\"cite\"]);\n $auteurs = utf8_encode($tableau[\"author\"]);\n $titre = utf8_encode($tableau[\"title\"]);\n\n // On formate la date\n if( array_key_exists('year', $tableau) )\n {\n $date = $tableau[\"year\"];\n $date_display = $tableau[\"year\"]; \n if(array_key_exists('month', $tableau) && $tableau[\"month\"] != \"\")\n {\n $date .= \"-\".$tableau[\"month\"].\"-01\";\n $date_display = $tableau[\"month\"].\" \".$date_display;\n }\n else\n {\n $date .= \"-01-01\";\n }\n }\n\n // On récupère les autres données\n foreach ($tableau as $key => $value)\n {\n if(!in_array($key, array('cite','author','title','year','month')))\n {\n $key = utf8_encode($value);\n }\n }\n\n // On fait correspondre les variables du fichier bibtex et les attributs\n // de la publication\n if(isset($booktitle))\n $journal = $booktitle;\n if(isset($address))\n $localite = $address;\n // On defini la categorie\n if( in_array($entryType, array('article','book','booklet','inbook','incollection')))\n $categ_id = \"1\";\n else if( in_array($entryType, array('manual','techreport')))\n $categ_id = \"3\";\n else if( in_array($entryType, array('conference','inproceedings','proceedings')))\n $categ_id = \"2\";\n else if( in_array($entryType, array('phdthesis','mastersthesis')))\n $categ_id = \"4\";\n else\n $categ_id = \"5\";\n \n \n // On créer la publication et on attribut les values\n $publication = new Publication();\n\t\t$publication->setAttribute('ID',null);\n\t\t$publication->setAttribute('reference',$reference);\n\t\t$publication->setAttribute('auteurs',$auteurs);\n\t\t$publication->setAttribute('titre',$titre);\n\t\t$publication->setAttribute('date',$date);\n\t\t$publication->setAttribute('journal',$journal);\n\t\t$publication->setAttribute('volume',$volume);\n\t\t$publication->setAttribute('number',$number);\n\t\t$publication->setAttribute('pages',$pages);\n\t\t$publication->setAttribute('note',$note);\n\t\t$publication->setAttribute('abstract',$abstract);\n\t\t$publication->setAttribute('keywords',$keywords);\n\t\t$publication->setAttribute('series',$series);\n\t\t$publication->setAttribute('localite',$localite);\n\t\t$publication->setAttribute('publisher',$publisher);\n\t\t$publication->setAttribute('editor',$editor);\n\t\t$publication->setAttribute('pdf',null);\n\t\t$publication->setAttribute('date_display',date('Y-m-d'));\n\t\t$publication->setAttribute('categorie_id',$categ_id);\n return $publication;\n }", "function sopac_bib_record() {\n global $user;\n\n $locum = sopac_get_locum();\n $insurge = sopac_get_insurge();\n $actions = sopac_parse_uri();\n $bnum = $actions[1];\n $getvars = sopac_parse_get_vars();\n $output = $getvars['output'];\n\n // Load social function\n require_once('sopac_social.php');\n drupal_add_js('misc/collapse.js');\n drupal_add_js(drupal_get_path('theme', 'aadl').'/soundmanager2-nodebug-jsmin.js');\n drupal_add_js(drupal_get_path('theme', 'aadl').'/inlineplayer.js');\n $no_circ = $locum->csv_parser($locum->locum_config['location_limits']['no_request']);\n $show_inactive = user_access('show suppressed records');\n $item = $locum->get_bib_item($bnum, $show_inactive);\n $bnum_arr[] = $bnum;\n $reviews = $insurge->get_reviews(NULL, $bnum_arr, NULL);\n $i = 0;\n foreach ($reviews['reviews'] as $insurge_review) {\n $rev_arr[$i]['rev_id'] = $insurge_review['rev_id'];\n $rev_arr[$i]['bnum'] = $insurge_review['bnum'];\n if ($insurge_review['uid']) {\n $rev_arr[$i]['uid'] = $insurge_review['uid'];\n }\n $rev_arr[$i]['timestamp'] = $insurge_review['rev_create_date'];\n $rev_arr[$i]['rev_title'] = $insurge_review['rev_title'];\n $rev_arr[$i]['rev_body'] = $insurge_review['rev_body'];\n $i++;\n }\n if (!$insurge->check_reviewed($user->uid, $bnum_arr[0]) && $user->uid) {\n $rev_form = drupal_get_form('sopac_review_form', $bnum_arr[0]);\n }\n else {\n $rev_form = NULL;\n }\n if($machinetags = $insurge->get_machine_tags($bnum)){\n foreach($machinetags as $machinetag){\n $item['machinetags'][$machinetag['namespace']][] = $machinetag;\n }\n }\n if(($item['magnatune_url'] || $item['mat_code'] == 'z') && !$item['stream_filetype']){\n $result_page = theme('sopac_record_musicdownload', $item, $locum->locum_config, $rev_arr, $rev_form);\n }\n else if ($item['mat_code']) {\n $item['tracks'] = $locum->get_cd_tracks($bnum);\n $item['trackupc'] = $locum->get_upc($bnum);\n if($item['bnum']) {\n $item_status = $locum->get_item_status($bnum, TRUE);\n }\n // Grab Syndetics reviews, etc..\n $review_links = $locum->get_syndetics($item['stdnum'][0]);\n if (count($review_links)) {\n $item['review_links'] = $review_links;\n }\n $lists = $insurge->get_item_list_ids($item['bnum']);\n if(count($lists)){\n $sql = \"SELECT * FROM {sopac_lists} WHERE public = 1 and list_id IN (\".implode($lists,',').\") ORDER BY list_id DESC\";\n $res = db_query($sql);\n for ($i = 1; $i <= 10; $i++) {\n $record = db_fetch_array($res);\n $item['lists'][] = $record;\n }\n }\n // Build the page\n $result_page = theme('sopac_record', $item, $item_status, $locum->locum_config, $no_circ, &$locum, $rev_arr, $rev_form);\n }\n else {\n $result_page = t('This record does not exist.');\n }\n\n if ($output == \"rss\") {\n $item['status'] = $item_status;\n $item['type'] = 'bib';\n $cover_img_url = $item['cover_img'];\n return theme('sopac_results_hitlist_rss', 1, $cover_img_url, $item, $locum->locum_config, $no_circ);\n } else {\n return '<p>'. t($result_page) .'</p>';\n }\n}", "function to_proteinDB($mainDB){\n $oldDBName = '';\n if($mainDB->selected_db_name != PROHITS_PROTEINS_DB){\n $oldDBName =$mainDB->selected_db_name;\n $mainDB->change_db(PROHITS_PROTEINS_DB); \n } \n return $oldDBName;\n}", "public function run() {\n\t\t$toolbox = R::$toolbox;\n\t\t$adapter = $toolbox->getDatabaseAdapter();\n\t\t$writer = $toolbox->getWriter();\n\t\t$redbean = $toolbox->getRedBean();\n\t\t$pdo = $adapter->getDatabase();\n\t\t$a = new RedBean_AssociationManager( $toolbox );\n\t\t$post = $redbean->dispense('post');\n\t\t$post->title = 'title';\n\t\t$redbean->store($post);\n\t\t$page = $redbean->dispense('page');\n\t\t$page->name = 'title';\n\t\t$redbean->store($page);\t\t\n\t\t$page = $redbean->dispense(\"page\");\n\t\t$page->name = \"John's page\";\n\t\t$idpage = $redbean->store($page);\n\t\t$page2 = $redbean->dispense(\"page\");\n\t\t$page2->name = \"John's second page\";\n\t\t$idpage2 = $redbean->store($page2);\n\t\t$a->associate($page, $page2);\n\t\t$redbean->freeze( true );\n\t\t$page = $redbean->dispense(\"page\");\n\t\t$page->sections = 10;\n\t\t$page->name = \"half a page\";\n\t\ttry {\n\t\t\t$id = $redbean->store($page);\n\t\t\tfail();\n\t\t}catch(RedBean_Exception_SQL $e) {\n\t\t\tpass();\n\t\t}\n\t\t$post = $redbean->dispense(\"post\");\n\t\t$post->title = \"existing table\";\n\t\ttry {\n\t\t\t$id = $redbean->store($post);\n\t\t\tpass();\n\t\t}catch(RedBean_Exception_SQL $e) {\n\t\t\tfail();\n\t\t}\n\t\tasrt(in_array(\"name\",array_keys($writer->getColumns(\"page\"))),true);\n\t\tasrt(in_array(\"sections\",array_keys($writer->getColumns(\"page\"))),false);\n\t\t$newtype = $redbean->dispense(\"newtype\");\n\t\t$newtype->property=1;\n\t\ttry {\n\t\t\t$id = $redbean->store($newtype);\n\t\t\tfail();\n\t\t}catch(RedBean_Exception_SQL $e) {\n\t\t\tpass();\n\t\t}\n\t\t$logger = RedBean_Plugin_QueryLogger::getInstanceAndAttach( $adapter );\n\t\t//now log and make sure no 'describe SQL' happens\n\t\t$page = $redbean->dispense(\"page\");\n\t\t$page->name = \"just another page that has been frozen...\";\n\t\t$id = $redbean->store($page);\n\t\t$page = $redbean->load(\"page\", $id);\n\t\t$page->name = \"just a frozen page...\";\n\t\t$redbean->store($page);\n\t\t$page2 = $redbean->dispense(\"page\");\n\t\t$page2->name = \"an associated frozen page\";\n\t\t$a->associate($page, $page2);\n\t\t$a->related($page, \"page\");\n\t\t$a->unassociate($page, $page2);\n\t\t$a->clearRelations($page,\"page\");\n\t\t$items = $redbean->find(\"page\",array(),array(\"1\"));\n\t\t$redbean->trash($page);\n\t\t$redbean->freeze( false );\n\t\tasrt(count($logger->grep(\"SELECT\"))>0,true);\n\t\tasrt(count($logger->grep(\"describe\"))<1,true);\n\t\tasrt(is_array($logger->getLogs()),true);\n\t}", "function addBook($name, $langt, $author, $langa, $type)\n{\n $conn = mysqli_connect(constant(\"DBSERVER\"),constant(\"DBUSER\"),constant(\"DBPASSWORD\"));\n $db_selected = mysqli_select_db($conn,MYDB);\n if (!$db_selected)\n {\n mysqli_query($conn,\"CREATE DATABASE IF NOT EXISTS \".MYDB.\";\");\n $db_selected = mysqli_select_db($conn,MYDB);\n }\n \n if (!$db_selected)\n {\n exit('Error select '.MYDB.' database: ' .mysqli_error($conn) );\t\t\n }\n $sql = \"CREATE TABLE IF NOT EXISTS \".MYTABLE.\" (\n\t\tid BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,\".$GLOBALS['MYFIELDS'][0].\" TEXT NOT NULL,\"\n\t\t.$GLOBALS['MYLANGFIELDS'][0].\" TINYTEXT,\"\n\t\t.$GLOBALS['MYFIELDS'][1].\" TEXT,\"\n\t\t.$GLOBALS['MYLANGFIELDS'][1].\" TINYTEXT,\"\n\t\t.$GLOBALS['MYNOLANGFIELDS'][0].\" TINYTEXT,date date\n )engine=myisam ;\";\n if (!mysqli_query($conn,$sql))\n {\n exit('Error creating '.MYTABLE.' table: ' .mysqli_error($conn) );\t\t\n }\n $names = array($author,$name);\n $langs = array($langa,$langt);\n $strn = '';\n $strv = '';\n for ($i=0; $i < count($GLOBALS['MYFIELDS']); $i++)\n {\n $strn .= $GLOBALS['MYFIELDS'][$i].\",\";\n $strv .= \"'\".$names[$i].\"',\";\n }\n for ($i=0; $i < count($GLOBALS['MYLANGFIELDS']); $i++)\n {\n $strn .= $GLOBALS['MYLANGFIELDS'][$i].\",\";\n $strv .= \"'\".$langs[$i].\"',\";\n }\n $strn .= $GLOBALS['MYNOLANGFIELDS'][0].',date';\n $strv .= \"'\".$type.\"','\".date('Y-m-d').\"'\";\n $sql = \"INSERT INTO \".MYTABLE.\" (\".$strn.\") VALUES (\".$strv.\");\";\n $err = mysqli_query($conn,$sql);\n if (!$err) \n {\n exit(\"Error Insert MySQL : \".mysqli_error($conn).\" \".$sql.\"<br>\");\n }\n // return as response the mySQL index of the latest inserted record\n echo mysqli_insert_id($conn);\n //echo $sql.\"<br>\";\n}", "public function generateDatabase()\n {\n $this->generateUserTable();\n $this->generateEmployerTable();\n $this->generateCandidateTable();\n $this->generateGuidTable();\n $this->generateWorkExperienceTable();\n $this->generateShortListTable();\n $this->generateQualTypeTable();\n $this->generateQualLevelTable();\n $this->generateQualificationsTable();\n $this->generateFieldTable();\n $this->generateSubFieldTable();\n $this->generateSkillTable();\n $this->generatePreferencesTable();\n }", "function xh_fetchDAO($db_type,$name)\r\n\t{\r\n\t}", "public function loadISBN(){\n $sqlQuery = 'SELECT I.val FROM identifiers I , books B WHERE I.type=\"ISBN\" AND B.id = I.book AND B.id='.$this->id;\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n return $row['val'];\n return \"\";\n }", "function documentCharge($phoneNumber, $companyName, $data, $conn) {\n $chargeId = substr($data[\"id\"],3); // removed \"ch_\"\n $chargeAmt = $data[\"amount\"];\n $chargeTime = $data[\"created\"];\n // $customerId = $data[\"customer\"]; fetchable via userInfo\n $currency = $data[\"currency\"];\n $paymentStatus = $data[\"status\"];\n $outcome_networkStatus = $data[\"outcome\"][\"network_status\"];\n $outcome_reason = $data[\"outcome\"][\"reason\"];\n $outcome_riskLevel = $data[\"outcome\"][\"risk_level\"];\n $outcome_sellerMessage = $data[\"outcome\"][\"seller_message\"];\n $outcome_type = $data[\"outcome\"][\"type\"];\n $source_id = substr($data[\"source\"][\"id\"],5); // removed \"card_\"\n\n $loopList = array(\n \"currency\",\n \"paymentStatus\",\n \"outcome_networkStatus\",\n \"outcome_reason\",\n \"outcome_riskLevel\",\n \"outcome_sellerMessage\",\n \"outcome_type\"\n );\n\n // Creates variables \"..Id\" in loop in accordance with the main table and abstracted tables\n foreach ($loopList as $loopItem) {\n $sql = '\n INSERT IGNORE INTO\n '.$loopItem.'\n ('.$loopItem.')\n VALUES\n (\"'.${$loopItem}.'\")';\n $conn->query($sql);\n\n $sql = 'SELECT\n '.$loopItem.'Id\n FROM\n '.$loopItem.'\n WHERE\n '.$loopItem.' = \"'.${$loopItem}.'\"\n LIMIT 1;';\n $object = $conn->query($sql)->fetch_object();//->{$loopItem + \"Id\"};\n $value = get_object_vars($object);\n \n ${$loopItem.\"Id\"} = $value[''.$loopItem.'Id'];\n }\n\n $sql = 'SELECT\n *\n FROM\n machineInfo\n WHERE\n company = \"'.$companyName.'\"\n ORDER BY\n machineId DESC\n LIMIT 1;';\n $machineId = $conn->query($sql)->fetch_object()->machineId;\n\n $sql = '\n INSERT IGNORE INTO\n chargeInfo\n (\n phoneNumber, machineId, chargeId, chargeAmt, chargeTime,\n currencyId, paymentStatusId,\n outcome_networkStatusId, outcome_reasonId, outcome_riskLevelId, outcome_sellerMessageId, outcome_typeId,\n source_id\n )\n VALUES\n (\n '.$phoneNumber.','.$machineId.',\"'.$chargeId.'\",'.($chargeAmt/100).','.$chargeTime.','\n .$currencyId.','.$paymentStatusId.','\n .$outcome_networkStatusId.','.$outcome_reasonId.','.$outcome_riskLevelId.','.$outcome_sellerMessageId.','.$outcome_typeId.','\n .'\"'.$source_id.'\")\n ;';\n $conn->query($sql);\n }", "public function readOne ()\n {\n $query = \"SELECT\n book_id,type_id,name,isbn,publisher,author,price\n FROM\n \" . $this->table_name . \"\n WHERE\n book_id = $this->book_id\";\n\n $stmt = $this->conn->prepare( $query );\n\n $stmt->execute();\n\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n $this->book_id = $row['book_id'];\n $this->type_id = $row['type_id'];\n $this->name = $row['name'];\n $this->isbn = $row['isbn'];\n $this->publisher=$row['publisher'];\n $this->author=$row['author'];\n $this->price=$row['price'];\n\n\n }", "private function create_WD_reference_item($citation_obj, $citation, $t_source)\n {\n $obj = $citation_obj[0];\n\n // /* manual fixes\n if($val = @$obj->title[0]) $obj->title[0] = self::manual_fix_title($val);\n // */\n\n // print_r($obj); exit(\"\\nstop muna\\n\");\n $rows = array();\n $rows[] = 'CREATE';\n\n // /* scholarly ?\n // The \"instance of\" classifications: To keep things simple, we could use \"scholarly article\" if the reference parsers tell us it's a journal article, \n // and \"scholarly work\" for everything else.\n $publication_types = array(\"article-journal\", \"chapter\", \"book\");\n if(in_array(@$obj->type, $publication_types)) {}\n else echo(\"\\nUndefined publication type. [\".@$obj->type.\"]\\nWill terminate.\\n\");\n if(stripos(@$obj->type, 'journal') !== false) $scholarly = \"scholarly article\";\n else $scholarly = \"scholarly work\";\n // */\n\n // /* first two entries: label and description\n # LAST TAB Lfr TAB \"Le croissant magnifique!\"\n if($title = @$obj->title[0]) {\n $rows[] = 'LAST|Len|' .'\"'.$title.'\"';\n $rows[] = 'LAST|Den|' .'\"'.self::build_description($obj, $scholarly).'\"';\n }\n // */\n\n // /* scholarly xxx\n // if($dois = @$obj->doi) $rows[] = \"LAST|P31|Q13442814\"; // instance of -> scholarly article //old\n if($scholarly == \"scholarly article\") $rows[] = \"LAST|P31|Q13442814 /* scholarly article */\"; // instance of -> scholarly article\n else $rows[] = \"LAST|P31|Q55915575 /* scholarly work */\"; // instance of -> scholarly work\n // */\n\n if($authors = @$obj->author) $rows = self::prep_for_adding($authors, 'P2093', $rows); #ok use P50 if author is an entity\n if($publishers = @$obj->publisher) $rows = self::prep_for_adding($publishers, 'P123', $rows, \"publisher\");\n if($place_of_publications = @$obj->location) $rows = self::prep_for_adding($place_of_publications, 'P291', $rows, \"place of publication\");\n if($pages = @$obj->pages) $rows = self::prep_for_adding($pages, 'P304', $rows, \"page(s)\"); #ok\n // if($issues = @$obj->issue) $rows = self::prep_for_adding($issues, 'P433', $rows); #ok\n if($volumes = @$obj->volume) $rows = self::prep_for_adding($volumes, 'P478', $rows, \"volume\"); #ok\n if($publication_dates = @$obj->date) $rows = self::prep_for_adding($publication_dates, 'P577', $rows, \"publication date\"); #ok\n if($chapters = @$obj->chapter) $rows = self::prep_for_adding($chapters, 'P792', $rows, \"chapter\"); //No 'chapter' parsed by AnyStyle. Eli should do his own parsing.\n if($titles = @$obj->title) $rows = self::prep_for_adding($titles, 'P1476', $rows, \"title\"); #ok\n\n // /* Eli's initiative, but was given a go signal -> property 'type of reference' (P3865)\n if($type = @$obj->type) $rows = self::prep_for_adding(array($type), 'P3865', $rows); #ok\n // */\n\n // /* Eli's initiative but close to Jen's \"published in\" (P1433) proposal\n if($containers = @$obj->{\"container-title\"}) $rows = self::prep_for_adding($containers, 'P1433', $rows, \"published in\"); #ok\n // */\n\n // Others:\n if($dois = @$obj->doi) $rows = self::prep_for_adding($dois, 'P356', $rows, \"DOI\"); #ok\n else { //check if t.source is DOI, if yes use it | New: Mar 13, 2023\n if($dois = $this->get_doi_from_tsource($t_source)) $rows = self::prep_for_adding($dois, 'P356', $rows, \"DOI\");\n }\n /* seems no instructions to use this yet:\n if($reference_URLs = @$obj->url) $rows = self::prep_for_adding($reference_URLs, 'P854', $rows);\n */\n\n /* Eli's choice: will take Jen's approval first -> https://www.wikidata.org/wiki/Property:P1683 -> WikiData says won't use it here.\n $rows = self::prep_for_adding(array($citation), 'P1683', $rows);\n */\n\n print_r($rows);\n $WRITE = Functions::file_open($this->citation_export_file, \"w\");\n foreach($rows as $row) fwrite($WRITE, $row.\"\\n\");\n fclose($WRITE);\n\n // /* new: so it continues...\n $this->debug['citation not matched in WD'][$t_source][$citation] = '';\n return \"-to be assigned-\";\n // */\n\n /* NEXT TODO: is the exec_shell command to trigger QuickStatements */\n exit(\"\\n[$t_source]\\n[$citation]\\nUnder construction...\\n\");\n \n /* Reminders:\n CREATE\n LAST\tP31\tQ13442814\n instance of -> scholarly article\n\n scholarly article https://www.wikidata.org/wiki/Q13442814 for anything with a DOI and \n scholarly work https://www.wikidata.org/wiki/Q55915575 for all other items we create for sources.\n */\n \n // CREATE\n // LAST|Len|\"Brazilian Flora 2020 project - Projeto Flora do Brasil 2020\"\n // LAST|Den|\"scholarly article by G\"\n // LAST|P31|Q13442814 /* scholarly article */\n // LAST|P2093|\"G, Brazil Flora\"\n // LAST|P478|\"393\" /* volume */\n // LAST|P577|+2019-00-00T00:00:00Z/9\n // LAST|P1476|en:\"Brazilian Flora 2020 project - Projeto Flora do Brasil 2020\"\n // LAST|P356|\"10.15468/1mtkaw\" /* DOI */\n\n\n // created...\n // [t.source] => https://doi.org/10.1007/978-3-662-02604-5_58\n // [t.citation] => C. N. PAGE. 1990. Pinaceae. In: The families and genera of vascular plants. Volume I; Pteridophytes and Gymnosperms. K. Kubitzki, K. U. Kramer and P. S. Green, eds.\n // https://www.wikidata.org/wiki/Q117088084\n // CREATE\n // LAST|Len|\"Pinaceae. In: The families and genera of vascular plants\"\n // LAST|Den|\"scholarly work by PAGE\"\n // LAST|P31|Q55915575 /* scholarly work */\n // LAST|P2093|\"PAGE, C.N.\"\n // LAST|P478|\"I\" /* volume */\n // LAST|P577|+1990-00-00T00:00:00Z/9\n // LAST|P1476|en:\"Pinaceae. In: The families and genera of vascular plants\"\n // LAST|P356|\"10.1007/978-3-662-02604-5_58\" /* DOI */\n\n // to be created...\n // [t.source] => https://doi.org/10.1007/978-3-540-31051-8\n // [t.citation] => J.W. Kadereit, C. Jeffrey, K. Kubitzki (eds). 2007. The families and genera of vascular plants. Volume VIII; Flowering Plants; Eudicots; Asterales. Springer Nature.\n // CREATE\n // LAST|Len|\"The families and genera of vascular plants\"\n // LAST|Den|\"scholarly work by Kadereit et al.\"\n // LAST|P31|Q55915575 /* scholarly work */\n // LAST|P2093|\"Kadereit, J.W.\"\n // LAST|P2093|\"Jeffrey, C.\"\n // LAST|P2093|\"Kubitzki, K.\"\n // LAST|P123|\"Flowering Plants; Eudicots; Asterales. Springer Nature\" /* publisher */\n // LAST|P478|\"VIII\" /* volume */\n // LAST|P577|+2007-00-00T00:00:00Z/9\n // LAST|P1476|en:\"The families and genera of vascular plants\"\n // LAST|P3865|Q55915575 /* book */\n // LAST|P356|\"10.1007/978-3-540-31051-8\" /* DOI */\n \n \n }", "function fill_sample_data()\n{\n /* \n insert_user(db, email, password, display_name) \n insert_textbook(db, title, isbn, author, seller_id, description, price)\n insert_message(db, from_id, to_id, subject, message_body)\n insert_purchase_request(db, buyer_id, seller_id, bookid)\n */\n\n $db = connect_to_db();\n regenerate_database($db);\n\n \n insert_user($db, \"[email protected]\", \"pass1\", \"Bob\");\n insert_user($db, \"[email protected]\", \"pass2\", \"Ralf\");\n insert_user($db, \"[email protected]\", \"pass3\", \"Ron\");\n insert_user($db, \"[email protected]\", \"pass4\", \"Cathy\");\n insert_user($db, \"[email protected]\", \"pass5\", \"Missy\");\n insert_user($db, \"[email protected]\", \"pass6\", \"Arney\");\n insert_user($db, \"[email protected]\", \"pass7\", \"Katie\");\n /* User with long informtion */\n insert_user($db, \"jasfidofjoajfdaio;@dfjiaosdjiaosjdi.sajfdio\", \"jdsa\", \"fjsadiojjfadsio\");\n\n\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS2', '123456788', 'bobby bob2', '3', 'good cond.', '35.55');\n insert_textbook($db, 'Intro to CS3', '123456789', 'bobby bob3', '3', 'good cond.', '36.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '2', 'good cond.', '37.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS1', '123456787', 'bobby bob', '3', 'good cond.', '34.55');\n insert_textbook($db, 'Intro to CS2', '123456788', 'bobby bob2', '3', 'good cond.', '38.55');\n insert_textbook($db, 'Intro to CS3', '123456789', 'bobby bob3', '4', 'good cond.', '39.55');\n /* A textbook with long information for testing purposes */\n insert_textbook($db, 'IntrotoCS3 Probability and Statistics thisis a longtitleoneword', '1234567890123', 'bobbybobbobbobhasalongname', '8', 'goodcondalongdescriptioniswhatthistextbookhashopefullyitfits', '139.55');\n\n \n insert_message($db, 1, 5, 'sample subject', 'sample message1');\n insert_message($db, 1, 5, 'sample subject', 'sample message2');\n insert_message($db, 1, 5, 'sample subject', 'sample message3');\n insert_message($db, 1, 3, 'sample subject', 'sample message4');\n insert_message($db, 1, 3, 'sample subject', 'sample message4');\n /* A long message to a long user */\n insert_message($db, 1, 8, 'sample subject this subject is deliberately really long for the purpose of testing the user interface', 'sample message4 this message is deliberately really long in order to test the user interface, hopefully it works with this really long message or it will make the users unhappy. We dont want unhappy user because they will go and use facebook to exchange textbooks. Now for a really long string to see how it breaks words: djasjdfkasjdkjfalkdjfksa;jdklkasdjfkla;sjdklfajkdsjfalskdjf;sadljfa;lskdjl;fjasdjfsadl;fjsadjfklasjlkjfklasjdklfa;lkdjfa;lkdjf;laksdj;flaskdjfl;ajskldjfklasjdkfjas;kldjfla;djkfal');\n\n insert_purchase_request($db, 3, 4, 1);\n insert_purchase_request($db, 3, 4, 2);\n insert_purchase_request($db, 3, 2, 3);\n insert_purchase_request($db, 4, 3, 1);\n insert_purchase_request($db, 5, 4, 1);\n\n /* A purchase request to a long user with a long textbook */\n insert_purchase_request($db, 8, 3, 6); \n\n echo \"data created sucessfully\";\n }", "function DBgetLicense(){\n\t\t \n\t\t $db = $this->startDB();\n\t\t \n\t\t $sql = \"SELECT fs.fk_license, cc.LINK_DEED as id, cc.NAME as name\n\t\t FROM \".$this->penelopeTabID.\" AS extab\n\t\t JOIN space ON extab.uuid = space.uuid\n\t\t JOIN file_summary AS fs ON space.source_id = fs.source_id\n\t\t JOIN w_lu_creative_commons AS cc ON fs.fk_license = cc.PK_LICENSE\n\t\t GROUP BY fs.source_id\n\t\t ORDER BY fs.fk_license DESC\n\t\t \";\n\t\t \n\t\t $result = $db->fetchAll($sql); \n\t\t if($result){\n\t\t\t\t$output = $result[0];\n\t\t\t\tif(stristr($output[\"id\"], \"creativecommons\")){\n\t\t\t\t\t $output[\"name\"] = \"Creative Commons \".$output[\"name\"];\n\t\t\t\t}\n\t\t\t\tunset($output[\"fk_license\"]);\n\t\t\t\treturn $output;\n\t\t }\n\t\t else{\n\t\t\t\treturn array(\"id\" => \"http://creativecommons.org/licenses/by/3.0\",\n\t\t\t\t\t\t\t\t \"name\" => \"Creative Commons Attribution\"\n\t\t\t\t\t\t\t\t );\n\t\t }\n\t\t \n\t\t \n\t }", "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 }", "function getPublicationRecord($rawdata_id, $connection) {\r\n\r\n\t// Get publicatin_id from table \"publications\"\r\n\t$dbQuery = \"select publication_auto_id, pmid, cover_image_id, pdf_file_id, supplement_file_id from publications where rawdata_id=\".$rawdata_id;\r\n\r\n\t// Run the query\r\n\tif (!($result = @ mysql_query($dbQuery, $connection)))\r\n\t\tshowerror();\r\n\r\n\tif( @ mysql_num_rows($result) == 0) {\r\n\t\t// Not found\r\n\t\treturn -1;\r\n\t}\r\n\r\n\t$record['publication_auto_id'] = @ mysql_result($result, 0, \"publication_auto_id\");\r\n\t$record['pmid'] = @ mysql_result($result, 0, \"pmid\");\r\n\t$record['cover_image_id'] = @ mysql_result($result, 0, \"cover_image_id\");\r\n\t$record['pdf_file_id'] = @ mysql_result($result, 0, \"pdf_file_id\");\r\n\t$record['supplement_file_id'] = @ mysql_result($result, 0, \"supplement_file_id\");\r\n\r\n\treturn $record;\r\n}", "abstract public function getSelectedDatabase();", "function DocumentNext ($TransType, $tag, $area,$legaid ,&$db) {\n\t$dsql = \"SELECT u_department FROM tags WHERE tagref = '\" . $tag . \"'\";\n\t//echo \"<br>dsql: \" . $dsql;\n\t$dresult = DB_query($dsql,$db);\n\tif ($dmyrow=DB_fetch_array($dresult,$db)){\n\t\t$u_department = $dmyrow['u_department'];\n\t}else{\n\t\t$u_department = 0;\n\t}\n\n\tif (($TransType == 10) and ($legaid==4)){\n\t\t$SQL = \"SELECT count(*) FROM sysDocumentIndex\n\t\tWHERE typeid = \" . $TransType . \" and tagref in ('\" . $tag .\"','0')\n\t\tand areacode in('\" . $area . \"','0') and legalid in('\" . $legaid . \"','0')\n\t\tand u_department in ('\" . $u_department . \"','0')\";\n\t}else{\n\t\t$SQL = \"SELECT count(*) FROM sysDocumentIndex\n\t\tWHERE typeid = \" . $TransType . \" and tagref in ('\" . $tag .\"','0')\n\t\tand areacode in('\".$area.\"','0') and legalid in('\".$legaid.\"','0')\";\n\t}\n\t//echo \"<br>\" . $SQL;\n\n\t$result = DB_query($SQL,$db);\n\t$myrow = DB_fetch_row($result);\n\tif ($myrow[0]==0)\n\t{\n\t $SQL = \"SELECT typename FROM sysDocumentIndex WHERE typeid = \" . $TransType;\n\t //echo \"<br>\" . $SQL;\n\t $result = DB_query($SQL,$db);\n\t if (DB_num_rows($result)!=0)\n\t {\n\t $myrowType = DB_fetch_row($result);\n\t $typename = $myrowType[0];\n\t }\n\t else\n\t {\n\t $typename = \"NOMBRE NO ASIGNADO\";\n\t }\n\n\t $SQL = 'INSERT INTO sysDocumentIndex (`typeid`,`legalid`,`typename`,`areacode`,`tagref`,`loccode`,`typeabbrev`,`typeno`)';\n\t $SQL .= ' VALUES ('.$TransType.',\"'.$legaid.'\",\"' .$typename. '\",\"'.$area.'\",' .$tag. ',\"ANY\",\"AN\",0)';\n\t $result = DB_query($SQL,$db);\n\t // echo \"<br>\" . $SQL;\n\t}\n\n\tDB_query(\"LOCK TABLES sysDocumentIndex WRITE\",$db);\n\tif (($TransType == 10) and ($legaid==4)){\n\t\t$SQL = \"SELECT typeno,folio FROM sysDocumentIndex\n\t\tWHERE typeid = \" . $TransType . \" and tagref in('\" . $tag . \"',0) and areacode in('\" . $area . \"','0')\n\t\tand legalid in('\" . $legaid . \"','0')\n\t\tand u_department in ('\" . $u_department . \"','0')\";\n\t}else{\n\t\t$SQL = \"SELECT typeno,folio FROM sysDocumentIndex\n\t\tWHERE typeid = \" . $TransType . \" and tagref in('\" . $tag . \"',0) and areacode in('\" . $area . \"','0')\n\t\tand legalid in('\" . $legaid . \"','0')\";\n\t}\n\t//echo \"<br>\" . $SQL;\n\t//echo '<pre><br>'.$SQL;\n\t$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': <BR>' . _('The next transaction number could not be retrieved from the database because');\n\t$DbgMsg = _('The following SQL to retrieve the transaction number was used');\n\t$GetTransNoResult = DB_query($SQL,$db,$ErrMsg,$DbgMsg);\n\t$myrow = DB_fetch_row($GetTransNoResult);\n\n\n\n\tif (($TransType == 10) and ($legaid==4)){\n\t\t$SQL = \"UPDATE sysDocumentIndex SET typeno = \" . ($myrow[0] + 1) . \"\n\t\tWHERE typeid = '\" . $TransType . \"' and tagref in ('\" . $tag . \"','0')\n\t\tand areacode in('\" . $area . \"','0') and legalid in('\" . $legaid . \"','0')\n\t\tand u_department in ('\" . $u_department . \"', '0')\";\n\t}else{\n\t\t$SQL = \"UPDATE sysDocumentIndex SET typeno = \" . ($myrow[0] + 1) . \"\n\t\tWHERE typeid = '\" . $TransType . \"' and tagref in ('\" . $tag . \"','0')\n\t\tand areacode in('\" . $area . \"','0') and legalid in('\" . $legaid . \"','0')\";\n\t}\n\t//echo '<pre><br>'.$SQL;\n\t$ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The transaction number could not be incremented');\n\t$DbgMsg = _('The following SQL to increment the transaction number was used');\n\t$UpdTransNoResult = DB_query($SQL,$db,$ErrMsg,$DbgMsg);\n\tDB_query(\"UNLOCK TABLES\",$db);\n\t$valordev=$myrow[0] + 1;\n\t$valordev=$valordev.'|'.$myrow[1];\n\treturn $valordev;\n\n}", "public static function get_model_dba() {\n $model_dba_id = Doggy_Config::get('app.model.dba');\n return self::get_dba(empty($model_dba_id)?'default':$model_dba_id);\n\t}", "public function save_donation();", "private function make_db() {\n ee()->load->dbforge();\n $fields = array(\n 'id' => array('type' => 'varchar', 'constraint' => '32'),\n 'access' => array('type' => 'integer', 'constraint' => '10', 'unsigned' => true),\n 'data' => array('type' => 'text')\n );\n ee()->dbforge->add_field($fields);\n ee()->dbforge->add_key('id', true);\n ee()->dbforge->create_table($this->table_name);\n\n return true;\n }", "public function loadLinkedFromdeterminationcitation() { \n // ForeignKey in: determinationcitation\n $t = new determinationcitation();\n }", "public function citationTask()\n\t{\n\t\t// Incoming\n\t\t$format = Request::getString('type', 'bibtex');\n\n\t\t// Get our model and load publication data\n\t\t$this->model = new Models\\Publication($this->_identifier, $this->_version);\n\n\t\t// Make sure we got a result from the database\n\t\tif (!$this->model->exists() || $this->model->isDeleted())\n\t\t{\n\t\t\tNotify::error(Lang::txt('COM_PUBLICATIONS_RESOURCE_NOT_FOUND'));\n\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=' . $this->_option, false)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Get version authors\n\t\t$authors = $this->model->table('Author')->getAuthors($this->model->version->get('id'));\n\n\t\t// Build publication path\n\t\t$path = $this->model->path('base', true);\n\n\t\tif (!is_dir($path))\n\t\t{\n\t\t\tif (!Filesystem::makeDirectory(PATH_APP . $path, 0755, true, true))\n\t\t\t{\n\t\t\t\t$this->setError('Error. Unable to create path.');\n\t\t\t}\n\t\t}\n\n\t\t// Build the URL for this resource\n\t\t$sef = Route::url($this->model->link('version'));\n\t\t$url = Request::base() . ltrim($sef, '/');\n\n\t\t// Choose the format\n\t\tswitch ($format)\n\t\t{\n\t\t\tcase 'endnote':\n\t\t\t\t$doc = \"%0 \" . Lang::txt('COM_PUBLICATIONS_GENERIC') . \"\\r\\n\";\n\t\t\t\t$doc .= \"%D \" . Date::of($this->model->published())->toLocal('Y') . \"\\r\\n\";\n\t\t\t\t$doc .= \"%T \" . trim(stripslashes($this->model->version->get('title'))) . \"\\r\\n\";\n\n\t\t\t\tif ($authors)\n\t\t\t\t{\n\t\t\t\t\tforeach ($authors as $author)\n\t\t\t\t\t{\n\t\t\t\t\t\t$name = $author->name ? $author->name : $author->p_name;\n\t\t\t\t\t\t$auth = preg_replace('/{{(.*?)}}/s', '', $name);\n\t\t\t\t\t\tif (!strstr($auth, ','))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$bits = explode(' ', $auth);\n\t\t\t\t\t\t\t$n = array_pop($bits) . ', ';\n\t\t\t\t\t\t\t$bits = array_map('trim', $bits);\n\t\t\t\t\t\t\t$auth = $n . trim(implode(' ', $bits));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$doc .= \"%A \" . trim($auth) . \"\\r\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$doc .= \"%U \" . $url . \"\\r\\n\";\n\t\t\t\tif ($this->model->published())\n\t\t\t\t{\n\t\t\t\t\t$doc .= \"%8 \" . Date::of($this->model->published())->toLocal('M') . \"\\r\\n\";\n\t\t\t\t}\n\t\t\t\tif ($this->model->version->get('doi'))\n\t\t\t\t{\n\t\t\t\t\t$doc .= \"%1 \" . 'doi:' . $this->model->version->get('doi');\n\t\t\t\t\t$doc .= \"\\r\\n\";\n\t\t\t\t}\n\n\t\t\t\t$file = 'publication' . $this->model->get('id') . '.enw';\n\t\t\t\t$mime = 'application/x-endnote-refer';\n\t\t\tbreak;\n\n\t\t\tcase 'bibtex':\n\t\t\tdefault:\n\t\t\t\tinclude_once Component::path('com_citations') . DS . 'helpers' . DS . 'BibTex.php';\n\n\t\t\t\t$bibtex = new \\Structures_BibTex();\n\t\t\t\t$addarray = array();\n\t\t\t\t$addarray['type'] = 'misc';\n\t\t\t\t$addarray['cite'] = Config::get('sitename') . $this->model->get('id');\n\t\t\t\t$addarray['title'] = stripslashes($this->model->version->get('title'));\n\n\t\t\t\tif ($authors)\n\t\t\t\t{\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tforeach ($authors as $author)\n\t\t\t\t\t{\n\t\t\t\t\t\t$name = $author->name ? $author->name : $author->p_name;\n\t\t\t\t\t\t$author_arr = explode(',', $name);\n\t\t\t\t\t\t$author_arr = array_map('trim', $author_arr);\n\n\t\t\t\t\t\t$addarray['author'][$i]['first'] = (isset($author_arr[1])) ? $author_arr[1] : '';\n\t\t\t\t\t\t$addarray['author'][$i]['last'] = (isset($author_arr[0])) ? $author_arr[0] : '';\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$addarray['month'] = Date::of($this->model->published())->toLocal('M');\n\t\t\t\t$addarray['url'] = $url;\n\t\t\t\t$addarray['year'] = Date::of($this->model->published())->toLocal('Y');\n\t\t\t\tif ($this->model->version->get('doi'))\n\t\t\t\t{\n\t\t\t\t\t$addarray['doi'] = 'doi:' . DS . $this->model->version->get('doi');\n\t\t\t\t}\n\n\t\t\t\t$bibtex->addEntry($addarray);\n\n\t\t\t\t$file = 'publication_' . $this->model->get('id') . '.bib';\n\t\t\t\t$mime = 'application/x-bibtex';\n\t\t\t\t$doc = $bibtex->bibTex();\n\t\t\tbreak;\n\t\t}\n\n\t\t// Write the contents to a file\n\t\t$fp = fopen($path . DS . $file, \"w\") or die(\"can't open file\");\n\t\tfwrite($fp, $doc);\n\t\tfclose($fp);\n\n\t\t$this->_serveup(false, $path, $file, $mime);\n\n\t\tdie; // REQUIRED\n\t}", "function regenerate_database($db)\n{\n\t/* SQL code to drop the tables -----------*/\n\t$purchase_requests_drop = \"DROP TABLE IF EXISTS purchase_requests\";\n\t$messages_drop = \"DROP TABLE IF EXISTS messages\";\n\t$textbooks_drop = \"DROP TABLE IF EXISTS textbooks\";\n\t$users_drop = \"DROP TABLE IF EXISTS users\";\n\n\t/* SQL code to create tables -----------*/\n\t/* users table*/\n\t$users_create = <<<ZZEOF\n\tCREATE TABLE users\n\t(\n\t\tid int NOT NULL AUTO_INCREMENT,\n\t\temail varchar(255) NOT NULL,\n\t\tpassword varchar(255) NOT NULL,\n\t\tdisplay_name varchar(255) NOT NULL,\n\n\t\tPRIMARY KEY (id)\n\t)\nZZEOF;\n\n\t$textbooks_create = <<<ZZEOF\n\tCREATE TABLE textbooks\n\t(\n\t\tid int NOT NULL AUTO_INCREMENT,\n\t\ttitle varchar(512) NOT NULL,\n\t\tisbn varchar(255) NOT NULL,\n\t\tauthor varchar(512) NOT NULL,\n\t\tseller_id int NOT NULL,\n\t\tdescription text NOT NULL,\n\t\tprice decimal(5,2) NOT NULL,\n\t\tdate_time DATETIME NOT NULL,\n\t\tremoved tinyint NOT NULL,\n\t\tPRIMARY KEY(id),\n\t\tFOREIGN KEY(seller_id) REFERENCES users(id)\n\t)\nZZEOF;\n\n\t/* messages table */\n\t$messages_create = <<<ZZEOF\n\tCREATE TABLE messages\n\t(\n\t\tid int NOT NULL AUTO_INCREMENT,\n\t\tfrom_id int NOT NULL,\n\t\tto_id int NOT NULL,\n\t\tsubject varchar(255) NOT NULL,\n\t\tmessage_body varchar(255) NOT NULL,\n\t\tdate_time DATETIME NOT NULL,\n\n\t\tPRIMARY KEY (id),\n\t\tFOREIGN KEY(to_id) REFERENCES users(id),\n\t\tFOREIGN KEY(from_id) REFERENCES users(id)\n\t)\nZZEOF;\n\n\n\t$purchase_requests_create = <<<ZZEOF\n\tCREATE TABLE purchase_requests\n\t(\n\t\tid int NOT NULL AUTO_INCREMENT,\n\t\tbuyer_id int NOT NULL,\n\t\tseller_id int NOT NULL,\n\t\tbookid int NOT NULL,\n\t\tdate_time DATETIME NOT NULL,\n\n\t\tPRIMARY KEY (id),\n\t\tFOREIGN KEY(buyer_id) REFERENCES users(id),\n\t\tFOREIGN KEY(seller_id) REFERENCES users(id),\n\t\tFOREIGN KEY(bookid) REFERENCES textbooks(id)\n\t)\nZZEOF;\n\n\n\t/* Run all queries ----------------*/\n\n\t$db = connect_to_db();\n\n\t/* Drop tables */\n\t$db->exec($purchase_requests_drop);\n\t$db->exec($messages_drop);\n\t$db->exec($textbooks_drop);\n\t$db->exec($users_drop);\n\n\t/* Create tables */\n\t$db->exec($users_create);\n\t$db->exec($textbooks_create);\n\t$db->exec($messages_create);\n\t$db->exec($purchase_requests_create);\n\n\techo \"Database Regenerated Sucessfully<br />\";\n\n insert_user($db, \"GUEST\", \"\", \"GUEST\");\n global $admin_password;\n insert_user($db, \"ADMIN\", $admin_password, \"ADMIN\");\n\treturn;\n}", "function getDatabase();", "public function getCitation($cit_num) {\n $sql = 'SELECT cit_num,per_num,per_num_valide,per_num_etu,cit_libelle,cit_date,cit_valide,cit_date_valide,cit_date_depo FROM citation c WHERE cit_num='.$cit_num;\n\n $requete = $this->db->prepare($sql);\n\n $requete->execute();\n\n $ligne = $requete->fetch(PDO::FETCH_OBJ);\n $citation = new Citation($ligne);\n //$citation->ctrlSaisie = new ControleurSaisie();\n $requete->closeCursor();\n return $citation;\n }", "function addBio($bio, $db) {\n $query = $db->prepare(\"INSERT INTO Bio (Titre, Description) VALUES (?)\");\n $query->execute([$bio[\"Titre\"], $bio[\"Description\"]]);\n}", "function meta_work($entity)\n{\n\tglobal $config;\n\t\n\t$meta = '';\n\t\n\t$query = 'SELECT ?citation_title ?citation_journal_title ?citation_date ?citation_volume ?citation_firstpage \n\t?citation_lastpage ?citation_abstract_html_url ?citation_doi ?citation_pdf_url\n\t?citation_biostor ?citation_handle\nWHERE {\n \n # title\n <URI> <http://schema.org/name> ?citation_title .\n\n # date\n OPTIONAL {\n <URI> <http://schema.org/datePublished> ?citation_date .\n } \n \n# authors \n\n # journal\n OPTIONAL {\n <URI> <http://schema.org/isPartOf> ?container .\n ?container <http://schema.org/name> ?citation_journal_title .\n } \n \n OPTIONAL {\n <URI> <http://schema.org/volumeNumber> ?citation_volume .\n } \n\n OPTIONAL {\n <URI> <http://schema.org/pageStart> ?citation_firstpage .\n } \n \n OPTIONAL {\n <URI> <http://schema.org/pageEnd> ?citation_lastpage .\n } \n \n OPTIONAL {\n <URI> <http://schema.org/url> ?citation_abstract_html_url .\n } \n \n # DOI\n OPTIONAL {\n <URI> <http://schema.org/identifier> ?identifier .\n?identifier <http://schema.org/propertyID> \"doi\" .\n?identifier <http://schema.org/value> ?citation_doi .\n }\n \n # PDF\n OPTIONAL {\n <URI> <http://schema.org/encoding> ?encoding .\n?encoding <http://schema.org/fileFormat> \"application/pdf\" .\n?encoding <http://schema.org/contentUrl> ?citation_pdf_url .\n }\n \n # rdmp hacks, maybe rethink to store as URLs\n # BioStor\n OPTIONAL {\n <URI> <http://schema.org/identifier> ?biostor_identifier .\n?biostor_identifier <http://schema.org/propertyID> \"biostor\" .\n?biostor_identifier <http://schema.org/value> ?citation_biostor .\n } \n \n # Handle\n OPTIONAL {\n <URI> <http://schema.org/identifier> ?handle_identifier .\n?handle_identifier <http://schema.org/propertyID> \"handle\" .\n?handle_identifier <http://schema.org/value> ?citation_handle .\n } \n \n }\n';\n\t\n\t$query = str_replace('<URI>', '<' . $entity->{'@id'} . '>', $query);\t\n\t$json = sparql_query($config['sparql_endpoint'], $query);\n\t\n\t$result = json_decode($json);\n\t\n\t//echo '<pre>' . $result . '</pre>';\n\t\n\t$meta_list = array();\n\t\n\tif (isset($result->results->bindings))\n\t{\n\t\tif (isset($result->results->bindings[0]))\n\t\t{\n\t\t\tforeach ($result->results->bindings[0] as $k => $v)\n\t\t\t{\t\t\t\t\n\t\t\t\t$key = '';\n\t\t\t\t\n\t\t\t\tswitch ($k) \n\t\t\t\t{\n\t\t\t\t\tcase 'citation_biostor':\n\t\t\t\t\t\t$key = 'citation_abstract_html_url';\n\t\t\t\t\t\t$value = 'https://biostor.org/reference/' . $v->value;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'citation_handle':\n\t\t\t\t\t\t$key = 'citation_abstract_html_url';\n\t\t\t\t\t\t$value = 'https://hdl.handle.net/' . $v->value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$key = $k;\n\t\t\t\t\t\t$value = $v->value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif (!isset($meta_list[$key]))\n\t\t\t\t{\n\t\t\t\t\t$meta_list[$key] = array();\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$meta_list[$key][] = $value;\n\t\t\t}\t\t\n\t\t}\t\n\t}\n\t\n\t\n\treturn $meta_list;\n}", "public function run()\n {\n DB::table('biblios')->insert([\n \"name\" => \"livre\",\n \"description\" => \"Ceci est une description\",\n\n ]);\n DB::table('biblios')->insert([\n \"name\" => \"livres\",\n \"description\" => \"Ceci est une description\",\n\n ]);\n DB::table('biblios')->insert([\n \"name\" => \"livrette\",\n \"description\" => \"Ceci est une description\",\n\n ]);\n }", "function iptsr_internal_deb($debata_id) {\n\t$rocnik = cpdb_fetch_one_value(\"select rocnik from debata left join soutez using (soutez_ID) where debata_ID = :debata_id\", array(\":debata_id\"=>$debata_id));\n\t\n\t$status = true;\n\tcpdb_transaction();\n\t\n\t// vycistit\n\t$status &= cpdb_exec(\"delete from clovek_debata_ibody where debata_ID = :debata_id\", array(\":debata_id\"=>$debata_id));\n\t\n\t// --- debateri\n\t// (podle poharovych bodu)\n\t$status &= cpdb_exec(\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) select clovek_debata.clovek_ID, clovek_debata.debata_ID, :rocnik, 'debater', debata_tym.body * 0.1 from clovek_debata left join debata_tym on clovek_debata.debata_ID = debata_tym.debata_ID and substring(clovek_debata.role,1,1) = elt(debata_tym.pozice + 1,'n','a') where clovek_debata.debata_ID = :debata_id and find_in_set(clovek_debata.role,'a1,a2,a3,n1,n2,n3')\", array(\":debata_id\"=>$debata_id, \":rocnik\"=>$rocnik));\n\t\t\n\t// --- rozhodci\n\t$status &= cpdb_exec(\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) select clovek_ID, debata_ID, :rocnik, 'rozhodci', 1 from clovek_debata where debata_ID = :debata_id and role = 'r'\", array(\":debata_id\"=>$debata_id, \":rocnik\"=>$rocnik));\n\t\n\t// --- treneri\n\t$treneri_dostanou = array();\n\t\n\tif (cpdb_fetch_all(\"select clovek_ID, ibody from clovek_debata_ibody where debata_ID = :debata_id and role = 'debater'\", array(\":debata_id\"=>$debata_id), $debateri)) {\n\t\tforeach ($debateri as $debater) {\n\t\t\t$pocet_treneru = cpdb_fetch_all(\"\n\t\t\t\tselect\n\t\t\t\t\tdk.clovek_ID as clovek_ID\n\t\t\t\tfrom\n\t\t\t\t\tclovek d, clovek_klub dk\n\t\t\t\twhere\n\t\t\t\t\td.clovek_ID = :clovek_ID\n\t\t\t\t\tand d.klub_ID = dk.klub_ID\n\t\t\t\t\tand dk.role = 't'\n\t\t\t\t\tand dk.rocnik = :rocnik\n\t\t\t\t\", array(\":clovek_ID\"=>$debater[\"clovek_ID\"], \":rocnik\"=>$rocnik), $treneri);\n\t\t\t\n\t\t\tforeach ($treneri as $trener) {\n\t\t\t\t$treneri_dostanou[$trener[\"clovek_ID\"]] += 0.1 * $debater[\"ibody\"] / $pocet_treneru;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tforeach ($treneri_dostanou as $trener_cid => $trener_ib) {\n\t\t$status &= cpdb_exec(\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) values (:clovek_id, :debata_id, :rocnik, 'trener', :ibody)\", array(\":clovek_id\"=>$trener_cid, \":debata_id\"=>$debata_id, \":rocnik\"=>$rocnik, \":ibody\"=>$trener_ib));\n\t}\n\t\n\t// --- organizatori\n\t$dostanou = 0.15; // kolik IB je z debaty\n\t$zasluhy_primych = 1; // defaultni zasluhy u primych ogranizatoru\n\t$celkem_zasluhy = 0;\n\t$zasluhy = array();\n\t\n\t// primi\n\tcpdb_fetch_all(\n\t\t\"select clovek_ID from clovek_debata where clovek_debata.role = 'o' and debata_ID = :debata_id\", array(\":debata_id\"=>$debata_id), $res_primi);\n\t\n\tforeach ($res_primi as $org) {\n\t\t$celkem_zasluhy += $zasluhy_primych;\n\t\t$zasluhy[$org[\"clovek_ID\"]] += $zasluhy_primych;\n\t}\n\t\n\t// neprimi\n\tcpdb_fetch_all(\"\n\t\tselect\n\t\t\tclovek_turnaj.clovek_ID,\n\t\t\tclovek_turnaj.mocnost\n\t\tfrom\n\t\t\tdebata, clovek_turnaj\n\t\twhere\n\t\t\tdebata.debata_ID = :debata_id\n\t\t\tand clovek_turnaj.turnaj_ID = debata.turnaj_ID\n\t\t\tand clovek_turnaj.role = 'o'\n\t\", array(\":debata_id\"=>$debata_id), $res_neprimi);\n\t\n\tforeach($res_neprimi as $org) {\n\t\t$celkem_zasluhy += $org[\"mocnost\"];\n\t\t$zasluhy[$org[\"clovek_ID\"]] += $org[\"mocnost\"];\n\t}\n\t\n\tforeach($zasluhy as $org_cid => $org_zasluhy) {\n\t\t$status &= cpdb_exec(\n\t\t\t\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) values (:clovek_id, :debata_id, :rocnik, 'organizator', :ibody)\",\n\t\t\tarray(\n\t\t\t\t\":clovek_id\" => $org_cid,\n\t\t\t\t\":debata_id\" => $debata_id,\n\t\t\t\t\":rocnik\" => $rocnik,\n\t\t\t\t\":ibody\" => $dostanou * $org_zasluhy / $celkem_zasluhy\n\t\t\t)\n\t\t);\n\t}\n\t\n\t// zaver\n\tif ($status) {\n\t\tcpdb_commit();\n\t} else {\n\t\tcpdb_rollback();\n\t}\n}", "function getGenerator($galleyItem) {\n\n\t\t// do the OJS object madness\n\t\t$article = $galleyItem->article;\n\t\t$articleId = $article->getId();\n\t\t$galley = $galleyItem->galley;\n\t\t$journal = $galleyItem->journal;\n\t\t$journalAbb = $journal->getPath();\n\t\t$journalSettingsDao =& \\DAORegistry::getDAO('JournalSettingsDAO');\n\t\t$journalSettings = $journalSettingsDao->getJournalSettings($journal->getId());\n\t\t$issueDao =& \\DAORegistry::getDAO('IssueDAO');\n\t\t$issue =& $issueDao->getIssueByArticleId($articleId, $journal->getId(), true);\n\t\timport('classes.file.ArticleFileManager');\n\t\t$articleFileManager = new \\ArticleFileManager($articleId);\n\t\t$articleFile = $articleFileManager->getFile($galley->_data['fileId']);\n\t\tif (!is_object($articleFile)) { // under some currently unknown circumstances $articleFile is empty\n\t\t\tthrow new \\Exception(\"File #$articleFile of galley #\" . $galley->getId() . \" of article #$articleId has a problem / is not found\");\n\t\t}\n\t\t$fileToUpdate = $articleFileManager->filesDir . $articleFileManager->fileStageToPath($articleFile->getFileStage()) . '/' . $articleFile->getFileName();\n\t\t$galleyDao =& \\DAORegistry::getDAO('ArticleGalleyDAO');\n\t\t$newGalley = new \\ArticleGalley();\n\t\t$newGalley->setLabel('PDF');\n\t\t$newGalley->setSequence(0);\n\t\t$newGalley->setFileType('application/pdf'); // important!\n\t\t$newGalley->setArticleId($articleId);\n\t\t$newGalley->setLocale($galley->getLocale());\n\t\t$galleyDao->insertGalley($newGalley); // why now? because for our pubids we maybe need the galley-ID, and otheriwse we would not have it\n\t\t$galleyItem->dirty = true;\n\t\t\n\t\t$pids = $this->createPubIds($newGalley, $article);\n\t\t$this->log->log(\"created the following PIDs: \" . print_r($pids,1));\n\t\t$galleyItem->newGalley = $newGalley;\n\t\t\n\t\t// get generator\n $generator = new \\dfm\\tcpdf_fm_creator($this->log, $this->settings); // TODO select correct generator\n\n\t\t// fill it with data\n\t\t@$meta = array(\n\t\t\t'article_author'\t=> $this->_noDoubleSpaces($article->getAuthorString(false, ' – ')),\n\t\t\t'article_title'\t\t=> $article->getTitle($galley->getLocale()) ? $article->getTitle($galley->getLocale()) : $article->getLocalizedTitle(),\n\t\t\t'editor'\t\t\t=> '<br>' . $this->_noLineBreaks($journalSettings['contactName'] . ' ' . $this->_getLocalized($journalSettings['contactAffiliation'])),\n\t\t\t'journal_title'\t\t=> $this->_getLocalized($journalSettings['title']), \n\t\t\t'journal_url'\t\t=> \\Config::getVar('general', 'base_url') . '/' . $journalAbb,\n\t\t\t'pages'\t\t\t\t=> str_replace('#DFM', '', $article->_data['pages']),\n\t\t\t'pub_id'\t\t\t=> $articleId,\n\t\t\t'publisher'\t\t\t=> $this->_noLineBreaks($journalSettings['publisherInstitution'] . ' ' . $this->_getLocalized($journalSettings['publisherNote'])),\n\t\t\t'url'\t\t\t\t=> \\Config::getVar('general', 'base_url') . '/' . $journalAbb . '/' . $articleId . '/' . $newGalley->getId(),\n\t\t\t'urn'\t\t\t\t=> isset($pids['other::urnDNB']) ? $pids['other::urnDNB'] : (isset($pids['other::urn']) ? $pids['other::urn'] : ''), // take the URN created by the ojsde-dnburn pugin, if not present try the normla pkugins urn or set ###\n\t\t\t'volume'\t\t\t=> $issue->_data['volume'],\n\t\t\t'year'\t\t\t\t=> $issue->_data['year'],\n\t\t\t'zenon_id'\t\t\t=> isset($pids['other::zenon']) ? $pids['other::zenon'] : '##'\n\t\t);\n\n\n\n\t\tif (isset($journalSettings['onlineIssn']) and $journalSettings['onlineIssn']) {\n\t\t\t$meta['issn_online']= $journalSettings['onlineIssn'];\n\t\t} elseif (isset($journalSettings['printIssn']) and $journalSettings['printIssn']) {\n\t\t\t$meta['issn_printed']= $journalSettings['printIssn'];\n\t\t}\n\n $generator->setJournalPreset($journalAbb);\n $generator->setMetadata($meta);\n $generator->fileToUpdate = $fileToUpdate;\n\n\n\n\n\t\treturn $generator;\n\t}", "function XSACreditNote($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db)\n{\n\t$arrBDAplicar = array('erpplacacentro','erpplacacentro_CAPA','erpplacacentro_DES' );\n\t$charelectronic='01';\n\t$charelectronic=$charelectronic.'|'.$serie;\n\t$serieelect=$serie;\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n\t$folioelect=$folio;//$InvoiceNoTAG;\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\t$InvoiceHeaderSQL = \"SELECT DISTINCT\n\t\t\t\treplace(debtortrans.trandate,'-','/') as trandate,\n\t\t\t\t(debtortrans.ovamount*-1) as ovamount,\n\t\t\t\t(debtortrans.ovdiscount*-1) as ovdiscount,\n\t\t\t\t(debtortrans.ovgst*-1) as ovgst,\n\t\t\t\tdebtorsmaster.name,\n\t\t\t\tdebtorsmaster.address1,debtorsmaster.address2,\n\t\t\t\tdebtorsmaster.address3,debtorsmaster.address4,debtorsmaster.address5,\n\t\t\t\tdebtorsmaster.address6,debtorsmaster.invaddrbranch,\n\t\t\t\tcustbranch.taxid as rfc,\n\t\t\t\tcustbranch.brname,\n\t\t\t\tcustbranch.braddress1,custbranch.braddress2,custbranch.braddress3,\n\t\t\t\tcustbranch.braddress4,custbranch.braddress5,custbranch.braddress6,\n\t\t\t\tcustbranch.brpostaddr1,custbranch.brpostaddr2,custbranch.brpostaddr3,\n\t\t\t\tcustbranch.brpostaddr4,custbranch.brpostaddr5,custbranch.brpostaddr6,\n\t\t\t\tdebtortrans.debtorno,debtortrans.branchcode,debtortrans.folio,\n\t\t\t\treplace(origtrandate,'-','/') as origtrandate,\n\t\t\t\tdebtortrans.currcode,\n\t\t\t\tcustbranch.branchcode,\n\t\t\t\tdebtortrans.tpe,\n\t\t\t\tdebtortrans.shipvia,\n\t\t\t\t(debtortrans.ovfreight*-1) as ovfreight,\n\t\t\t\tdebtortrans.rate AS cambio,\n\t\t\t\tdebtorsmaster.currcode as moneda,\n\t\t\t\tcustbranch.defaultlocation,\n\t\t\t\tcustbranch.brnumext,\n\t\t\t\tcustbranch.brnumint,\n\t\t\t\t\";\n\t$InvoiceHeaderSQL = $InvoiceHeaderSQL . \"\n\t\t\t\tlocations.taxprovinceid,\n\t\t\t\tdebtortrans.tagref,\n\t\t\t\tcustbranch.phoneno as telofi,\n\t\t\t\tIFNULL(paymentmethods.codesat,'') as paymentname,\n\t\t\tdebtortrans.nocuenta\n\t\t\tFROM debtortrans \n\t\t\t\tLEFT JOIN paymentmethods ON debtortrans.paymentname = paymentmethods.paymentname\n\t\t\t\tINNER JOIN debtorsmaster ON debtortrans.debtorno = debtorsmaster.debtorno\n\t\t\t\tINNER JOIN custbranch ON debtortrans.debtorno = custbranch.branchcode\n\t\t\t\tINNER JOIN currencies ON debtorsmaster.currcode = currencies.currabrev\n\t\t\t\tINNER JOIN stockmoves ON stockmoves.transno=debtortrans.transno\n\t\t\t\tINNER JOIN locations ON stockmoves.loccode = locations.loccode\n\t\t\tWHERE debtortrans.transno = \" . $InvoiceNo . \"\n\t\t\t\tAND debtortrans.type=11\n\t\t\t\tAND stockmoves.type=11\";\n \n\t$Result=DB_query($InvoiceHeaderSQL,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t// fecha emision\n\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\t\t// subtotal\n\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t$nombre=$myrow['name'];\n\t\t$subtotal= number_format($myrow['ovamount'], 2, '.', '');\n\t\tif (strlen($rfccliente)<12){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], 2, '.', '');\n\t\t\t$imprimepublico=1;\n\t\t}elseif(strlen($rfccliente)>=14){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], 2, '.', '');\n\t\t\t$imprimepublico=1;\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t// total factura\n\t\t$total=number_format($myrow['ovamount']+$myrow['ovgst'],2,'.','');\n\n\t\t$charelectronic=$charelectronic.'|'.$total;\n\t\t// total de iva\n\t\t$iva=number_format($myrow['ovgst'],'.','');\n\t\t// transladado\n\t\t$charelectronic=$charelectronic.'|'.$iva;\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret;\n\t\t//descuento trae desde el stockmoves\n\t\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento) as descuento\n\t\t\t\t FROM stockmoves\n\t\t\t\t WHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=number_format($myrowdis['descuento'],2,'.','');\n\t\t\t}\n\t\t}else{\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento+(IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)*totaldescuento)) as descuento\n\t\t\t \t\t\tFROM stockmoves inner join stockmaster on stockmaster.stockid=stockmoves.stockid\n\t\t\t\t\t\t\t-- LEFT JOIN taxauthrates ON stockmaster.taxcatid = taxauthrates.taxcatid\n\t\t\t\t\t\t\tLEFT JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\n\t\t\t\t\t \t\tWHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=number_format($myrowdis['descuento'],2,'.','');\n\t\t\t}\n\t\t}\n\t\t//descuento\n\t\t$descuento=number_format($descuento,2,'.','');\n\t\t$charelectronic=$charelectronic.'|'.$descuento;\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|';\n\t\t// tipo de moneda\n \n\t\t$moneda=$myrow['currcode'];\n \n\t\t// CANTIDAD CON LETRAS\n\t\t$amount = number_format($myrow['ovamount'],3);\n\t\t$ovgst = number_format($myrow['ovgst'],2);\n\t\t$rountotal = $amount + $ovgst ;\n\t\t$rountotal = number_format($rountotal,2);\n\t\t$totaletras=round($myrow['ovamount']+$myrow['ovgst'],2);\n\n\t\t$totalx=str_replace(',','',$total);\n\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\n\t\t$separa2=explode(\".\",$totalx,4);//\n\t\t$montoctvs2 = $separa2[1];\n\t\t$montoletra=Numbers_Words::toWords($montoletra,'es');\n\t\t//$montocentavos=Numbers_Words::toWords($montoctvs2,'es');\n\t\tif ($moneda=='MXN'){\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\" /100 M.N.\";\n\t\t}//\n\t\telse\n\t\t{\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/100 USD\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t// tipo de cambio\n\t\t$rate=number_format($myrow['cambio'],6,'.','');\n\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t// numero de orden para referencia\n\t\t$ordenref=$myrow['orderno'];\n\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t// observaciones 1: vendedores\n\t\t$vendedor=\"\";\n\t\t$SQL=\" SELECT *\n\t\t FROM salesman\n\t\t WHERE salesmancode='\".$myrow['salesman'].\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowsales = DB_fetch_array($Result);\n\t\t\t$vendedor=$myrowsales['salesmanname'];\n\t\t}\n\t\t$observaciones1='Vendedor: '.$myrow['salesman'].' '.$vendedor;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t// observaciones 2\n\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t$comments=trim($myrowtags['comments']);\n\t\t}\n\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\t\t$metodopago = $myrow['paymentname'];\n\t\tif ($metodopago==\"\") {\n\t\t\t$metodopago = \"99\";\n\t\t}\n\t\t\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\") {\n\t\t\t$nocuenta = \"No Identificado\";\n\t\t}\n\t\t\n\t\t\n\t\t// observaciones 3\n\t\t$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones3;\n\t\t\n\t\t//$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$nocuenta;\n\t\t// datos de la forma de pago\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\t\t\n\t\t$terminospago=$myrow['terms'];\n\t\t$SQL=\" SELECT *\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=70\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==0) {\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}else{\n\t\t\t$Tipopago=\"Parcialidades\";\n\t\t}\n\t\t$Tipopago=$Tipopago.' '.$terminospago;\n\t\t//$Tipopago=$terminospago;\n\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t// condiciones de pago\n\t\t$charelectronic=$charelectronic.'|Genera Interes Moratorio 3 % mensual/credito';\n\t\t// metodo de pago\n\t//\t$metodopago='varios';\n\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t// fecha vencimiento\n\t\t$fechavence=$myrow['trandate'];\n\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t// observaciones 4\n\t\t$observaciones4=$observaciones3;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t// datos del cliente\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t$branch=$myrow['debtorno'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\n\t\tif (in_array($_SESSION['DatabaseName'], $arrBDAplicar)) {\n\t\t\t$charelectronic=$charelectronic.'|';\n\t\t}\n\t\telse{\n\t\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t}\n\t\t\n\t\t$calle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$calle=$myrow['address1'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=\"\";\n\n\t\tif ($imprimepublico==0 || in_array($_SESSION['DatabaseName'], $arrBDAplicar)){\n $colonia=$myrow['address2'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$municipio=$myrow['address3'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$edo=$myrow['address4'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$cp=$myrow['address5'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t// datos del custbranch\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t$branch=$myrow['branchcode'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t//$rfc=$myrow['rfc'];\n\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$nombre=$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=$myrow['braddress1'];\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=$myrow['braddress6'];\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=$myrow['braddress2'];\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=$myrow['braddress4'];\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\n\t}\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\tif ($_SESSION['DecimalPlacesInvoice']==''){\n\t\t$_SESSION['DecimalPlacesInvoice']=6;\n\t}\n\t$decimalplaces=$_SESSION['DecimalPlacesInvoice'];\n\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))- totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\t$nolinea=0;\n\t\t$descrprop=\"\";\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=number_format($myrow2['quantity'],4,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT DISTINCT p.InvoiceValue AS val,\n\t\t\t\t\t\t\t p.complemento,\n\t\t\t\t\t\t\t sp.label\n\t\t\t\t\t\t\tFROM salesstockproperties p,\n\t\t\t\t\t\t\t stockcatproperties sp,\n\t\t\t\t\t\t\t stockmaster sm\n\t\t\t\t\t\t\tWHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t\t\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t\t\t\t AND p.typedocument=11\n\t\t\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0) {\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t} else {\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\tswitch ($myrowprop['val']) {\n\t\t\t\t\tcase 'Interno':\n\t\t\t\t\t\t$sqlbomb = \"SELECT class FROM stockclass WHERE idclass = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['class'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Externo':\n\t\t\t\t\t\t$sqlbomb = \" SELECT suppname FROM suppliers WHERE supplierid = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['suppname'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\n\t\t\t$descrnarrative=\"\";\n\t\t\t$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n $descrnarrative = str_replace('|', '-', $descrnarrative);\n\t\t\t}\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\t// consultar cantidad restante para tyqsa en remisones contra orden de trabajo\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";*/\n\t\t\t\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescrip.$descrprop.$descrnarrative;\n\t\t\t\n\t\t\t//IF($_SESSION)\n\t\t\t//ECHO $charelectronicdetail;\n\t\t\t$stockprecio=number_format($myrow2['fxprice'],6,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=number_format($myrow2['fxnet'],6,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$nameaduana='';\n\t\t\t$numberaduana='';\n\t\t\t$fechaaduana='';\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$nolinea=$nolinea+1;\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,\n\t\t\t\t\t\ttaxcalculationorder,taxontax,\n\t\t\t\t\t\ttaxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description']; \n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,2,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=number_format($myrow3['taxrate']*($myrow2['subtotal'] - $totalRowAnticipo),6,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\n\t\t\t}\n\n\t\t}\n\t}else{\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))-totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV\n\t\t\t\t\tFROM stockmoves inner join stockmaster ON stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\tinner join stockcategory on stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t\t\t\tleft JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\t\t\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=number_format($myrow2['quantity'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT DISTINCT p.InvoiceValue AS val,\n\t\t\t\t\t\t\t p.complemento,\n\t\t\t\t\t\t\t sp.label\n\t\t\t\t\t\t\tFROM salesstockproperties p,\n\t\t\t\t\t\t\t stockcatproperties sp,\n\t\t\t\t\t\t\t stockmaster sm\n\t\t\t\t\t\t\tWHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t\t\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0) {\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t} else {\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\tswitch ($myrowprop['val']) {\n\t\t\t\t\tcase 'Interno':\n\t\t\t\t\t\t$sqlbomb = \"SELECT class FROM stockclass WHERE idclass = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['class'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Externo':\n\t\t\t\t\t\t$sqlbomb = \" SELECT suppname FROM suppliers WHERE supplierid = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['suppname'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){//\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\t\t\t$descrnarrative=\"\";\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t FROM salesorderdetails p\n\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\tAND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t$descrnarrative=$myrownarrative['narrative'];\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}*/\n\t\t\t\t\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\t\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative;\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=number_format($myrow2['fxprice'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=number_format($myrow2['fxnet'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t//$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\t\t\t\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,taxcalculationorder,taxontax,taxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=number_format($myrow3['taxrate']*($myrow2['subtotal']),6,'.','');\n\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t$taxtotalratex=number_format($myrow3['taxrate']*($myrow2['subtotal']),6);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\t\t\t\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$aduana=$myrowaduana['aduana'];\n\t\t\t\t$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t$nameaduana = $separaaduana[0];\n\t\t\t\t$numberaduana= $separaaduana[1];\n\t\t\t\t$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t}\n\t}\n\t// ivas retenidos\n\t$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\tif ($rfccliente==\"XAXX010101000\"){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronicEmbarque.$totalCantEmision;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxs.$charelectronictaxsret.$charelectronicEmbarque.$totalCantEmision;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\n\t}\n\t\n\t//echo '<pre><br>'.$cadenaenviada; \n\treturn $cadenaenviada;\n}", "public function disclosure_statement_step3() {\n\t\t$this->loadAllModel(array('Loan','User','ShortApplication','ProcessorDocument'));\n\t\t$brokerDetail = '';\n\t\t$loanID = $this->Session->read('GFE_Loan_id');\n\t\tif($this->request->data){\n\t\t\t$this->Session->write('GFE.GFEStep3', $this->request->data);\n\t\t\t$data = $this->Session->read('GFE');\n\t\t\t$saveData['gfe'] = json_encode($data);\n\t\t\t$saveData['processor_id'] = $this->Session->read('userInfo.id');\n\t\t\t$saveData['loan_id'] = $loanID;\n\t\t\t$this->ProcessorDocument->save($saveData);\n\t\t\t$this->set('data',$data);\n\t\t\t$this->layout = '/pdf/default';\n\t\t\t$this->render('/Pdf/gfe');\n\t\t\t$this->Session->setFlash('Disclosure statement submit successfully.','default',array('class'=>'alert alert-success'));\n\t\t\t$this->redirect(array('controller'=>'processors', 'action'=>'generateTil/',base64_encode($loanID)));\n\t\t}else{\n\t\t\t$this->request->data = $this->Session->read('GFE.GFEStep3');\n\t\t}\n\t\t$loanDetail = $this->Loan->findById($loanID);\n\t\n\t\t//$shortApplication = $this->ShortApplication->find('first',array('conditions'=>array('ShortApplication.id'=>$loanDetail['Loan']['short_app_id']),'recursive'=>-1));\n\t\t$shortApplication = $this->ShortApplication->find('first',array('conditions'=>array('ShortApplication.id'=>$loanDetail['Loan']['short_app_id']),'fields' =>array('ShortApplication.broker_ID','ShortApplication.broker_ID','SoftQuote.id','ShortApplication.loan_amount','SoftQuote.interest_rate')));\n\t\t\n\t\tif(!empty($shortApplication['ShortApplication']['broker_ID'])){\n\t\t\tif($shortApplication['ShortApplication']['broker_ID'] == 'Rockland'){\n\t\t\t\t$brokerDetail['User']['name'] = 'Rockland';\n\t\t\t}else{\n\t\t\t\t$brokerDetail = $this->User->findById($shortApplication['ShortApplication']['broker_ID']);\n\t\t\t}\n\t\t}\n\t\t$this->set(compact(array('loanDetail','brokerDetail','shortApplication')));\n }", "protected function initDatabaseRecord() {}", "function __createDocId() {\n\t\treturn $this->model->alias . '_' . $this->model->id;\n\t}", "function wp_publications_shortcode_handler( $atts, $content=null, $code=\"\" ) {\n // first we simulate a standard call to bibtexbrowser\n $_GET = array_merge($_GET, $atts);\n \n $_GET['bib'] = $this->resolve($_GET['bib']);\n $database = zetDB($this->resolve($_GET['bib']));\n \n foreach($database->getEntries() as $entry) {\n $bibdisplay = new BibEntryDisplay($entry);\n \n $key =$entry->getKey(); \n $args=array(\n 'name' => $key,\n 'post_type' => __WP_PLUGIN__,\n );\n $my_posts = get_posts($args);\n if( $my_posts ) {\n // already added in the database\n // echo 'ID on the first post found '.$my_posts[0]->ID;\n } else {\n $this->add_or_update_publication_entry($entry,$atts['bib']);\n }\n }\n ob_start();\n $x = new Dispatcher();\n $x->main();\n return ob_get_clean(); \n }", "function getDatabaseId();", "public function run() {\n\t\t$toolbox = R::$toolbox;\n\t\t$adapter = $toolbox->getDatabaseAdapter();\n\t\t$writer = $toolbox->getWriter();\n\t\t$redbean = $toolbox->getRedBean();\n\t\t$pdo = $adapter->getDatabase();\n\t\t$a = new RedBean_AssociationManager( $toolbox );\n\t\t$adapter->exec(\"DROP TABLE IF EXISTS testtable\");\n\t\tasrt(in_array(\"testtable\",$adapter->getCol(\"show tables\")),false);\n\t\t$writer->createTable(\"testtable\");\n\t\tasrt(in_array(\"testtable\",$adapter->getCol(\"show tables\")),true);\n\t\tasrt(count(array_diff($writer->getTables(),$adapter->getCol(\"show tables\"))),0);\n\t\tasrt(count(array_keys($writer->getColumns(\"testtable\"))),1);\n\t\tasrt(in_array(\"id\",array_keys($writer->getColumns(\"testtable\"))),true);\n\t\tasrt(in_array(\"c1\",array_keys($writer->getColumns(\"testtable\"))),false);\n\t\t$writer->addColumn(\"testtable\", \"c1\", 1);\n\t\tasrt(count(array_keys($writer->getColumns(\"testtable\"))),2);\n\t\tasrt(in_array(\"c1\",array_keys($writer->getColumns(\"testtable\"))),true);\n\t\tforeach($writer->sqltype_typeno as $key=>$type) {\n\t\t\tif ($type < 100) {\n\t\t\t\tasrt($writer->code($key),$type);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tasrt($writer->code($key),99);\n\t\t\t}\n\t\t}\n\t\tasrt($writer->code(\"unknown\"),99);\n\t\tasrt($writer->scanType(false),0);\n\t\tasrt($writer->scanType(NULL),0);\n\t\tasrt($writer->scanType(2),1);\n\t\tasrt($writer->scanType(255),1);\n\t\tasrt($writer->scanType(256),2);\n\t\tasrt($writer->scanType(-1),3);\n\t\tasrt($writer->scanType(1.5),3);\n\t\tasrt($writer->scanType(INF),4);\n\t\tasrt($writer->scanType(\"abc\"),4);\n\t\tasrt($writer->scanType(\"2001-10-10\",true),RedBean_QueryWriter_MySQL::C_DATATYPE_SPECIAL_DATE);\n\t\tasrt($writer->scanType(\"2001-10-10 10:00:00\",true),RedBean_QueryWriter_MySQL::C_DATATYPE_SPECIAL_DATETIME);\n\t\tasrt($writer->scanType(\"2001-10-10\"),4);\n\t\tasrt($writer->scanType(\"2001-10-10 10:00:00\"),4);\n\t\tasrt($writer->scanType(\"POINT(1 2)\",true),RedBean_QueryWriter_MySQL::C_DATATYPE_SPECIAL_POINT);\n\t\tasrt($writer->scanType(\"POINT(1 2)\"),4);\n\t\tasrt($writer->scanType(str_repeat(\"lorem ipsum\",100)),5);\n\t\t$writer->widenColumn(\"testtable\", \"c1\", 2);\n\t\t$cols=$writer->getColumns(\"testtable\");\n\t\tasrt($writer->code($cols[\"c1\"]),2);\n\t\t$writer->widenColumn(\"testtable\", \"c1\", 3);\n\t\t$cols=$writer->getColumns(\"testtable\");\n\t\tasrt($writer->code($cols[\"c1\"]),3);\n\t\t$writer->widenColumn(\"testtable\", \"c1\", 4);\n\t\t$cols=$writer->getColumns(\"testtable\");\n\t\tasrt($writer->code($cols[\"c1\"]),4);\n\t\t$writer->widenColumn(\"testtable\", \"c1\", 5);\n\t\t$cols=$writer->getColumns(\"testtable\");\n\t\tasrt($writer->code($cols[\"c1\"]),5);\n\t\t$id = $writer->updateRecord(\"testtable\", array(array(\"property\"=>\"c1\",\"value\"=>\"lorem ipsum\")));\n\t\t$row = $writer->selectRecord(\"testtable\", array(\"id\"=>array($id)));\n\t\tasrt($row[0][\"c1\"],\"lorem ipsum\");\n\t\t$writer->updateRecord(\"testtable\", array(array(\"property\"=>\"c1\",\"value\"=>\"ipsum lorem\")), $id);\n\t\t$row = $writer->selectRecord(\"testtable\", array(\"id\"=>array($id)));\n\t\tasrt($row[0][\"c1\"],\"ipsum lorem\");\n\t\t$writer->selectRecord(\"testtable\", array(\"id\"=>array($id)),null,true);\n\t\t$row = $writer->selectRecord(\"testtable\", array(\"id\"=>array($id)));\n\t\tasrt(empty($row),true);\n\t\t//$pdo->setDebugMode(1);\n\t\t$writer->addColumn(\"testtable\", \"c2\", 2);\n\t\ttry {\n\t\t\t$writer->addUniqueIndex(\"testtable\", array(\"c1\",\"c2\"));\n\t\t\tfail(); //should fail, no content length blob\n\t\t}catch(RedBean_Exception_SQL $e) {\n\t\t\tpass();\n\t\t}\n\t\t$writer->addColumn(\"testtable\", \"c3\", 2);\n\t\ttry {\n\t\t\t$writer->addUniqueIndex(\"testtable\", array(\"c2\",\"c3\"));\n\t\t\tpass(); //should fail, no content length blob\n\t\t}catch(RedBean_Exception_SQL $e) {\n\t\t\tfail();\n\t\t}\n\t\t$a = $adapter->get(\"show index from testtable\");\n\t\tasrt(count($a),3);\n\t\tasrt($a[1][\"Key_name\"],\"UQ_64b283449b9c396053fe1724b4c685a80fd1a54d\");\n\t\tasrt($a[2][\"Key_name\"],\"UQ_64b283449b9c396053fe1724b4c685a80fd1a54d\");\n\t\t//Zero issue (false should be stored as 0 not as '')\n\t\ttestpack(\"Zero issue\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS `zero`\");\n\t\t$bean = $redbean->dispense(\"zero\");\n\t\t$bean->zero = false;\n\t\t$bean->title = \"bla\";\n\t\t$redbean->store($bean);\n\t\tasrt( count($redbean->find(\"zero\",array(),\" zero = 0 \")), 1 );\n\t\tR::store(R::dispense('hack'));\n\t\ttestpack(\"Test RedBean Security - bean interface \");\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\t$bean = $redbean->load(\"page\",\"13; drop table hack\");\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\ttry {\n\t\t\t$bean = $redbean->load(\"page where 1; drop table hack\",1);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\t$bean = $redbean->dispense(\"page\");\n\t\t$evil = \"; drop table hack\";\n\t\t$bean->id = $evil;\n\t\ttry {\n\t\t\t$redbean->store($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\tunset($bean->id);\n\t\t$bean->name = \"\\\"\".$evil;\n\t\ttry {\n\t\t\t$redbean->store($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\t$bean->name = \"'\".$evil;\n\t\ttry {\n\t\t\t$redbean->store($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\t$bean->$evil = 1;\n\t\ttry {\n\t\t\t$redbean->store($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\tunset($bean->$evil);\n\t\t$bean->id = 1;\n\t\t$bean->name = \"\\\"\".$evil;\n\t\ttry {\n\t\t\t$redbean->store($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\t$bean->name = \"'\".$evil;\n\t\ttry {\n\t\t\t$redbean->store($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\t$bean->$evil = 1;\n\t\ttry {\n\t\t\t$redbean->store($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\ttry {\n\t\t\t$redbean->trash($bean);\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\ttry {\n\t\t\t$redbean->find(\"::\",array(),\"\");\n\t\t}catch(Exception $e) {\n\t\t\tpass();\n\t\t}\n\t\t$adapter->exec(\"drop table if exists sometable\");\n\t\ttestpack(\"Test RedBean Security - query writer\");\n\t\ttry {\n\t\t\t$writer->createTable(\"sometable` ( `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT , PRIMARY KEY ( `id` ) ) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ; drop table hack; --\");\n\t\t}catch(Exception $e) {}\n\t\tasrt(in_array(\"hack\",$adapter->getCol(\"show tables\")),true);\n\t\t\t\t\n\t\ttestpack(\"Test ANSI92 issue in clearrelations\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS book_group\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS author_book\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS book\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS author\");\n\t\t$redbean = $toolbox->getRedBean();\n\t\t$a = new RedBean_AssociationManager( $toolbox );\n\t\t$book = $redbean->dispense(\"book\");\n\t\t$author1 = $redbean->dispense(\"author\");\n\t\t$author2 = $redbean->dispense(\"author\");\n\t\t$book->title = \"My First Post\";\n\t\t$author1->name=\"Derek\";\n\t\t$author2->name=\"Whoever\";\n\t\tset1toNAssoc($a,$book,$author1);\n\t\tset1toNAssoc($a,$book, $author2);\n\t\tpass();\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS book_group\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS book_author\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS author_book\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS book\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS author\");\n\t\t$redbean = $toolbox->getRedBean();\n\t\t$a = new RedBean_AssociationManager( $toolbox );\n\t\t$book = $redbean->dispense(\"book\");\n\t\t$author1 = $redbean->dispense(\"author\");\n\t\t$author2 = $redbean->dispense(\"author\");\n\t\t$book->title = \"My First Post\";\n\t\t$author1->name=\"Derek\";\n\t\t$author2->name=\"Whoever\";\n\t\t$a->associate($book,$author1);\n\t\t$a->associate($book, $author2);\n\t\tpass();\n\t\ttestpack(\"Test Association Issue Group keyword (Issues 9 and 10)\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS `book_group`\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS `group`\");\n\t\t$group = $redbean->dispense(\"group\");\n\t\t$group->name =\"mygroup\";\n\t\t$redbean->store( $group );\n\t\ttry {\n\t\t\t$a->associate($group,$book);\n\t\t\tpass();\n\t\t}catch(RedBean_Exception_SQL $e) {\n\t\t\tfail();\n\t\t}\n\t\t//test issue SQL error 23000\n\t\ttry {\n\t\t\t$a->associate($group,$book);\n\t\t\tpass();\n\t\t}catch(RedBean_Exception_SQL $e) {\n\t\t\tfail();\n\t\t}\n\t\tasrt((int)$adapter->getCell(\"select count(*) from book_group\"),1); //just 1 rec!\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS book_group\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS author_book\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS book\");\n\t\t$pdo->Execute(\"DROP TABLE IF EXISTS author\");\n\t\t$redbean = $toolbox->getRedBean();\n\t\t$a = new RedBean_AssociationManager( $toolbox );\n\t\t$book = $redbean->dispense(\"book\");\n\t\t$author1 = $redbean->dispense(\"author\");\n\t\t$author2 = $redbean->dispense(\"author\");\n\t\t$book->title = \"My First Post\";\n\t\t$author1->name=\"Derek\";\n\t\t$author2->name=\"Whoever\";\n\t\t$a->unassociate($book,$author1);\n\t\t$a->unassociate($book, $author2);\n\t\tpass();\n\t\t$redbean->trash($redbean->dispense(\"bla\"));\n\t\tpass();\n\t\t$bean = $redbean->dispense(\"bla\");\n\t\t$bean->name = 1;\n\t\t$bean->id = 2;\n\t\t$redbean->trash($bean);\n\t\tpass();\n\t\t\n\t\ttestpack('Special data types');\n\t\tR::nuke();\n\t\t$bean = R::dispense('bean');\n\t\t$bean->date = 'someday';\n\t\tR::store($bean);\n\t\t$cols = R::getColumns('bean');\n\t\tasrt($cols['date'],'varchar(255)');\n\t\t$bean = R::dispense('bean');\n\t\t$bean->date = '2011-10-10';\n\t\tR::store($bean);\n\t\t$cols = R::getColumns('bean');\n\t\tasrt($cols['date'],'varchar(255)');\n\t\t\n\t\tR::nuke();\n\t\t$bean = R::dispense('bean');\n\t\t$bean->date = '2011-10-10';\n\t\tR::store($bean);\n\t\t$cols = R::getColumns('bean');\n\t\tasrt($cols['date'],'date');\n\t\t\n\t\tR::nuke();\n\t\t$bean = R::dispense('bean');\n\t\t$bean->date = '2011-10-10 10:00:00';\n\t\tR::store($bean);\n\t\t$cols = R::getColumns('bean');\n\t\tasrt($cols['date'],'datetime');\n\t\t$bean = R::dispense('bean');\n\t\t$bean->date = 'soon';\n\t\tR::store($bean);\n\t\t$cols = R::getColumns('bean');\n\t\tasrt($cols['date'],'datetime');\n\t\t$this->setGetSpatial('POINT(1 2)');\n\t\t$this->setGetSpatial('LINESTRING(3 3,4 4)');\n\t\t$this->setGetSpatial('POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7,5 5))');\n\t\t$this->setGetSpatial('MULTIPOINT(0 0,20 20,60 60)');\n\t}", "public function insert(string $reference, string $authors, string $title, string $date, string $journal = NULL, string $volume = NULL, string $number = NULL, string $pages = NULL, string $note = NULL, string $abstract = NULL, string $keywords = NULL, string $series = NULL, string $localite = NULL, string $publisher = NULL, string $editor = NULL, string $pdf = NULL, string $date_display = NULL, int $category_id){\n $query = 'INSERT INTO Publication (`reference`, `authors`, `title`, `date`, `journal`, `volume`, `number`, `pages`, `note`, `abstract`, `keywords`, `series`, `localite`, `publisher`, `editor`, `pdf`, `date_display`, `categorie_id`) VALUES (:reference, :authors, :title, :date, :journal, :volume, :number, :pages, :note, :abstract, :keywords, :series, :localite, :publisher, :editor, :pdf, :date_display, :category_id);';\n $this->connection->executeQuery($query, array(\n ':reference' => array($reference, PDO::PARAM_STR),\n ':authors' => array($authors, PDO::PARAM_STR),\n ':title' => array($title, PDO::PARAM_STR),\n ':date' => array($date, PDO::PARAM_STR),\n ':journal' => array($journal, PDO::PARAM_STR),\n ':volume' => array($volume, PDO::PARAM_STR),\n ':number' => array($number, PDO::PARAM_STR),\n ':pages' => array($pages, PDO::PARAM_STR),\n ':note' => array($note, PDO::PARAM_STR),\n ':abstract' => array($abstract, PDO::PARAM_STR),\n ':keywords' => array($keywords, PDO::PARAM_STR),\n ':series' => array($series, PDO::PARAM_STR),\n ':localite' => array($localite, PDO::PARAM_STR),\n ':publisher' => array($publisher, PDO::PARAM_STR),\n ':editor' => array($editor, PDO::PARAM_STR),\n ':pdf' => array($pdf, PDO::PARAM_STR),\n ':date_display' => array($date_display, PDO::PARAM_STR),\n ':category_id' => array($category_id, PDO::PARAM_INT) \n ));\n }", "function XSACreditNote($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db)\n{\n\t$charelectronic='01';\n\t$charelectronic=$charelectronic.'|'.$serie;\n\t$serieelect=$serie;\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n\t$folioelect=$folio;//$InvoiceNoTAG;\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\t$InvoiceHeaderSQL = \"SELECT DISTINCT\n\t\t\t\treplace(debtortrans.trandate,'-','/') as trandate,\n\t\t\t\t(debtortrans.ovamount*-1) as ovamount,\n\t\t\t\t(debtortrans.ovdiscount*-1) as ovdiscount,\n\t\t\t\t(debtortrans.ovgst*-1) as ovgst,\n\t\t\t\tdebtorsmaster.name,\n\t\t\t\tdebtorsmaster.address1,debtorsmaster.address2,\n\t\t\t\tdebtorsmaster.address3,debtorsmaster.address4,debtorsmaster.address5,\n\t\t\t\tdebtorsmaster.address6,debtorsmaster.invaddrbranch,\n\t\t\t\tcustbranch.taxid as rfc,\n\t\t\t\tcustbranch.brname,\n\t\t\t\tcustbranch.braddress1,custbranch.braddress2,custbranch.braddress3,\n\t\t\t\tcustbranch.braddress4,custbranch.braddress5,custbranch.braddress6,\n\t\t\t\tcustbranch.brpostaddr1,custbranch.brpostaddr2,custbranch.brpostaddr3,\n\t\t\t\tcustbranch.brpostaddr4,custbranch.brpostaddr5,custbranch.brpostaddr6,\n\t\t\t\tdebtortrans.debtorno,debtortrans.branchcode,debtortrans.folio,\n\t\t\t\treplace(origtrandate,'-','/') as origtrandate,\n\t\t\t\tdebtortrans.currcode,\n\t\t\t\tcustbranch.branchcode,\n\t\t\t\tdebtortrans.tpe,\n\t\t\t\tdebtortrans.shipvia,\n\t\t\t\t(debtortrans.ovfreight*-1) as ovfreight,\n\t\t\t\tdebtortrans.rate AS cambio,\n\t\t\t\tdebtorsmaster.currcode,\n\t\t\t\tcustbranch.defaultlocation,\n\t\t\t\tcustbranch.brnumext,\n\t\t\t\tcustbranch.brnumint,\n\t\t\t\t\";\n\t$InvoiceHeaderSQL = $InvoiceHeaderSQL . \"\n\t\t\t\tlocations.taxprovinceid,\n\t\t\t\tdebtortrans.tagref,\n\t\t\t\tcustbranch.phoneno as telofi,\n\t\t\t\tdebtortrans.paymentname,\n\t\t\tdebtortrans.nocuenta\n\t\t\tFROM debtortrans INNER JOIN debtorsmaster ON\n\t\t\t\tdebtortrans.debtorno = debtorsmaster.debtorno\n\t\t\t\tINNER JOIN custbranch ON\n\t\t\t\tdebtortrans.branchcode = custbranch.branchcode\n\t\t\t\tAND debtortrans.debtorno = custbranch.debtorno\n\t\t\t\tINNER JOIN currencies ON\n\t\t\t\tdebtorsmaster.currcode = currencies.currabrev\n\t\t\t\tINNER JOIN stockmoves ON\n\t\t\t\tstockmoves.transno=debtortrans.transno\n\t\t\t\tINNER JOIN locations ON\n\t\t\t\tstockmoves.loccode = locations.loccode\n\t\t\tWHERE debtortrans.transno = \" . $InvoiceNo . \"\n\t\t\t\tAND debtortrans.type=11\n\t\t\t\tAND stockmoves.type=11\";\n\t$Result=DB_query($InvoiceHeaderSQL,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t// fecha emision\n\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\t\t// subtotal\n\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t$nombre=$myrow['name'];\n\t\t$subtotal= FormatNumberERP($myrow['ovamount']);\n\t\tif (strlen($rfccliente)<12){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}elseif(strlen($rfccliente)>=14){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t// total factura\n\t\t$total=FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t$charelectronic=$charelectronic.'|'.$total;\n\t\t// total de iva\n\t\t$iva=FormatNumberERP($myrow['ovgst']);\n\t\t// transladado\n\t\t$charelectronic=$charelectronic.'|'.$iva;\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret;\n\t\t//descuento\n\t\t$descuento=FormatNumberERP($myrow['ovdiscount']);\n\t\t$charelectronic=$charelectronic.'|'.$descuento;\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|';\n\t\t// tipo de moneda\n\t\t$moneda=$myrow['currcode'];\n\t\t// CANTIDAD CON LETRAS\n\t\t$totaletras=$myrow['ovamount']+$myrow['ovgst'];\n\t\t$totalx=str_replace(',' ,'', FormatNumberERP($totaletras));\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\t\t$separa2=explode(\".\", FormatNumberERP($total));\n\t\t$montoctvs2 = $separa2[1];\n\t\t$montoletra=Numbers_Words::toWords($montoletra, 'es');\n\t\t\n\t\t$zeroPad = \"\";\n\t\tif (empty($_SESSION['Decimals'])) {\n\t\t\t$zeroPad = str_pad($zeroPad, 4, 0, STR_PAD_RIGHT);\n\t\t} else {\n\t\t\t$zeroPad = str_pad($zeroPad, $_SESSION['Decimals'], 0, STR_PAD_RIGHT);\n\t\t}\n\t\t\n\t\tif ($moneda == 'MXN') {\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\"/1$zeroPad M.N.\";\n\t\t} else {\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/1$zeroPad USD\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t// tipo de cambio\n\t\t$rate=FormatRateNumberERP($myrow['cambio']);\n\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t// numero de orden para referencia\n\t\t$ordenref=$myrow['orderno'];\n\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t// observaciones 1: vendedores\n\t\t$vendedor=\"\";\n\t\t$SQL=\" SELECT *\n\t\t FROM salesman\n\t\t WHERE salesmancode='\".$myrow['salesman'].\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowsales = DB_fetch_array($Result);\n\t\t\t$vendedor=$myrowsales['salesmanname'];\n\t\t}\n\t\t$observaciones1='Vendedor: '.$myrow['salesman'].' '.$vendedor;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t// observaciones 2\n\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t$comments=trim($myrowtags['comments']);\n\t\t}\n\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\t\t$metodopago = $myrow['paymentname'];\n\t\tif ($metodopago==\"\") {\n\t\t\t$metodopago = \"No Identificado\";\n\t\t}\n\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\") {\n\t\t\t$nocuenta = \"No Identificado\";\n\t\t}\n\n\n\t\t// observaciones 3\n\t\t$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones3;\n\n\t\t//$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$nocuenta;\n\t\t// datos de la forma de pago\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\n\t\t$terminospago=$myrow['terms'];\n\t\t$SQL=\" SELECT *\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=70\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==0) {\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}else{\n\t\t\t$Tipopago=\"Parcialidades\";\n\t\t}\n\t\t$Tipopago=$Tipopago.' '.$terminospago;\n\t\t//$Tipopago=$terminospago;\n\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t// condiciones de pago\n\t\t$charelectronic=$charelectronic.'|Genera Interes Moratorio 3 % mensual/credito';\n\t\t// metodo de pago\n\t\t//\t$metodopago='varios';\n\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t// fecha vencimiento\n\t\t$fechavence=$myrow['trandate'];\n\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t// observaciones 4\n\t\t$observaciones4=$observaciones3;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t// datos del cliente\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t$branch=$myrow['debtorno'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$calle=$myrow['address1'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$colonia=$myrow['address2'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$municipio=$myrow['address3'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$edo=$myrow['address4'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$cp=$myrow['address5'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t// datos del custbranch\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t$branch=$myrow['branchcode'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t//$rfc=$myrow['rfc'];\n\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$nombre=$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0) {\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=$myrow['braddress1'];\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=$myrow['braddress6'];\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=$myrow['braddress2'];\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=$myrow['braddress4'];\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\n\t}\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\t\n\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))- totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\t$nolinea=0;\n\t\t$descrprop=\"\";\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT distinct p.InvoiceValue as val,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=11\n\t\t\t\t \tAND sp.reqatprint=1\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0){\n\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t}else{\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\n\t\t\t$descrnarrative=\"\";\n\t\t\t$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n\t\t\t}\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescrip.$descrprop.$descrnarrative;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$nameaduana='';\n\t\t\t$numberaduana='';\n\t\t\t$fechaaduana='';\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$nolinea=$nolinea+1;\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,\n\t\t\t\t\t\ttaxcalculationorder,taxontax,\n\t\t\t\t\t\ttaxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\n\t\t}\n\t}else{\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))-totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV\n\t\t\t\t\tFROM stockmoves inner join stockmaster ON stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\tinner join stockcategory on stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t\t\t\tleft JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT distinct p.InvoiceValue as val,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t \t\tAND sp.reqatprint=1\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0){\n\t\t\t\t\t\t\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t}else{\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){//\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\t\t\t$descrnarrative=\"\";\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t FROM salesorderdetails p\n\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\tAND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t$descrnarrative=$myrownarrative['narrative'];\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}*/\n\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative;\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t//$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\t\t\t\t\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,taxcalculationorder,taxontax,taxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t$taxtotalratex=$myrow3['taxrate']*($myrow2['subtotal']);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\t\t\t\t\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t\t\n\t\t\t\t\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$aduana=$myrowaduana['aduana'];\n\t\t\t\t$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t$nameaduana = $separaaduana[0];\n\t\t\t\t$numberaduana= $separaaduana[1];\n\t\t\t\t$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t}\n\t}\n\t// ivas retenidos\n\t$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\tif ($rfccliente==\"XAXX010101000\"){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronicEmbarque;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxs.$charelectronictaxsret.$charelectronicEmbarque;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\n\t}\n\t//echo '<pre><br>'.$cadenaenviada;\n\treturn $cadenaenviada;\n}", "protected function getDatabase() {}", "function GenerateDataSQL($strDatabase, $strTable, $bwlAddSlashes=false, $bwlNoDBMention=false, $bwlHTMLEsc=false, $tableprefix=\"\", $tablepostfix=\"\",$rowlist=\"*\", $bwlrecursivebackup=false, $bwlnullpks=false)\n//creates a SQL-based dump of a table's data\n//can handle recursive backups of related data and the moving of data (PKs and related FKs) \n//into fresh new autoinc PK ranges\n//Judas Gutenberg, jan 9 2007\n{\n \n\t$sql=conDB();\n\t$out=\"\";\n\t$strSQL=\"SELECT * FROM \" . $strDatabase . \".\" . $strTable;\n\t$wherclause=\"\";\n\t$strThisSpecialID=\"@rootpk\";\n\t\n\t$intSpecialIDCount=0;\n\t$pkname=PKLookup($strDatabase, $strTable);\n\t$bwlThisIsAutoIncPK=hasautocount($strDatabase, $strTable);\n\t\t\t\t\t \n\t\t\t\t\t \n\tif($rowlist!=\"*\")\n\t{\n\t\t$arrRowlist=explode(\" \", $rowlist);\n\t\t\n\t\t\n\t\tif(!contains($pkname, \" \") && $bwlThisIsAutoIncPK) //can't handle multi-part PKs!\n\t\t{\n\t\t\t$wherclause=\" WHERE \";\n\t\t\tforeach($arrRowlist as $thisID)\n\t\t\t{\n\t\t\t\t$wherclause.=\" \" . $pkname . \"='\" . $thisID . \"' OR\";\n\t\t\t\n\t\t\t}\n\t\t\t$wherclause=substr($wherclause, 0, strlen($wherclause)-3);\n\t\t}\n\t\t$strSQL.=$wherclause;\n\t}\n\tif($bwlnullpks && !contains($pkname, \" \"))\n\t{\n\t\t$out.=\"\\nSET \" . $strThisSpecialID .\"=(SELECT MAX( \" . $pkname . \" ) +1 FROM \" . IfAThenB(!$bwlNoDBMention, $strDatabase . \".\") . $strTable . \");\";\n\t}\n\t//echo \"===\" . $strSQL;\n\t//die();\n\t$records = $sql->query($strSQL);\n\t$rowcount=0;\n\t$out.=\"\\n\";\n\t$pkname=PKLookup($strDatabase, $strTable);\n\t$bwlColListCreated=false;\n\t$colList=\"\";\n\t \n\tforeach($records as $record)\n\t{\n\t\tif($bwlNoDBMention)\n\t\t{\n\t\t\t$out.=\"\\nINSERT INTO \" . $tableprefix . $strTable . $tablepostfix . \"(\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$out.=\"\\nINSERT INTO \" . $strDatabase . \".\" . $tableprefix . $strTable . $tablepostfix . \"(\";\n\t\t}\n \t\t$insertdata=\"\";\n\t\t\n\t\tforeach($record as $k=>$field)\n\t\t{\n\t\t\t//$bwlnullpks\n\t\t\t\n\t\t\t$bwlFieldIsPK=false;\n\t\t\tif($k==$pkname)\n\t\t\t{\n\t\t\t\t$bwlFieldIsPK=true;\n\t\t\t\t$id=$field;\n\t\t\t\tif(!$bwlColListCreated)//i keep from doing the expensive lookup of hasautocount for every export row\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!$bwlColListCreated && (!($bwlFieldIsPK && $bwlnullpks) || $bwlrecursivebackup))\n\t\t\t{\n\t\t\t\t$colList.=\"`\" . $k . \"`,\";\n\t\t\t}\n\t\t\t\n\t \t\tif($bwlrecursivebackup && ($bwlFieldIsPK && $bwlThisIsAutoIncPK) && $bwlnullpks )\n\t\t\t{\n\t\t\t\t$insertdata.= $strThisSpecialID . \" + \" . $intSpecialIDCount . \",\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(($bwlFieldIsPK && $bwlThisIsAutoIncPK) && $bwlnullpks && !$bwlrecursivebackup)\n\t\t\t{\n\t\t\t\n\t\t\t}\n\t\t\telse if($bwlHTMLEsc)\n\t\t\t{\n\t\t\t\t$insertdata.= \"'\" . str_replace(\"'\", \"&#39;\", $field). \"',\";\n\t\t\t}\n\t\t\telse if($bwlAddSlashes)\n\t\t\t{\n\t\t\t\t$insertdata.= \"'\" . addslashes($field). \"',\";\n\t\t\t}\n\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$insertdata.= \"'\" . $field. \"',\";\n\t\t\t}\n\t\t\t$rowcount++;\n\t\t}\n\t\tif(!$bwlColListCreated)\n\t\t{\n\t\t\t$colList=RemoveEndCharactersIfMatch($colList, \",\");\n\t\t}\n\t\t\t\t\n\t\t$bwlColListCreated=true;\n\t\t$insertdata=RemoveEndCharactersIfMatch($insertdata, \",\");\n\t\t$out.=$colList . \") VALUES(\" . $insertdata . \");\";\n\t\t//$out.=$insertdata . \");\\n\";\n\t\tif($bwlrecursivebackup)\n\t\t{\n\t\t\t//echo $pkname . \" \" . $id . \"<br>\";\n\t\t\t$strThisSpecialIDToPass=$strThisSpecialID . \" + \" . $intSpecialIDCount;\n\t\t\tif(!$bwlnullpks)\n\t\t\t{\n\t\t\t\t$strThisSpecialIDToPass=\"\";\n\t\t\t}\n\n\t\t\t$out.=ScriptOutRelatedData($strDatabase, $strTable, $pkname, $id, 0, $tableprefix, $tablepostfix, $bwlNoDBMention, $bwlnullpks, $strThisSpecialIDToPass);\n\t\t\n\t\t\n\t\t}\n\t\t$intSpecialIDCount++;\n\t}\n\t$out.=\"\\n\";\n\n\treturn $out;\n}", "function db_impcarne($objpdf,$impmodelo){\n $this->objpdf = $objpdf;\n $this->impmodelo = $impmodelo; \n }", "function getFeeDocByProposalID($ProposalID)\n {\n try\n {\n $query = \"SELECT ProposalDocs.DocTemplateID, Docs.DocID, Docs.DocTitle, Docs.Description, Docs.Path, Docs.Url, Docs.CreatedDate, Docs.LastEditDate, Docs.SortOrder FROM Docs INNER JOIN ProposalDocs ON Docs.DocID=ProposalDocs.DocID WHERE ProposalDocs.FeeDoc = 1 AND ProposalDocs.ProposalID='\".$ProposalID.\"' \";\n\n\n $stmt = $this->conn->prepare( $query );\n\n // bind parameters\n //$stmt->bindParam(':ProposalID', $ProposalID);\n $stmt->execute();\n\n return $stmt;\n }\n catch (PDOException $e)\n {\n echo 'Connection failed: ' . $e->getMessage();\n }\n }", "function calcDTI() {\n try {\n $results = $db->query(\"SELECT * FROM borrower_tbl WHERE id='\" . $borrowerId . \"';\" );\n } catch (Exception $e) {\n echo \"Could not connect to database!: \" . $e->getMessage();\n exit;\n }\n $borrower = $results->fetchAll(PDO::FETCH_ASSOC);\n \n }", "private function gen_provSQL() {\n\t\t\t$this -> Retun_val = true;\n\t\t}", "public function database();", "function buildOSAlignments($collection){\r\n $dbConnection = GetDBConnection();\r\n\r\n $q = \"DELETE FROM outdoorschool_alignments\";\r\n if($dbConnection->query($q) !== TRUE) echo \"Failed to delete from sciencebuddies_collection\\n\";\r\n\r\n\r\n\r\n //for every resource in the outdoor school collection\r\n for($i = 0; $i < count($collection); $i++){\r\n $curResource = $collection[$i];\r\n $alignmentsCount = $collection[$i]->numAlignments;\r\n\r\n //for every alignment to the current resource\r\n for($j = 0; $j < $alignmentsCount; $j++){\r\n //Add resource alignment pair to the database\r\n $NGSSCode = str_replace(\" \", \"\", $curResource->alignments[$j]);\r\n\r\n $ASNCode = getASNCode($NGSSCode);\r\n\r\n print($NGSSCode . \", \" . $ASNCode . \", \" . $collection[$i]->docId . \"\\n\");\r\n $insertQuery = \"INSERT INTO outdoorschool_alignments\" . \"(\"\r\n . \"doc_id,\"\r\n . \"sCode\"\r\n . \")\"\r\n .\"VALUES (\"\r\n . \"'\" . $collection[$i]->title . \"',\"\r\n . \"'\" . $ASNCode . \"'\"\r\n . \")\";\r\n if($dbConnection->query($insertQuery) !== TRUE){\r\n echo \"Failed inserting into bh_science_buddies_docs\";\r\n return;\r\n }\r\n }\r\n\r\n }\r\n}", "function allinea_db() {\r\n\t\t\r\n\t\t$in=$this->session_vars;\r\n\t\t$conn=$this->conn;\r\n\t\t$service=$this->service;\r\n\t\t$tb_exist = false;\r\n\t\t$str_synonym=\"select * from USER_SYNONYMS where synonym_name='\" . $this->form ['TABLE'] . \"'\";\r\n\t\t$sql = new query ( $conn );\r\n\t\t$sql->set_sql ( $str_synonym );\r\n\t\t$sql->exec ();//non richiede binding\r\n\t\t$sql->get_row();\r\n\t\tif($sql->row['TABLE_NAME']!='') $this->form ['TABLE']=$sql->row['TABLE_NAME'];\r\n\t\t$query = \"select column_name from user_col_comments where table_name='\" . $this->form ['TABLE'] . \"'\";\r\n\t\t$sql = new query ( $conn );\r\n\t\t$sql->set_sql ( $query );\r\n\t\t$sql->exec ();//non richiede binding\r\n\t\t$all_field_exist = true;\r\n\t\tforeach ( $this->fields as $key => $val ) {\r\n\t\t\tif (isset ( $val ['TYPE'] ) && $val ['TYPE'] != '')\r\n\t\t\t$field_type = \"field_{$val['TYPE']}\";\r\n\t\t\telse\r\n\t\t\t$field_type = \"field\";\r\n\t\t\t\r\n\t\t\tif ($this->config_service['field_lib'] != '' && file_exists ( $this->config_service['field_lib'] . $field_type . \".inc\" )) {\r\n\t\t\t\tinclude_once $this->config_service['field_lib'] . $field_type . \".inc\";\r\n\t\t\t} else\r\n\t\t\tinclude_once \"{$field_type}.inc\";\r\n\t\t\t$this->no_field_value_by_tb=true;\r\n\t\t\t$field_obj = new $field_type ( $this, $key, $this->conn, $this->tb_vals, $this->session_vars, $this->service, $this->errors);\r\n\t\t\t$this->no_field_value_by_tb=false;\r\n\t\t\t$allinea_stmt [$key] = $field_obj->allinea_db ();\r\n\t\t\tif ($field_obj->attributes ['PK'] == 'yes') {\r\n\t\t\t\t$sql_pk_fields .= \"{$field_obj->attributes['VAR']},\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$sql_pk_fields = rtrim ( $sql_pk_fields, \",\" );\r\n\t\tif ($sql->numrows > 0) {\r\n\t\t\t$tb_exist = true;\r\n\t\t\t$i = 0;\r\n\t\t\twhile ( $sql->get_row () ) {\r\n\t\t\t\t$res [$i] = $sql->row ['COLUMN_NAME'];\r\n\t\t\t\t$i ++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($tb_exist) {\r\n\t\t\t$sql_pk = null;\r\n\t\t\t$c = 0;\r\n\t\t\t$all_field_exist = true;\r\n\t\t\tforeach ( $allinea_stmt as $key => $val ) {\r\n\t\t\t\tif ($val != '') {\r\n\t\t\t\t\t$field_exist = false;\r\n\t\t\t\t\tforeach ( $val as $vk => $vval ) {\r\n\t\t\t\t\t\t$nome_campo = explode ( \" \", $vval );\r\n\t\t\t\t\t\t$field_exist [$key] [$vk] = false;\r\n\t\t\t\t\t\tforeach ( $res as $key_res => $val_res ) {\r\n\t\t\t\t\t\t\tif ($val_res == $nome_campo [0] || $nome_campo [0] == '') {\r\n\t\t\t\t\t\t\t\t$field_exist [$key] [$vk] = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tforeach ( $field_exist as $key1 => $val1 ) {\r\n\t\t\t\t\t\tforeach ( $val1 as $vk => $boolval )\r\n\t\t\t\t\t\tif (! $boolval) {\r\n\t\t\t\t\t\t\t$all_field_exist = false;\r\n\t\t\t\t\t\t\t$index = (count ( $this->fields ) * $vk) + $key;\r\n//\t\t\t\t\t\t\t$eq_sql_str [$index] = \"alter table EQ_\" . $this->form ['TABLE'] . \" add {$allinea_stmt[$key][$vk]}\";\r\n\t\t\t\t\t\t\t$s_sql_str [$index] = \"alter table S_\" . $this->form ['TABLE'] . \" add {$allinea_stmt[$key][$vk]}\";\r\n\t\t\t\t\t\t\t$sql_str [$index] = \"alter table \" . $this->form ['TABLE'] . \" add {$allinea_stmt[$key][$vk]}\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$sql_pk_drop = \"alter table \" . $this->form ['TABLE'] . \" drop constraint PK_\" . $this->form ['TABLE'] . \" cascade\";\r\n\t\t\t$sql_pk = \"alter table \" . $this->form ['TABLE'] . \" add constraint PK_\" . $this->form ['TABLE'] . \" primary key ($sql_pk_fields)\";\r\n\t\t\t$sql_fk_coord_drop = \"alter table \" . $this->form ['TABLE'] . \" drop constraint FK_\" . $this->form ['TABLE'] . \"_COORD cascade\";\r\n\t\t\tglobal $config_service;\r\n\t\t\tif ($config_service ['VISITNUM_PROGR'] == 1)\r\n\t\t\t$sql_fk_coord = \"alter table \" . $this->form ['TABLE'] . \" add constraint FK_\" . $this->form ['TABLE'] . \"_COORD foreign key (VISITNUM, VISITNUM_PROGR, ESAM, {$this->PK_SERVICE}, PROGR) references {$service}_COORDINATE (VISITNUM, VISITNUM_PROGR, ESAM, {$this->PK_SERVICE}, PROGR) on delete cascade\";\r\n\t\t\telse\r\n\t\t\t$sql_fk_coord = \"alter table \" . $this->form ['TABLE'] . \" add constraint FK_\" . $this->form ['TABLE'] . \"_COORD foreign key (VISITNUM, ESAM, {$this->PK_SERVICE}, PROGR) references {$service}_COORDINATE (VISITNUM, ESAM, {$this->PK_SERVICE}, PROGR) on delete cascade\";\r\n\t\t} else {\r\n\t\t\t$this->body .= \"Table <b>\" . $this->form ['TABLE'] . \"</b> doesn't exist<br/>\";\r\n\t\t\tforeach ( $allinea_stmt as $key => $val ) {\r\n\t\t\t\tforeach ( $val as $key_f => $val_f )\r\n\t\t\t\tif ($val_f != '')\r\n\t\t\t\t$sql_create_fields .= \"{$val_f},\";\r\n\t\t\t}\r\n\t\t\t$sql_create_fields = rtrim ( $sql_create_fields, \",\" );\r\n\t\t\t$sql_str_ini = \"create table \" . $this->form ['TABLE'] . '(';\r\n\t\t\t$sql_str_end = \")\";\r\n\t\t\t$sql_str [0] = $sql_str_ini . $sql_create_fields . $sql_str_end;\r\n\t\t\t$sql_pk = \"alter table \" . $this->form ['TABLE'] . \" add constraint PK_\" . $this->form ['TABLE'] . \" primary key ($sql_pk_fields)\";\r\n\t\t\t$config_service=$this->config_service;\r\n\t\t\tif ($config_service ['VISITNUM_PROGR'] == 1)\r\n\t\t\t$sql_fk_coord = \"alter table \" . $this->form ['TABLE'] . \" add constraint FK_\" . $this->form ['TABLE'] . \"_COORD foreign key (VISITNUM, VISITNUM_PROGR, ESAM, {$this->PK_SERVICE}, PROGR) references {$service}_COORDINATE (VISITNUM, VISITNUM_PROGR, ESAM, {$this->PK_SERVICE}, PROGR) on delete cascade\";\r\n\t\t\telse\r\n\t\t\t$sql_fk_coord = \"alter table \" . $this->form ['TABLE'] . \" add constraint FK_\" . $this->form ['TABLE'] . \"_COORD foreign key (VISITNUM, ESAM, {$this->PK_SERVICE}, PROGR) references {$service}_COORDINATE (VISITNUM, ESAM, {$this->PK_SERVICE}, PROGR) on delete cascade\";\r\n//\t\t\t$eq_sql_str [0] = \"create table EQ_\" . $this->form ['TABLE'] . \" (ID NUMBER, COMMENTO varchar2(400),\" . $sql_create_fields . $sql_str_end;\r\n//\t\t\t$eq_sql_str [1] = \"alter table EQ_\" . $this->form ['TABLE'] . \" add constraint EQ_PK_\" . $this->form ['TABLE'] . \" primary key (ID)\";\r\n\r\n\t\t\t$s_sql_str [0] = \"create table S_\" . $this->form ['TABLE'] . \"(USERID VARCHAR2(20),MODDT DATE,MODPROG NUMBER not null,FL_QUERY CHAR(1) not null,ID_QUERY NUMBER,\" . $sql_create_fields . $sql_str_end;\r\n\t\t\t$s_sql_str [1] = \"alter table S_\" . $this->form ['TABLE'] . \" add constraint S_PK_\" . $this->form ['TABLE'] . \" primary key (MODPROG)\";\r\n\r\n\t\t}\r\n\t\tif (isset ( $in ['CREATE'] ) || isset ( $in ['CREATE_' . $this->form ['TABLE']] )) {\r\n\t\t\tforeach ( $sql_str as $key => $val ) {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($val); // bind non necessario\r\n\t\t\t}\r\n\t\t\tforeach ( $eq_sql_str as $key => $val ) {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($val); // bind non necessario\r\n\t\t\t}\r\n\t\t\tforeach ( $s_sql_str as $key => $val ) {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($val); // bind non necessario\r\n\t\t\t}\r\n\t\t\tif ($sql_pk_drop != '') {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($sql_pk_drop); // bind non necessario\r\n\t\t\t}\r\n\t\t\t$sql = new query ( $conn );\r\n\t\t\t$sql->ins_upd ($sql_pk); // bind non necessario\r\n\t\t\tif ($sql_fk_coord_drop != '') {\r\n\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t$sql->ins_upd ($sql_fk_coord_drop); // bind non necessario\r\n\t\t\t}\r\n\t\t\t$sql = new query ( $conn );\r\n\t\t\t$sql->ins_upd ($sql_fk_coord); // bind non necessario\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\treturn ($tb_exist && $all_field_exist);\r\n\t}", "function get_org_rec($donation){\n\t\tif( $this->get_donor_type($donation) == 'O'){\n\t\t\t$org_rec = 'Y';\n\t\t}\n\t\telse{\n\t\t\t$org_rec = 'N';\n\t\t}\t\t\n\t\treturn $org_rec;\n\t}", "function cl_ing_ingreso_det() {\r\n\r\n $this->database = new Database();\r\n }", "protected function createDatabaseStructure() {}", "function allinea_db(){\n\t\tif ($this->attributes['BYTB']!='' ) $this->fields_value_bytb($this->attributes['BYTB']);\n\t\tif ($this->attributes['TB']!='no'){\n\t\t\t$i=0;\n\t\t\tforeach ($this->values as $key => $val){\n\t\t\t\t$ret[$i]=\"{$key} NUMBER\";\n\t\t\t\t$i++;\n\t\t\t\t$ret[$i]=\"D_{$key} VARCHAR2(200 CHAR)\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $ret;\n\t\t}\n\t\telse return ;\n\t}", "public function acfedu_create_fill_db() {\n\t\t\t\t$this->acfedu_check_table();\n\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\tob_start();\n\t\t\t\tglobal $wpdb;\n //require_once( 'lib/import_nl.php' );\n //require_once( 'lib/import_be.php' );\n //require_once( 'lib/import_lux.php' );\n require_once( 'lib/import_id.php' );\n\t\t\t\t$sql = ob_get_clean();\n\t\t\t\tdbDelta( $sql );\n\t\t\t}", "function censusCitation($year, $page, $idir, $type)\n{\n global $connection;\n global $debug;\n\n if ($type == Citation::STYPE_BIRTH &&\n \t!is_null($idir))\n {\t // citation to birth\n \t// extract keys identifying the specific page of the census\n \t// from the citation string\n \t$prov\t\t = '';\n \t$dist\t \t= 0;\n \t$subdist \t= '';\n \t$div\t \t= '';\n \t$pagenum \t= 0;\n \t$pattern \t= \"/^([A-Z]{2},|) *(dist *([0-9.]+)|).*?, *(subdist ([A-Z0-9]+)|)(.*?)(div *([A-Z0-9]+)|) *page *([0-9]+)/i\";\n \t//$pattern\t= \"/^(([A-Z]{2},|))/i\";\n \t$count\t \t= preg_match($pattern,\n \t\t\t\t \t\t $page,\n \t\t\t\t \t\t $matches);\n \tif ($count == 1)\n \t{\n \t if ($debug)\n \t\t\tprint \"\\\"matches\\\" : \" . print_r($matches, true) . \",\\n\";\n \t if (strlen($matches[1]) == 3)\n \t\t\t$prov\t= substr($matches[1],0,2);\n \t else\n \t\t\t$prov\t= \"''\";\n \t $dist\t = $matches[3];\n \t $subdist\t= $matches[5];\n \t $div\t = $matches[8];\n \t $pagenum\t= $matches[9];\n \t if ($debug)\n \t {\n \t\t\tprint \"\\\"prov\\\" : \" . json_encode($prov) . \",\\n\";\n \t\t\tprint \"\\\"dist\\\" : \" . json_encode($dist) . \",\\n\";\n \t\t\tprint \"\\\"subdist\\\" : \" . json_encode($subdist) . \",\\n\";\n \t\t\tprint \"\\\"div\\\" : \" . json_encode($div) . \",\\n\";\n \t\t\tprint \"\\\"pagenum\\\" : \" . json_encode($pagenum) . \",\\n\";\n \t }\n \t}\n \telse\n \tif ($debug)\n \t print \"\\\"count\\\" : \" . json_encode($count) . \",\\n\";\n\n \t// get information about the individual in a format\n \t// suitable for use in the SQL command\n \t// the individual may be identified in the census by\n \t// birth name, married name, or other alternate name\n\n \tprint \",\\n \\\"alt\\\" : {\\n\";\n \t$nameparms\t = array('idir' => $idir);\n \t$namerecs\t = new RecordSet('Names', $nameparms);\n\n \t$whereName\t = '';\n \t$genderTest\t = '';\n \t$or\t\t = '';\n $sqlParms\t = array();\n \tforeach($namerecs as $idnx => $namerec)\n \t{\n \t $surname\t = $namerec->get('surname');\n \t $givenname\t = $namerec->get('givenname');\n \t $birthsd\t = $namerec->get('birthsd');\n \t $gender\t = $namerec->get('gender');\n \t print \"\\\"row$idnx\\\" : {\\n\";\n \t print \"\\\"idnx\\\" : \" . json_encode($idnx) . \",\\n\";\n \t print \"\\\"surname\\\" : \" . json_encode($surname) . \",\\n\";\n \t print \"\\\"givenname\\\" : \" . json_encode($givenname) . \",\\n\";\n \t print \"\\\"birthsd\\\" : \" . json_encode($birthsd) . \",\\n\";\n \t print \"\\\"gender\\\" : \" . json_encode($gender) . \"\\n\";\n \t print \"}\\n\";\n \t $sqlParms['surname' . $idnx]\t= $surname;\n \t $sqlParms['partGiven' . $idnx]\t= substr($givenname, 0, 2);\n \t if (strlen($genderTest) == 0)\n \t {\t\t // add gender test\n \t\t\tif ($gender == 0)\n \t\t\t\t$genderTest\t= \"SEX='M' AND \";\n \t\t\telse\n \t\t\tif ($gender == 1)\n \t\t\t\t$genderTest\t= \"SEX='F' AND \";\n \t }\t\t // add gender test\n \t $whereName\t.= \"$or(LEFT(SOUNDEX(:surname$idnx),4)=SurnameSoundex AND \" .\n \t\t\t\t\t\t\"LOCATE(:partGiven$idnx, GivenNames) > 0)\";\n \t $or\t\t = ' OR ';\n $birthYear\t= floor($birthsd/10000);\n \t}\t // loop through matching names\n \tprint \"}\";\n\n \tif (strlen($whereName) > 0)\n \t{\t // have at least one name to check\n \t // search the census page for a vague match\n \t $sqlParms['dist']\t\t= $dist;\n \t $sqlParms['subdist']\t= $subdist;\n \t $sqlParms['div']\t\t= $div;\n \t $sqlParms['pagenum']\t= $pagenum;\n \t $sqlParms['birthYear']\t= $birthYear;\n \t if ($year < 1867)\n \t {\n \t\t\t$sqlParms['prov']\t= $prov;\n \t\t\t$select\t= \"SELECT Line, Surname, GivenNames FROM Census$year \" .\n \t\t\t\t\t\" WHERE Province=:prov AND\" .\n \t\t\t\t\t\" District=:dist AND\" .\n \t\t\t\t\t\" SubDistrict=:subdist AND\" .\n \t\t\t\t\t\" Division=:div AND\" .\n \t\t\t\t\t\" Page=:pagenum AND $genderTest\" .\n \t\t\t\t\t\" ($whereName) AND\" .\n \t\t\t\t\t\" ABS(BYear - :birthYear) < 3\";\n \t }\n \t else\n \t\t\t$select\t= \"SELECT Line, Surname, GivenNames FROM Census$year \" .\n \t\t\t\t\t\"WHERE District=:dist AND \" .\n \t\t\t\t\t\"SubDistrict=:subdist AND \" .\n \t\t\t\t\t\"Division=:div AND \" .\n \t\t\t\t\t\"Page=:pagenum AND $genderTest \" .\n \t\t\t\t\t\"($whereName) AND \" .\n \t\t\t\t\t\"ABS(BYear - :birthYear) < 3\";\n \t $sqlParmsText\t= print_r($sqlParms, true);\n \t $stmt\t\t = $connection->prepare($select);\n \t if ($stmt->execute($sqlParms))\n \t {\t // select succeeded\n \t\t\t$sresult\t= $stmt->fetchAll(PDO::FETCH_ASSOC);\n \t\t\t$count\t\t= count($sresult);\n print \",\\n \\\"select\\\" : {\\n\";\n print \" \\\"count\\\" : $count,\";\n print \" \\\"cmd\\\" : \" .\n json_encode($select) . \",\\n\";\n print \" \\\"parms\\\" : \" .\n json_encode($sqlParmsText) . \"\\n\";\n print \" }\";\n $comma = \",\\n\";\n \t\t\tforeach($sresult as $row)\n \t\t\t{\t // found match in census\n \t\t\t $line\t = $row['line'];\n \t\t\t $csurname\t = $row['surname'];\n \t\t\t $cgivennames = $row['givennames'];\n\n \t\t\t print \",\\n \\\"row$line\\\" : {\\n\";\n \t\t\t print \"\t \\\"line\\\" : $line,\\n\";\n print \"\t \\\"surname\\\" : \" . \n json_encode($csurname) . \",\\n\";\n print \" \\\"givennames\\\" : \" .\n json_encode($cgivennames) . \"\\n\";\n print \"\\n }\";\n\n \t\t\t if ($count == 1)\n \t\t\t {\t\t// unique match\n \t\t\t\t\tif ($year < 1867)\n \t\t\t\t\t $censusId\t\t= $prov . $year;\n \t\t\t\t\telse\n \t\t\t\t\t $censusId\t\t= 'CA' . $year;\n \t\t\t\t\t$line\t= new CensusLine(array(\n \t\t\t\t\t\t\t\t 'Census'\t=> $censusId,\n \t\t\t\t\t\t\t\t 'District'\t=> $dist,\n \t\t\t\t\t\t\t\t 'SubDistrict'=> $subdist,\n \t\t\t\t\t\t\t\t 'Division'\t=> $div,\n \t\t\t\t\t\t\t\t 'Page'\t\t=> $pagenum),\n \t\t\t\t\t\t\t\t $line);\n \t\t\t\t\t$line->set('idir', $idir);\n $result\t\t= $line->save();\n print \",\\n \\\"sqlcmd\" . __LINE__ . \"\\\" : \" .\n json_encode($line->getLastSqlCmd());\n \t\t\t }\t\t// unique match\n \t\t\t}\t\t // found matches in census\n \t }\t\t // select succeeded\n \t else\n \t {\t // failed to select records\n print \" \\\"select\\\" : {\\n\";\n print \" \\\"failed\\\" : true,\";\n print \" \\\"cmd\\\" : \" .\n json_encode($select) . \",\\n\";\n print \" \\\"parms\\\" : \" .\n json_encode($sqlParmsText) . \",\\n\";\n print \" \\\"msg\\\" : \" .\n json_encode(print_r($stmt->errorInfo(),true)) . \"\\n\";\n print \" },\\n\";\n \t }\t // failed\n \t}\t // have at least one name to check\n }\t\t // citation to birth\n}", "public function run()\n {\n DB::table('editorial_book')->insert([\n 'editorial_id' => 4,\n 'book_id' \t\t=> 1,\n 'type' \t\t=> 1\n ]);\n DB::table('editorial_book')->insert([\n 'editorial_id' => 3,\n 'book_id' \t\t=> 2,\n 'type' \t\t=>1\n ]);\n DB::table('editorial_book')->insert([\n 'editorial_id' => 2,\n 'book_id' => 3,\n 'type' =>1\n ]);\n }", "public function pick_db($db)\n\t\t{\t$this->db = $db\n\t\t}", "function ciniki_donations_templates_canadaDefault(&$ciniki, $tnid, $donation_id, $tenant_details, $settings) {\n //\n // Get the receipt record\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'donations', 'private', 'donationLoad');\n $rc = ciniki_donations_donationLoad($ciniki, $tnid, $donation_id);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $donation = $rc['donation'];\n \n //\n // Load TCPDF library\n //\n require_once($ciniki['config']['ciniki.core']['lib_dir'] . '/tcpdf/tcpdf.php');\n\n class MYPDF extends TCPDF {\n //Page header\n public $header_image = null;\n public $header_name = '';\n public $header_addr = array();\n public $header_details = array();\n public $header_height = 0; // The height of the image and address\n public $tenant_details = array();\n public $settings = array();\n\n public function Header() {\n //\n // Check if there is an image to be output in the header. The image\n // will be displayed in a narrow box if the contact information is to\n // be displayed as well. Otherwise, image is scaled to be 100% page width\n // but only to a maximum height of the header_height (set far below).\n //\n $img_width = 0;\n if( $this->header_image != null ) {\n $height = $this->header_image->getImageHeight();\n $width = $this->header_image->getImageWidth();\n $image_ratio = $width/$height;\n if( count($this->header_addr) == 0 && $this->header_name == '' ) {\n $img_width = 180;\n } else {\n $img_width = 120;\n }\n $available_ratio = $img_width/$this->header_height;\n // Check if the ratio of the image will make it too large for the height,\n // and scaled based on either height or width.\n if( $available_ratio < $image_ratio ) {\n $this->Image('@'.$this->header_image->getImageBlob(), 15, $this->getY()+7, \n $img_width, 0, 'JPEG', '', 'L', 2, '150');\n } else {\n $this->Image('@'.$this->header_image->getImageBlob(), 15, $this->getY()+7, \n 0, $this->header_height-5, 'JPEG', '', 'L', 2, '150');\n }\n }\n\n //\n // Add the contact information\n //\n if( !isset($this->settings['receipt-header-contact-position']) \n || $this->settings['receipt-header-contact-position'] != 'off' ) {\n if( isset($this->settings['receipt-header-contact-position'])\n && $this->settings['receipt-header-contact-position'] == 'left' ) {\n $align = 'L';\n } elseif( isset($this->settings['receipt-header-contact-position'])\n && $this->settings['receipt-header-contact-position'] == 'right' ) {\n $align = 'R';\n } else {\n $align = 'C';\n }\n $this->Ln(8);\n if( $this->header_name != '' ) {\n $this->SetFont('times', 'B', 20);\n if( $img_width > 0 ) {\n $this->Cell($img_width, 10, '', 0);\n }\n $this->Cell(180-$img_width, 10, $this->header_name, \n 0, false, $align, 0, '', 0, false, 'M', 'M');\n $this->Ln(5);\n }\n $this->SetFont('times', '', 10);\n if( count($this->header_addr) > 0 ) {\n $address_lines = count($this->header_addr);\n if( $img_width > 0 ) {\n $this->Cell($img_width, ($address_lines*5), '', 0);\n }\n $this->MultiCell(180-$img_width, $address_lines, implode(\"\\n\", $this->header_addr), \n 0, $align, 0, 0, '', '', true, 0, false, true, 0, 'M', false);\n $this->Ln();\n }\n }\n\n //\n // Output the receipt details which should be at the top of each page.\n //\n/* $this->SetCellPadding(2);\n if( count($this->header_details) <= 6 ) {\n if( $this->header_name == '' && count($this->header_addr) == 0 ) {\n $this->Ln($this->header_height+6);\n } elseif( $this->header_name == '' && count($this->header_addr) > 0 ) {\n $used_space = 4 + count($this->header_addr)*5;\n if( $used_space < 30 ) {\n $this->Ln(30-$used_space+5);\n } else {\n $this->Ln(7);\n }\n } elseif( $this->header_name != '' && count($this->header_addr) > 0 ) {\n $used_space = 10 + count($this->header_addr)*5;\n if( $used_space < 30 ) {\n $this->Ln(30-$used_space+6);\n } else {\n $this->Ln(5);\n }\n } elseif( $this->header_name != '' && count($this->header_addr) == 0 ) {\n $this->Ln(25);\n }\n $this->SetFont('times', '', 10);\n $num_elements = count($this->header_details);\n if( $num_elements == 3 ) {\n $w = array(60,60,60);\n } elseif( $num_elements == 4 ) {\n $w = array(45,45,45,45);\n } elseif( $num_elements == 5 ) {\n $w = array(36,36,36,36,36);\n } else {\n $w = array(30,30,30,30,30,30);\n }\n $lh = 6;\n $this->SetFont('', 'B');\n for($i=0;$i<$num_elements;$i++) {\n if( $this->header_details[$i]['label'] != '' ) {\n $this->SetFillColor(224);\n $this->Cell($w[$i], $lh, $this->header_details[$i]['label'], 1, 0, 'C', 1);\n } else {\n $this->SetFillColor(255);\n $this->Cell($w[$i], $lh, '', 'T', 0, 'C', 1);\n }\n }\n $this->Ln();\n $this->SetFillColor(255);\n $this->SetFont('');\n for($i=0;$i<$num_elements;$i++) {\n if( $this->header_details[$i]['label'] != '' ) {\n $this->Cell($w[$i], $lh, $this->header_details[$i]['value'], 1, 0, 'C', 1);\n } else {\n $this->Cell($w[$i], $lh, '', 0, 0, 'C', 1);\n }\n }\n $this->Ln();\n } */\n }\n\n // Page footer\n public function Footer() {\n // Position at 15 mm from bottom\n// $this->SetY(-15);\n// // Set font\n// $this->SetFont('helvetica', 'I', 8);\n// if( isset($this->settings['receipt-footer-message']) \n// && $this->settings['receipt-footer-message'] != '' ) {\n// $this->Cell(90, 10, $this->settings['receipt-footer-message'],\n// 0, false, 'L', 0, '', 0, false, 'T', 'M');\n// $this->Cell(90, 10, 'Page ' . $this->pageNo().'/'.$this->getAliasNbPages(), \n// 0, false, 'R', 0, '', 0, false, 'T', 'M');\n// } else {\n// // Center the page number if no footer message.\n// $this->Cell(0, 10, 'Page ' . $this->pageNo().'/'.$this->getAliasNbPages(), \n// 0, false, 'C', 0, '', 0, false, 'T', 'M');\n// }\n }\n }\n\n //\n // Start a new document\n //\n $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);\n\n //\n // Figure out the header tenant name and address information\n //\n $pdf->header_height = 0;\n $pdf->header_name = '';\n if( !isset($settings['receipt-header-contact-position'])\n || $settings['receipt-header-contact-position'] != 'off' ) {\n if( !isset($settings['receipt-header-tenant-name'])\n || $settings['receipt-header-tenant-name'] == 'yes' ) {\n $pdf->header_name = $tenant_details['name'];\n $pdf->header_height = 8;\n }\n if( !isset($settings['receipt-header-tenant-address'])\n || $settings['receipt-header-tenant-address'] == 'yes' ) {\n if( isset($tenant_details['contact.address.street1']) \n && $tenant_details['contact.address.street1'] != '' ) {\n $pdf->header_addr[] = $tenant_details['contact.address.street1'];\n }\n if( isset($tenant_details['contact.address.street2']) \n && $tenant_details['contact.address.street2'] != '' ) {\n $pdf->header_addr[] = $tenant_details['contact.address.street2'];\n }\n $city = '';\n if( isset($tenant_details['contact.address.city']) \n && $tenant_details['contact.address.city'] != '' ) {\n $city .= $tenant_details['contact.address.city'];\n }\n if( isset($tenant_details['contact.address.province']) \n && $tenant_details['contact.address.province'] != '' ) {\n $city .= ($city!='')?', ':'';\n $city .= $tenant_details['contact.address.province'];\n }\n if( isset($tenant_details['contact.address.postal']) \n && $tenant_details['contact.address.postal'] != '' ) {\n $city .= ($city!='')?' ':'';\n $city .= $tenant_details['contact.address.postal'];\n }\n if( $city != '' ) {\n $pdf->header_addr[] = $city;\n }\n }\n/* if( !isset($settings['receipt-header-tenant-phone'])\n || $settings['receipt-header-tenant-phone'] == 'yes' ) {\n if( isset($tenant_details['contact.phone.number']) \n && $tenant_details['contact.phone.number'] != '' ) {\n $pdf->header_addr[] = 'phone: ' . $tenant_details['contact.phone.number'];\n }\n if( isset($tenant_details['contact.tollfree.number']) \n && $tenant_details['contact.tollfree.number'] != '' ) {\n $pdf->header_addr[] = 'phone: ' . $tenant_details['contact.tollfree.number'];\n }\n }\n if( !isset($settings['receipt-header-tenant-cell'])\n || $settings['receipt-header-tenant-cell'] == 'yes' ) {\n if( isset($tenant_details['contact.cell.number']) \n && $tenant_details['contact.cell.number'] != '' ) {\n $pdf->header_addr[] = 'cell: ' . $tenant_details['contact.cell.number'];\n }\n }\n if( (!isset($settings['receipt-header-tenant-fax'])\n || $settings['receipt-header-tenant-fax'] == 'yes')\n && isset($tenant_details['contact.fax.number']) \n && $tenant_details['contact.fax.number'] != '' ) {\n $pdf->header_addr[] = 'fax: ' . $tenant_details['contact.fax.number'];\n }\n if( (!isset($settings['receipt-header-tenant-email'])\n || $settings['receipt-header-tenant-email'] == 'yes')\n && isset($tenant_details['contact.email.address']) \n && $tenant_details['contact.email.address'] != '' ) {\n $pdf->header_addr[] = $tenant_details['contact.email.address'];\n }\n if( (!isset($settings['receipt-header-tenant-website'])\n || $settings['receipt-header-tenant-website'] == 'yes')\n && isset($tenant_details['contact-website-url']) \n && $tenant_details['contact-website-url'] != '' ) {\n $pdf->header_addr[] = $tenant_details['contact-website-url'];\n }\n*/\n }\n $pdf->header_height += (count($pdf->header_addr)*5);\n\n //\n // Set the minimum header height\n //\n if( $pdf->header_height < 30 ) {\n $pdf->header_height = 30;\n }\n\n //\n // Load the header image\n //\n if( isset($settings['receipt-header-image']) && $settings['receipt-header-image'] > 0 ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'images', 'private', 'loadImage');\n $rc = ciniki_images_loadImage($ciniki, $tnid, \n $settings['receipt-header-image'], 'original');\n if( $rc['stat'] == 'ok' ) {\n $pdf->header_image = $rc['image'];\n }\n }\n\n $pdf->tenant_details = $tenant_details;\n $pdf->settings = $settings;\n\n //\n // Determine the header details\n //\n// $pdf->header_details = array(\n// array('label'=>'Receipt No.', 'value'=>$donation['receipt_number']),\n// array('label'=>'Date Received', 'value'=>$donation['date_received']),\n// array('label'=>'Issued On', 'value'=>$donation['date_issued']),\n// array('label'=>'Location', 'value'=>$donation['location_issued']),\n// array('label'=>'Eligible Amount', 'value'=>$donation['amount_display']),\n// );\n\n //\n // Setup the PDF basics\n //\n $pdf->SetCreator('Ciniki');\n $pdf->SetAuthor($tenant_details['name']);\n $pdf->SetTitle('Receipt #' . $donation['receipt_number']);\n $pdf->SetSubject('');\n $pdf->SetKeywords('');\n\n // set margins\n $pdf->SetMargins(PDF_MARGIN_LEFT, $pdf->header_height+15, PDF_MARGIN_RIGHT);\n $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);\n $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);\n\n\n // set font\n $pdf->SetFont('times', 'BI', 10);\n $pdf->SetCellPadding(1);\n\n // add a page\n $pdf->AddPage();\n $pdf->SetFillColor(255);\n $pdf->SetTextColor(0);\n $pdf->SetDrawColor(51);\n $pdf->SetLineWidth(0.15);\n\n //\n // Determine the billing address information\n //\n $addr = array();\n if( isset($donation['name']) && $donation['name'] != '' ) {\n $addr[] = $donation['name'];\n }\n if( isset($donation['address1']) && $donation['address1'] != '' ) {\n $addr[] = $donation['address1'];\n }\n if( isset($donation['address2']) && $donation['address2'] != '' ) {\n $addr[] = $donation['address2'];\n }\n $city = '';\n if( isset($donation['city']) && $donation['city'] != '' ) {\n $city = $donation['city'];\n }\n if( isset($donation['province']) && $donation['province'] != '' ) {\n $city .= (($city!='')?', ':'') . $donation['province'];\n }\n if( isset($donation['postal']) && $donation['postal'] != '' ) {\n $city .= (($city!='')?', ':'') . $donation['postal'];\n }\n if( $city != '' ) {\n $addr[] = $city;\n }\n if( isset($donation['country']) && $donation['country'] != '' ) {\n $addr[] = $donation['country'];\n }\n\n //\n // Output the details\n //\n $w = array(45, 45, 90);\n $lh = 6;\n $pdf->SetFillColor(255);\n $pdf->setCellPadding(0.5);\n $pdf->SetFont('', 'B');\n $pdf->Cell($w[0], $lh, 'Receipt Number:', 0, 0, 'R', 1);\n $pdf->SetFont('', '');\n $pdf->Cell($w[1], $lh, $donation['receipt_number'], 0, 0, 'L', 1);\n $pdf->Cell($w[2], $lh, (isset($addr[0])?$addr[0]:''), 0, 0, 'L', 1);\n $pdf->Ln();\n\n $pdf->SetFont('', 'B');\n $pdf->Cell($w[0], $lh, 'Amount Received:', 0, 0, 'R', 1);\n $pdf->SetFont('', '');\n $pdf->Cell($w[1], $lh, $donation['amount_display'], 0, 0, 'L', 1);\n $pdf->Cell($w[2], $lh, (isset($addr[1])?$addr[1]:''), 0, 0, 'L', 1);\n $pdf->Ln();\n\n $pdf->SetFont('', 'B');\n $pdf->Cell($w[0], $lh, 'Date Received:', 0, 0, 'R', 1);\n $pdf->SetFont('', '');\n $pdf->Cell($w[1], $lh, $donation['date_received'], 0, 0, 'L', 1);\n $pdf->Cell($w[2], $lh, (isset($addr[2])?$addr[2]:''), 0, 0, 'L', 1);\n $pdf->Ln();\n\n $pdf->SetFont('', 'B');\n $pdf->Cell($w[0], $lh, 'Date Issued:', 0, 0, 'R', 1);\n $pdf->SetFont('', '');\n $pdf->Cell($w[1], $lh, $donation['date_issued'], 0, 0, 'L', 1);\n $pdf->Cell($w[2], $lh, (isset($addr[3])?$addr[3]:''), 0, 0, 'L', 1);\n $pdf->Ln();\n\n $pdf->SetFont('', 'B');\n $pdf->Cell($w[0], $lh, 'Location Issued:', 0, 0, 'R', 1);\n $pdf->SetFont('', '');\n $pdf->Cell($w[1], $lh, $donation['location_issued'], 0, 0, 'L', 1);\n $pdf->Cell($w[2], $lh, (isset($addr[4])?$addr[4]:''), 0, 0, 'L', 1);\n $pdf->Ln();\n \n $w = array(50, 50, 80);\n if( isset($settings['receipt-thankyou-message']) && $settings['receipt-thankyou-message'] != '' ) {\n $pdf->SetFont('', 'B');\n $pdf->Cell($w[0]+$w[1], $lh*2, $settings['receipt-thankyou-message'], 0, 0, 'L', 1);\n $pdf->Cell($w[2], $lh*2, '', 0, 0, 'L', 1);\n } else {\n $pdf->Cell($w[0]+$w[1], $lh*2, '', 0, 0, 'L', 1);\n $pdf->Cell($w[2], $lh*2, '', 0, 0, 'L', 1);\n }\n $pdf->Ln();\n $pdf->SetFont('', '');\n $pdf->setCellPadding(2);\n\n //\n // Output charity information and signature\n //\n// $pdf->Cell($w[0] + $w[1], $lh, 'Official ' . $donation['donation_year'] . ' Donation Receipt for Income Tax Purposes, Canada Revenue Agency: www.cra.gc.ca/charitiesandgiving', 0, 0, 'L', 1);\n// $pdf->Cell($w[0] + $w[1], $lh, 'Official ' . $donation['donation_year'] . ' Donation Receipt for Income Tax Purposes', 0, 0, 'L', 1);\n// $pdf->Cell($w[2], $lh, '', 0, 0, 'L', 1);\n// $pdf->Ln();\n $pdf->Cell($w[0]+$w[1], $lh, 'Charity BN/Registration #: ' . $settings['receipt-charity-number'], 0, 0, 'L', 1);\n// $pdf->Cell($w[2], $lh, '', 0, 0, 'L', 1);\n// $pdf->Ln();\n\n// $pdf->Cell($w[0] + $w[1], $lh, 'Canada Revenue Agency: www.cra.gc.ca/charitiesandgiving', 0, 0, 'L', 1);\n $pdf->Cell($w[2], $lh, $settings['receipt-signing-officer'], 'T', 0, 'R', 1); \n $pdf->Ln(10);\n $pdf->Cell(180, $lh, 'Official ' . $donation['donation_year'] . ' Donation Receipt for Income Tax Purposes, Canada Revenue Agency: www.cra.gc.ca/charitiesandgiving', 0, 0, 'C', 1);\n $pdf->Ln(10);\n\n //\n // Separator between official receipt and summary for customer to keep\n //\n $pdf->Cell(180, $lh, 'detach and retain for your records', array('T'=>array('dash'=>4, 'color'=>array(125,125,125))), 0, 'C', 1);\n\n $pdf->setCellPadding(1);\n $pdf->Ln(10);\n\n $pdf->Header();\n $pdf->Ln(15);\n\n $w = array(45, 45, 90);\n $pdf->Cell($w[0], $lh, 'Receipt Number:', 0, 0, 'R', 1);\n $pdf->Cell($w[1], $lh, $donation['receipt_number'], 0, 0, 'L', 1);\n $pdf->Cell($w[2], $lh, (isset($addr[0])?$addr[0]:''), 0, 0, 'L', 1);\n $pdf->Ln();\n\n $pdf->Cell($w[0], $lh, 'Eligible Amount:', 0, 0, 'R', 1);\n $pdf->Cell($w[1], $lh, $donation['amount_display'], 0, 0, 'L', 1);\n $pdf->Cell($w[2], $lh, (isset($addr[1])?$addr[1]:''), 0, 0, 'L', 1);\n $pdf->Ln();\n\n $pdf->Cell($w[0], $lh, 'Date Received:', 0, 0, 'R', 1);\n $pdf->Cell($w[1], $lh, $donation['date_received'], 0, 0, 'L', 1);\n $pdf->Cell($w[2], $lh, (isset($addr[2])?$addr[2]:''), 0, 0, 'L', 1);\n $pdf->Ln();\n\n $pdf->Cell($w[0], $lh, 'Date Issued:', 0, 0, 'R', 1);\n $pdf->Cell($w[1], $lh, $donation['date_issued'], 0, 0, 'L', 1);\n $pdf->Cell($w[2], $lh, (isset($addr[3])?$addr[3]:''), 0, 0, 'L', 1);\n $pdf->Ln();\n\n $pdf->Cell($w[0], $lh, 'Location Issued:', 0, 0, 'R', 1);\n $pdf->Cell($w[1], $lh, $donation['location_issued'], 0, 0, 'L', 1);\n $pdf->Cell($w[2], $lh, (isset($addr[4])?$addr[4]:''), 0, 0, 'L', 1);\n $pdf->Ln();\n \n if( isset($settings['receipt-thankyou-message']) && $settings['receipt-thankyou-message'] != '' ) {\n $pdf->SetFont('', 'B');\n $pdf->Cell(180, $lh*2, $settings['receipt-thankyou-message'], 0, 0, 'C', 1);\n } else {\n $pdf->Cell(180, $lh, '', 0, 0, 'C', 1);\n }\n $pdf->SetFont('', '');\n $pdf->Ln();\n\n //\n // Output charity information and signature\n //\n $pdf->Cell($w[0]+$w[1], $lh, 'Charity BN/Registration #: ' . $settings['receipt-charity-number'], 0, 0, 'L', 1);\n $pdf->Ln();\n\n $pdf->Cell($w[0] + $w[1], $lh, 'Canada Revenue Agency: www.cra.gc.ca/charitiesandgiving', 0, 0, 'L', 1);\n $pdf->Ln();\n\n // ---------------------------------------------------------\n\n //Close and output PDF document\n $pdf->Output('receipt_' . $donation['receipt_number'] . '.pdf', 'D');\n\n return array('stat'=>'exit');\n}", "function sopac_bib_record_download($bnum = NULL) {\n $locum = sopac_get_locum();\n $actions = sopac_parse_uri();\n if(!$bnum){\n $actions = sopac_parse_uri();\n $bnum = $actions[1];\n }\n $bib = $locum->get_bib_item($bnum);\n $type = $_GET['type'];\n $license = isset($bib['licensed_from']) ? $bib['licensed_from'] : 'magnatune';\n global $user;\n if ($user->uid && $user->bcode_verified && $type && $bib['zipmd5']) {\n switch($type){\n case 'album':\n $locum->count_download($bnum,\"album\");\n $path = \"http://media.aadl.org/music/$license/$bnum/derivatives/\".$bib['zipmd5'].\".zip?name=$bnum.zip\";\n header(\"Location: $path\");\n break;\n case 'flac':\n $locum->count_download($bnum,\"flac\");\n $path = \"http://media.aadl.org/music/$license/$bnum/derivatives/\".$bib['zipmd5'].\"-flac.zip?name=$bnum-flac.zip\";\n header(\"Location: $path\");\n break;\n case 'track':\n $tracknum = $_GET['tracknum'];\n $locum->count_download($bnum,\"track\",$tracknum);\n if(!$tracknum) {\n $path = variable_get('sopac_url_prefix', 'cat/seek') . '/record/' . $bnum;\n drupal_set_message(t(\"There appears to be a problem downloading the file. Please make sure you have an active library card associated with this account\"),\"error\");\n drupal_goto($path);\n }\n $paddedtrack = str_pad($tracknum, 2, \"0\", STR_PAD_LEFT);\n $trackname = $bib['tracks'][$tracknum]['title'] . \"-\" . $bib['artist'];\n if($bib['tracks'][$tracknum]['filename']) {\n $filename = $bib['tracks'][$tracknum]['filename'];\n }\n else {\n $filename = $paddedtrack.\"-\".str_replace(array(' ','(',')'),'-', $trackname).\".mp3\";\n }\n $path = \"http://media.aadl.org/music/$license/$bnum/derivatives/\".str_replace(array(' ','(',')','/'),'-', $bib['title']).\"/\".urlencode($filename).\"?name=\".urlencode($filename);\n //header('Content-Disposition: attachment; filename=\"'.$path.'\"');\n //readfile($path);\n header(\"Location: $path\");\n break;\n case 'play':\n $tracknum = $_GET['tracknum'];\n $locum->count_download($bnum,\"play\",$tracknum);\n $paddedtrack = str_pad($tracknum, 2, \"0\", STR_PAD_LEFT);\n $trackname = $bib['tracks'][$tracknum]['title'] . \"-\" . $bib['artist'];\n if($bib['tracks'][$tracknum]['filename']) {\n $filename = $bib['tracks'][$tracknum]['filename'];\n }\n else {\n $filename = $paddedtrack.\"-\".str_replace(array(' ','(',')'),'-', $trackname).\".mp3\";\n }\n $path = \"http://media.aadl.org/music/$license/$bnum/derivatives/streaming/\".rawurlencode($filename);\n //header('Content-Disposition: attachment; filename=\"'.$path.'\"');\n header('Content-Type: audio/mpeg');\n readfile($path);\n //header(\"Location: $path\");\n break;\n }\n\n }\n else {\n $path = variable_get('sopac_url_prefix', 'cat/seek') . '/record/' . $bnum;\n drupal_set_message(t(\"There appears to be a problem downloading the file. Please make sure you have an active library card associated with this account\"),\"error\");\n drupal_goto($path);\n }\n}", "function reading_list(){\n\t//1. connect to BDD\t\t\n\t$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;\n\t$bdd = new PDO(DB_PMBA, DB_USER, DB_PWD);\n\t$bdd->exec(\"SET CHARACTER SET utf8\");\n\n\t$count = 0;\n\t\n\t// 2. clean\n\t$bdd->exec('DELETE FROM reading_list');\n\t\n\t\n\t$url = \"http://personalmba.com/best-business-books/\";\n\t$pmba_url = \"http://personalmba.com\";\n\t\n\t$html = connect_to($url,$book);\n\t$html = str_get_html($html);\n\t\n\t// 2. get category\n\t$h2 = $html->find('h2[id]');\n\t\n\tforeach($h2 as $category){\n\t\t\n\t\t$en_category = $category->innertext;\t\t\n\t\t$list_books = $category->next_sibling()->find('li');\n\t\tforeach($list_books as $book){\n\t\t\n\t\t\t//3. info\n\t\t\t$title = $book->find('a',0)->plaintext;\n\t\t\t$amazon_com_url = $pmba_url.$book->find('a',0)->href;\n\t\t\t$author = $book->plaintext;\n\t\t\t$id = get_id($author);\n\t\t\t$author = get_author($author);\t\t\t\n\t\t\t$en_review = $pmba_url.$book->find('a',1)->href;\n\n\t\t\t$fr_category = \"\";\n\t\t\t$fr_review = \"\";\t\t\t\t\t\t\n\t\t\t$amazon_best_url = \"\";\n\t\t\t$amazon_price = \"\";\n\t\t\t$cheapest_price = \"\";\n\t\t\t$ship_price = \"\";\n\t\t\t$ISBN = \"\";\n\n\t\t\t// step 4 : insert in db\t\t\n\t\t\t$request = 'INSERT INTO reading_list VALUES(\\''.$id.'\\', \\''.$title.'\\', \\''.$author.'\\', \\''.$en_category.'\\', \\''.$fr_category.\n\t\t\t\t\t\t'\\', \\''.$en_review.'\\', \\''.$fr_review.'\\', \\''.$amazon_com_url.'\\', \\''.$amazon_best_url.'\\', \\''.$amazon_price.'\\', \\''.$cheapest_price.'\\', \\''.$ship_price.'\\', \\''.$ISBN.'\\')';\n\t\t\t$bdd->exec($request);\t\n\t\t\t\n\t\t\techo $id.\"\\n\";\n\t\t}\n\t}\n\t\t\n\t\n\t$html->clear(); \n\tunset($html);\n\t\n\t\t\n\t// and now we're done; close it\n\t$bdd = null;\n}", "function journal_voucher_detail(\n\t\t\t\t\t\t\t $voucher_id\n\t\t\t\t\t\t\t, $voucher_date\n\t\t\t\t\t\t\t, $account_id\t\n\t\t\t\t\t\t\t, $entry_desc\n\t\t\t\t\t\t\t, $debit_amount\n\t\t\t\t\t\t\t, $credit_amount\n\t\t\t\t\t\t\t ) \n{\t\t\t\t\n\t\t\t\t\t$now= getDateTime(0,'mySQL');\n\t\t\t\t\t$insert = DB::Insert(DB_PREFIX.$_SESSION['co_prefix'].'journal_voucher_details', \n\t\t\t\t\t\t\t\tarray(\t\t\t\n\t\t\t\t\t\t\t\t\t\t'voucher_id' \t\t\t=> $voucher_id,\t\n\t\t\t\t\t\t\t\t\t\t'voucher_date' \t \t\t=> $voucher_date,\n\t\t\t\t\t\t\t\t\t\t'account_id' \t\t\t=> $account_id,\n\t\t\t\t\t\t\t\t\t\t'entry_description' \t=> $entry_desc,\n\t\t\t\t\t\t\t\t\t\t'debit_amount' \t\t\t=> $debit_amount,\t\n\t\t\t\t\t\t\t\t\t\t'credit_amount' \t\t=> $credit_amount,\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t'created_on'\t\t\t=> $now,\n\t\t\t\t\t\t\t\t\t\t'created_by'\t\t\t=> $_SESSION['user_name'],\n\t\t\t\t\t\t\t\t\t\t'voucher_detail_status'\t=>\t'Draft'\n\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t$voucher_detail_id =DB::insertId();\n\t\t\t\t\tif($voucher_detail_id) { \n\t\t\t\t\treturn $voucher_detail_id;\n\t\t\t\t\treturn $voucher_id;\n\t\t\t\t\t} else {\n\t\t\t\t\treturn 0;\t\n\t\t\t\t\t}\n\t }", "function pntresmailer_init(){\n $dbconn =& pnDBGetConn(true);\n $pntable = pnDBGetTables();\n\n// nl_arch_subscriber\n $nl_arch_subscribertable = $pntable['nl_arch_subscriber'];\n $nl_arch_subscribercolumn = &$pntable['nl_arch_subscriber_column'];\n\n $sql = \"CREATE TABLE $nl_arch_subscribertable (\n $nl_arch_subscribercolumn[arch_mid] int(11) NOT NULL default '0',\n $nl_arch_subscribercolumn[sub_reg_id] int(11) NOT NULL default '0',\n $nl_arch_subscribercolumn[arch_date] int(25) NOT NULL default '0',\n $nl_arch_subscribercolumn[arch_read] int(25) NOT NULL default '0')\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n// nl_archive\n $nl_archivetable = $pntable['nl_archive'];\n $nl_archivecolumn = &$pntable['nl_archive_column'];\n\n $sql = \"CREATE TABLE $nl_archivetable (\n $nl_archivecolumn[arch_mid] int(11) NOT NULL auto_increment,\n $nl_archivecolumn[arch_issue] tinytext NOT NULL,\n $nl_archivecolumn[arch_message] longtext NOT NULL,\n $nl_archivecolumn[arch_date] int(25) NOT NULL default '0',\n PRIMARY KEY(arch_mid))\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n// nl_archive_txt\n $nl_archive_txttable = $pntable['nl_archive_txt'];\n $nl_archive_txtcolumn = &$pntable['nl_archive_txt_column'];\n\n $sql = \"CREATE TABLE $nl_archive_txttable (\n $nl_archive_txtcolumn[arch_mid] int(11) NOT NULL,\n $nl_archive_txtcolumn[arch_issue] tinytext NOT NULL,\n $nl_archive_txtcolumn[arch_message] longtext NOT NULL,\n $nl_archive_txtcolumn[arch_date] int(25) NOT NULL default '0',\n PRIMARY KEY(arch_mid))\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n// nl_modules\n $nl_modulestable = $pntable['nl_modules'];\n $nl_modulescolumn = &$pntable['nl_modules_column'];\n\n $sql = \"CREATE TABLE $nl_modulestable (\n $nl_modulescolumn[mod_id] int(11) NOT NULL auto_increment,\n $nl_modulescolumn[mod_pos] int(11) NOT NULL default '0',\n $nl_modulescolumn[mod_file] tinytext NOT NULL,\n $nl_modulescolumn[mod_name] tinytext NOT NULL,\n $nl_modulescolumn[mod_function] tinytext NOT NULL,\n $nl_modulescolumn[mod_descr] tinytext NOT NULL,\n $nl_modulescolumn[mod_version] tinytext NOT NULL,\n $nl_modulescolumn[mod_multi_output] int(5) NOT NULL default '0',\n $nl_modulescolumn[mod_qty] int(5) NOT NULL default '1',\n $nl_modulescolumn[mod_edit] int(5) NOT NULL default '0',\n $nl_modulescolumn[mod_data] mediumtext NOT NULL,\n PRIMARY KEY(mod_id))\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n// nl_subscriber\n $nl_subscribertable = $pntable['nl_subscriber'];\n $nl_subscribercolumn = &$pntable['nl_subscriber_column'];\n\n $sql = \"CREATE TABLE $nl_subscribertable (\n $nl_subscribercolumn[sub_reg_id] int(11) NOT NULL auto_increment,\n $nl_subscribercolumn[sub_uid] int(11) NOT NULL default '0',\n $nl_subscribercolumn[sub_name] tinytext NOT NULL,\n $nl_subscribercolumn[sub_email] tinytext NOT NULL,\n $nl_subscribercolumn[sub_last_date] int(25) NOT NULL default '0',\n PRIMARY KEY(sub_reg_id))\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n// nl_unsubscribe\n $nl_unsubscribetable = $pntable['nl_unsubscribe'];\n $nl_unsubscribecolumn = &$pntable['nl_unsubscribe_column'];\n\n $sql = \"CREATE TABLE $nl_unsubscribetable (\n $nl_unsubscribecolumn[unsub_reg_id] int(11) NOT NULL default '0',\n $nl_unsubscribecolumn[unsub_uid] int(11) NOT NULL default '0',\n $nl_unsubscribecolumn[unsub_name] tinytext NOT NULL,\n $nl_unsubscribecolumn[unsub_email] tinytext NOT NULL,\n $nl_unsubscribecolumn[unsub_last_date] int(25) NOT NULL default '0',\n $nl_unsubscribecolumn[unsub_date] int(25) NOT NULL default '0',\n $nl_unsubscribecolumn[unsub_received] int(5) NOT NULL default '0',\n $nl_unsubscribecolumn[unsub_remote_addr] tinytext NOT NULL,\n $nl_unsubscribecolumn[unsub_user_agent] tinytext NOT NULL,\n $nl_unsubscribecolumn[unsub_who] int(11) NOT NULL default '0')\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n// nl_var\n $nl_vartable = $pntable['nl_var'];\n $nl_varcolumn = &$pntable['nl_var_column'];\n\n $sql = \"CREATE TABLE $nl_vartable (\n $nl_varcolumn[nl_var_id] int(11) NOT NULL default '0',\n $nl_varcolumn[nl_header] mediumtext NOT NULL,\n $nl_varcolumn[nl_footer] mediumtext NOT NULL,\n $nl_varcolumn[nl_subject] tinytext NOT NULL,\n $nl_varcolumn[nl_name] tinytext NOT NULL,\n $nl_varcolumn[nl_email] tinytext NOT NULL,\n $nl_varcolumn[nl_url] tinytext NOT NULL,\n $nl_varcolumn[nl_tpl_html] tinytext NOT NULL,\n $nl_varcolumn[nl_tpl_text] tinytext NOT NULL,\n $nl_varcolumn[nl_issue] int(11) NOT NULL default '0',\n $nl_varcolumn[nl_bulk_count] int(5) NOT NULL default '500',\n $nl_varcolumn[nl_loop_count] int(5) NOT NULL default '5',\n $nl_varcolumn[nl_mail_server] tinytext NOT NULL,\n $nl_varcolumn[nl_unreg] int(5) NOT NULL default '0',\n $nl_varcolumn[nl_system] int(5) NOT NULL default '0',\n $nl_varcolumn[nl_popup] int(5) NOT NULL default '0',\n $nl_varcolumn[nl_popup_days] int(5) NOT NULL default '10',\n $nl_varcolumn[nl_sample] int(5) NOT NULL default '0',\n $nl_varcolumn[nl_personal] int(5) NOT NULL default '0',\n $nl_varcolumn[nl_resub] int(5) NOT NULL default '1',\n PRIMARY KEY(nl_var_id))\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n $sql = \"INSERT INTO $nl_vartable VALUES (1,'Here is this weeks newsletter.','Thanks for checking out our news.\\r\\n\\r\\nsincerely,\\r\\nme','Our Newsletter','Your Site Name','[email protected]','http://www.yoursite.com','default/html.tpl','default/text.tpl',1,500,5,'localhost',0,0,0,10,0,0,1)\";\n $dbconn->Execute($sql);\n\n if ($dbconn->ErrorNo() != 0) {\n pnSessionSetVar('errormsg', _CREATETABLEFAILED);\n return false;\n }\n\n return true;\n}", "function ABIDatabase($dbtype, $dbhost, $dbuser, $dbpass, $dbname, $dbprefix = 'jos_')\n\t{\n\t\t$this->dbtype = $dbtype;\n\t\t$this->dbhost = $dbhost;\n\t\t$this->dbuser = $dbuser;\n\t\t$this->dbpass = $dbpass;\n\t\t$this->dbname = $dbname;\n\t\t$this->dbprefix = $dbprefix;\n\t}", "function XSAInvoicingCreditdirect($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db)\n{\n\t$charelectronic='01';\n\t$charelectronic=$charelectronic.'|'.$serie.$folio;\n\t$serieelect=$serie;\n\t$folioelect=$folio;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$SQLInvoice = \"SELECT\n\t\t\treplace(debtortransmovs.origtrandate,'-','/') as origtrandate,\n\t\t\tSUM(abs(debtortransmovs.ovamount)) AS ovamount,\n\t\t\tSUM(abs(debtortransmovs.ovgst)) AS ovgst,\n\t\t\tdebtortransmovs.currcode,\n\t\t\tdebtortransmovs.rate as cambio,\n\t\t\tdebtortransmovs.order_,\n\t\t\treplace(debtortransmovs.trandate,'-','/') as trandate,\n\t\t\tdebtortransmovs.debtorno,\n\t\t\tcustbranch.taxid as rfc,\n\t\t\tdebtorsmaster.name,\n\t\t\tdebtorsmaster.address1,\n\t\t\tdebtorsmaster.address2,\n\t\t\tdebtorsmaster.address3,\n\t\t\tdebtorsmaster.address4,\n\t\t\tdebtorsmaster.address5,\n\t\t\tdebtortransmovs.branchcode,\n\t\t\tcustbranch.braddress1,\n\t\t\tcustbranch.braddress2,\n\t\t\tcustbranch.braddress3,\n\t\t\tcustbranch.braddress4,\n\t\t\tcustbranch.braddress5,\n\t\t\tcustbranch.brnumint,\n\t\t\tcustbranch.brnumext,\n\t\t\tcustbranch.specialinstructions,\n\t\t\tcustbranch.brpostaddr1,\n\t\t\tcustbranch.brpostaddr2,\n\t\t\tcustbranch.brpostaddr3,\n\t\t\tcustbranch.brpostaddr4,\n\t\t\tcustbranch.brpostaddr5,\n\t\t\tcustbranch.brpostaddr6,\n\t\t\tcustpais as brpostaddr7,\n\t\t\twww_users.realname,\n\t\t\tdebtortransmovs.transno,\n\t\t\tdebtortransmovs.reference,\n\t\t\tcustbranch.phoneno as telofi,\n\t\t\tdebtortrans.paymentname,\n\t\t\tdebtortrans.nocuenta,\n\t\t\tdebtortrans.observf\n\t\t\tFROM debtortransmovs\n\t\t\tINNER JOIN debtortrans ON debtortrans.type = debtortransmovs.type\n\t\t\tAND debtortrans.transno = debtortransmovs.transno\n\t\t\t,debtorsmaster,custbranch, www_users\n\t\t\tWHERE debtortransmovs.type=$TypeInvoice\n\t\t\tAND debtortransmovs.transno=$InvoiceNo\n\t\t\tAND debtortransmovs.tagref=$tag\n\t\t\tAND debtortransmovs.debtorno=debtorsmaster.debtorno\n\t\t\tAND debtortransmovs.debtorno=custbranch.debtorno\n\t\t\tAND debtortransmovs.branchcode=custbranch.branchcode\n\t\t\tAND www_users.userid = debtortransmovs.userid\n\t\t\tGROUP BY debtortransmovs.transno\";\n\t\n\t$Result=DB_query($SQLInvoice,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t{\n\t\t\t$myrow = DB_fetch_array($Result);\n\t\t\t// fecha emision\n\t\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t\t$UserRegister=\"\";//$myrow['UserRegister'];\n\t\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\t\t\t// subtotal\n\t\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t\t$nombre=$myrow['name'];\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']);\n\t\t\tif ((strlen($rfccliente)<12) OR (strlen($rfccliente)>=14)){\n\t\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t\t$nombre=\"Publico en General\";\n\t\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t\t$imprimepublico=1;\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t\t// total factura\n\t\t\t$total=FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$charelectronic=$charelectronic.'|'.abs($total);\n\t\t\t// total de iva\n\t\t\t$iva=FormatNumberERP($myrow['ovgst']);\n\t\t\t// transladado\n\t\t\t$charelectronic=$charelectronic.'|'.abs($iva);\n\t\t\t// retenido\n\t\t\t$ivaret=0;\n\t\t\t$charelectronic=$charelectronic.'|'.abs($ivaret);\n\t\t\t//descuento\n\t\t\t//$descuento=number_format(0,2,'.','');\n\t\t\t$descuento='0.00';\n\t\t\t$charelectronic=$charelectronic.'|'.($descuento);\n\t\t\t//motivo descuento\n\t\t\t$charelectronic=$charelectronic.'|';\n\t\t\t// tipo de moneda\n\t\t\t$moneda=$myrow['currcode'];\n\t\t\t// CANTIDAD CON LETRAS\n\t\t\t$totaletras=abs($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$separa=explode(\".\",$totaletras);\n\t\t\t$montoctvs2 = $separa[1];\n\t\t\t$montoctvs1 = $separa[0];\n\t\t\tif ($montoctvs2>995){\n\t\t\t\t$montoctvs1=$montoctvs1+1;\n\t\t\t}\n\t\t\t$montoletra=Numbers_Words::toWords($montoctvs1,'es');\n\t\t\t$totaletras=FormatNumberERP($totaletras);\n\t\t\t$separa=explode(\".\",$totaletras);\n\t\t\t$montoctvs2 = $separa[1];\n\t\t\tif ($montoctvs2>995){\n\t\t\t\t$montoctvs2=0;\n\t\t\t}\n\t\t\t$montocentavos=Numbers_Words::toWords($montoctvs2,'es');\n\t\t\t\n\t\t\t$zeroPad = \"\";\n\t\t\tif (empty($_SESSION['Decimals'])) {\n\t\t\t\t$zeroPad = str_pad($zeroPad, 4, 0, STR_PAD_RIGHT);\n\t\t\t} else {\n\t\t\t\t$zeroPad = str_pad($zeroPad, $_SESSION['Decimals'], 0, STR_PAD_RIGHT);\n\t\t\t}\n\t\t\t\n\t\t\tif ($moneda == 'MXN') {\n\t\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\"/1$zeroPad M.N.\";\n\t\t\t} else {\n\t\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/1$zeroPad USD\";\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t\t// tipo moneda\n\t\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t\t// tipo de cambio\n\t\t\t$rate=FormatRateNumberERP($myrow['cambio']);\n\t\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t\t// numero de orden para referencia\n\t\t\t$ordenref=$myrow['order_'];\n\t\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t\t// observaciones 1: vendedores\n\t\t\t$vendedor=$myrow['realname'];\n\t\t\t$observaciones1='Vendedor: '.' '.$vendedor;\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t\t// observaciones 2\n\t\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t\t FROM legalbusinessunit l, tags t\n\t\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t\t$Result= DB_query($SQL,$db);\n\t\t\tif (DB_num_rows($Result)==1) {\n\t\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t\t$comments=trim($myrowtags['comments']);\n\t\t\t}\n\t\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\n\t\t\t$metodopago = $myrow['paymentname'];\n\t\t\tif ($metodopago==\"\") {\n\t\t\t\t$metodopago = \"No Identificado\";\n\t\t\t}\n\n\t\t\t$nocuenta = $myrow['nocuenta'];\n\t\t\tif ($nocuenta==\"\") {\n\t\t\t\t$nocuenta = \"No Identificado\";\n\t\t\t}\n\n\t\t\t// observaciones 3\n\t\t\t$observaciones3='Id Nota :'.$InvoiceNo;//' '.$comments .' usr:'.$UserRegister;\n\t\t\t$TypeInvoice.\"\n\t\t\tAND debtortransmovs.transno=\" . $InvoiceNo . \"\n\t\t\tAND debtortransmovs.tagref=\" . $tag .\n\n\t\t\t$observaciones3 = $observaciones3 . $detallerecibos . \"; \" ;// \"Este comprobante es complementario a los expedidos en la fecha y folios descritos en cada partida detallada arriba\";\n\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones3 . $detallerecibos;\n\n\t\t\t//SE AGREGA NUEVO CAMPO INFORMACION EXTRA\n\t\t\t$charelectronic=$charelectronic . '|' . '';\n\n\t\t\t// datos de la forma de pago\n\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\t\t\tif(strlen($myrow['observf'])>0){\n\t\t\t\t\n\t\t\t\t$terminospago=$myrow['observf'];\n\t\t\t}else{\n\t\t\t\t$terminospago=\"Pago en una sola exhibicion\";\n\t\t\t}\n\t\t\t//echo 'terminos:'.$terminospago.' obs:'.$myrow['observf'].'<br><br>';\n\t\t\t$Tipopago=$Tipopago.' '.$terminospago;\n\t\t\t//$Tipopago=$terminospago;\n\t\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t\t// condiciones de pago\n\t\t\t$charelectronic=$charelectronic.'|---';\n\t\t\t// metodo de pago\n\t\t\t//$metodopago='Varios';\n\t\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t\t// fecha vencimiento\n\t\t\t$fechavence=$myrow['trandate'];\n\t\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t\t// observaciones 4\n\t\t\t$observaciones4=$nocuenta;\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t\t// datos del cliente\n\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t\t$branch=$myrow['debtorno'];\n\t\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));\n\t\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t\t}else{\n\t\t\t\t$pais=\"Mexico\";\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$pais;\n\n\t\t}\n\t\t{\n\t\t\t$calle=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$calle=$myrow['address1'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t\t$noext=$myrow['brnumext'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t\t$noint=$myrow['brnumint'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t\t$colonia=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$colonia=$myrow['address2'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t\t$localidad=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t\t$referenciacalle=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t\t$municipio=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$municipio=$myrow['address3'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t\t$edo=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$edo=$myrow['address4'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t\t$cp=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$cp=$myrow['address5'];\n\t\t\t}\n\t\t}\n\t\t{\n\t\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t\t// datos del custbranch\n\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t\t$branch=$myrow['branchcode'];\n\t\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t\t//$rfc=$myrow['rfc'];\n\t\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t\t$nombre=$myrow['name'];\n\t\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));\n\t\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t\t}else{\n\t\t\t\t$pais=\"Mexico\";\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t\t$calle=$myrow['braddress1'];\n\t\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t\t$noext=$myrow['brnumext'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t\t$noint=$myrow['brnumint'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t\t$colonia=$myrow['braddress6'];\n\t\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t\t$localidad=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t\t$referenciacalle=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t\t$municipio=$myrow['braddress2'];;\n\t\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t\t$edo=$myrow['braddress3'];\n\t\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t\t$cp=$myrow['braddress4'];\n\t\t\t$charelectronic=$charelectronic.'|'.$cp;\n\n\t\t}\n\t}\n\t\n\t$charelectronicEmbarque='|'.chr(13).chr(10).'09';\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['specialinstructions'];\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr1'];//calle\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//noext\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//no int\n\t\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr2'];//colonia\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr3'];//municipio\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr4'];//cp\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr5'];//estado\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr6'];//pais\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr7'];\n\t\n\t// cadena para datos de los productos\n\t// productos vendidos\n\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\t$stockid='Nota '.$myrow['transno'];\n\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t$charelectronicdetail=$charelectronicdetail.'|'.$myrow['transno'];\n\t$cantidad = 1;\n\t$stockcantidad=FormatNumberERP($cantidad);\n\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t$stockdescrip=$myrow['reference'];\n\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescrip;\n\t$stockprecio=FormatNumberERP(abs($myrow['ovamount']));\n\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t$stockneto=FormatNumberERP(abs($myrow['ovamount']));\n\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t$stockunits= '';\n\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t$stockcat='NC';\n\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t$ordencompra='';\n\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t//DESCUENTO 1\n\t$charelectronicdetail = $charelectronicdetail . '|' . '0.00';\n\t//DESCUENTO 2\n\t$charelectronicdetail = $charelectronicdetail . '|' . '0.00';\n\t//DESCUENTO 3\n\t$charelectronicdetail = $charelectronicdetail . '|' . '0.00';\n\t//SUBTOTAL\n\t$charelectronicdetail = $charelectronicdetail . '|' . FormatNumberERP(abs($myrow['ovamount']));\n\t//ADUANA\n\t$charelectronicdetail = $charelectronicdetail . '|' . '';\n\t//NUMERO DE ADUANA\n\t$charelectronicdetail = $charelectronicdetail . '|' . '';\n\t//FECHA DE INGRESO A ADUANA\n\t$charelectronicdetail = $charelectronicdetail . '|' . '';\n\tif ($imprimepublico==0){\n\t\t$impuesto=\"IVA\";\n\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t$totalcred=(abs($myrow['ovgst'])/abs($myrow['ovamount']));\n\n\n\t\t//$totalcred=$totalcred-1;\n\t\t$taxrate=FormatNumberERP($totalcred*100);\n\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t$taxratetotal=FormatNumberERP(abs($myrow['ovgst']));\n\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t}\n\n\t// ivas retenidos\n\t//$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\n\tif ($charelectronictaxs != \"\"){\n\t\treturn $charelectronic.$charelectronicdetail.$charelectronictaxs.$charelectronictaxsret.$charelectronicEmbarque;\n\t}else{\n\t\treturn $charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronicEmbarque;\n\t}\n\n}", "function makePurchase($conn,$ISBN) {\n $purchase = \"INSERT INTO purchase (ISBN,date) VALUES ('$ISBN',NOW())\";\n if(mysqli_query($conn, $purchase)) {\n echo \"New record created\";\n } else {\n echo 'Nothing <br>';\n exit;\n }\n }", "function generateRapportBCEAO($date_rapport) {\n global $dbHandler;\n $db = $dbHandler->openConnection();\n\n $filepath = '/tmp/rapport_bic.xml';\n $user = 'apache';\n\n if(file_exists($filepath)) {\n file_put_contents($filepath, null);\n }\n else {\n touch($filepath);\n }\n\n chown($filepath, $user);\n chgrp($filepath, $user);\n chmod($filepath, 0777);\n\n $date_rapport = php2pg($date_rapport);\n\n $sql = \"SELECT * FROM rapport_bic_file(date('$date_rapport'));\";\n $result = $db->query($sql);\n\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n Signalerreur(__FILE__,__LINE__,__FUNCTION__,_(\"DB\").\": \".$result->getMessage());\n }\n\n $dbHandler->closeConnection(true);\n return true;\n\n}", "function uf_create_release_db_libre_V_3_54()\r\n\t{\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//\t Function: uf_create_release_db_libre_V_3_54\r\n\t\t//\t\t Access: public \r\n\t\t// Modulos: Configuracion\r\n\t\t//\t Description: \r\n\t\t// Fecha Creacion: 23/04/2008 \t\t\t\t\t\t\t\tFecha Ultima Modificacion : \r\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t $lb_valido=true;\r\n\t $ls_sql=\"\";\r\n\t switch($_SESSION[\"ls_gestor\"])\r\n\t {\r\n\t\t\tcase \"MYSQL\":\r\n \t\t\t $ls_sql=\"CREATE TABLE tepuy_unidad_tributaria ( \".\r\n \" codunitri CHAR(4) NOT NULL, \".\r\n \" \t\t\t anno CHAR(4) NOT NULL, \".\r\n \" fecentvig DATE NOT NULL, \".\r\n \" gacofi CHAR(10) NOT NULL, \".\r\n \" fecpubgac DATE NOT NULL, \".\r\n \" decnro CHAR(10) NOT NULL, \".\r\n \" fecdec DATE NOT NULL, \".\r\n \" valunitri DOUBLE(19,4) NOT NULL, \".\r\n \" PRIMARY KEY (codunitri) \".\r\n \" ) ENGINE = InnoDB CHARACTER SET utf8;\";\r\n\t\t\t break;\r\n\t\t\t \r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t $ls_sql=\"CREATE TABLE tepuy_unidad_tributaria ( \".\r\n\t\t\t\t\t\t\" codunitri char(4) not null, \".\r\n\t\t\t\t\t\t\" \t\t anno char(4) not null, \".\r\n\t\t\t\t\t\t\" \t\t fecentvig date not null, \".\r\n\t\t\t\t\t\t\" \t\t gacofi char(10) not null, \".\r\n\t\t\t\t\t\t\" \t\t fecpubgac date not null, \".\r\n\t\t\t\t\t\t\" \t decnro char(10) not null, \".\r\n\t\t\t\t\t\t\" \t\t fecdec date not null, \".\r\n\t\t\t\t\t\t\" \t\t valunitri decimal(19,4) not null, \".\r\n\t\t\t\t\t\t\" \t\t constraint pk_tepuy_unidad_tributaria primary key (codunitri) \".\r\n\t\t\t\t\t\t\" )WITHOUT OIDS;\";\r\n\t\t\t break;\r\n\t\t}\t\r\n\t\t$li_row=$this->io_sql->execute($ls_sql);\r\n\t\tif($li_row===false)\r\n\t\t{ \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 3.54\");\r\n\t\t\t $lb_valido=false;\r\n\t\t}\r\n\t return $lb_valido;\t\r\n\t}", "function CreateDocument($conn, $DATA)\n{\n $boolean = false;\n $count = 0;\n $hotpCode = $DATA[\"hotpCode\"];\n $deptCode = $DATA[\"deptCode\"];\n $userid = $DATA[\"userid\"];\n\n\n //\t $Sql = \"INSERT INTO log ( log ) VALUES ('userid : $userid')\";\n // mysqli_query($conn,$Sql);\n\n $Sql = \"SELECT CONCAT('DW',lpad('$hotpCode', 3, 0),'/',SUBSTRING(YEAR(DATE(NOW())),3,4),LPAD(MONTH(DATE(NOW())),2,0),'-',\n LPAD( (COALESCE(MAX(CONVERT(SUBSTRING(DocNo,12,5),UNSIGNED INTEGER)),0)+1) ,5,0)) AS DocNo,DATE(NOW()) AS DocDate,\n CURRENT_TIME() AS RecNow\n FROM draw\n INNER JOIN department on draw.DepCode = department.DepCode\n WHERE DocNo Like CONCAT('DW',lpad('$hotpCode', 3, 0),'/',SUBSTRING(YEAR(DATE(NOW())),3,4),LPAD(MONTH(DATE(NOW())),2,0),'%')\n AND department.HptCode = '$hotpCode'\n ORDER BY DocNo DESC LIMIT 1\";\n\n $meQuery = mysqli_query($conn, $Sql);\n while ($Result = mysqli_fetch_assoc($meQuery)) {\n $DocNo = $Result['DocNo'];\n $return[0]['DocNo'] = $Result['DocNo'];\n $return[0]['DocDate'] = $Result['DocDate'];\n $return[0]['RecNow'] = $Result['RecNow'];\n $count = 1;\n }\n\n if ($count == 1) {\n $Sql = \"INSERT INTO draw\n ( DocNo,DocDate,DepCode,RefDocNo,\n TaxNo,TaxDate,DiscountPercent,DiscountBath,\n Total,IsCancel,Detail,\n draw.Modify_Code,draw.Modify_Date )\n VALUES\n ( '$DocNo',DATE(NOW()),$deptCode,'',\n 0,DATE(NOW()),0,0,\n 0,0,'',\n $userid,NOW() )\";\n mysqli_query($conn, $Sql);\n\n $Sql = \"INSERT INTO daily_request\n (DocNo,DocDate,DepCode,RefDocNo,Detail,Modify_Code,Modify_Date)\n VALUES\n ('$DocNo',DATE(NOW()),$deptCode,'','Shelf Count',$userid,DATE(NOW()))\";\n mysqli_query($conn, $Sql);\n\n $Sql = \"SELECT users.FName\n FROM users\n WHERE users.ID = $userid\";\n $meQuery = mysqli_query($conn, $Sql);\n while ($Result = mysqli_fetch_assoc($meQuery)) {\n $DocNo = $Result['DocNo'];\n $return[0]['Record'] = $Result['FName'];\n }\n\n $boolean = true;\n } else {\n $boolean = false;\n }\n\n if ($boolean) {\n $return['status'] = \"success\";\n $return['form'] = \"CreateDocument\";\n echo json_encode($return);\n mysqli_close($conn);\n die;\n } else {\n $return['status'] = \"failed\";\n $return['form'] = \"CreateDocument\";\n $return['msg'] = 'cantcreate';\n echo json_encode($return);\n mysqli_close($conn);\n die;\n }\n }", "public function addBook($what = NULL, $how = 'type', $num = 1)\n {\n $whereSQL = \" WHERE \" . $how . \" = '\" . $what . \"'\";\n if ($num == 1) {\n $sql = 'SELECT * FROM wd_books' . $whereSQL . ' LIMIT 1;';\n } else {\n $sql = 'SELECT * FROM wd_books' . $whereSQL . ' ORDER BY RAND() LIMIT ' . $num . ';';\n }\n $query = $this->CI->db->query($sql);\n $out = '';\n if ($query->num_rows() < 1) {\n return $out;\n }\n foreach ($query->result() as $row)\n {\n $title = $row->title;\n $author = $row->author;\n $id = $row->id;\n $banner = $row->banner;\n $out .= '<div class=\"row well rounded-2x shadow-effect-1\"><div class=\"col-lg-12 col-md-12\">' . \"\\n\";\n $out .= '<div class=\"pull-left margin-right-5\">' . \"\\n\";\n $out .= '<a href=\"http://www.fishpond.com.au/product_info.php?ref=2802&id=';\n $out .= $id;\n $out .= '&affiliate_banner_id=1\" target=\"_blank\"><img class=\"pull-left margin-right-5 box-shadow shadow-effect-1 img-thumbnail rounded-2x\" src=\"http://www.fishpond.com.au/affiliate_show_banner.php?ref=2802&affiliate_pbanner_id=';\n $out .= $banner;\n $out .= '\" alt=\"';\n $out .= $title;\n $out .= '\" title=\"';\n $out .= $title;\n $out .= '\" /></a>' . \"\\n\";\n $out .= '</div>' . \"\\n\";\n $out .= '<p><strong>';\n $out .= $title;\n $out .= '</strong></p>' . \"\\n\";\n $out .= '<p>by ' . $author . '</p>' . \"\\n\";\n $out .= '<p>Buy the book <a href=\"http://www.fishpond.com.au/product_info.php?ref=2802&id=';\n $out .= $id;\n $out .= '&affiliate_banner_id=1\" target=\"_blank\">';\n $out .= $title;\n $out .= '</a> on Fishpond.</p>' . \"\\n\";\n $out .= '</div>' . \"\\n</div>\\n\";\n }\n return $out;\n }", "public function obtenerID();", "function obtener_distribucion($iddoc)\n{\n return '*';\n}", "public static function create()\n {\n if (!isset($_SESSION['logged_in'])) {\n header(\"Location: http://localhost:8000/login\");\n exit();\n }\n\n\n $mySql = new Database();\n $mySql->connect();\n $query = \"SELECT * FROM authors\";\n //result is used in view\n $result = $mySql->myConn->query($query);\n\n require_once(\"./Views/Author/authors.php\");\n $mySql->close();\n }", "public function create ()\n {\n $query = \"INSERT INTO \" . $this->table_name .\" \". \" SET\n book_id=:book_id, type_id=:type_id, name=:name, isbn=:isbn, publisher=:publisher,author=:author,price=:price\";\n $stmt = $this->conn->prepare($query);\n\n\n $this->book_id=htmlspecialchars(strip_tags($this->book_id));\n $this->type_id=htmlspecialchars(strip_tags($this->type_id));\n $this->name=htmlspecialchars(strip_tags($this->name));\n $this->isbn=htmlspecialchars(strip_tags($this->isbn));\n $this->publisher=htmlspecialchars(strip_tags($this->publisher));\n $this->author=htmlspecialchars(strip_tags($this->author));\n $this->price=htmlspecialchars(strip_tags($this->price));\n\n\n\n $stmt->bindParam(\":book_id\", $this->book_id);\n $stmt->bindParam(\":type_id\", $this->type_id);\n $stmt->bindParam(\":name\", $this->name);\n $stmt->bindParam(\":isbn\", $this->isbn);\n $stmt->bindParam(\":publisher\", $this->publisher);\n $stmt->bindParam(\":author\", $this->author);\n $stmt->bindParam(\":price\",$this->price);\n\n if($stmt->execute()){\n return true;\n }else{\n return false;\n }\n }", "function setupDb(&$mdb2)\n{\n // loading the Manager module\n $mdb2->loadModule('Manager');\n $tableDefinition = array (\n 'id' => array (\n 'type' => 'integer',\n 'unsigned' => 1,\n 'notnull' => 1,\n 'default' => 0,\n ),\n 'name' => array (\n 'type' => 'text',\n 'length' => 300,\n 'notnull' => 1\n ),\n 'type' => array (\n 'type' => 'text',\n 'length' => 300,\n 'notnull' => 1\n ),\n 'lifespan' => array (\n 'type' => 'integer',\n 'unsigned' => 1,\n 'notnull' => 1,\n 'default' => 0,\n ),\n );\n \n $tableConstraints = array (\n 'primary' => true,\n 'fields' => array (\n 'id' => array()\n )\n );\n $mdb2->dropTable('tbl_animals');\n $mdb2->createTable('tbl_animals', $tableDefinition);\n $mdb2->createConstraint('tbl_animals', 'primary_key', $tableConstraints);\n $mdb2->createSequence('primary_key');\n \n}", "function payment_create($con, $data, $params, $types, $table_name, $primary_key, $foreign_key) {\n\n /* Checking if the data and params are matching */\n $combined_param = '';\n $comma = ',';\n $combined_param = check_attributes($data, $params, $types, $comma, $primary_key, $foreign_key, 0);\n if($combined_param != '') {\n /* If the parameter is found, then combined param will not be empty and filled with data types and variable names */\n /* create table query */\n $create_query = \"CREATE TABLE IF NOT EXISTS \".$table_name. ' ('.$combined_param.' )';\n if($con->query($create_query)) {\n /* Creating the Payment Main table */\n return 1;\n } else {\n return 0;\n }\n } else {\n /* returning false when the attributes count doesn't match */\n return 0;\n }\n}", "function gen_prescriptions($PID) {\n\n $conn = sql_connect();\n\n $sql_pres = mysqli_query($conn, \"SELECT * FROM Prescriptions WHERE Patient='$PID';\");\n\n if (mysqli_num_rows($sql_pres)==0) {\n echo \"No prescriptions<br>\";\n return;\n }\n\n echo \"<table><tr><th> Drug </th>\";\n echo \"<th> Dosage </th>\";\n echo \"<th> Refill </th>\";\n echo \"<th> Expiration Date </th>\";\n echo \"<th> Expired? </th>\";\n echo \"<th> Prescribing Doctor </th></tr>\";\n\n while($pres = mysqli_fetch_assoc($sql_pres)) {\n\n echo \"<tr><td align='center'>\".$pres['Prescript_Name'].\"</td>\";\n echo \"<td align='center'>\".$pres['Dosage'].\"</td>\";\n echo \"<td align='center'>\".$pres['Refill'].\"</td>\";\n echo \"<td align='center'>\".$pres['Expiration_date'].\"</td>\";\n\n $current_time = date(\"Y-m-d H:i:s\");\n\n if($current_time > $pres['Expiration_date']) {\n echo \"<td align='center'> Yes </td>\";\n } else {\n echo \"<td align='center'> No </td>\";\n }\n\n $sql_doc = mysqli_query($conn, \"SELECT * FROM Doctors WHERE NPI='$pres[Prescribing_doc]';\");\n $doc = mysqli_fetch_assoc($sql_doc);\n\n echo \"<td align='center'>\".$doc['Name'].\"</td></tr>\";\n\n }\n\n echo \"</table>\";\n\n }", "function insert() {\n\t\tglobal $db_table_recipes, $DB_LINK, $g_rb_recipe_id_seq, $LangUI;\n\t\t// do the Insert\n\t\t$sql = \"INSERT INTO $db_table_recipes\n\t\t\t\t\t\t(recipe_name,\n\t\t\t\t\t\t recipe_ethnic,\n\t\t\t\t\t\t recipe_base,\n\t\t\t\t\t\t recipe_course,\n\t\t\t\t\t\t recipe_prep_time,\n\t\t\t\t\t\t recipe_difficulty,\n\t\t\t\t\t\t recipe_directions,\n\t\t\t\t\t\t recipe_comments,\n\t\t\t\t\t\t recipe_serving_size,\n\t\t\t\t\t\t recipe_source,\n\t\t\t\t\t\t recipe_source_desc,\n\t\t\t\t\t\t recipe_modified,\n\t\t\t\t\t\t recipe_system,\n\t\t\t\t\t\t recipe_private,\n\t\t\t\t\t\t recipe_user)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t('\".$DB_LINK->addq($this->name, get_magic_quotes_gpc()).\"',\n\t\t\t\t\t\t \".$DB_LINK->addq($this->ethnic, get_magic_quotes_gpc()).\",\n\t\t\t\t\t\t \".$DB_LINK->addq($this->base, get_magic_quotes_gpc()).\",\n\t\t\t\t\t\t \".$DB_LINK->addq($this->course, get_magic_quotes_gpc()).\",\n\t\t\t\t\t\t \".$DB_LINK->addq($this->prep_time, get_magic_quotes_gpc()).\",\n\t\t\t\t\t\t \".$DB_LINK->addq($this->difficulty, get_magic_quotes_gpc()).\",\n\t\t\t\t\t\t '\".$DB_LINK->addq($this->directions, get_magic_quotes_gpc()).\"',\n\t\t\t\t\t\t '\".$DB_LINK->addq($this->comments, get_magic_quotes_gpc()).\"',\n\t\t\t\t\t\t \".$DB_LINK->addq($this->serving_size, get_magic_quotes_gpc()).\",\n\t\t\t\t\t\t \".$DB_LINK->addq($this->source, get_magic_quotes_gpc()).\",\n\t\t\t\t\t\t '\".$DB_LINK->addq($this->source_desc, get_magic_quotes_gpc()).\"',\n\t\t\t\t\t\t $this->modified,\n\t\t\t\t\t\t '\".$DB_LINK->addq($this->unitSystem, get_magic_quotes_gpc()).\"',\n\t\t\t\t\t\t '\".$DB_LINK->addq($this->private, get_magic_quotes_gpc()).\"',\n\t\t\t\t\t\t '\".$DB_LINK->addq($this->user, get_magic_quotes_gpc()).\"')\";\n\t\t$rc = $DB_LINK->Execute($sql);\n\t\tDBUtils::checkResult($rc, $LangUI->_('Recipe Successfully created') . \": \". $this->name,\n\t\t\t$LangUI->_('There was an error inserting the recipe'), $sql);\n\t\t// retrieve incremented sequence value\n\t\t$this->id = DBUtils::getSequenceValue($g_rb_recipe_id_seq);\n\t\treturn $this->id;\n\t}", "public function addDBData()\n {\n\n if ( Title::newFromText( 'Checklist', NS_TEMPLATE )->exists() ) {\n return;\n }\n\n $title = Title::newFromText( \"Checklist\", NS_TEMPLATE );\n\n $user = User::newFromName( 'UTSysop' );\n $comment = __METHOD__ . ': Sample page for unit test.';\n\n $page = WikiPage::factory( $title );\n $page->doEditContent( ContentHandler::makeContent(\n \" [[Category:Checklist]]\"\n , $title ), $comment, 0, false, $user );\n\n $result = $this->insertPage( \"UTChecklist\", \"{{Checklist||Checklist name=UTChecklist||Checklist items=* Test item 1}}\" );\n\n self::$_checklistId = $result['id'];\n\n }", "protected function createDonationContentEntry()\n {\n $this->donation_content = new DonationContent;\n \n $this->donation_content->set('donation_id', $this->donation->get('id'));\n $this->donation_content->set('donation_per_hole', 0);\n $this->donation_content->set('donation_flat_amount', $this->data['amount'] );\n $this->donation_content->set('sponsored_holes', $this->fundraiser_profile->get('goal_holes'));\n \n $this->donation_content->create();\n }", "function AddSingleBook()\n {\n $id_libro = $_POST[\"id_libro\"];\n $cart = new Carrello;\n $cart->InsertNewCart($id_libro);\n $book = new Libri;\n $libro = $book->GetBook($id_libro);\n return $libro[\"titolo\"].\"$$$\".$libro[\"autore\"].\"$$$\".$libro[\"prezzo\"].\"$$$\".$libro[\"path_copertina\"];\n }", "abstract function getPrimaryKey();", "public function getDataWithTypeDb() {}", "static function get_dbase($dbname){\n //\n //Test if there are databases already created so as to check if the requested \n //database is among them \n if(\\count(sql::$dbase)>0){\n //\n //Check if we have a ready dbase\n foreach (sql::$dbase as $key=>$value){\n //\n //\n if ($dbname===$key){\n //\n //We do, return it. \n return sql::$dbase[$dbname];\n }\n } \n }\n //\n //\n //create the database from first principle ie from the information schema \n sql::$dbase[$dbname] = new \\database($dbname);\n //\n //popilate the database with the entites\n sql::$dbase[$dbname]->export_structure();\n //\n //Set the dbase\n return sql::$dbase[$dbname];\n }", "function view_donation() \n{\n // $con=mysqli_connect(\"localhost\",\"ccmtAdmin\",\"#us6sTek\",\"data_gcmw\");\n // if (mysqli_connect_errno())\n // {\n // echo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n // }\n // else\n // {\n faq_load_css();\n echo \"<form action='.' method='post'>\";\n echo \"<input class='itin' name='donation-download' type='submit' value='Download Donation' style='background-color:white;border:none;color:#000;font-size:15px;cursor:pointer;'>\";\n echo \"</form>\";\n echo \"<form action='.' method='post'>\";\n echo \"<input class='itin' name='balvihar-download' type='submit' value='Download Balvihar Subscription' style='background-color:white;border:none;color:#000;font-size:15px;cursor:pointer;'>\";\n echo \"</form>\";\n echo \"<h2>Donation By Credit Card</h2>\";\n \n global $wpdb;\n $result = $wpdb->get_results(\"SELECT * FROM wp_donation WHERE payment_method = 'Credit Card'\");\n //$result = mysqli_query($con,\"SELECT * FROM `wp_donation` WHERE `payment_method` = 'Credit Card'\");\n echo \"<div style='width:1209px;max-height:800px;overflow-x: auto;overflow-y:auto;'>\";\n echo \"<table class='loc-table'style='empty-cells:show;'>\";\n echo \"<th>ID</th>\";\n echo \"<th>Date & Time</th>\";\n echo \"<th>Name</th>\";\n echo \"<th>Email</th>\";\n echo \"<th>Pancard No.</th>\";\n echo \"<th>Contact</th>\";\n echo \"<th>Address</th>\";\n echo \"<th>Total Amount</th>\";\n echo \"<th>Payement Method</th>\";\n echo \"<th>Status</th>\";\n echo \"<th>Transaction Id</th>\";\n echo \"<th>Receipt No.</th>\";\n echo \"<th>Bank AUthorisation Id</th>\";\n echo \"<th>Batch No.</th>\";\n \n // while($row = mysqli_fetch_array($result)) \n while($row =$result)\n {\n $id = $row['id'];\n $date = $row['date'];\n $time = $row['time'];\n $fname = $row['first_name'];\n $lname = $row['last_name'];\n $email = $row['email'];\n $pan_num = $row['pan_num'];\n $contact = $row['contact'];\n $place = $row['address1'];\n $address = $row['address2'];\n $city = $row['city'];\n $state = $row['state'];\n $country = $row['country'];\n $total_amount = $row['total_amount'];\n // $order = $row['order_id'];\n $payment_method = $row['payment_method'];\n // $bank = $row['bank'];\n // $account_no = $row['account_no'];\n // $cheque_number = $row['cheque_number'];\n // $name_on_cheque = $row['name_on_cheque'];\n // $name_of_donor = $row['name_of_donor'];\n // $originating_account = $row['originating_account'];\n $status = $row['status'];\n $transaction_id = $row['transaction_id'];\n $receipt_no = $row['receipt_no'];\n $bank_authorization_id = $row['bank_authorization_id'];\n $batch_no = $row['batch_no'];\n // $project = $row['project_name'];\n // $order = $row['order_id'];\n // $amount = $row['amount'];\n echo \"<tr value='$id'>\";\n echo \"<td>\" . $id. \"</td>\";\n echo \"<td>\" . $date.\"-\".$time. \"</td>\";\n echo \"<td>\" . $fname.\" \". $lname.\"</td>\";\n echo \"<td>\" . $email. \"</td>\";\n echo \"<td>\" . $pan_num. \"</td>\";\n echo \"<td>\" . $contact. \"</td>\";\n echo \"<td>\" . $place.\",\".$address.\",\".$city.\",\".$state.\",\".$country.\"</td>\";\n echo \"<td>\" . $total_amount. \"</td>\";\n echo \"<td>\" . $payment_method. \"</td>\";\n echo \"<td>\" . $status. \"</td>\";\n echo \"<td>\" . $transaction_id. \"</td>\";\n echo \"<td>\" . $receipt_no. \"</td>\";\n echo \"<td>\" . $bank_authorization_id. \"</td>\";\n echo \"<td>\" . $batch_no. \"</td>\";\n echo \"<td><input type='button' name='reply' id='$id' class='reply_contact' value='Reply'></td>\";\n echo \"<td><input type='button' name='detail' id='$id' class='detail_contact' value='Detail'></td>\";\n echo \"<div class='plugin_box plugin_box-$id'> <!-- OUR content_box DIV-->\";\n echo \"<h1 style='font-weight:bold;text-align:center;font-size:30px;'></h1>\";\n echo \"<a class='pluginBoxClose'>Close</a>\";\n echo \"<div class='projectcontent'>\";\n echo \"<div class='select-style'>\n <form method='post' action='.'>\n From: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' name='from'><br/>\n To: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' value='$email' name='to' readonly><br/>\n Subject:&nbsp;&nbsp;<input type='text' name='subject'><br/>\n <p><span style='vertical-align:top;'>Message:</span><textarea rows='5' cols='30' name='message' ></textarea></p>\n <div style='width:520px;margin-left:200px;'><input type='submit' name='submit' value='Send'></div>\n </form>\n </div>\";\n echo \"</div>\";\n echo \"</div><!-- content_box -->\";\n echo \"<div class='detail_box detail_box-$id'> <!-- OUR content_box DIV-->\";\n echo \"<h2 style='font-weight:bold;text-align:center;font-size:30px;'>Donation Detail #\".$id.\"</h2>\";\n echo \"<a class='detailBoxClose'>Close</a>\";\n echo \"<div class='projectcontent'>\";\n echo \"Name:\".$fname.\" \".$lname.\"</br>\";\n echo \"Transaction Id:\".$transaction_id.\"</br>\";\n\n $detailresult = $wpdb->get_results(\"SELECT * FROM wp_donation_project WHERE transaction_id = '$transaction_id'\");\n //$detailresult = mysqli_query($con,\"SELECT * FROM `wp_donation_project` WHERE transaction_id = '$transaction_id'\");\n \n while($detailrow = mysqli_fetch_array($detailresult)) \n {\n $id = $detailrow['id'];\n // $pcategory_id = $row['category_id'];\n $pcategory_name = $detailrow['category_name'];\n // $pproject_id = $row['project_id'];\n $pproject_name = $detailrow['project_name'];\n $porder_id = $detailrow['order_id'];\n $ptransaction_id = $detailrow['transaction_id'];\n $pamount = $detailrow['amount']; \n echo $id.\" \".$pcategory_name.\" \".$pproject_name.\" \".$porder_id.\" \".$ptransaction_id.\" \".$pamount.\"</br>\";\n }\n echo \"</div>\";\n echo \"</div><!-- content_box -->\";\n echo \"</form>\";\n echo \"</tr>\";\n }\n echo \"</table>\";\n echo \"</div>\";\n faq_load_js();\n // } \n}", "function _GetDB($Cod=-1,$Campo='id_noticia'){\n\t\t// Cargo campos\n\t\t$this->Registro[$Campo] = $Cod;\n\t\t$this->TablaDB->getRegistro($this->Registro, $Campo);\n\t}", "public static function add_field_for_donation_table() {\n // echo \"Donation Table\";\n $newwp_list_donation_table = new FP_List_Table_DonationTable();\n $newwp_list_donation_table->prepare_items();\n $newwp_list_donation_table->display();\n }", "function MetaDatabases() {}", "function panier2bdd() {\n\t// if (!empty($_SESSION['dims']['userid']) && !empty($_SESSION['catalogue']['panier'])) {\n\tif (!empty($_SESSION['dims']['userid'])) {\n\t\tinclude_once DIMS_APP_PATH.'/modules/catalogue/include/class_panier.php';\n\t\t$panier = new cata_panier();\n\t\t$panier->open($_SESSION['dims']['userid']);\n\t\t$panier->articles = array();\n\n\t\t$panier->fields['libelle'] = '';\n\t\t$panier->fields['id_user'] = $_SESSION['dims']['userid'];\n\t\t$panier->fields['id_module'] = $_SESSION['dims']['moduleid'];\n\n\t\tif (isset($_SESSION['catalogue']['panier'])) {\n\t\t\tforeach ($_SESSION['catalogue']['panier']['articles'] as $ref => $values) {\n\t\t\t\t$panier->articles[] = array(\n\t\t\t\t\t'ref' \t\t\t=> $ref,\n\t\t\t\t\t'qte' \t\t\t=> $values['qte'],\n\t\t\t\t\t'forced_price' \t=> (isset($values['forced_price']) ? $values['forced_price'] : 'NULL')\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$panier->save();\n\t}\n}", "function copy_shared_content_type_to_dbs() {\n //drupal_set_message('<pre>$$databases:'. print_r($databases['default']['default']['database'], TRUE) .'</pre>');\n\n /* shared field - id range\n *\n * in 'field_config' and 'field_config_instance' table\n *\n * 1000 ~ 1999 : profile\n * 2000 ~ 2999 : projects and publications\n * 3000 ~ 3999 : news/events\n * 1,000,000 : local fields in each sites. !!!!!!!!!\n */\n\n \n global $databases;\n global $des_db;\t// actually this is a server name.\n \n // copying records to other database\n global $des_table;\n global $primarykey;\n\n $source_db_name=$databases['default']['default']['database']; //current db.\n\n if (stristr($source_db_name, \"profiles\")) { \n $target_db_names=array_filter(preg_split(\"/\\n\\r|\\n|\\r/\", variable_get(\"projects_pubs_copy_to_db_name\",\"\"))); // get target db list from new&events db variable table.\n $id_min=2000;\n $id_max=2999;\n } else if (stristr($source_db_name, \"newsevents\")) { \n $target_db_names=array_filter(preg_split(\"/\\n\\r|\\n|\\r/\", variable_get(\"news_events_copy_to_db_name\",\"\"))); // get target db list from new&events db variable table.\n $id_min=3000;\n $id_max=3999;\n \n } else {\n form_set_error('', t('This content type must be managed in main site. i.e. in \\'Profiles\\' or \\'News & Events\\' site.'));\n return;\n }\n\n $arr_content_types=array_filter(preg_split(\"/\\n\\r|\\n|\\r/\", variable_get(\"shared_content_types\")));\n $table_list=array(); \n foreach ($arr_content_types as $type_name) {\n $type_name=trim($type_name); \n $table_list[]=\"'{$type_name}'\";\n }\n \n if (empty($target_db_names) || empty($table_list)) { \n form_set_error('', t('Target database/content type is not set.'));\n return;\n }\n\n \n foreach ($target_db_names as $target_db_name) {\n $content_type_list=implode(', ', $table_list);\n \n // field_config\n // A-1. Delete fields if id is in reserved range\n $sql = \"DELETE FROM {$target_db_name}.'field_config'\n \t\t\t\t\tWHERE (id >= {$id_min} AND id <= {$id_max}) \n \t\t\t\t\t\tAND id IN (\n \tSELECT field_id \n \tFROM field_config_instance\n \tWHERE bundle IN ({$content_type_list}) AND deleted=0\n )\"; \n $result = mysql_query($sql, $des_db);\n \n // A-2. Copy to target db from source db.\n $primarykey= \"id\";\n $src_table = \"{$source_db_name}.field_config\";\n $des_table = \"{$target_db_name}.field_config\";\n $sql = \"SELECT\n \t\t\t\t\t\t(select @rownum1:=@rownum1+1 rownum1 FROM (SELECT @rownum1:={$id_min}-1) r) as id,\t\n \t\t\t\t\t\tfield_name,\t\n \t\t\t\t\t\ttype,\t\n \t\t\t\t\t\tmodule,\t\n \t\t\t\t\t\tactive,\t\n \t\t\t\t\t\tstorage_type,\n \t\t\t\t\t\tstorage_module,\t\n \t\t\t\t\t\tstorage_active,\t\n \t\t\t\t\t\tlocked,\t\n \t\t\t\t\t\tdata,\t\n \t\t\t\t\t\tcardinality,\t\n \t\t\t\t\t\ttranslatable,\t\n \t\t\t\t\t\tdeleted \n \t\t\t\t\tFROM {$src_table}\n \t\t WHERE \n \t\t deleted=0 AND\n \t\t id IN (\n \t \tSELECT field_id \n \t \tFROM {$src_table}_instance\n \t \tWHERE bundle IN ({$content_type_list}) \n \t )\";\n $result = mysql_query($sql, $des_db);\n execute($result);\n \n // A-3. For all local field should start from 1,000,000\n $query = mysql_query(\"SELECT MAX(id) AS id FROM {$des_table}\", $des_db);\n $row = mysql_fetch_array($query);\n if ($row['id'] < 1000000) {\n $query = mysql_query(\"ALTER TABLE {$des_table} AUTO_INCREMENT = 1000000 \", $des_db);\n }\n \n \n // A-4. update field list for shared_tables.php\n $result = mysql_query(\"SELECT field_name FROM {$target_db_name}.field_config \n \t\t\t\t\t\t\t\t\t\t\t\tWHERE \n \t\t\t\t\t\t\t\t\t\t\t\t\tid>={$id_min} \n \t\t\t\t\t\t\t\t\t\t\t\t\tAND id <= {$id_max}\n \t\t\t\t\t\t\t\t\t\t\t\t\tAND deleted=0\n \t\t\t\t\t\t\t\t\t\t\t\", $des_db);\n /*\n drupal_set_message('<pre>'. print_r(\"SELECT field_name FROM {$target_db_name}.field_config \n \t\t\t\t\t\t\t\t\t\t\t\tWHERE \n \t\t\t\t\t\t\t\t\t\t\t\t\tid>={$id_min} \n \t\t\t\t\t\t\t\t\t\t\t\t\tAND id <= {$id_max}\n \t\t\t\t\t\t\t\t\t\t\t\t\tAND deleted=0\n \t\t\t\t\t\t\t\t\t\t\t\", TRUE) .'</pre>');\n */\n $field_list=array(); \n while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { \n $field_list[]=$row[\"field_name\"];\n //drupal_set_message('<pre>'. print_r($row[\"field_name\"], TRUE) .'</pre>');\n }\n \n _update_shared_fields($source_db_name, $field_list);\n \n // field_config_instance\n // B-1. Delete fields in target db if id is in reserved range \n $sql = \"DELETE FROM {$target_db_name}.field_config_instance\n \t\t\t\t\tWHERE (id>={$id_min} AND id <= {$id_max}) AND NOT bundle IN ({$content_type_list})\";\n $result = mysql_query($sql, $des_db);\n \n // B-2. Copy to target db from source db.\n // !! copy all fields only if the record is not in target table in order to have flexibility in each site.\n // !! 'data' field includes field details - weight, title, widget info etc.\n $primarykey= \"id\";\n $src_table = \"{$source_db_name}.field_config_instance\";\n $des_table = \"{$target_db_name}.field_config_instance\";\n \n // B-2-1. copy all fields except 'data' field which include field instance details.\n $sql = \"SELECT\n \t\t\t\t\t\t(SELECT @rownum1:=@rownum1+1 rownum1 FROM (SELECT @rownum1:={$id_min}-1) r) as id,\n \t\t\t\t\t\t(SELECT id FROM {$target_db_name}.field_config \n \t\t\t\t\t\t\tWHERE field_config.field_name=field_config_instance.field_name LIMIT 1 \n \t\t\t\t\t\t) as field_id, \n \t\t\t\t\t\tfield_name, \n \t\t\t\t\t\tentity_type, \n \t\t\t\t\t\tbundle,\n \t\t\t\t\t\tIFNULL(\n \t\t\t\t\t\t\t(\n \t\t\t\t\t\t\t\tSELECT data FROM {$des_table} \n \t\t\t\t\t\t\t\tWHERE field_name={$src_table}.field_name LIMIT 1\n \t\t\t\t\t\t\t),data\n \t\t\t\t\t\t) as data,\n \t\t\t\t\t\tdeleted \n \t\t\t\tFROM {$src_table}\n \t\t\t\t\tWHERE entity_type='node' AND (bundle IN ({$content_type_list})) AND deleted=0\";\n $result = mysql_query($sql, $des_db);\n \n execute($result);\n \n \n // B-3. For all local field should start from 1,000,000\n $query = mysql_query(\"SELECT MAX(id) AS id FROM {$des_table}\", $des_db);\n $row = mysql_fetch_array($query);\n if ($row['id'] < 1000000) {\n $query = mysql_query(\"ALTER TABLE {$des_table} AUTO_INCREMENT = 1000000 \", $des_db);\n }\n \n // C. copy node_type record\n $primarykey = \"type\"; \n $src_table = \"{$source_db_name}.node_type\";\n $des_table = \"{$target_db_name}.node_type\";\n $sql = \"SELECT *\n \t\t\t\tFROM {$src_table}\n \t\t\t\t\tWHERE {$primarykey} IN ({$content_type_list})\"; \n // print $sql . \"\\n\";\n $result = mysql_query($sql, $des_db);\n execute($result);\n \n // D. copy comment related variables\n $primarykey = \"name\";\n $src_table = \"{$source_db_name}.variable\";\n $des_table = \"{$target_db_name}.variable\";\n \n $arr_content_types=array_filter(preg_split(\"/\\n\\r|\\n|\\r/\", variable_get(\"shared_content_types\")));\n foreach ($arr_content_types as $value) {\n $type_name=trim($value); \n \n $sql = \"SELECT *\n \t\t\t\tFROM {$src_table}\n \t\t\t\t\tWHERE {$primarykey} LIKE '%\" . $type_name . \"%' AND {$primarykey} LIKE 'comment_%' \n \t\t\t\t \"; \n //drupal_set_message('<pre>sql:'. print_r($sql, TRUE) .'</pre>'); \n $result = mysql_query($sql, $des_db);\n execute($result); \n }\n\n }\n}", "function booklinkp($author,$isbn,$title=\"\",$pubyear=\"\",$adddate=\"\",$float=\"left\",$type=\"t\",$size=\"s\",$top=\"0\",$bordersize=\"0\",$bordercolor=\"000000\")\n {\n $type=strtolower($type);\n if ($float==\"l\") $float=\"left\";\n if ($float==\"r\") $float=\"right\";\n if (($float==\"left\")) $marg=\"right\"; else $marg=\"left\";\n\t$title=stripcslashes($title);\n\t$title=strtolower($title);\n\t$title=nomorexs($title);\n\t$author=nomorexs($author);\n\t$title=ucwords($title);\t\n\t$temptitle =explode(\":\",$title);\n\t$author=stripcslashes($author);\n $titleplus= str_replace(' ','+',$temptitle[0]);\n\t$titleplus= str_replace('&+','',$titleplus);\n $authorplus= str_replace(' ','+',$author);\n\t$authorplus= str_replace('&+','',$authorplus);\n if ($type==\"t\") { $type=\"TI%5ETITLE\"; $keywordsplus= $titleplus; }\n elseif ($type==\"a\") { $type=\"AU%5EAUTHOR\"; $keywordsplus= $authorplus; }\n elseif ($type==\"i\") { $type=\"ISBN\"; $keywordsplus= $isbn;}\n\t\n\t\t\t\t$adyear= (int) substr($adddate,2,2);\n\t\t\t\t$admonth= (int) substr($adddate,4,2);\n\t\t\t\t$adday= (int) substr($adddate,6,2);\n\t\t\t\t$adddate = $admonth.\"/\".$adday.\"/\".$adyear;\n $datedata =\" &copy; \".$pubyear.\" (Added: \".$adddate.\")\";\n // \"&amp;pubyear=\".$pubyear.\n\techo \"<a href=\\\"http://cat.mfrl.org/uhtbin/cgisirsi.exe/0/CBURG/0/5?searchdata1=%22\".\n\t$keywordsplus.\"%22&amp;srchfield1=\".$type.\"&amp;searchoper1=AND&amp;searchdata2=%22\"\n\t.$authorplus.\"%22&amp;srchfield2=AU%5EAUTHOR\\\">\";\n\t$filename=\"images/isbn/\".$isbn.\"S.GIF\";\n\tif (file_exists($filename)) { echo \"<img src=\\\"/\".$filename.\"\\\"\";}\n\telse echo \"<img src=\\\"http://syndetics.com/index.aspx?isbn=\".$isbn.\"/\".$size.\"C.GIF\\\"\";\n\techo \" style=\\\"border:\".$bordersize.\"px solid #\".$bordercolor.\"; float:\".$float.\"; \".$yodaexception.\" margin-\".$marg.\":3px;\";\n\tif ($top!=\"0\") echo \" margin-top:\".$top.\"px;\";\n\tif ($title==\"\") {echo \"\\\" alt=\\\"\".$author.\"\\\" title=\\\"\".$author.\"\\\"></a>\";}\n\telse {echo \"\\\" alt=\\\"\".$title.\" by \".$author.$datedata.\"\\\" title=\\\"\".$title.\" by \".$author.$datedata.\"\\\"></a>\";}\n}", "public function run()\r\n {\r\n DonorType::create([\r\n 'name' => 'Супермаркет',\r\n 'description' => 'Супермаркет',\r\n ]);\r\n DonorType::create([\r\n 'name' => 'Кујна',\r\n 'description' => 'Народна кујна',\r\n ]);\r\n DonorType::create([\r\n 'name' => 'Бензинска пумпа',\r\n 'description' => '',\r\n ]);\r\n DonorType::create([\r\n 'name' => 'Маалска продавничка',\r\n 'description' => '',\r\n ]);\r\n DonorType::create([\r\n 'name' => 'Друго',\r\n 'description' => 'Останато',\r\n ]);\r\n }", "function handle_get($indata) {\n \n $this->is_new = 0; // necessary for an insert\n $this->is_find_form = 0; \n \n if( array_key_exists('find', $indata) ) {\n $this->is_find_form = 1;\n $this->title = 'Search';\n } elseif(array_key_exists('new', $indata)) {\n $this->is_new = '1';\n $this->id = $this->largestProductID + 1;\n \n $this->cancer_type = '';\n $this->synopsis = '';\n $this->overview = '';\n $this->primary_anatomical_site = '';\n $this->other_anatom_type_text = '';\n $this->primary_trt_program = '';\n } else {\n $this->id = $indata['id'];\n $db_table = $this->fetchRecordInfo('id', $this->id);\n \n $this->cancer_type = $db_table['cancer_type'];\n $this->synopsis = $db_table['synopsis'];\n $this->overview = $db_table['overview'];\n $this->primary_anatomical_site = $db_table['primary_anatomical_site'];\n $this->other_anatom_type_text = $db_table['other_anatom_type_text'];\n $this->primary_trt_program = $db_table['primary_trt_program'];\n \n $this->title = $this->cancer_type;\n }\n $this->primary_key_value = $this->id;\n }", "public function get_book();", "public function addBook()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$ISBN = $_POST['ISBN'];\n\t\t\t$title = $_POST['title'];\n\t\t\t$author = $_POST['author'];\n\t\t\t$press = $_POST['press'];\n\t\t\t$category = $_POST['category'];\n\t\t\t$pub_date = $_POST['pub_date'];\n\t\t\t$price = $_POST['price'];\n\t\t\t$floor = $_POST['floor'];\n\t\t\t$bookshelf = $_POST['bookshelf'];\n\t\t\t$area_code = $_POST['area_code'];\n\t\t\t$number = $_POST['number'];\n\t\t\t$book = D('Book_species');\n\t\t\t$sql1 = \"select count(*) as a from lib_book_unique\";\n\t\t\t$return23 = $book->query($sql1);\n\t\t\t$num = $return23[0]['a'];\n\t\t\t$newbookid = array();\n\t\t\tfor ($k = 1; $k <= $number; $k++) {\n\t\t\t\t$numnew = $k + $num;\n\t\t\t\t$temp_num = 100000;\n\t\t\t\t$new_num = $numnew + $temp_num;\n\t\t\t\tarray_push($newbookid, substr($new_num, 1, 5));\n\t\t\t}\n\t\t\t$sql2333 = \"select * from lib_book_species where isbn = '{$ISBN}';\";\n\t\t\t$return2333 = $book->query($sql2333);\n\t\t\t$sql = \"insert into lib_book_species(isbn,title,author,press,\n\t\t\t\t\tcategory,pub_date,price,floor,bookshelf,area_code) \n\t\t\t\t\tvalues('{$ISBN}','{$title}','{$author}',\n\t\t\t\t\t'{$press}','{$category}','{$pub_date}',\n\t\t\t\t\t'{$price}','{$floor}','{$bookshelf}','{$area_code}');\";\n\t\t\tif(!$return2333){\n\t\t\t\t$return = $book->execute($sql);\n\t\t\t}\n\t\t\t$return = true;\n\t\t\t$sql1 = \"insert into lib_book_unique(isbn) values('{$ISBN}');\";\n\t\t\tfor ($i = 0; $i < $number; $i++) {\n\t\t\t\t$return1 = $book->execute($sql1);\n\t\t\t\t$return = $return && $return1;\n\t\t\t}\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'msg' => 'Add successfully!',\n\t\t\t\t\t'newbookid' => json_encode($newbookid)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function getBibData($findno) {\r\r\n\t\treturn $this->dbHandle->sql_query(\"SELECT b.auth, b.title1, b.title2, b.year, b.picture, b.bibtype FROM rp_bib b, rp_findbib f WHERE f.findno=\".$findno.\" AND b.bibno=f.bibno ORDER BY b.year ASC;\");\r\r\n\t}" ]
[ "0.54284257", "0.5408602", "0.5388924", "0.53524673", "0.5341923", "0.524546", "0.522762", "0.5178627", "0.5108063", "0.51039094", "0.51026505", "0.5099203", "0.50718975", "0.5062826", "0.50535744", "0.5025577", "0.50252205", "0.5022597", "0.50024015", "0.4992005", "0.49910986", "0.49903566", "0.49788994", "0.49729607", "0.49595624", "0.49581364", "0.49400875", "0.49317113", "0.49306747", "0.49281588", "0.49188447", "0.49127063", "0.49103826", "0.4905666", "0.48994133", "0.48961905", "0.4887995", "0.48697627", "0.48613146", "0.48537016", "0.48528922", "0.48478857", "0.48470074", "0.48450792", "0.48446864", "0.4835651", "0.48295912", "0.48268035", "0.4826708", "0.48264113", "0.4825746", "0.48009312", "0.47986126", "0.47976974", "0.4788699", "0.4765172", "0.47584665", "0.47571105", "0.47557747", "0.47482824", "0.4736344", "0.47356424", "0.47302297", "0.4724384", "0.4718302", "0.4715875", "0.47150573", "0.47124827", "0.47111383", "0.47006032", "0.46998277", "0.46771294", "0.46755305", "0.46752638", "0.4674395", "0.46738237", "0.46697626", "0.46680877", "0.46676183", "0.46656045", "0.4665289", "0.466387", "0.46621868", "0.46559504", "0.46540934", "0.46480253", "0.4640434", "0.46375468", "0.46351892", "0.46321952", "0.4631494", "0.4627549", "0.46244624", "0.46240175", "0.4621833", "0.4621764", "0.46216223", "0.46165872", "0.46092838", "0.46086362", "0.46033418" ]
0.0
-1
Returns the static model of the specified AR class. Please note that you should have this exact method in all your CActiveRecord descendants!
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function model() {\n return parent::model(get_called_class());\n }", "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\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 {\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 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__) {\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__) {\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__) {\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__) {\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__) {\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__) {\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__) {\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 }" ]
[ "0.7574005", "0.7528819", "0.7270635", "0.7269363", "0.72611624", "0.7211197", "0.72105455", "0.7130912", "0.7127844", "0.7127844", "0.7101899", "0.7101899", "0.7101485", "0.70736724", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427", "0.70631427" ]
0.0
-1
Retrieves a list of models based on the current search/filter conditions. Typical usecase: Initialize the model fields with values from filter form. Execute this method to get CActiveDataProvider instance which will filter models according to data in model fields. Pass data provider to CGridView, CListView or any similar widget.
public function search() { // @todo Please modify the following code to remove attributes that should not be searched. $criteria=new CDbCriteria; $criteria->compare('id',$this->id); $criteria->compare('event_id',$this->event_id); $criteria->compare('ticket',$this->ticket,true); $criteria->compare('style',$this->style,true); $criteria->compare('type',$this->type); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id);\n $criteria->compare('model_id',$this->model_id,true);\n $criteria->compare('color',$this->color,true);\n $criteria->compare('is_in_pare',$this->is_in_pare);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('generator_id',$this->generator_id,true);\n\t\t$criteria->compare('serial_number',$this->serial_number,true);\n\t\t$criteria->compare('model_number',$this->model_number,true);\n\t\t$criteria->compare('manufacturer_name',$this->manufacturer_name,true);\n\t\t$criteria->compare('manufacture_date',$this->manufacture_date,true);\n\t\t$criteria->compare('supplier_name',$this->supplier_name,true);\n\t\t$criteria->compare('date_of_purchase',$this->date_of_purchase,true);\n\t\t$criteria->compare('date_of_first_use',$this->date_of_first_use,true);\n\t\t$criteria->compare('kva_capacity',$this->kva_capacity);\n\t\t$criteria->compare('current_run_hours',$this->current_run_hours);\n\t\t$criteria->compare('last_serviced_date',$this->last_serviced_date,true);\n\t\t$criteria->compare('engine_make',$this->engine_make,true);\n\t\t$criteria->compare('engine_model',$this->engine_model,true);\n\t\t$criteria->compare('fuel_tank_capacity',$this->fuel_tank_capacity);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('idmodel',$this->idmodel);\n\t\t$criteria->compare('usuario_anterior',$this->usuario_anterior);\n\t\t$criteria->compare('usuario_nuevo',$this->usuario_nuevo);\n\t\t$criteria->compare('estado_anterior',$this->estado_anterior,true);\n\t\t$criteria->compare('estado_nuevo',$this->estado_nuevo,true);\n\t\t$criteria->compare('fecha',$this->fecha,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('sex',$this->sex);\n\t\t$criteria->compare('car',$this->car,true);\n\t\t$criteria->compare('source_id',$this->source_id,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('client_type_id',$this->client_type_id,true);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('link',$this->link,true);\n\t\t$criteria->compare('other',$this->other,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('UserID',$this->UserID);\n\t\t$criteria->compare('ProviderID',$this->ProviderID);\n\t\t$criteria->compare('Date',$this->Date,true);\n\t\t$criteria->compare('RawID',$this->RawID);\n\t\t$criteria->compare('Document',$this->Document,true);\n\t\t$criteria->compare('State',$this->State,true);\n\t\t$criteria->compare('Temperature',$this->Temperature,true);\n\t\t$criteria->compare('Conditions',$this->Conditions,true);\n\t\t$criteria->compare('Expiration',$this->Expiration,true);\n\t\t$criteria->compare('Comments',$this->Comments,true);\n\t\t$criteria->compare('Quantity',$this->Quantity,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n \t'pageSize'=>Yii::app()->params['defaultPageSize'], \n ),\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t// $criteria->compare('text',$this->text,true);\n\t\t// $criteria->compare('record',$this->record,true);\n\t\t$criteria->compare('user',$this->user,true);\n\t\t$criteria->compare('createdBy',$this->createdBy,true);\n\t\t$criteria->compare('viewed',$this->viewed);\n\t\t$criteria->compare('createDate',$this->createDate,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('comparison',$this->comparison,true);\n\t\t// $criteria->compare('value',$this->value,true);\n\t\t$criteria->compare('modelType',$this->modelType,true);\n\t\t$criteria->compare('modelId',$this->modelId,true);\n\t\t$criteria->compare('fieldName',$this->fieldName,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('Currency_ID',$this->Currency_ID);\n\t\t$criteria->compare('CurrencyNo',$this->CurrencyNo,true);\n\t\t$criteria->compare('ExchangeVND',$this->ExchangeVND,true);\n\t\t$criteria->compare('AppliedDate',$this->AppliedDate,true);\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('firm',$this->firm,true);\n\t\t$criteria->compare('change_date',$this->change_date,true);\n\t\t$criteria->compare('item_id',$this->item_id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('availability',$this->availability,true);\n\t\t$criteria->compare('price',$this->price,true);\n\t\t$criteria->compare('bonus',$this->bonus,true);\n\t\t$criteria->compare('shipping_cost',$this->shipping_cost,true);\n\t\t$criteria->compare('product_page',$this->product_page,true);\n\t\t$criteria->compare('sourse_page',$this->sourse_page,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('column_id',$this->column_id);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type',$this->type);\n\t\t$criteria->compare('condition',$this->condition,true);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('industry',$this->industry,true);\n\t\t$criteria->compare('industry_sub',$this->industry_sub,true);\n\t\t$criteria->compare('area',$this->area,true);\n\t\t$criteria->compare('province',$this->province,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('contact_name',$this->contact_name,true);\n\t\t$criteria->compare('contact_tel',$this->contact_tel,true);\n\t\t$criteria->compare('ip',$this->ip,true);\n\t\t$criteria->compare('source',$this->source,true);\n $criteria->compare('status',$this->status);\n\t\t$criteria->compare('update_time',$this->update_time);\n\t\t$criteria->compare('create_time',$this->create_time);\n\t\t$criteria->compare('notes',$this->notes);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('university',$this->university,true);\n\t\t$criteria->compare('major',$this->major,true);\n\t\t$criteria->compare('gpa',$this->gpa,true);\n\t\t$criteria->compare('appl_term',$this->appl_term);\n\t\t$criteria->compare('toefl',$this->toefl);\n\t\t$criteria->compare('gre',$this->gre);\n\t\t$criteria->compare('appl_major',$this->appl_major,true);\n\t\t$criteria->compare('appl_degree',$this->appl_degree,true);\n\t\t$criteria->compare('appl_country',$this->appl_country,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that should not be searched.\n\t\t$criteria = new \\CDbCriteria;\n\n\t\tforeach (array_keys($this->defineAttributes()) as $name)\n\t\t{\n\t\t\t$criteria->compare($name, $this->$name);\n\t\t}\n\n\t\treturn new \\CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('goods_code',$this->goods_code,true);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('brand_id',$this->brand_id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('kind',$this->kind,true);\n\t\t$criteria->compare('color',$this->color,true);\n\t\t$criteria->compare('size',$this->size,true);\n\t\t$criteria->compare('material',$this->material,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('purchase_price',$this->purchase_price,true);\n\t\t$criteria->compare('selling_price',$this->selling_price,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('meta_title',$this->meta_title,true);\n\t\t$criteria->compare('meta_keywords',$this->meta_keywords,true);\n\t\t$criteria->compare('meta_description',$this->meta_description,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ContractsDetailID',$this->ContractsDetailID,true);\n\t\t$criteria->compare('ContractID',$this->ContractID,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\t\t$criteria->compare('CustomerID',$this->CustomerID,true);\n\t\t$criteria->compare('Share',$this->Share);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria = $this->criteriaSearch();\r\n\t\t$criteria->limit = 10;\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria' => $criteria,\r\n\t\t));\r\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('organizationName',$this->organizationName,true);\n\t\t$criteria->compare('contactNo',$this->contactNo,true);\n\t\t$criteria->compare('partnerType',$this->partnerType);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('area',$this->area,true);\n\t\t$criteria->compare('category',$this->category,true);\n\t\t$criteria->compare('emailId',$this->emailId,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('firstName',$this->firstName,true);\n\t\t$criteria->compare('lastName',$this->lastName,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_ID,$this->{Globals::FLD_NAME_ACTIVITY_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_TASK_ID,$this->{Globals::FLD_NAME_TASK_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_BY_USER_ID,$this->{Globals::FLD_NAME_BY_USER_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_TYPE,$this->{Globals::FLD_NAME_ACTIVITY_TYPE},true);\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_SUBTYPE,$this->{Globals::FLD_NAME_ACTIVITY_SUBTYPE},true);\n\t\t$criteria->compare(Globals::FLD_NAME_COMMENTS,$this->{Globals::FLD_NAME_COMMENTS},true);\n\t\t$criteria->compare(Globals::FLD_NAME_CREATED_AT,$this->{Globals::FLD_NAME_CREATED_AT},true);\n\t\t$criteria->compare(Globals::FLD_NAME_SOURCE_APP,$this->{Globals::FLD_NAME_SOURCE_APP},true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('manufacturers_image',$this->manufacturers_image,true);\n\t\t$criteria->compare('date_added',$this->date_added);\n\t\t$criteria->compare('last_modified',$this->last_modified);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_clicked',$this->url_clicked);\n\t\t$criteria->compare('date_last_click',$this->date_last_click);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('date',$this->date);\n\t\t$criteria->compare('del',$this->del);\n\t\t$criteria->compare('action_id',$this->action_id);\n\t\t$criteria->compare('item_id',$this->item_id);\n\t\t$criteria->compare('catalog',$this->catalog,true);\n\t\t$criteria->compare('is_new',$this->is_new);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('case',$this->case);\n\t\t$criteria->compare('basis_doc',$this->basis_doc);\n\t\t$criteria->compare('calc_group',$this->calc_group);\n\t\t$criteria->compare('time',$this->time,true);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('competition',$this->competition);\n\t\t$criteria->compare('partner',$this->partner);\n\t\t$criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('website',$this->website,true);\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('data_attributes_fields',$this->data_attributes_fields,true);\n\t\t$criteria->compare('is_active',$this->is_active);\n\t\t$criteria->compare('created',$this->created,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('skill_id',$this->skill_id);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('account_id',$this->account_id);\n\t\t$criteria->compare('field_name',$this->field_name);\n\t\t$criteria->compare('content',$this->content);\n\t\t$criteria->compare('old_data',$this->old_data,true);\n\t\t$criteria->compare('new_data',$this->new_data,true);\n\t\t$criteria->compare('status',$this->status);\n\t\t$criteria->compare('type',$this->type);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_updated',$this->date_updated,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('company_id',$this->company_id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('validator',$this->validator,true);\n\t\t$criteria->compare('position',$this->position);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n $criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('display_name',$this->display_name,true);\n $criteria->compare('actionPrice',$this->actionPrice);\n\t\t$criteria->compare('translit',$this->translit,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('display_description',$this->display_description,true);\n\t\t$criteria->compare('meta_keywords',$this->meta_keywords,true);\n\t\t$criteria->compare('meta_description',$this->meta_description,true);\n\t\t$criteria->compare('editing',$this->editing);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'pagination' => array(\n 'pageSize' => 15,\n ),\n\t\t));\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('BrandID', $this->BrandID);\n $criteria->compare('BrandName', $this->BrandName, true);\n $criteria->compare('Pinyin', $this->Pinyin, true);\n $criteria->compare('Remarks', $this->Remarks, true);\n $criteria->compare('OrganID', $this->OrganID);\n $criteria->compare('UserID', $this->UserID);\n $criteria->compare('CreateTime', $this->CreateTime);\n $criteria->compare('UpdateTime', $this->UpdateTime);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('code', $this->code, true);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('printable_name', $this->printable_name, true);\n\t\t$criteria->compare('iso3', $this->iso3, true);\n\t\t$criteria->compare('numcode', $this->numcode);\n\t\t$criteria->compare('is_default', $this->is_default);\n\t\t$criteria->compare('is_highlight', $this->is_highlight);\n\t\t$criteria->compare('is_active', $this->is_active);\n\t\t$criteria->compare('date_added', $this->date_added);\n\t\t$criteria->compare('date_modified', $this->date_modified);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('componente_id',$this->componente_id);\n\t\t$criteria->compare('tipo_dato',$this->tipo_dato,true);\n\t\t$criteria->compare('descripcion',$this->descripcion,true);\n\t\t$criteria->compare('cruce_automatico',$this->cruce_automatico,true);\n\t\t$criteria->compare('sw_obligatorio',$this->sw_obligatorio,true);\n\t\t$criteria->compare('orden',$this->orden);\n\t\t$criteria->compare('sw_puntaje',$this->sw_puntaje,true);\n\t\t$criteria->compare('sw_estado',$this->sw_estado,true);\n\t\t$criteria->compare('todos_obligatorios',$this->todos_obligatorios,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('real_name',$this->real_name,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('zip_code',$this->zip_code,true);\n\t\t$criteria->compare('province_id',$this->province_id);\n\t\t$criteria->compare('city_id',$this->city_id);\n\t\t$criteria->compare('district_id',$this->district_id);\n\t\t$criteria->compare('district_address',$this->district_address,true);\n\t\t$criteria->compare('street_address',$this->street_address,true);\n\t\t$criteria->compare('is_default',$this->is_default);\n\t\t$criteria->compare('create_time',$this->create_time);\n\t\t$criteria->compare('update_time',$this->update_time);\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('EMCE_ID',$this->EMCE_ID);\n\t\t$criteria->compare('MOOR_ID',$this->MOOR_ID);\n\t\t$criteria->compare('EVCR_ID',$this->EVCR_ID);\n\t\t$criteria->compare('EVES_ID',$this->EVES_ID);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('customerName',$this->customerName,true);\n\t\t$criteria->compare('agencyHead',$this->agencyHead,true);\n\t\t$criteria->compare('region_id',$this->region_id);\n\t\t$criteria->compare('province_id',$this->province_id);\n\t\t$criteria->compare('municipalityCity_id',$this->municipalityCity_id);\n\t\t$criteria->compare('barangay_id',$this->barangay_id);\n\t\t$criteria->compare('houseNumber',$this->houseNumber,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('fax',$this->fax,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('nature_id',$this->nature_id);\n\t\t$criteria->compare('industry_id',$this->industry_id);\n\t\t$criteria->compare('created_by',$this->created_by);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('update_time',$this->update_time,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->name,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('state',$this->address,true);\n\t\t$criteria->compare('country',$this->address,true);\n\t\t$criteria->compare('contact_number',$this->contact_number,true);\n\t\t$criteria->compare('created_by',$this->created_by,true);\n\t\t$criteria->compare('is_deleted',$this->is_deleted);\n\t\t$criteria->compare('deleted_by',$this->deleted_by,true);\n\t\t$criteria->compare('created_at',$this->created_at,true);\n\t\t$criteria->compare('updated_at',$this->updated_at,true);\n\t\tif(YII::app()->user->getState(\"role\") == \"admin\") {\n\t\t\t$criteria->condition = 'is_deleted = 0';\n\t\t}\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('industry_id',$this->industry_id);\n\t\t$criteria->compare('professional_status_id',$this->professional_status);\n\t\t$criteria->compare('birthday',$this->birthday);\n\t\t$criteria->compare('location',$this->location);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('memo',$this->memo,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\r\n\t{\r\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\r\n\r\r\n\t\t$criteria=new CDbCriteria;\r\r\n\r\r\n\t\t$criteria->compare('id',$this->id);\r\r\n\t\t$criteria->compare('user_id',$this->user_id);\r\r\n\t\t$criteria->compare('adds',$this->adds);\r\r\n\t\t$criteria->compare('edits',$this->edits);\r\r\n\t\t$criteria->compare('deletes',$this->deletes);\r\r\n\t\t$criteria->compare('view',$this->view);\r\r\n\t\t$criteria->compare('lists',$this->lists);\r\r\n\t\t$criteria->compare('searches',$this->searches);\r\r\n\t\t$criteria->compare('prints',$this->prints);\r\r\n\r\r\n\t\treturn new CActiveDataProvider($this, array(\r\r\n\t\t\t'criteria'=>$criteria,\r\r\n\t\t));\r\r\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('applyId',$this->applyId);\n\t\t$criteria->compare('stuId',$this->stuId);\n\t\t$criteria->compare('stuName',$this->stuName,true);\n\t\t$criteria->compare('specification',$this->specification,true);\n\t\t$criteria->compare('assetName',$this->assetName,true);\n\t\t$criteria->compare('applyTime',$this->applyTime,true);\n\t\t$criteria->compare('loanTime',$this->loanTime,true);\n\t\t$criteria->compare('returnTime',$this->returnTime,true);\n\t\t$criteria->compare('RFID',$this->RFID,true);\n\t\t$criteria->compare('stuTelNum',$this->stuTelNum,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=$this->getBaseCDbCriteria();\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('verid',$this->verid);\n\t\t$criteria->compare('appversion',$this->appversion,true);\n\t\t$criteria->compare('appfeatures',$this->appfeatures,true);\n\t\t$criteria->compare('createtime',$this->createtime,true);\n\t\t$criteria->compare('baseNum',$this->baseNum);\n\t\t$criteria->compare('slave1Num',$this->slave1Num);\n\t\t$criteria->compare('packagename',$this->packagename,true);\n\t\t$criteria->compare('ostype',$this->ostype);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('itemcode', $this->itemcode, true);\n $criteria->compare('product_id', $this->product_id, true);\n $criteria->compare('delete_flag', $this->delete_flag);\n $criteria->compare('status', $this->status);\n $criteria->compare('expire', $this->expire, true);\n $criteria->compare('date_input', $this->date_input, true);\n $criteria->compare('d_update', $this->d_update, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('client_id',$this->client_id,true);\n\t\t$criteria->compare('extension',$this->extension,true);\n\t\t$criteria->compare('rel_type',$this->rel_type,true);\n\t\t$criteria->compare('rel_id',$this->rel_id,true);\n\t\t$criteria->compare('meta_key',$this->meta_key,true);\n\t\t$criteria->compare('meta_value',$this->meta_value,true);\n\t\t$criteria->compare('date_entry',$this->date_entry,true);\n\t\t$criteria->compare('date_update',$this->date_update,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('column_id',$this->column_id,true);\n\t\t$criteria->compare('research_title',$this->research_title,true);\n\t\t$criteria->compare('research_url',$this->research_url,true);\n\t\t$criteria->compare('column_type',$this->column_type);\n\t\t$criteria->compare('filiale_id',$this->filiale_id,true);\n\t\t$criteria->compare('area_name',$this->area_name,true);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('trigger_config',$this->trigger_config);\n\t\t$criteria->compare('status',$this->status);\n $criteria->compare('terminal_type',$this->terminal_type);\n\t\t$criteria->compare('start_time',$this->start_time,true);\n\t\t$criteria->compare('end_time',$this->end_time,true);\n\t\t$criteria->compare('explain',$this->explain,true);\n\t\t$criteria->compare('_delete',$this->_delete);\n\t\t$criteria->compare('_create_time',$this->_create_time,true);\n\t\t$criteria->compare('_update_time',$this->_update_time,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('birthday',$this->birthday,true);\n\t\t$criteria->compare('sex',$this->sex);\n\t\t$criteria->compare('photo',$this->photo,true);\n\t\t$criteria->compare('is_get_news',$this->is_get_news);\n\t\t$criteria->compare('user_id',$this->user_id);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function backendSearch()\n {\n $criteria = new CDbCriteria();\n\n return new CActiveDataProvider(\n __CLASS__,\n array(\n 'criteria' => $criteria,\n )\n );\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('order_id',$this->order_id);\n\t\t$criteria->compare('device_id',$this->device_id,true);\n\t\t$criteria->compare('money',$this->money,true);\n\t\t$criteria->compare('status',$this->status);\n\t\t$criteria->compare('add_time',$this->add_time);\n\t\t$criteria->compare('recharge_type',$this->recharge_type);\n\t\t$criteria->compare('channel',$this->channel,true);\n\t\t$criteria->compare('version_name',$this->version_name,true);\n\t\t$criteria->compare('pay_channel',$this->pay_channel);\n\t\t$criteria->compare('chanel_bid',$this->chanel_bid);\n\t\t$criteria->compare('chanel_sid',$this->chanel_sid);\n\t\t$criteria->compare('versionid',$this->versionid);\n\t\t$criteria->compare('chanel_web',$this->chanel_web);\n\t\t$criteria->compare('dem_num',$this->dem_num);\n\t\t$criteria->compare('last_watching',$this->last_watching,true);\n\t\t$criteria->compare('pay_type',$this->pay_type);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('tbl_customer_supplier', $this->tbl_customer_supplier, true);\n $criteria->compare('id_customer', $this->id_customer, true);\n $criteria->compare('id_supplier', $this->id_supplier, true);\n $criteria->compare('title', $this->title, true);\n $criteria->compare('date_add', $this->date_add, true);\n $criteria->compare('date_upd', $this->date_upd, true);\n $criteria->compare('active', $this->active);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\r\n {\r\n // @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n $criteria = new CDbCriteria;\r\n\r\n $criteria->compare('id', $this->id);\r\n $criteria->compare('country_id', $this->country_id);\r\n $criteria->compare('user_id', $this->user_id);\r\n $criteria->compare('vat', $this->vat);\r\n $criteria->compare('manager_coef', $this->manager_coef);\r\n $criteria->compare('curator_coef', $this->curator_coef);\r\n $criteria->compare('admin_coef', $this->admin_coef);\r\n $criteria->compare('status', $this->status);\r\n\r\n return new CActiveDataProvider($this, array(\r\n 'criteria' => $criteria,\r\n ));\r\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('fname',$this->fname,true);\n\t\t$criteria->compare('mname',$this->mname,true);\n\t\t$criteria->compare('lname',$this->lname,true);\n\t\t$criteria->compare('photo',$this->photo,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\t\t$criteria->compare('date_of_birth',$this->date_of_birth,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('landline',$this->landline,true);\n\t\t$criteria->compare('em_contact_name',$this->em_contact_name,true);\n\t\t$criteria->compare('em_contact_relation',$this->em_contact_relation,true);\n\t\t$criteria->compare('em_contact_number',$this->em_contact_number,true);\n\t\t$criteria->compare('created_by',$this->created_by,true);\n\t\t$criteria->compare('created_date',$this->created_date,true);\n\n return new CActiveDataProvider( $this, array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => Yii::app()->user->getState( 'pageSize', Yii::app()->params[ 'defaultPageSize' ] ),\n ),\n ) );\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('code',$this->code,true);\n\t\t$criteria->compare('purchase_price',$this->purchase_price);\n\t\t$criteria->compare('sell_price',$this->sell_price);\n\t\t$criteria->compare('amount',$this->amount);\n\t\t$criteria->compare('measurement',$this->measurement,true);\n\t\t$criteria->compare('date_create',$this->date_create,true);\n\t\t$criteria->compare('date_update',$this->date_update,true);\n\t\t$criteria->compare('date_out',$this->date_out,true);\n\t\t$criteria->compare('date_in',$this->date_in,true);\n\t\t$criteria->compare('firma_id',$this->firma_id,true);\n\t\t$criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('instock',$this->instock);\n\t\t$criteria->compare('user_id',$this->user_id);\n $criteria->compare('warning_amount',$this->warning_amount);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t\n\t\t$criteria=new CDbCriteria;\n\t\t\n\t\t$criteria->compare('COMPETITOR_ID',$this->COMPETITOR_ID);\n\t\t$criteria->compare('WSDC_NO',$this->WSDC_NO);\n\t\t$criteria->compare('FIRST_NAME',$this->FIRST_NAME,true);\n\t\t$criteria->compare('LAST_NAME',$this->LAST_NAME,true);\n\t\t$criteria->compare('COMPETITOR_LEVEL',$this->COMPETITOR_LEVEL);\n\t\t$criteria->compare('REMOVED',$this->REMOVED);\n\t\t$criteria->compare('ADDRESS',$this->ADDRESS,true);\n\t\t$criteria->compare('CITY',$this->CITY,true);\n\t\t$criteria->compare('STATE',$this->STATE,true);\n\t\t$criteria->compare('POSTCODE',$this->POSTCODE);\n\t\t$criteria->compare('COUNTRY',$this->COUNTRY,true);\n\t\t$criteria->compare('PHONE',$this->PHONE,true);\n\t\t$criteria->compare('MOBILE',$this->MOBILE,true);\n\t\t$criteria->compare('EMAIL',$this->EMAIL,true);\n\t\t$criteria->compare('LEADER',$this->LEADER);\n\t\t$criteria->compare('REGISTERED',$this->REGISTERED);\n\t\t$criteria->compare('BIB_STATUS',$this->BIB_STATUS);\n\t\t$criteria->compare('BIB_NUMBER',$this->BIB_NUMBER);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('sys_name',$this->sys_name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('CustomerId',$this->CustomerId,true);\n\t\t$criteria->compare('AddressId',$this->AddressId,true);\n\t\t$criteria->compare('CustomerStatusId',$this->CustomerStatusId,true);\n\t\t$criteria->compare('DateMasterId',$this->DateMasterId,true);\n\t\t$criteria->compare('FirstName',$this->FirstName,true);\n\t\t$criteria->compare('LastName',$this->LastName,true);\n\t\t$criteria->compare('CustomerPhoto',$this->CustomerPhoto,true);\n\t\t$criteria->compare('CustomerCode',$this->CustomerCode);\n\t\t$criteria->compare('Telephone',$this->Telephone,true);\n\t\t$criteria->compare('Mobile',$this->Mobile,true);\n\t\t$criteria->compare('EmailId',$this->EmailId,true);\n\t\t$criteria->compare('Status',$this->Status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$parameters = array('limit'=>ceil(Profile::getResultsPerPage()));\n\t\t$criteria->scopes = array('findAll'=>array($parameters));\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('itemId',$this->itemId);\n\t\t$criteria->compare('changedBy',$this->changedBy,true);\n\t\t$criteria->compare('recordName',$this->recordName,true);\n\t\t$criteria->compare('fieldName',$this->fieldName,true);\n\t\t$criteria->compare('oldValue',$this->oldValue,true);\n\t\t$criteria->compare('newValue',$this->newValue,true);\n\t\t$criteria->compare('diff',$this->diff,true);\n\t\t$criteria->compare('timestamp',$this->timestamp);\n\n\t\treturn new SmartActiveDataProvider(get_class($this), array(\n\t\t\t'sort'=>array(\n\t\t\t\t'defaultOrder'=>'timestamp DESC',\n\t\t\t),\n\t\t\t'pagination'=>array(\n\t\t\t\t'pageSize'=>Profile::getResultsPerPage(),\n\t\t\t),\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('company_id', $this->company_id);\n\t\t$criteria->compare('productId', $this->productId);\n\t\t$criteria->compare('upTo', $this->upTo);\n\t\t$criteria->compare('fixPrice', $this->fixPrice);\n\t\t$criteria->compare('isActive', $this->isActive);\n\t\t$criteria->order = 'company_id';\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('city_id',$this->city_id);\n\t\t$criteria->compare('locality',$this->locality,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('id',$this->id);\r\n\t\t$criteria->compare('user_id',$this->user_id);\r\n\t\t$criteria->compare('mem_type',$this->mem_type);\r\n\t\t$criteria->compare('business_type',$this->business_type);\r\n\t\t$criteria->compare('product_name',$this->product_name,true);\r\n\t\t$criteria->compare('panit',$this->panit,true);\r\n\t\t$criteria->compare('sex',$this->sex);\r\n\t\t$criteria->compare('tname',$this->tname);\r\n\t\t$criteria->compare('ftname',$this->ftname,true);\r\n\t\t$criteria->compare('ltname',$this->ltname,true);\r\n\t\t$criteria->compare('etname',$this->etname);\r\n\t\t$criteria->compare('fename',$this->fename,true);\r\n\t\t$criteria->compare('lename',$this->lename,true);\r\n\t\t$criteria->compare('birth',$this->birth,true);\r\n\t\t$criteria->compare('email',$this->email,true);\r\n\t\t$criteria->compare('facebook',$this->facebook,true);\r\n\t\t$criteria->compare('twitter',$this->twitter,true);\r\n\t\t$criteria->compare('address',$this->address,true);\r\n\t\t$criteria->compare('province',$this->province);\r\n\t\t$criteria->compare('prefecture',$this->prefecture);\r\n\t\t$criteria->compare('district',$this->district);\r\n\t\t$criteria->compare('postcode',$this->postcode,true);\r\n\t\t$criteria->compare('tel',$this->tel,true);\r\n\t\t$criteria->compare('mobile',$this->mobile,true);\r\n\t\t$criteria->compare('fax',$this->fax,true);\r\n\t\t$criteria->compare('high_education',$this->high_education);\r\n\t\t$criteria->compare('career',$this->career);\r\n\t\t$criteria->compare('skill_com',$this->skill_com);\r\n\t\t$criteria->compare('receive_news',$this->receive_news,true);\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('item_id',$this->item_id);\n\t\t$criteria->compare('table_id',$this->table_id);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('cou_id',$this->cou_id);\n\t\t$criteria->compare('thm_id',$this->thm_id);\n\t\t$criteria->compare('cou_nom',$this->cou_nom,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=$this->getBaseCDbCriteria();\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n// $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n// $criteria->compare('alias', $this->alias, true);\n// $criteria->compare('module', $this->module, true);\n $criteria->compare('crud', $this->crud, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('idempleo',$this->idempleo);\n\t\t$criteria->compare('administrativo',$this->administrativo,true);\n\t\t$criteria->compare('comercial',$this->comercial,true);\n\t\t$criteria->compare('artes',$this->artes,true);\n\t\t$criteria->compare('informatica',$this->informatica,true);\n\t\t$criteria->compare('salud',$this->salud,true);\n\t\t$criteria->compare('marketing',$this->marketing,true);\n\t\t$criteria->compare('servicio_domestico',$this->servicio_domestico,true);\n\t\t$criteria->compare('construccion',$this->construccion,true);\n\t\t$criteria->compare('agricultura',$this->agricultura,true);\n\t\t$criteria->compare('ganaderia',$this->ganaderia,true);\n\t\t$criteria->compare('telecomunicaciones',$this->telecomunicaciones,true);\n\t\t$criteria->compare('atencion_cliente',$this->atencion_cliente,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID_VALOR',$this->ID_VALOR);\n\t\t$criteria->compare('ID_UBICACION',$this->ID_UBICACION);\n\t\t$criteria->compare('ID_VISITA',$this->ID_VISITA);\n\t\t$criteria->compare('VALOR',$this->VALOR);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t\n\t\t$criteria->compare('id_aspecto',$this->id_aspecto,true);\n\t\t$criteria->compare('tbl_Programa_id_programa',$this->tbl_Programa_id_programa,true);\n\t\t$criteria->compare('tbl_Factor_id_factor',$this->tbl_Factor_id_factor);\n\t\t$criteria->compare('tbl_caracteristica_id_caracteristica',$this->tbl_caracteristica_id_caracteristica,true);\n\t\t$criteria->compare('num_aspecto',$this->num_aspecto,true);\n\t\t$criteria->compare('aspecto',$this->aspecto,true);\n\t\t$criteria->compare('instrumento',$this->instrumento,true);\n\t\t$criteria->compare('fuente',$this->fuente,true);\n\t\t$criteria->compare('documento',$this->documento,true);\n\t\t$criteria->compare('link',$this->link,true);\n\t\t$criteria->compare('Observaciones',$this->Observaciones,true);\n\t\t$criteria->compare('cumple',$this->cumple,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('sex',$this->sex,true);\n\t\t$criteria->compare('website_url',$this->website_url,true);\n\t\t$criteria->compare('summary',$this->summary,true);\n\t\t$criteria->compare('user_name',$this->user_name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('created_datetime',$this->created_datetime,true);\n\t\t$criteria->compare('icon_src',$this->icon_src,true);\n\t\t$criteria->compare('show_r18',$this->show_r18);\n\t\t$criteria->compare('show_bl',$this->show_bl);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('creationDate',$this->creationDate,true);\n\t\t$criteria->compare('year',$this->year);\n\t\t$criteria->compare('term',$this->term,true);\n\t\t$criteria->compare('activated',$this->activated);\n\t\t$criteria->compare('startingDate',$this->startingDate,true);\n\t\t$criteria->compare('activation_userId',$this->activation_userId);\n\t\t$criteria->compare('parent_catalogId',$this->parent_catalogId);\n $criteria->compare('isProspective', $this->isProspective);\n $criteria->compare('creatorId', $this->creatorId);\n $criteria->compare('isProposed', $this->isProposed);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('FirstName',$this->FirstName,true);\n\t\t$criteria->compare('LastName',$this->LastName,true);\n\t\t$criteria->compare('location',$this->location);\n\t\t$criteria->compare('theripiest',$this->theripiest);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\t\t$criteria->compare('dob',$this->dob,true);\n\t\t$criteria->compare('inurancecompany',$this->inurancecompany,true);\n\t\t$criteria->compare('injurydate',$this->injurydate,true);\n\t\t$criteria->compare('therapy_start_date',$this->therapy_start_date,true);\n\t\t$criteria->compare('ASIA',$this->ASIA,true);\n\t\t$criteria->compare('injury',$this->injury,true);\n\t\t$criteria->compare('medication',$this->medication,true);\n\t\t$criteria->compare('notes',$this->notes,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search () {\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('formId', $this->formId, true);\n\t\t$criteria->compare('data', $this->data, true);\n\t\t$criteria->compare('ctime', $this->ctime);\n\t\t$criteria->compare('mtime', $this->mtime);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t 'criteria' => $criteria,\n\t\t ));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('imputetype_id',$this->imputetype_id);\n\t\t$criteria->compare('project_id',$this->project_id);\n\n\t\treturn new ActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('category_id',$this->category_id);\n\t\t$criteria->compare('amount',$this->amount);\n\t\t$criteria->compare('price_z',$this->price_z);\n\t\t$criteria->compare('price_s',$this->price_s);\n\t\t$criteria->compare('price_m',$this->price_m);\n\t\t$criteria->compare('dependence',$this->dependence,true);\n\t\t$criteria->compare('barcode',$this->barcode,true);\n\t\t$criteria->compare('unit',$this->unit,true);\n\t\t$criteria->compare('minimal_amount',$this->minimal_amount);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'pagination' => array('pageSize' => 100),\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('image',$this->image,true);\n\t\t$criteria->compare('manager',$this->manager);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('realname',$this->realname,true);\n\t\t$criteria->compare('identity',$this->identity,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('bussiness_license',$this->bussiness_license,true);\n\t\t$criteria->compare('bankcode',$this->bankcode,true);\n\t\t$criteria->compare('banktype',$this->banktype,true);\n\t\t$criteria->compare('is_open',$this->is_open,true);\n\t\t$criteria->compare('introduction',$this->introduction,true);\n\t\t$criteria->compare('images_str',$this->images_str,true);\n\t\t$criteria->compare('gmt_created',$this->gmt_created,true);\n\t\t$criteria->compare('gmt_modified',$this->gmt_modified,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('id_user',$this->id_user);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('email_admin',$this->email_admin,true);\n\t\t$criteria->compare('password_api',$this->password_api,true);\n\t\t$criteria->compare('url_result_api',$this->url_result_api,true);\n\t\t$criteria->compare('id_currency_2',$this->id_currency_2);\n\t\t$criteria->compare('id_currency_1',$this->id_currency_1,true);\n\t\t$criteria->compare('is_test_mode',$this->is_test_mode);\n\t\t$criteria->compare('is_commission_shop',$this->is_commission_shop);\n\t\t$criteria->compare('commission',$this->commission);\n\t\t$criteria->compare('is_enable',$this->is_enable);\n\t\t$criteria->compare('is_active',$this->is_active);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('mod_date',$this->mod_date,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID,true);\n\t\t$criteria->compare('userID',$this->userID,true);\n\t\t$criteria->compare('mtID',$this->mtID,true);\n\t\t$criteria->compare('fxType',$this->fxType);\n\t\t$criteria->compare('leverage',$this->leverage);\n\t\t$criteria->compare('amount',$this->amount,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t/*\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('percent_discount',$this->percent_discount,true);\n\t\t$criteria->compare('taxable',$this->taxable);\n\t\t$criteria->compare('id_user_created',$this->id_user_created);\n\t\t$criteria->compare('id_user_modified',$this->id_user_modified);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_modified',$this->date_modified,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t\t*/\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('surname',$this->surname,true);\n\t\t$criteria->compare('comany_name',$this->comany_name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('uuid',$this->uuid,true);\n\t\t$criteria->compare('is_admin',$this->is_admin);\n\t\t$criteria->compare('paid_period_start',$this->paid_period_start,true);\n\t\t$criteria->compare('ftp_pass',$this->ftp_pass,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('price',$this->price,true);\n\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('breed',$this->breed,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('date_birthday',$this->date_birthday,true);\n\t\t$criteria->compare('sex',$this->sex,true);\n\t\t$criteria->compare('color',$this->color,true);\n\t\t$criteria->compare('tattoo',$this->tattoo,true);\n\t\t$criteria->compare('sire',$this->sire,true);\n\t\t$criteria->compare('dame',$this->dame,true);\n\t\t$criteria->compare('owner_type',$this->owner_type,true);\n\t\t$criteria->compare('honors',$this->honors,true);\n\t\t$criteria->compare('photo_preview',$this->photo_preview,true);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('pet_status',$this->pet_status,true);\n\t\t$criteria->compare('about',$this->about,true);\n\t\t$criteria->compare('uid',$this->uid);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('veterinary',$this->veterinary,true);\n\t\t$criteria->compare('vaccinations',$this->vaccinations,true);\n\t\t$criteria->compare('show_class',$this->show_class,true);\n\t\t$criteria->compare('certificate',$this->certificate,true);\n $criteria->compare('neutered_spayed',$this->certificate,true);\n \n\n $criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('city',$this->city,true);\n\n \n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('HISTORY',$this->HISTORY,true);\n\t\t$criteria->compare('WELCOME_MESSAGE',$this->WELCOME_MESSAGE,true);\n\t\t$criteria->compare('LOCATION',$this->LOCATION,true);\n\t\t$criteria->compare('PHONES',$this->PHONES,true);\n\t\t$criteria->compare('FAX',$this->FAX,true);\n\t\t$criteria->compare('EMAIL',$this->EMAIL,true);\n\t\t$criteria->compare('MISSION',$this->MISSION,true);\n\t\t$criteria->compare('VISION',$this->VISION,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('company_id', Yii::app()->user->company_id);\n $criteria->compare('zone_id', $this->zone_id, true);\n $criteria->compare('low_qty_threshold', $this->low_qty_threshold);\n $criteria->compare('high_qty_threshold', $this->high_qty_threshold);\n $criteria->compare('created_date', $this->created_date, true);\n $criteria->compare('created_by', $this->created_by, true);\n $criteria->compare('updated_date', $this->updated_date, true);\n $criteria->compare('updated_by', $this->updated_by, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('orgName',$this->orgName,true);\n\t\t$criteria->compare('noEmp',$this->noEmp);\n\t\t$criteria->compare('phone',$this->phone);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('addr1',$this->addr1,true);\n\t\t$criteria->compare('addr2',$this->addr2,true);\n\t\t$criteria->compare('state',$this->state,true);\n\t\t$criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('orgType',$this->orgType,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('fax',$this->fax);\n\t\t$criteria->compare('orgId',$this->orgId,true);\n\t\t$criteria->compare('validity',$this->validity);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('category',$this->category,true);\n\t\t$criteria->compare('sortorder',$this->sortorder,true);\n\t\t$criteria->compare('fullname',$this->fullname,true);\n\t\t$criteria->compare('shortname',$this->shortname,true);\n\t\t$criteria->compare('idnumber',$this->idnumber,true);\n\t\t$criteria->compare('summary',$this->summary,true);\n\t\t$criteria->compare('summaryformat',$this->summaryformat);\n\t\t$criteria->compare('format',$this->format,true);\n\t\t$criteria->compare('showgrades',$this->showgrades);\n\t\t$criteria->compare('sectioncache',$this->sectioncache,true);\n\t\t$criteria->compare('modinfo',$this->modinfo,true);\n\t\t$criteria->compare('newsitems',$this->newsitems);\n\t\t$criteria->compare('startdate',$this->startdate,true);\n\t\t$criteria->compare('marker',$this->marker,true);\n\t\t$criteria->compare('maxbytes',$this->maxbytes,true);\n\t\t$criteria->compare('legacyfiles',$this->legacyfiles);\n\t\t$criteria->compare('showreports',$this->showreports);\n\t\t$criteria->compare('visible',$this->visible);\n\t\t$criteria->compare('visibleold',$this->visibleold);\n\t\t$criteria->compare('groupmode',$this->groupmode);\n\t\t$criteria->compare('groupmodeforce',$this->groupmodeforce);\n\t\t$criteria->compare('defaultgroupingid',$this->defaultgroupingid,true);\n\t\t$criteria->compare('lang',$this->lang,true);\n\t\t$criteria->compare('theme',$this->theme,true);\n\t\t$criteria->compare('timecreated',$this->timecreated,true);\n\t\t$criteria->compare('timemodified',$this->timemodified,true);\n\t\t$criteria->compare('requested',$this->requested);\n\t\t$criteria->compare('enablecompletion',$this->enablecompletion);\n\t\t$criteria->compare('completionnotify',$this->completionnotify);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('zipcode',$this->zipcode,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('role',$this->role,true);\n\t\t$criteria->compare('active',$this->active);\n\t\t$criteria->compare('camaras',$this->camaras);\n\t\t$criteria->compare('freidoras',$this->freidoras);\n\t\t$criteria->compare('cebos',$this->cebos);\n\t\t$criteria->compare('trampas',$this->trampas);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('attribute',$this->attribute,true);\n\t\t$criteria->compare('displayName',$this->displayName,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('value_type',$this->value_type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('cod_venda',$this->cod_venda,true);\n\t\t$criteria->compare('filial_cod_filial',$this->filial_cod_filial,true);\n\t\t$criteria->compare('funcionario_cod_funcionario',$this->funcionario_cod_funcionario,true);\n\t\t$criteria->compare('cliente_cod_cliente',$this->cliente_cod_cliente,true);\n\t\t$criteria->compare('data_2',$this->data_2,true);\n\t\t$criteria->compare('valor_total',$this->valor_total);\n\t\t$criteria->compare('forma_pagamento',$this->forma_pagamento,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('state', $this->state);\n $criteria->compare('type','0');\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->buscar,'OR');\n\t\t$criteria->compare('fecha',$this->buscar,true,'OR');\n\t\t$criteria->compare('fechaUpdate',$this->buscar,true,'OR');\n\t\t$criteria->compare('idProfesional',$this->buscar,'OR');\n\t\t$criteria->compare('importe',$this->buscar,'OR');\n\t\t$criteria->compare('idObraSocial',$this->buscar,'OR');\n\t\t$criteria->compare('estado',$this->buscar,true,'OR');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('sex', $this->sex);\n $criteria->compare('mobile', $this->mobile, true);\n $criteria->compare('idcard', $this->idcard, true);\n $criteria->compare('password', $this->password, true);\n $criteria->compare('place_ids', $this->place_ids, true);\n $criteria->compare('depart_id', $this->depart_id);\n $criteria->compare('bank', $this->bank, true);\n $criteria->compare('bank_card', $this->bank_card, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('education', $this->education, true);\n $criteria->compare('created', $this->created);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('codop',$this->codop,true);\n\t\t$criteria->compare('codcatval',$this->codcatval,true);\n\t\t$criteria->compare('cuentadebe',$this->cuentadebe,true);\n\t\t$criteria->compare('cuentahaber',$this->cuentahaber,true);\n\t\t$criteria->compare('desop',$this->desop,true);\n\t\t$criteria->compare('descat',$this->descat,true);\n\t\t$criteria->compare('debe',$this->debe,true);\n\t\t$criteria->compare('haber',$this->haber,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array('pagesize'=>100),\n\t\t));\n\t}" ]
[ "0.7212621", "0.7135736", "0.7093357", "0.70932513", "0.69849926", "0.6960267", "0.6947744", "0.6941827", "0.6933585", "0.69238573", "0.6910198", "0.69027245", "0.68983555", "0.6897855", "0.6892253", "0.68823045", "0.68791807", "0.68736356", "0.6849398", "0.6848704", "0.68356377", "0.6826142", "0.68152815", "0.6806314", "0.6803058", "0.67971116", "0.679592", "0.67953247", "0.6795254", "0.6793826", "0.6789957", "0.67854613", "0.678461", "0.67835623", "0.6780817", "0.67805874", "0.6778604", "0.6777089", "0.67767817", "0.6776157", "0.67753345", "0.67753345", "0.67753345", "0.67753345", "0.67753345", "0.67753345", "0.67753345", "0.67753345", "0.67727244", "0.6768517", "0.67668086", "0.6765389", "0.67622024", "0.6761988", "0.67605364", "0.6759849", "0.67585695", "0.6758506", "0.67529345", "0.6752845", "0.6751469", "0.6747546", "0.6747546", "0.6745679", "0.6745303", "0.6744712", "0.67442304", "0.6743871", "0.674378", "0.6743507", "0.67419976", "0.6740871", "0.6739626", "0.6738867", "0.6736424", "0.67361856", "0.6734048", "0.6731823", "0.6730865", "0.67248213", "0.67225444", "0.67222834", "0.6721936", "0.67122877", "0.6712216", "0.6710673", "0.6708636", "0.6706224", "0.6705409", "0.67053735", "0.6703286", "0.67020106", "0.6700344", "0.6698013", "0.6696155", "0.66950107", "0.6694625", "0.6693197", "0.66925746", "0.6692546", "0.6690933" ]
0.0
-1
Determine if the validation rule passes.
public function passes($attribute, $value) { return preg_match('/^[\u4E00-\u9FA5A-Za-z0-9_-]+$/', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isValidationPassed();", "public function passes()\n {\n $validator = $this->validator->make($this->data, $this->rules, $this->messages);\n \n if($validator->fails())\n {\n $this->errors = $validator->messages();\n return false;\n }\n \n return true;\n }", "public function passes()\n {\n $rules = $this->replace();\n\n $validator = Validator::make($this->data, $rules);\n\n if( $validator->passes() )\n {\n return true;\n }\n\n $this->errors = $validator->messages();\n }", "function passes() {\n return $this->startValidation();\n }", "public function validate() : bool\n {\n return $this->passes();\n }", "public function passes()\n {\n $validator = $this->validator->make($this->data, $this->rules);\n\n if($validator->passes())\n {\n return true;\n }\n\n $this->errors = $validator->errors()->all(':message');\n return false;\n }", "public function passes()\n {\n foreach ($this->rules as $attribute => $rules) {\n foreach ($rules as $rule) {\n $this->validate($attribute, $rule);\n }\n }\n\n return count($this->messages) === 0;\n }", "public function passes() {\n $this->message = new MessageBag;\n\n // We'll spin through each rule, validating the attributes attached to that\n // rule. Any error messages will be added to the containers with each of\n // the other error messages, returning true if we don't have messages.\n foreach ($this->rules as $attribute => $rules) {\n\n }\n\n return $this->message->isEmpty();\n }", "public function isValid()\r\n\t{\r\n\t\t$valid = $this->validate($this->rule, $this->control->getValue(), $this->arg);\r\n\t\tif ($this->negative)\r\n\t\t\t$valid = !$valid;\r\n\r\n\t\tif ($valid)\r\n\t\t\treturn true;\r\n\r\n\t\t$this->control->setError($this->getMessage());\r\n\t\treturn false;\r\n\t}", "public function valid(): bool {\n return false !== current($this->rules);\n }", "public function valid()\n {\n return $this->makeValidator()->passes();\n }", "public function valid()\n {\n return current($this->rules) !== false;\n }", "public function validation()\n {\n if ($this->validationHasFailed() == true) {\n return false;\n }\n }", "public function validate(): bool\n {\n $result = true;\n foreach ($this->rules as $field_name => $field_rules) {\n foreach ($field_rules as $field_rule => $field_params) {\n\n if (array_key_exists($field_rule, self::$known_rules)) {\n\n if (class_exists(self::$known_rules[$field_rule]) and\n is_subclass_of(self::$known_rules[$field_rule], 'Shulha\\Framework\\Validation\\Rules\\AbstractValidationRule')) {\n\n /** @var $validation_class AbstractValidationRule */\n $validation_class = new self::$known_rules[$field_rule];\n $field_value = isset($this->request->$field_name) ? $this->request->$field_name : null;\n\n if (!$validation_class->check($field_name, $field_value, $field_params)) {\n $result = false;\n $this->errorList[$field_name][] = $validation_class->getError($field_name, $field_value, $field_params);\n }\n } else\n throw new RuleClassNotFoundException(\"Class \" . self::$known_rules[$field_rule] . \" not found or don't extends AbstractValidationRule\");\n } else\n throw new RuleNotFoundException(\"Rule \\\"$field_rule\\\" not found\");\n }\n }\n return $result;\n\n }", "public function passed(){\n \n //Loop through all the fields in the ruleset\n foreach($this->rules as $fieldName => $ruleCollection){\n foreach($ruleCollection as $rule => $rule_value){\n $this->validateField($fieldName, $rule, $rule_value); \n }\n }\n \n if($this->useValidationToken){\n if( Input::get(\"form_token\") != Session::get(\"form_token\") ){\n $this->addError(\"form_token\", \"token\", \"Could not process form form at this time. Please try again.\");\n }\n }\n \n //If we're using session flash, add a formatted list of errors to the session flash system\n if($this->useSessionFlash){\n Session::addFlash($this->formattedErrors(\"list\"), \"danger\", \"Please correct the following errors\");\n }\n \n return $this->hasPassed;\n }", "public function isValid() {\n\t\t$validation = Validator::make($this->attributes, static::$rules);\n\n\t\tif ($validation->passes()){\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->messages = $validation->messages();\n\t\treturn false;\n\t}", "function validate()\n\t{\n\t\t$result = true;\n\t\tif ($this->required && !$this->value) { $result = false; }\n\n\t\tif (!$result) { $this->error = '*'; }\n\n\t\treturn $result;\n\t}", "public function validate()\n {\n foreach ($this->aRule as $aRule) {\n if (count($aRule) < 2) { continue; }\n $sKey = array_shift($aRule);\n $sValidator = array_shift($aRule);\n $Validator = $this->createValidator(\n $sValidator,\n $sKey,\n Arr::get($this->aData, $sKey),\n $aRule,\n Arr::get($this->aMsg, $sKey, array())\n );\n if(true !== ($sValidMsg = $Validator->validator())){\n return $sValidMsg;\n }\n }\n return true;\n }", "public function fails()\n {\n return count($this->_rules->errors) > 0;\n }", "function fails() {\n return !($this->startValidation());\n }", "public function passes()\n {\n if ($this->isRemoteValidationRequest()) {\n return $this->validateJsRemoteRequest($this->data['_jsvalidation'], [$this, 'parent::passes']);\n }\n\n return parent::passes();\n }", "public function checkValidity()\n {\n if($this->validator->fails()) {\n return $this->validator->errors();\n }\n else\n return false;\n }", "public function isValid(): bool\n {\n $success = true;\n\n foreach ($this->rules->getRules() as $field => $rules) {\n foreach ($rules as $rule => $args) {\n $fieldError = $this->fieldErrors[$field] ?? null;\n\n if (key_exists($rule, $this->sets) === false) {\n // Rule doesn't exist, throw an exception\n throw new InvalidArgumentException(\"Unknown rule '$rule'\");\n }\n\n if ($this->params->has($field) === false) {\n // The field doesn't exist.\n if ($this->rules->isRequired($field)) {\n // The rule is required but doesn't exist. Set error and\n // continue to the next field\n $this->errors->add($field, $fieldError ?? \"$field is required\");\n $success = false;\n break;\n }\n\n // The rule doesn't exist but isn't required, so let's just\n // continue to the next field\n continue;\n }\n\n // Add the field value as the first argument\n array_unshift($args, $this->params->get($field));\n\n $callback = call_user_func_array($this->sets[$rule], $args);\n\n if ($callback === true) {\n // The validation rule passed, continue to next\n continue;\n }\n\n // Set success to false since the validation failed\n $success = false;\n\n if ($fieldError || is_string($callback)) {\n // We found a custom field error, let's use that\n $this->errors->add($field, $fieldError ?? $callback);\n break;\n }\n\n // No other error messages was found or returned, create a generic one\n $this->errors->add($field, \"Validation for $rule failed\");\n break;\n }\n }\n\n return $success;\n }", "public function validation() {\n $this->validate(\n new PresenceOf(\n array(\n \"field\" => \"name\",\n \"message\" => \"The name is required\"\n )\n )\n );\n\n if ($this->validationHasFailed() == true) {\n return false;\n }\n\n return true;\n }", "public function validationHasFailed(): bool;", "public function isValid(): bool{\n if ($this->getError() == null){return true;}\n return false;\n }", "protected final function validate()\n {\n $validator = new Validator($this);\n $validator->validate();\n\n return $this->hasErrors() ? false : true;\n }", "public function isRulesPassed()\n {\n if(!isset($this->rules_objects_list[$this->table_name]))\n return true;\n\n //current table's rules object\n $l_target = $this->rules_objects_list[$this->table_name];\n\n return ($l_target->rules_error_flag == false);\n }", "public function isFailed()\n {\n return $this->validator->fails();\n }", "public function validate()\n {\n $validator = new Validator;\n $validator->add($this->rules);\n if ($validator->validate($this->attributes)) {\n return TRUE;\n }\n\n $this->errors = $validator->getMessages();\n\n return FALSE;\n }", "public function isValid()\n {\n $this->beforeValidation();\n\n if ( ! isset($this->validationRules)) {\n throw new NoValidationRulesException('No validation rules found on class ' . get_called_class());\n }\n\n $this->validator = Validator::make($this->inputData, $this->validationRules, $this->validationMessages);\n\n return $this->validator->passes();\n }", "function isValid () {\r\n if ( count ($this->errors) > 0 ) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "public function isValid(): bool\n {\n return (count($this->violations) <= 0);\n }", "public function isValidated()\n {\n return $this->attribute('state') == self::STATUS_VALIDATED;\n }", "public function isValid()\n {\n return $this->validates();\n }", "public function isValidated(): bool\n {\n return $this->status != self::STATUS_ERROR;\n }", "public function validate() : bool\n {\n foreach ($this->rules() as $inputName => $rules) {\n $value = $this->{$inputName} ?? '';\n foreach ($rules as $rule) {\n if(!is_string($rule)) {\n $ruleName = $rule[0];\n } else $ruleName = $rule;\n if($ruleName === self::RULE_REQUIRED && !$value) {\n $this->addError($inputName, self::RULE_REQUIRED);\n } else if ($ruleName === self::RULE_EMAIL && !filter_var($value, FILTER_VALIDATE_EMAIL) ) {\n $this->addError($inputName, self::RULE_EMAIL);\n } else if ($ruleName === self::RULE_MAX && strlen($value) > $rule['max']) {\n $this->addError($inputName, self::RULE_MAX, $rule);\n } else if ($ruleName === self::RULE_MIN && strlen($value) < $rule['min']) {\n $this->addError($inputName, self::RULE_MIN, $rule);\n } else if ($ruleName === self::RULE_MATCH && $value !== $this->{$rule['match']}) {\n $this->addError($inputName, self::RULE_MATCH, $rule);\n } else if ($ruleName === self::RULE_UNIQUE) {\n $sql = \" SELECT uniqueID from \" . self::$tableName . \" WHERE \" . $rule['column'] . \"=?\"; \n $stmt = self::$mysqli->prepare($sql);\n $stmt->bind_param('s', $value);\n if($stmt->execute() === false) {\n $this->addError($inputName, self::RULE_UNIQUE, $rule);\n } else {\n $result = $stmt->get_result()->fetch_all(); \n if(count($result) > 0) {\n $this->addError($inputName, self::RULE_UNIQUE, $rule);\n }\n }\n }\n }\n }\n return empty($this->errors);\n }", "public function isValidated()\n {\n if (empty($this->errors)) {\n return true;\n } else {\n return false;\n }\n }", "public function isValid(): bool\n {\n return $this->getErrors()->count() === 0;\n }", "public function isValid()\n {\n return $this->isBound() ? count($this->errors)==0 : false; // TESTME\n }", "public function validate(): bool;", "public function validate(): bool;", "public function validate(): bool;", "public function validate(): bool;", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "function isValid() {\n return $this->validator ? $this->validator->isValid($this->value) : true;\n }", "public function validate(): bool\n {\n return true;\n }", "public function validate(): bool\n {\n return true;\n }", "public function validate(): bool\n {\n return true;\n }", "public function validate(): bool\n {\n return true;\n }", "public function validate(): bool\n {\n return true;\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 }", "public function isValid() : bool {\n\t\t\treturn $this->error == 0;\n\t\t}", "protected function isValid()\r\n\t{\r\n\t\treturn $this->isValid;\r\n\t}", "public function valid()\n {\n\n if ($this->container['rule_id'] === null) {\n return false;\n }\n if ($this->container['rule_name'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n if ($this->container['execution_source'] === null) {\n return false;\n }\n return true;\n }", "public function isValid()\n\t{\n\t\treturn true;\n\t}", "public function isValid() {\n return $this->getValidation()->isValidField($this->getName());\n }", "public function getIsValid()\n {\n return $this->isValid;\n }", "public function isValid() {\n\t\ttry {\n\t\t\t$this->validate();\n\t\t\treturn true;\n\t\t} catch (ValidationException $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public function passes()\n {\n if (!($this->validator instanceof \\Illuminate\\Validation\\Validator)) {\n throw new LogicException('No model was set. Nothing to validate.');\n }\n\n return $this->getValidator()->passes();\n }", "public function validate(): bool\n {\n foreach ($this->rules() as $attribute => $rules) {\n\n $value = $this->{$attribute};\n //We loop twice because some rules have array rules within them\n foreach ($rules as $rule) {\n /* If $rule is a string take the $rule and assign it to to $ruleName*/\n $ruleName = $rule;\n /* If $rule is not a string i.e an array, take the first element of the array i.e.\n *$rule[0] and assign it to to $ruleName\n */\n if(!is_string($rule))\n {\n $ruleName = $rule[0];\n }\n /*\n * If any attribute has a rule required and no value exists, add an error to the\n * errors array and pass the attribute and the rule as parameters to the addErrors function\n */\n if($ruleName === self::RULE_REQUIRED && !$value)\n {\n $this->addErrors($attribute, self::RULE_REQUIRED);\n }\n /*\n * If any attribute has a rule email and the value does not pass as valid email, add to the\n * errors array and pass the attribute and the rule as parameters to the addErrors function\n */\n\n if($ruleName === self::RULE_EMAIL && !filter_var($value, FILTER_VALIDATE_EMAIL))\n {\n $this->addErrors($attribute, self::RULE_EMAIL);\n }\n\n /*\n * If any attribute has a rule match and the value does not match with the value passed\n * in the rule array where this rule is found i.e $this->{$rule['match']} which corresponds\n * to password, so in short, $this->password, if they don't match add error to the\n * errors array and pass the attribute and the rule as parameters to the addErrors function\n */\n\n if($ruleName === self::RULE_MATCH && $value !== $this->{$rule['match']})\n {\n $this->addErrors($attribute, self::RULE_MATCH);\n }\n\n /*\n * This control structure if the user input is unique to the database. If it is not,\n * it adds an error to the errors array and pass the attribute and\n * the rule as parameters to the addErrors function\n * The model class that returns the unique set of rules also returns the tableName and the attributes\n * (column names in db) specific to that model class\n * The unique rule is rendered differently to cater for various classes, an array with the unique\n * rule passed along with the self::class that calls the active model class which extends to model\n * and attr is also passed along withe corresponding attribute (this is optional)\n *\n */\n\n if($ruleName === self::RULE_UNIQUE)\n {\n /*\n * Here, the active class is gotten along with the tablename and attribute which we\n * call uniqueAttr specific to the active model class\n */\n $className = $rule['class'];\n $tableName = $className::tableName();\n $uniqueAttr = $rule['attr'] ?? $attribute;\n\n /*\n * We prepare a statement that selects all from the tablename gotten where uniqueAttr\n * is typed param :attr (to avoid sql injection)\n * :attr is bound to $value which is the user input (remember data was loaded before\n * passing it through the validate() function) and executed and object of the result is fetched\n */\n\n $statement = Application::$app->db->prepare(\"SELECT * FROM $tableName WHERE $uniqueAttr = :attr\");\n $statement->bindValue(\":attr\", $value);\n $statement->execute();\n $record = $statement->fetchObject();\n\n /*\n * If a record exists, add an Error, if not it returns true\n */\n if($record)\n {\n $this->addErrors($uniqueAttr, self::RULE_UNIQUE);\n }\n\n }\n /*\n * Added a rule valid start date and valid end date that check if the start date is before\n * the current date and if the end date is before the start date of the project\n * If the rule name has valid_start_date and the value is before (here we use < )\n * the date of today which is passed as a corresponding value of start_date in the\n * RULE_VALID_START_DATE array that is passed. Then add an error for the corresponding\n * attribute and rule passing them as arguments in the addErrors function\n */\n\n if ($ruleName === self::RULE_VALID_START_DATE && $value < $rule['start_date'])\n {\n $this->addErrors('start_date', self::RULE_VALID_START_DATE);\n }\n\n /*\n * If the attribute has rule valid_end_date and the value is before or equal to the\n * day of the project start date. Then add an error for the corresponding\n * attribute and rule passing them as arguments in the addErrors function\n */\n\n if ($ruleName === self::RULE_VALID_END_DATE && $value <= $this->{$rule['end_date']})\n {\n $this->addErrors('end_date', self::RULE_VALID_END_DATE);\n }\n\n }\n }\n /*\n * If all the above conditions are met it means validation passed for the data that was passed\n * to the validate function. If so it means the errors array is empty\n * Then if validate passed, return if empty errors array, as true. If errors array is not empty\n * validate function returns false\n */\n return empty($this->errors);\n\n }", "function validate()\n {\n if ( $this->options['required'] && $this->value == '' )\n {\n $this->validationError = $this->label . ' is required!';\n fWarn::getInstance()->add('Validation failed for ' . $this->name . ', field is required.');\n return false;\n }\n if ( isset($this->regex) )\n {\n $return = preg_match($this->regex, $this->value);\n if ( !$return )\n $this->fDebug->add('Could not validate \"' . $this->value . '\" against \"' . $this->regex . '\"', 1);\n return $return;\n }\n return true;\n }", "private function isValid(){\r\n $this->validator->required('title', 'Image Title Is Required');\r\n $this->validator->required('slideHint', 'Slide Name Is Required');\r\n $this->validator->image('image');\r\n return $this->validator->passes();\r\n }", "public function validation()\n {\n\n $this->validate(\n new Email(\n array(\n \"field\" => \"email\",\n \"required\" => true,\n )\n )\n );\n if ($this->validationHasFailed() == true) {\n return false;\n }\n }", "public function validation()\n {\n\n $this->validate(\n new Email(\n array(\n \"field\" => \"email\",\n \"required\" => true,\n )\n )\n );\n if ($this->validationHasFailed() == true) {\n return false;\n }\n }", "public function validation()\n {\n\n $this->validate(\n new Email(\n array(\n \"field\" => \"email\",\n \"required\" => true,\n )\n )\n );\n if ($this->validationHasFailed() == true) {\n return false;\n }\n }", "public function validation()\n {\n $this->validate(\n new Email(\n array(\n 'field' => 'email',\n 'required' => true,\n )\n )\n );\n\n if ($this->validationHasFailed() == true) {\n return false;\n }\n\n return true;\n }", "public function validation()\n {\n $this->validate(\n new Email(\n array(\n 'field' => 'email',\n 'required' => true,\n )\n )\n );\n\n if ($this->validationHasFailed() == true) {\n return false;\n }\n\n return true;\n }", "public function validation()\n {\n $this->validate(\n new Email(\n array(\n 'field' => 'email',\n 'required' => true,\n )\n )\n );\n\n if ($this->validationHasFailed() == true) {\n return false;\n }\n\n return true;\n }", "public function validation()\n {\n $this->validate(\n new Email(\n array(\n 'field' => 'email',\n 'required' => true,\n )\n )\n );\n\n if ($this->validationHasFailed() == true) {\n return false;\n }\n\n return true;\n }", "public function validation()\n {\n $this->validate(\n new Email(\n array(\n 'field' => 'email',\n 'required' => true,\n )\n )\n );\n\n if ($this->validationHasFailed() == true) {\n return false;\n }\n\n return true;\n }", "public function validation()\n {\n\n $this->validate(\n new Email(\n array(\n 'field' => 'email',\n 'required' => true,\n )\n )\n );\n if ($this->validationHasFailed() == true) {\n return false;\n }\n }", "public function validation()\n {\n\n $this->validate(\n new Email(\n array(\n 'field' => 'email',\n 'required' => true,\n )\n )\n );\n if ($this->validationHasFailed() == true) {\n return false;\n }\n }", "public function isValid() {\r\n $this->errors->clean();\r\n $this->validate();\r\n\r\n return $this->errors->isEmpty();\r\n }", "public function validate(): bool\r\n {\r\n array_walk(\r\n $this->rules,\r\n function ($rules, $field) {\r\n // $all_rules = array_merge(array_keys($rules), array_values($rules));\r\n try {\r\n // if (!isset($this->data[$field])) {\r\n // throw new FieldDoesNotExist(\"$field is requied\");\r\n // }\r\n\r\n // if (empty($this->data($field))) {\r\n // throw new FieldEmpty(\"$field can't be empty\");\r\n // }\r\n\r\n $this->validateField($field);\r\n } catch (FieldDoesNotExist | FieldEmpty $e) {\r\n // if (in_array(\"nullable\", $all_rules)) {\r\n // unset($this->data[$field]);\r\n // return;\r\n // }\r\n $this->addError($field, str_replace(\"_\", \" \", $e->getMessage()));\r\n }\r\n }\r\n );\r\n\r\n $this->valid = !boolval(count($this->getErrors()));\r\n\r\n $this->validated = true;\r\n\r\n return $this->valid;\r\n }", "private function isRuleChecked(): bool\n {\n $res = true;\n foreach ($this->getRules() as $method => $rule) {\n if (is_array($rule)) {\n foreach ($rule as $r) {\n $res = $res && $this->checkRule($method, $r);\n }\n } else {\n $res = $res && $this->checkRule($method, $rule);\n }\n }\n return $res;\n }", "public function isValid() {\n\t\treturn $this->is_valid;\n\t}", "public function validate(): bool\n {\n $result = true;\n foreach ($this->validation_data as $rule_name => $verifiable_data) {\n if (array_key_exists($rule_name, self::$know_validated_rule)) {\n if (class_exists(self::$know_validated_rule[$rule_name])) {\n /** @var $class BaseRule */\n $class = new self::$know_validated_rule[$rule_name](array_pop($verifiable_data));\n if (!$class->check($this->object, $verifiable_data)) {\n $result = false;\n $this->errors[$rule_name] = $class->getErrors();\n }\n } else {\n throw new ValidationClassNotFoundException(\"Class \". self::$know_validated_rule[$rule_name] . \" not found!\");\n }\n } else {\n throw new ValidationRuleNotFoundException(\"Rule '$rule_name' not found!\");\n }\n }\n return $result;\n }", "public function isValid()\n\t{\n\t\treturn $this->valid;\n\t}", "public function isValid()\n\t{\n\t\treturn $this->valid;\n\t}", "public function validateRules();", "public function getIsValid(){\r\n\t\treturn $this->isValid;\r\n\t}", "public function isValid() : bool {\n\t\t\treturn $this->isValid;\n\t\t}", "public function is_valid()\n\t{\n\t\tif (!array_key_exists('errors', $this->vars)) $this->validate();\n\t\treturn (!count($this->get_var('errors', array())));\n\t}", "public function isValid() {\n return $this->isAccepted();\n }", "protected function rule()\n {\n if (!key_exists('value', $this->admittedFields['Mobile']) && !key_exists('value', $this->admittedFields['Phone'])) {\n $this->setErrorMsg('At least mobile or phone number are required');\n\n return false;\n }\n\n return true;\n }", "public function validate(){\r\n\t\t// make validation\r\n\t\t$res = Validator::validate( $this->value, $this->constraints );\r\n\t\tif ( !$res )\r\n\t\t\t$this->has_error = true;\r\n\r\n\t\treturn $res;\r\n\t}", "public function validate()\n {\n return true;\n }", "public function validate()\n {\n return true;\n }", "public function validate()\n {\n return true;\n }", "public function validate()\n {\n return true;\n }", "public function validate()\n {\n return true;\n }", "public function valid() : bool\n {\n return $this->errors() ? false : true;\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}" ]
[ "0.8135265", "0.7998094", "0.7949586", "0.79207087", "0.7848346", "0.7822134", "0.7803216", "0.7624212", "0.7482484", "0.74785715", "0.7434167", "0.7372512", "0.7300044", "0.7276218", "0.7268265", "0.721696", "0.72142994", "0.7207063", "0.7206368", "0.7205338", "0.7192363", "0.71921784", "0.7180164", "0.715784", "0.7120054", "0.71140933", "0.7094975", "0.7079584", "0.7064947", "0.7064079", "0.7048906", "0.7040511", "0.70378214", "0.7023095", "0.6998057", "0.69895273", "0.6982949", "0.69582605", "0.6952997", "0.69371706", "0.6932453", "0.6932453", "0.6932453", "0.6932453", "0.69103324", "0.69103324", "0.6909498", "0.6909498", "0.6909498", "0.6909498", "0.6909498", "0.6909192", "0.6906191", "0.69051605", "0.69051605", "0.69051605", "0.69051605", "0.69051605", "0.68881285", "0.685342", "0.6826829", "0.68238884", "0.6818192", "0.6815093", "0.6812909", "0.6799436", "0.67952085", "0.679295", "0.6787502", "0.67847204", "0.67778784", "0.67778784", "0.67778784", "0.6777322", "0.6777322", "0.6777322", "0.6777322", "0.6777322", "0.67763066", "0.67763066", "0.677537", "0.6775199", "0.67742115", "0.6766578", "0.6763116", "0.67493236", "0.67493236", "0.6749102", "0.6742035", "0.67103934", "0.6708182", "0.6708026", "0.6707769", "0.67022556", "0.6702222", "0.6702222", "0.6702222", "0.6702222", "0.6702222", "0.66955185", "0.668894" ]
0.0
-1
Get the validation error message.
public function message() { return '请输入正确的物流单号'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error messagess.';\n }", "public function getErrorMessage()\n {\n return $this->error_message;\n }", "public function getErrorMessage()\r\n {\r\n return $this->error_message;\r\n }", "public function get_error_message() {\n\t\treturn $this->error_message;\n\t}", "public function message()\n {\n return $this->errorText;\n }", "public function getMessage()\n {\n return $this->_error;\n }", "function getErrorMessage()\n\t{\n\t\t// Ah, we have a custom message, use that.\n\t\tif ($this->errorMessage) {\n\t\t\treturn $this->errorMessage;\n\t\t}\n\t\t\n\t\t// Field is required, but empty, so return a fill in this form message.\n\t\telse if ($this->required && $this->value == false) \n\t\t\treturn sprintf($this->getTranslationString(\"Please fill in the required '%s' field.\"), $this->label);\n\t\n\t\t// Have we got an empty error message? Create a default one\n\t\telse if (!$this->errorMessage) {\n\t\t\treturn sprintf($this->getTranslationString(\"There's a problem with value for '%s'.\"), $this->label);\n\t\t} \n\t}", "public function message()\n {\n return __(\"validation.{$this->error}\", ['attribute' => 'nomor sampel']);\n }", "public function getErrorMessage()\n {\n return $this->singleValue('//i:errorMessage');\n }", "public function getMessage()\n {\n return self::getMessageForError($this->value);\n }", "public function getMessage() {\n\n // Remove the 'validate_' prefix that GUMP adds to all broken rules.\n $key = str_replace('validate_', '', $this->rule);\n\n // Get the message template for this rule.\n $template = self::$messages[$key];\n\n // Inject our field label, and if this field has a parameter, inject that too.\n $message = preg_replace(array(\"/(%s)/\", \"/(%s)/\"), array($this->field->getLabel(), $this->parameter), $template, 1);\n\n // Return the message.\n return $message;\n }", "protected function getErrorMessage(): string\n\t{\n\t\tif($this->input !== null)\n\t\t{\n\t\t\t$errorMessage = $this->input->getErrorMessage();\n\t\t}\n\n\t\treturn $errorMessage ?? $this->defaultErrorMessage;\n\t}", "public function getErrorMessage()\n {\n // then re-apply the error code:\n if(($this->error_code !== 0) && empty($this->error_msg))\n {\n $this->setError($this->error_code);\n }\n return $this->error_msg;\n }", "public function message()\n {\n return $this->getError();\n }", "function get_error_message() {\n return $this->error_msg;\n }", "public function getErrorMessage() {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n\t{\n\t\treturn $this->errorMessage;\n\t}", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function message()\n {\n if ($this->error['type'] === 'custom') {\n return $this->error['message'];\n }\n\n $messages = null;\n\n if ($this->request) {\n $messages = $this->request->messages();\n }\n\n $message = $messages[\"{$this->error['attribute']}.check_file_{$this->error['type']}\"] ??\n trans(\"validation.check_file_{$this->error['type']}\");\n\n [$keys, $values] = Arr::divide($this->error['payload'] ?? []);\n\n $keys = \\array_map(function (string $key) {\n return \":{$key}\";\n }, $keys);\n\n return \\str_replace($keys, $values, $message);\n }", "public function message()\n {\n return $this->errorMsg;\n }", "public function getMessage()\n {\n return isset($this->data->failure_msg) ? $this->data->failure_msg : '';\n }", "function getMessage()\n {\n return ($this->error_message_prefix . $this->message);\n }", "public function message()\n {\n return $this->validationFailures;\n }", "public function message()\n {\n return $this->error_message;\n }", "public function getErrorMessage() : string\n {\n return $this->errorMessage;\n }", "public function message()\n {\n return $this->errorMessage;\n }", "public function message()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n\t{\n\t\treturn $this->_errorMessage;\n\t}", "public function getErrorMessage()\n {\n return $this->applyTemplate();\n }", "public function message()\n {\n return 'Invalid message mark up.';\n }", "public function getErrorMessage()\n {\n $errorMessages = $this->getErrorMessages();\n if (empty($errorMessages)) {\n return false;\n }\n return $errorMessages[0];\n }", "public function getErrMsg() {\n return $this->get(self::ERR_MSG);\n }", "public function getErrorMessage();", "public function getErrorMessage();", "public function getErrMsg()\n {\n return $this->get(self::ERRMSG);\n }", "public function getMessage(): string\n\t{\n\t\treturn $this->err->getMessage();\n\t}", "public function getErrorMessage(): string\n {\n if ($this->getSuccess()) {\n return '';\n }\n\n return (string) $this->errorMessage;\n }", "public function message(): string\n {\n return $this->errorMessage;\n }", "public function getErrorMessage() {\n return '';\n }", "public function errorMessage()\n {\n $errorMsg = '<strong>' . $this->getMessage() . \"</strong><br />\\n\";\n return $errorMsg;\n }", "public function getErrorMessage()\n {\n return $this->validator->errors()->all();\n }", "public function getMsgError() {\r\n return $this->msg_error;\r\n }", "public function message(): string\n {\n return $this->getValidationMessage(Str::snake(class_basename($this)), __('The :attribute size cannot exceed :max_size.', ['max_size' => $this->bytesToHuman($this->max_size)]));\n }", "protected function getMessage(\\Phalcon\\Validation $validator)\n {\n // get message\n $message = $this->getOption('message');\n if (! $message) {\n $message = $this->message;\n }\n return $message;\n }", "public function getMessage()\n {\n // check if any error message available.\n if (!is_null($this->_message)) {\n // return the message\n return $this->lang->line($this->_message) ? $this->lang->line($this->_message) : $this->_message;\n }\n\n // return nothing if previous condition does not apply\n return NULL;\n }", "public function errorMessage() {\n\t\t\treturn $this->strError; \n\t\t}", "public final function getLastErrorMsg() {\n return $this->lastErrorMsg;\n }", "public function getRuleError()\n {\n if(!isset($this->rules_objects_list[$this->table_name]))\n return '';\n\n //current table rules object\n $l_target = $this->rules_objects_list[$this->table_name];\n\n if($l_target->rules_error_flag)\n return $l_target->rules_error_message;\n\n return '';\n }", "public function message()\n {\n return \"Ошибочное значение\";\n }", "public function getErrorMessage(): string\n {\n static $errors = [\n UPLOAD_ERR_OK => 'No error found.',\n UPLOAD_ERR_INI_SIZE => 'The file \"%s\" exceeds your upload_max_filesize ini directive (limit is %d kb).',\n UPLOAD_ERR_FORM_SIZE => 'The file \"%s\" exceeds the upload limit defined in your form.',\n UPLOAD_ERR_PARTIAL => 'The file \"%s\" was only partially uploaded.',\n UPLOAD_ERR_NO_FILE => 'No file was uploaded.',\n UPLOAD_ERR_CANT_WRITE => 'The file \"%s\" could not be written on disk.',\n UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.',\n UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.',\n ];\n\n $errorCode = $this->error;\n $maxFilesize = $errorCode === UPLOAD_ERR_INI_SIZE ? self::getMaxFilesize() / 1024 : 0;\n $message = $errors[$errorCode] ?? 'The file \"%s\" was not uploaded due to an unknown error.';\n\n return sprintf($message, $this->getOriginalName(), $maxFilesize);\n }", "public function getErrMsg() {\n $errMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()\n . '<br><b>Message: ' . $this->getMessage()\n . '</b><br>Exception Type: NoFormsFoundException';\n return $errMsg;\n }", "public function getErrorMessage(): ?string {\n\t\t// 1. a string with an error message (e.g. `{\"error\":{\"code\":404,\"errors\":\"invalid token\"},\"success\":false}`)\n\t\t// 2. an object (e.g. `{\"error\":{\"code\":120,\"errors\":{\"name\":\"payload\",\"reason\":\"required\"}},\"success\":false}`)\n\t\t//\n\t\t// Below is an attempt to make sense of such craziness.\n\t\t$error = $this->getValue('[error][errors]');\n\t\tif ($error === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!is_array($error)) {\n\t\t\t$error = [\n\t\t\t\t'name' => 'generic',\n\t\t\t\t'reason' => $error,\n\t\t\t];\n\t\t}\n\n\t\treturn sprintf(\n\t\t\t'name=%s, reason=%s',\n\t\t\t(array_key_exists('name', $error) ? $error['name'] : 'missing'),\n\t\t\t(array_key_exists('reason', $error) ? $error['reason'] : 'missing')\n\t\t);\n\t}", "function getErrorMsg() {\n\t\treturn $this->errorMsg;\n\t}", "public function errorMessage()\n\t{\n\t\treturn $this->_source->errorMessage();\n\t}", "public function getMessage(): string\n {\n return $this->requireString('message');\n }", "public function getErrorMessage($input) {\n\t\treturn $input . ' is invalid.';\n\t}", "public function message()\n {\n return 'Invalid phone number format.';\n }", "public function getErrorMessage() {\n\t\tswitch( $this->error ) {\n\t\t\tcase TAN_NOT_FOUND : return \"Die TAN wurde nicht gefunden\";\n case REGISTRATION_USER_EXISTS : return \"Dieser Nutzer Existiert bereits\";\n\t\t}\n\t}", "public function message()\n {\n return $this->doorman->error;\n }", "public function message()\n {\n return trans('validation.custom.phone.error');\n }", "public function message()\n {\n return trans('validation.BTCValidation');\n //return trans('validation.uppercase');\n }", "public function getMessage(): string\n {\n return \"The $this->name field is not a valid date.\";\n }", "public final function last_error_message()\n {\n return isset($this->error) ? $this->error['message'] : '';\n }", "public function getError(): string\n {\n return $this->Error;\n }", "public function getErrorMessage()\n {\n $error = $this->_checkoutSession->getErrorMessage();\n return $error;\n }", "function error() {\n return $this->error_message;\n }", "public function getError(){\n if (empty($this->getErrorCode())) {\n return null;\n }\n return $this->getErrorCode().': '.$this->getErrorMessage();\n }", "public function getError(): string\n {\n return $this->error;\n }", "public function getErrorMessage():? string\n {\n return $this->errorMessage;\n }", "public function publicErrorMessage()\n\t{\n\t\t$errorMsg = $this->getMessage().' is not a valid E-Mail address.';\n\t\treturn $errorMsg;\n\t}", "public function message()\n {\n switch ($this->errorType) {\n case self::ERROR_TYPE_NUMERIC:\n $msg = 'Điện thoại phải là chữ số';\n break;\n case self::ERROR_TYPE_LENGTH:\n $msg = 'Điện thoại phải có độ dài từ 10 hoặc 11 số';\n break;\n default:\n $msg = 'Số điện thoại không đúng định dạng';\n break;\n }\n return $msg;\n }", "protected function getErrorFlashMessage() {\n\t\treturn $this->translate('tx_placements.error'.'.organization.'. $this->actionMethodName);\n\t }", "public function getFailedMessage()\n {\n if (array_key_exists(\"failedMessage\", $this->_propDict)) {\n return $this->_propDict[\"failedMessage\"];\n } else {\n return null;\n }\n }", "public function errorMessage() { return $this->errorMessage; }", "public function getErrorMessage()\n {\n return null;\n }", "public function errorMessage()\n {\n return $this->provider->errorMessage;\n }", "public function errorMessage()\n {\n return $this->error;\n }", "function errorMsg() {\r\n return \r\n $this->resultError;\r\n }", "public function message()\n {\n return 'Recaptcha validation failed.';\n }", "public function messages()\n {\n return VALIDATION_MESSAGE;\n }", "public function messages()\n {\n return VALIDATION_MESSAGE;\n }", "public function getValidationErrorMessages() {}", "public static function message()\n {\n return __('validation.translate_required');\n }", "public function getError() : string\r\n {\r\n return $this->strError;\r\n }", "public function message()\n {\n return 'The Phone Number does not match the expected format';\n }", "public function message()\n {\n return 'O Titulo de eleitor digitado é invalido';\n }", "public function getErrorText(){\n return $this->error;\n }", "public function getValidatedMessage(){\n $valid = $this->getIsValid();\n if(!is_null($valid)){\n if($valid === false) $key = 'error';\n else $key = 'success';\n return \"<p class=\\\"form_{$key}\\\">{$this->validatedMessage[$key]}</p>\";\n }\n return '';\n }", "public function message()\n {\n return 'Errores en plantilla<li>'.join('</li><li>',$this->invalid);\n }" ]
[ "0.8368853", "0.8368853", "0.8368853", "0.8368853", "0.8368853", "0.8368853", "0.8207248", "0.8094182", "0.8061137", "0.80309856", "0.8023962", "0.79981095", "0.7994271", "0.79576373", "0.7955562", "0.7948321", "0.7938317", "0.7914095", "0.78989285", "0.78862643", "0.78477675", "0.78278995", "0.7820734", "0.78084075", "0.78084075", "0.78084075", "0.78084075", "0.78084075", "0.78084075", "0.78084075", "0.78047746", "0.7791322", "0.777954", "0.77778727", "0.77716756", "0.77658075", "0.7762871", "0.7700995", "0.7700995", "0.7690562", "0.76759744", "0.7670985", "0.76627505", "0.7611973", "0.7593284", "0.7593284", "0.7588579", "0.75603616", "0.75542986", "0.75334644", "0.7519062", "0.7456365", "0.74313736", "0.7404993", "0.73731256", "0.73456687", "0.73453265", "0.7322456", "0.73109883", "0.73097974", "0.73096555", "0.7306417", "0.7298058", "0.7262625", "0.7258779", "0.7251916", "0.7245762", "0.7235462", "0.7227823", "0.7226286", "0.72256136", "0.7219457", "0.72138363", "0.72109324", "0.7205099", "0.7190278", "0.71763974", "0.7174699", "0.7172004", "0.7169085", "0.7161534", "0.71573865", "0.7155334", "0.7152703", "0.7149651", "0.71428394", "0.7142287", "0.7136937", "0.71314335", "0.71309406", "0.7130864", "0.71253085", "0.71253085", "0.71201915", "0.7118912", "0.71098405", "0.71092737", "0.71021503", "0.70993507", "0.7079352", "0.70751965" ]
0.0
-1
show user with data table
public function fetch_user() { //echo '<pre>';print_r($_POST);die; $fetch_data = $this->user_model->datatables(); $data = array(); // echo '<pre>';print_r($fetch_data);die; $i = 1; foreach ($fetch_data as $row) { $html = ''; $html .= '<button data-id="'.$row->id.'" type="button" class="btn btn-primary btn-sm edit_user_btn" href="javascript:void(0)"> Edit</button> <a href="'.base_url().'delete-user/ '.$row->id.'" class="btn btn-danger btn-sm">Delete</a>'; $test = array(); $test[] = $i; $test[] = $row->name; $test[] = $row->email; $test[] = $row->user_mobile; $test[] = $row->user_address; $test[] = $row->user_type; $test[] = '<img height="50" weidtht="50" src="'.base_url().'uploads/'.$row->user_image.'">'; $test[] = $html; $data[] = $test; $i++; //echo '<pre>';print_r($data);die; } $output = array( "draw" => intval($_POST["draw"]), "recordsTotal" => $this->user_model->get_all_data(), "rescordsFiltered" => $this->user_model->get_filtered_data(), "data" => $data ); echo json_encode($output); //echo '<pre>';print_r($output);die; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function showUserTable() {\n echo \"<table id='users'>\n <tr>\n <th></th>\n <th>Utilisateur</th>\n <th>Mail</th>\n <th>Date de naissance</th>\n <th>Note</th>\n <th>Voitures</th>\n <th>Commentaires</th>\n </tr>\";\n for ($i = 0; $i < count(User::$listOfUsers); $i++ ) {\n echo \"<tr>\";\n echo \"<td>\";\n $iLink = $i + 1;\n echo \"<a href='users.php?user=$iLink'>Voir</a>\";\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getFirstName() . \" \" . User::$listOfUsers[$i]->getLastName();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getEmail();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getBirthDate();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getRate();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getListOfCars();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getListOfComments();\n echo \"</td>\";\n echo \"</tr>\";\n }\n echo \"</table>\";\n }", "public function ctrShowTableUser(){\n\n $item = null;\n $valor = null;\n\n $usuarios = ControllerUser::ctrShowUsers($item, $valor);\n\n $datosJson = '\n {\n \"data\":[';\n\n for($i = 0; $i < count($usuarios); $i++){\n \n $datosJson .= '[\n \"'.($i+1).'\",\n \"'.$usuarios[$i][\"id_institucion\"].'\",\n \"'.$usuarios[$i][\"acceso\"].'\",\n \"'.$usuarios[$i][\"nombre\"].'\",\n \"'.$usuarios[$i][\"labor\"].'\",\n \"'.$usuarios[$i][\"grupo\"].'\",\n \"'.$usuarios[$i][\"password\"].'\",\n \"'.$usuarios[$i][\"email\"].'\",\n \"'.$usuarios[$i][\"foto\"].'\",\n \"'.$usuarios[$i][\"verificacion\"].'\",\n \"'.$usuarios[$i][\"emailEncriptado\"].'\",\n \"'.$usuarios[$i][\"fecha\"].'\"\n ],';\n\n }\n\n $datosJson = substr($datosJson, 0, -1);\n\n $datosJson .= ']\n\n }\n\n ';\n\n echo $datosJson;\n\n }", "function printUserTable() {\n\tglobal $dbh;\n\t$users = User::getAllUsers($dbh);\n\t//var_dump($users);\n\tforeach($users as $user) {\n\t\techo \"<p>\" . $user . \"</p>\";\n\t}\n}", "private function printUserData($user)\n {\n $this->info(\"Found a user:\");\n\n $table = new Table(new ConsoleOutput);\n\n $table->setHeaders(['id', 'name', 'e-mail', 'activated', 'last_login', 'created_at'])\n ->setRows($user->toArray())\n ->render();\n }", "public function index(UserDataTable $dataTable){\n return $dataTable->render('user::index');\n }", "function show_users($conn) {\n\t$sql = \"SELECT * FROM Officer;\";\n\t$result = mysqli_query($conn, $sql);\n\techo \"<table>\";\n\techo \"<tr>\";\n\techo \"<th>Username </th>\";\n\techo \"<th> Role </th>\";\n\techo \"</tr>\";\n\twhile ($row = mysqli_fetch_assoc($result)) {\n\t\t$name = $row[\"Officer_Username\"];\n\t\t$role = $row[\"Officer_Role\"];\n\t\techo \"<tr>\";\n\t\techo \"<td>\". $name. \"</td>\";\n\t\techo \"<td>\". $role. \"</td>\";\n\t\techo \"</tr>\";\n\t}\n\techo \"</table>\";\n\t\n}", "protected function show()\n {\n $userModel = config('admin.database.users_model');\n\n $headers = ['User Name', 'Name', 'Roles', 'Permissions', 'Routes', 'Actions', 'Created', 'Updated'];\n\n $userslist = [];\n foreach ($userModel::all() as $user) {\n $roles = implode(',', $user->roles->pluck('name')->toArray());\n\n $userdata = [\n 'username' => $user->username,\n 'name' => $user->name,\n 'roles' => $roles,\n 'permission' => implode(\"\\n\", $user->allPermissions(true)->pluck('name')->toArray()),\n 'routes' => implode(\"\\n\", $user->allRoutes(true)->pluck('http_path')->toArray()),\n 'actions' => implode(\"\\n\", $user->allActions(true)->pluck('name')->toArray()),\n 'created_at' => date($user->created_at),\n 'updated_at' => date($user->updated_at),\n ];\n\n array_push($userslist, $userdata);\n }\n\n $this->table($headers, $userslist);\n }", "public function index()\n {\n\n Gate::authorize('haveaccess','user.index');\n\n //$users = User::orderBy('id','Asc')->paginate(8);\n\n //return view('user.index',compact('users'));\n\n //$users = User::all();\n\n return datatables()\n ->eloquent(User::query())\n //->eloquent($users)\n ->addColumn('accion', 'user.adicionales' )\n ->rawColumns(['accion'])\n ->toJson();\n\n }", "public static function showUserTableFromDb() {\n $model = new UserModel();\n $users = $model->getUsers();\n\n echo \"<table id='users'>\n <tr>\n <th></th>\n <th>Utilisateur</th>\n <th>Date de création</th>\n <th>Mail</th>\n <th>Date de naissance</th>\n <th>Note</th>\n <th>Voitures</th>\n <th>Commentaires</th>\n </tr>\";\n for ($i = 0; $i < count($users); $i++ ) {\n\n $user = $users[$i];\n array_push(User::$listOfUsers, $user);\n\n echo \"<tr>\";\n echo \"<td>\";\n $iLink = $i + 1;\n echo \"<a href='users.php?user=$iLink'>Voir</a>\";\n echo \"</td>\";\n echo \"<td>\";\n echo $user['firstName'] . \" \" . $user['lastName'];\n echo \"</td>\";\n echo \"<td>\";\n echo $user['date'];\n echo \"</td>\";\n echo \"<td>\";\n echo $user['email'];\n echo \"</td>\";\n echo \"<td>\";\n echo $user['birthDate'];\n echo \"</td>\";\n echo \"<td>\";\n if($user['rate'] === '0') { echo \"Pas de note\"; }\n echo \"</td>\";\n echo \"<td>\";\n echo $user['listOfCars'];\n echo \"</td>\";\n echo \"<td>\";\n echo $user['listOfComments'];\n echo \"</td>\";\n echo \"</tr>\";\n }\n $_SESSION['listOfUsers'] = User::$listOfUsers;\n\n echo \"</table>\";\n }", "function view($data)\n{\n\t\t\n\tstartOfPage();\n\tstartContent();\t\n\t$users = $data[\"users\"];\n\techo '<table><tr><th>USERNAME</th><th>EMAIL</th></tr>';\n\tif (!empty($users))\n\t{\n\tforeach ($users as $user)\n\t\t{\n\t\techo '<tr><td>',$user[\"username\"],'</td>';\n\t\techo '<td>',$user[\"email\"],'</td></tr>';\n\t\t}\n\n }\n echo '</table>';\n\tendContent();\n\tendOfPage();\n\n}", "public function usersTable()\n {\n $users = User::all();\n return view('admin.users')->with('admin', Auth::user())\n ->with('users', $users);\n }", "public function index(){\n\t\t$data = array();\n\n\t\t$select_fields = '*';\n \t$is_multy_result = 2;\n\t\t$conditions = \"\";\n\t\t$data['users'] = $this->BlankModel->getTableData(USERS, $conditions, $select_fields, $is_multy_result);\t\n\t\t\t\t\n\t\tcommon_viewloader('users/index', $data);\n }", "function displayAllUser() {\n\t\t$sql = \"SELECT * FROM accounts\";\n\t\t$result = $this->connection->query($sql);\n\t\techo \"Displays all users\";\n\t\techo '<table style=\"border-style: ridge; border-width:6px\">';\n\t\techo '<th style=\"text=align:center;font-weight:bold\">ID</th>';\n\t\techo '<th style=\"text=align:center;font-weight:bold\">Email</th>';\n\t\techo '<th style=\"text=align:center;font-weight:bold\">First Name</th>';\n\t\techo '<th style=\"text=align:center;font-weight:bold\">Last Name</th>';\n\t\techo '<th style=\"text=align:center;font-weight:bold\">Phone</th>';\n\t\techo '<th style=\"text=align:center;font-weight:bold\">Birthday</th>';\n\t\techo '<th style=\"text=align:center;font-weight:bold\">Gender</th>';\n\t\techo '<th style=\"text=align:center;font-weight:bold\">Password</th>';\n\t\techo '</tr>';\n\t\t\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\techo \"<tr>\";\n\t\t\techo \"<td>\".$row[\"id\"].\"</td>\";\n\t\t\techo \"<td>\".$row[\"email\"].\"</td>\";\n\t\t\techo \"<td>\".$row[\"fname\"].\"</td>\";\n\t\t\techo \"<td>\".$row[\"lname\"].\"</td>\";\n\t\t\techo \"<td>\".$row[\"phone\"].\"</td>\";\n\t\t\techo \"<td>\".$row[\"birthday\"].\"</td>\";\n\t\t\techo \"<td>\".$row[\"gender\"].\"</td>\";\n\t\t\techo \"<td>\".$row[\"password\"].\"</td>\";\n\t\t\techo \"</tr>\";\n \t}\n \techo \"</table>\";\n\t\techo \"<br>\";\n\t}", "public function get()\n\t{\n\t \n\n\t\t// Get data user\n\t\t$result = $this->datatables->getData('user', array('user_paysal','user_identityNo','user_name','user_full_name','user_email','user_phone','user_address','group_name','region_name','user_group','user_password','user_region','user_id'), 'user_id', array('groups','groups.group_id = user.user_group','inner'),array('regions','regions.region_id = user.user_region','inner'));\n\t\t\n\t\t\n\t\t\n\t\techo $result;\n\t}", "public function showUsers()\n {\n $users = User::join('role_user', 'role_user.user_id', 'users.id')\n ->join('roles', 'roles.id', 'role_user.role_id')\n ->select(['users.id', 'users.name', 'users.email', 'surname', 'contact_number', 'users.created_at', 'users.updated_at', 'display_name']);\n\n return Datatables::of($users)\n ->addColumn('action', function ($user) {\n $re = 'users/' . $user->id;\n $sh = 'users/show/' . $user->id;\n $del = 'users/delete/' . $user->id;\n return '<a class=\"btn btn-primary\" href=' . $sh . ' style=\"margin:0.4em;\"><i class=\"glyphicon glyphicon-eye-open\"></i></a> <a class=\"btn btn-success\" style=\"margin:0.4em;\" href=' . $re . '><i class=\"glyphicon glyphicon-edit\"></i></a> <a class=\"btn btn-danger\" style=\"margin:0.4em;\" href=' . $del . '><i class=\"glyphicon glyphicon-trash\"></i></a>';\n })\n ->make(true);\n }", "public function index(UserDataTable $dataTable) \n {\n return $dataTable->render('users.index');\n }", "function listUser()\n {\n $conn = new mysqli(SERVER, USER, PASSWORD, DB);\n $sql = \"SELECT id_user, tb_user.nombre, apellidos, tb_tip_doc.tip_doc AS tip_doc,num_doc, correo,\n celular, password, tb_tip_user.nombre AS tip_user, tb_business.nombre AS nombreempresa, date_create\n FROM tb_user\n INNER JOIN tb_tip_doc ON tb_user.id_tip_doc=tb_tip_doc.id_tip_doc\n INNER JOIN tb_tip_user ON tb_user.id_tip_user=tb_tip_user.id_tip_user\n INNER JOIN tb_business ON tb_user.id_business=tb_business.id_business \";\n $result = $conn->query($sql);\n if ($result->num_rows > 0)\n {\n $table = \"\";\n $table .=\"<table id='example2' class='table table-bordered table-hover'>\";\n $table .=\"<thead>\";\n $table .=\"<tr>\";\n $table .=\"<th>ID</th>\";\n $table .=\"<th>NOMBRE</th>\";\n $table .=\"<th>APELLIDOS</th>\";\n $table .=\"<th>TIP DOC</th>\";\n $table .=\"<th>DOCUMENTO</th>\";\n $table .=\"<th>CORREO</th>\";\n $table .=\"<th>CELULAR</th>\";\n $table .=\"<th>TIP USUARIO</th>\";\n $table .=\"<th>EMPRESA</th>\";\n $table .=\"<th>CREACION</th>\";\n $table .=\"<th>OPCIONES</th>\";\n $table .=\"</tr>\";\n $table .=\"</thead>\";\n // output data of each row\n while($row = $result->fetch_assoc())\n {\n $table .=\"<thead>\";\n $table .= \"<tr>\";\n $table .= \"<td>\".$row['id_user'].\"</td>\";\n $table .= \"<td>\".$row['nombre'].\"</td>\";\n $table .= \"<td>\".$row['apellidos'].\"</td>\";\n $table .= \"<td>\".$row['tip_doc'].\"</td>\";\n $table .= \"<td>\".$row['num_doc'].\"</td>\";\n $table .= \"<td>\".$row['correo'].\"</td>\";\n $table .= \"<td>\".$row['celular'].\"</td>\";\n $table .= \"<td>\".$row['tip_user'].\"</td>\";\n $table .= \"<td>\".$row['nombreempresa'].\"</td>\";\n $table .= \"<td>\".$row['date_create'].\"</td>\";\n $table .= \"<td><a href=''><i class='nav-icon fas fa-edit' style='color:#239200;'></i></a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\";\n $table .= \"<a href=''><i class='nav-icon fas fa-trash-alt' style='color:red;'></i></a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\";\n $table .= \"<a href=''><i class='nav-icon fas fa-info-circle' style='color:blue;'></i></td>\";\n $table .= \"</tr>\";\n $table .=\"</thead>\";\n }\n $table .=\"</table>\";\n return $table;\n\n }\n\n }", "public function userlist()\n {\n $users = array('users' => UserModel::getPublicProfilesOfAllUsers(),'dynatable'=>'userlist');\n $this->View->render('user/userlist',$users);\n }", "public function index(UsersDataTable $dataTable)\n {\n return $dataTable->render(\"user.index\");\n }", "public function actionIndex()\n {\n $request = \\Yii::$app->request;\n $pageSize = $request->get('pageSize', 30);\n\n $userdb = new User();\n\n $response = $userdb->getUserList($pageSize);\n\n $userData = $response['data'];\n $results = [];\n if(!empty($userData) && is_array($userData)){\n foreach ($userData as $row){\n $results[$row->id] = [\n 'id' => $row->id,\n 'username' => $row->username,\n 'role_name' => $row->role['name'],\n 'create_time' => date('Y-m-d H:i:s',$row['create_time']),\n ];\n }\n }\n\n $dataProvider = new ArrayDataProvider([\n 'sort' => [\n 'attributes' => ['id'],\n ],\n 'pagination' => [\n 'pageSize' => $pageSize,\n 'totalCount' => $response['count']\n ]\n ]);\n $dataProvider->setModels($results);\n $dataProvider->setTotalCount($response['count']);\n\n return $this->render('index',['dataProvider' => $dataProvider]);\n }", "public function show(Userdato $userdato)\n {\n //\n }", "public function show_alluser_datatbl()\n {\n $model = new mainModel();\n $UserId = session()->get('userid');\n $responese = $model->getAllUserDetails($UserId);\n return Datatables::of($responese)\n ->addIndexColumn()\n ->addColumn('master_roleId', function ($query) {\n $masterROles = $query->master_roleId;\n $sql = \"SELECT GROUP_CONCAT(MASTER_ROLE_NAME ,'') as 'MASTER_ROLE_NAME' FROM mst_tbl_master_role WHERE MASTER_ROLE_ID IN($masterROles) \";\n $info = DB::select(DB::raw($sql));\n // print_r();\n return $info[0]->MASTER_ROLE_NAME;\n })\n ->addColumn('REPORTING_MANGERS', function ($query) {\n $REPORTING = $query->REPORTING_MANGERS;\n $sql = \"SELECT GROUP_CONCAT(username ,'') as 'REPORTING_MANGERS' FROM mst_user_tbl WHERE userId IN($REPORTING) \";\n $info = DB::select(DB::raw($sql));\n // print_r();\n return $info[0]->REPORTING_MANGERS;\n })\n ->addColumn('PRIMARY_MANGER', function ($query) {\n if ($query->PRIMARY_MANGER != null) {\n $assinedusers = DB::table('mst_user_tbl')->where(['Flag' => 'Show', 'userId' => $query->PRIMARY_MANGER])->get()->first();\n return $assinedusers->username;\n } else {\n return 'Not Assinded';\n }\n })->addColumn('SHIFT_ID', function ($query) {\n if ($query->SHIFT_ID != 0) {\n $assinedShift = DB::table('mst_tbl_shifts')->where(['Flag' => 'Show', 'SHIFT_ID' => $query->SHIFT_ID])->get()->first();\n return $assinedShift->SHIFT_NAME;\n } else {\n return 'No Shifts';\n }\n })\n ->addColumn('action', function ($query) {\n $id = Crypt::encrypt($query->userId);\n return '<a href=\"' . action('Admin\\UserController@editUser', Crypt::encrypt($query->userId)) . '\" id=\"userform' . $query->userId . '\"><img src=\"/asset/css/zondicons/zondicons/edit-pencil.svg\" style=\"width: 15px;margin-right: 20px; filter: invert(0.5);\" alt=\"\"></a>\n <a href=\"javascript:void(0)\" onclick=\"deleteUser(' . \"'$id'\" . ',event)\"><img src=\"/asset/css/zondicons/zondicons/close.svg\"\n style=\"width: 15px; filter: invert(0.5);\" alt=\"\"></a>\n ';\n })\n ->rawColumns(['action', 'PRIMARY_MANGER', 'master_roleId', 'REPORTING_MANGERS'])\n ->make(true);\n\n }", "public function bddAction()\n {\n $u = new UserTable();\n //$u->displayClass($u);\n $user = $u->findOne(\"login = ?\", ['coquel_d']);\n }", "public function show_usrlist($eltxtusr)\n {\n // load library to cek user session and level\n $this->pageauth->sess_level_auth();\n $this->load->model('pages/m_crud_report');\n $query = $this->m_crud_report->select_usrlist($eltxtusr);\n ?>\n <!-- tampilkan ketika dalam mode print -->\n <div class=\"title\" align=\"center\" style=\"margin-top: 10px;\">\n DAFTAR PENGGUNA (USER)<br/>\n YANG TERDAFTAR DALAM SISTEM\n </div>\n <table id=\"id_tblusr\" class=\"display compact table-hover\" role=\"grid\" aria-describedby=\"example2_info\">\n <thead>\n <tr>\n <th>NAMA USER</th>\n <th>KATA KUNCI</th>\n <th>AKSES</th>\n <th>NAMA LENGKAP</th>\n <th>OTORISASI</th>\n </tr>\n </thead>\n <tbody id=\"id_TbodyRptUsr\">\n <?php\n foreach ($query->result() as $row) {\n echo \" <tr>\";\n echo \" <td>\". $row->username .\"</td>\";\n echo \" <td>\". $row->password .\"</td>\";\n echo \" <td>\". $row->access .\"</td>\";\n echo \" <td>\". $row->fullname .\"</td>\";\n echo \" <td>\". $row->obj_level .\"</td>\";\n echo \" </tr>\";\n }\n ?>\n </tbody>\n </table>\n <?php\n }", "public function index()\n {\n return view('userTable');\n }", "public function showUsers(){\n\n\t\ttry{\n\t\t\trequire CONTROLLER_DIR . '/dbConnecterController.php';\n\n\t\t\t$result = $db->query('SELECT id, username FROM users ORDER BY id');\n\n\n\t\t\techo \"<table border='1'>\n\t\t\t\t<tr>\n\t\t\t\t<th>ID</th>\n\t\t\t\t<th>Username</th>\n\t\t\t\t<th></th>\n\t\t\t\t<th></th>\n\t\t\t\t</tr>\";\n\t\t\t// This will make it so admin is not displayed on the table\n\t\t\t$row = $result->fetchColumn();\n\t\t\twhile($row = $result->fetch(PDO::FETCH_ASSOC)){\n\t \t\t\techo \"<tr>\";\n\t\t echo \"<td>\" . $row['id'] . \"</td>\";\n\t\t echo \"<td>\" . $row['username'] . \"</td>\";\n\t\t echo '<td> \n\t\t \t\t<form method=\"GET\" action=\"/showEditUserPage\"> \n\t\t \t\t\t<input type=\"hidden\" name=\"id\" value=\"' . $row['id'] . '\"/>\n\t\t\t \t\t<input type=\"hidden\" name=\"username\" value=\"' . $row['username'] . '\"/>\n\t\t \t\t\t<input type=\"submit\" value=\"EDIT\" name=\"showEditUserPage\"/> \n\t\t \t\t</form></td>';\n\t\t echo '<td> \n\t\t \t\t<form method=\"POST\" action=\"/deleteUser\"> \n\t\t\t \t\t<input type=\"hidden\" name=\"id\" value=\"' . $row['id'] . '\"/>\n\t\t \t\t\t<input type=\"submit\" value=\"DELETE\" name=\"deleteUser\"/> \n\t\t \t\t</form></td>';\n\t\t echo \"</tr>\";\n\t\t\t}\n\t\t\techo '</table>';\n\n\t\t} catch (PDOException $e) {\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"<br/>\";\n\t\t\tdie();\n\t\t}\n\t}", "function print_user_info($query_result) {\n\n $row = pg_fetch_row($query_result);\n\n echo '<div class=\"user-info pure-g\">';\n echo '<div class=\"pure-u pure-u-1-6\">';\n echo '<dl><dt>UID</dt><dd>'.$row[0].'</dd></dl>';\n echo '</div>';\n echo '<div class=\"pure-u pure-u-1-6\">';\n echo '<dl><dt>First Name</dt><dd>'.$row[1].'</dd></dl>';\n echo '</div>';\n echo '<div class=\"pure-u pure-u-1-6\">';\n echo '<dl><dt>Last Name</dt><dd>'.$row[2].'</dd></dl>';\n echo '</div>';\n echo '<div class=\"pure-u pure-u-1-6\">';\n echo '<dl><dt> Gender</dt><dd>'.$row[3].'</dd></dl>';\n echo '</div>';\n echo '<div class=\"pure-u pure-u-1-6\">';\n echo '<dl><dt>Age</dt><dd>'.$row[4].'</dd></dl>';\n echo '</div>';\n echo '<div class=\"pure-u pure-u-1-6\">';\n echo '<dl class=\"last-child\"><dt>Location</dt><dd>'.$row[5].'</dd></dl>';\n echo '</div>';\n echo '</div>';\n }", "public function showListAction() {\n $users = $this->getDoctrine()\n ->getRepository(User::class)\n ->findAll();\n return $this->render(':Security\\User:users.html.twig', [\n 'users' => $users\n ]);\n }", "public function getdata(){\n\n $type = \\Request::query('only');\n\n $user = DB::table('users');\n $user->select('*');\n\n if($type=='admins'){\n $user->where('usertype', '=', 'Admin');\n }elseif($type=='staff'){\n $user->where('usertype', '=', 'Staff');\n }elseif($type=='banned'){\n $user->where('usertype','=', 'banned');\n }\n\n\n\n return Datatables::of($user)\n\n ->addColumn('icon', function ($user) {\n\n return view('._admin._particles.datatable.userlist.icon', compact('user'))->render();\n\n })->addColumn('username', function ($user) {\n\n return view('._admin._particles.datatable.userlist.username', compact('user'))->render();\n\n })->addColumn('email', function ($user) {\n\n return view('._admin._particles.datatable.userlist.email', compact('user'))->render();\n\n })->addColumn('status', function ($user) {\n\n return view('._admin._particles.datatable.userlist.status', compact('user'))->render();\n\n })->addColumn('created_at', function ($user) {\n\n return view('._admin._particles.datatable.userlist.created_at', compact('user'))->render();\n\n })->addColumn('updated_at', function ($user) {\n\n return view('._admin._particles.datatable.userlist.updated_at', compact('user'))->render();\n\n })->addColumn('action', function ($user) {\n\n return view('._admin._particles.datatable.userlist.action', compact('user'))->render();\n\n })->make(true);\n\n }", "public function index(UserDataTable $dataTable)\n {\n return $dataTable->render('dashboard.users.index');\n }", "public function index()\n {\n $result = User::leftJoin('positions', 'employees.positionId', '=', 'positions.id')\n ->leftJoin('departments', 'employees.iDeptId', '=', 'departments.id')\n ->leftJoin('regions', 'employees.iRegion', '=', 'regions.id')\n ->select('employees.*','positions.positionName', 'departments.deptName','regions.regionName','employees.isDeactivated')\n ->getQuery() // Optional: downgrade to non-eloquent builder so we don't build invalid User objects.\n ->get();\n \n return Datatables::of($result)->make(true);\n }", "public function visualizzazione(){\n $nameColumn = $this->getColumnName();\n $tuple = $this->read();\n foreach($nameColumn as $nome){\n $x = ' <td> '. $nome . ' </td> ';\n echo $x;\n }\n \n foreach($tuple as $ris){\n $str ='<tr> <td> '.$ris->getId(). ' </td> '.\n '<td> '.$ris->getNome(). '</td>'.\n '<td> '.$ris->getUsername(). '</td>'.\n '<td> '.$ris->getPassword(). '</td>'.\n '<td> '.$ris->getEmail(). '</td>'.\n '<td> '.$ris->getMuseo(). '</td>'.\n '</tr>';\n echo $str;\n };\n }", "public function index(UserDataTable $dataTable)\n {\n //過濾器\n if (!request()->ajax()) {\n /** @var Collection|Role[] $roles */\n $roles = Role::withCount('users')->get();\n $roleNameOptions = [null => ''];\n foreach ($roles as $role) {\n $roleNameOptions[$role->name] = $role->display_name . ' (' . $role->users_count . ')';\n }\n view()->share(compact('roleNameOptions'));\n }\n //過濾\n if ($selectedRole = Role::whereName(request('role'))->first()) {\n $dataTable->addScope(new UserRoleScope($selectedRole));\n }\n\n return $dataTable->render('user.index');\n }", "public function index(UsersDataTable $dataTable)\n {\n // return view('users', [\n // 'users' => User::orderBy('id', 'asc')->get(),\n // 'roles' => Role::orderBy('id', 'desc')->get(),\n // ]);\n return $dataTable->render('users', [\n 'users' => User::orderBy('id', 'asc')->get(),\n 'roles' => Role::orderBy('id', 'desc')->get(),\n ]);\n }", "public function index()\n {\n if ( $this->session->userdata('user')->tipe_user == \"superadmin\" )\n {\n $data['datas'] = $this->db->get($this->User->table, 100)->result();\n }else\n {\n $data['datas'] = $this->db->where(['tipe_user !=' => 'superadmin'])->get($this->User->table, 100)->result();\n }\n\n $this->Helper->view('user/index', $data);\n }", "public function printUserAll()\n\t{\n\t\t$data['reklame'] = $this->madmin->printReklameAll('users')->result();\n\t\t// print_r($data);\n\n\t\t$this->load->view('cetak/cetakuser.php',$data);\n\t}", "public function index()\n {\n // show list user\n }", "public function getUsersv()\n {\n \t$users = DB::table('users')->select('*');\n return Datatables::of($users)\n ->make(true);\n }", "public function viewUserAction()\n {\n \tif($this->getRequest()->getParam('id')){\n \t\t$db = new RsvAcl_Model_DbTable_DbUser();\n \t\t$user_id = $this->getRequest()->getParam('id');\n \t\t$rs=$db->getUser($user_id);\n \t\t//print_r($rs); exit;\n \t\t$this->view->rs=$rs;\n \t} \t \n \t\n }", "public function displayTable () {\r\n\t\t// Echoes html for table containing customer data.\r\n\t\t\r\n\t\t$pdo = Database::connect();\r\n\t\t\r\n\t\t// SQL to execute:\r\n\t\t$sql = 'SELECT * FROM tdg_users ORDER BY id DESC';\r\n\t\t\r\n\t\techo '<table><tr><th>Name</th><th>Email</th><th>Mobile</th><th>Actions</th></tr>'; // echo out table header\r\n\t\t\r\n\t\tforeach ($pdo->query($sql) as $row) { // send query via the connection represented by $pdo\r\n\t\t\t// the query being sent is $sql\r\n\t\t\t// as $row -- as you iterate through, the current row will be named $row\r\n\t\t\t// Now we iterate through the rows selected\r\n\t\t\techo '<tr>';\r\n\t\t\techo '<td>'. $row['name'] . '</td>';\r\n\t\t\techo '<td>'. $row['email'] . '</td>';\r\n\t\t\techo '<td>'. $row['mobile'] . '</td>';\r\n\t\t\techo '<td width=\"250\">';\r\n\t\t\techo '<a class=\"btn\" href=\"read.php?id='. $row['id'].'\">Read</a>';\r\n\t\t\techo '&nbsp;';\r\n\t\t\techo '<a class=\"btn btn-success\" href=\"update.php?id='.$row['id'].'\">Update</a>';\r\n\t\t\techo '&nbsp;';\r\n\t\t\techo '<a class=\"btn btn-danger\" href=\"delete.php?id='.$row['id'].'\">Delete</a>';\r\n\t\t\techo '</td>';\r\n\t\t\techo '</tr>';\r\n\t\t} // End of table drawing loop\r\n\r\n\t\t\techo '</table>';\r\n\t\t\tDatabase::disconnect();\r\n\t}", "public function show($id)\n {\n $user = User::with(['roles','opds']);\n\n $ret = datatables($user)\n ->addColumn('roles', 'user._listRole')\n ->addColumn('action', 'user._actionBtn')\n ->toJson();\n return $ret;\n }", "public function show()\n\t{\n\n\n\t\t$this->load->database();\n\t\t$this->load->model('User_model');\n\n\n\t\t$data['results'] = $this->User_model->get_users(5);\n\n\t\t$this->load->view('User_view', $data);\n\n\t}", "public function view_user_data()\n {\n $data['user'] = $this->Admin_Insert->userlist_data();\n $data['user_address'] = $this->Admin_Insert->useraddress_data();\n $this->load->view('header');\n $this->load->view('footer');\n $this->load->view('user_details', $data);\n }", "public static function showData() {\n\n\t\tforeach(self::$employee_array as $id => $employee) { // Pour chaque ligne on affiche chaque attribut correspondant au colonne du tableau\n\n\t\t\tif($employee->_entityShortName == null) // Gestion du cas où une entité a été supprimée mais pas l'employé de l'entité\n\t\t\t\techo \"<tr><td>null</td><td>\" . $employee->_lastName . \"</td><td>\" . $employee->_firstName . \"</td><td>\" . $employee->_login . \"</td><td><a href=\\\"user.php?action=modifier&id=\" . $employee->_id . \"\\\">modifier</a></td><td><a href=\\\"user.php?action=supprimer&id=\" . $id . \"\\\">supprimer</a></td></tr>\";\n\t\t\telse\n\t\t\t\techo \"<tr><td>\" . $employee->_entityShortName . \"</td><td>\" . $employee->_lastName . \"</td><td>\" . $employee->_firstName . \"</td><td>\" . $employee->_login . \"</td><td><a href=\\\"user.php?action=modifier&id=\" . $employee->_id . \"\\\">modifier</a></td><td><a href=\\\"user.php?action=supprimer&id=\" . $id . \"\\\">supprimer</a></td></tr>\";\n\t\t}\n\t}", "public function showUser()\n\t{\n $data = [\n 'userData' => $this->user->getUserInfo(),\n \"positionData\" => $this->positions->getAllPositions(),\n \"departmentData\" => $this->departments->getAllDepartments(),\n \n ];\n\t\treturn view('employees/index', $data);\n\t}", "public function showUser($name)\n {\n //fetch data from the Users class\n $models = $this->getUser($name); // array of UserModel\n foreach ($models as $user) {\n echo \"Full name: \" . $user->getFirstName() . \" \" . $user->getLastName(); // <---- here. there is a forEach loop here, so each $user is an Array inside the $models array\n }\n // what do i want to show inside the website from here?\n // its an associative array so we need to refer to the columns in the database\n }", "public function show() {\r\n\t\t$this->db->connect();\r\n\t\t$this->conn = $this->db->conn();\r\n\r\n\t\t$usuario = new Usuario();\r\n\t\t$usuario->obtener_datos($this->conn);\r\n\t}", "public function show(UserData $userData)\n {\n //\n }", "public function showUsers()\n {\n $userRepo = $this->getDoctrine()->getRepository(User::class);\n $users = $userRepo->getUsersOrderByAsc();\n\n return $this->render('admin/list-of-users.html.twig', [\n 'users' => $users\n ]);\n }", "public function userList() {\n /** @var User[] $users */\n $users = $this->entityManager->getRepository(\"Entity\\\\User\")->findAll(); // Retrieve all User objects registered in database\n echo $this->twig->render('admin/lists/users.html.twig', ['users' => $users]);\n }", "public function getUserIndex()\n\t{\n\t\t//当不是超级管理员时 只显示本人用户信息\n\t\t$query = array();\n\t\tif($this->cVariable['userInfo']->id != 17){\n\t\t\t$query['id'] = $this->cVariable['userInfo']->id;\n\t\t}\n\t\t\n\t\t$this->cVariable['total'] = $this->user->getUserCount($query);\n\n $this->cVariable['pages'] = ceil($this->cVariable['total'] / 10); //总页数\n\n $this->cVariable['userData'] = $this->user->getUserData($query);\n\n\t\treturn View::make('User.UserIndex', $this->cVariable);\n\t}", "public function list()\n {\n $listUsers = AppUser::findAll();\n $this->show('back/user/list', [\"users\" => $listUsers]);\n }", "function user_details() {\r\n\t\t\t$query = $this->pdo->prepare(\"select * from user_account\");\r\n\t\t\t$query->execute();\r\n\t\t\treturn $query->fetchAll();\r\n\t\t}", "function usersWith(){\n\t\t\t\t\trequire_once(\"database\\database_connection.php\");\n\t\t\t\t\t$conn=database();\n\t\t\t\t\t//Query the database\n\t\t\t\t\t$resultSet = $conn->query(\"SELECT * FROM users_cs_count_view\");\n\n\t\t\t\t\tif($resultSet->num_rows != 0){\n\t\t\t\t\t\twhile($rows = $resultSet->fetch_assoc()){\n\t\t\t\t\t\t\t$users = $rows['users_with_cs'];\n\n\t\t\t\t\t\t\techo \"<h4 class='heading'>\n\t\t\t\t\t\t\tRegistered users with CS:GO: $users\n\t\t\t\t\t\t\t</h4>\";\n\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\techo\"ERROR\";\n\t\t\t\t\t}\n\t\t \t\t$conn->close();\n}", "function show_list() {\n\t\tif(!has_permission(3)) {\n\t\t\tset_warning_message('Sory you\\'re not allowed to access this page.');\n\t\t\tredirect('global/dashboard');\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$this->output_head['function'] = __FUNCTION__;\n\n\t\t$this->output_head['style_extras'] = array(assets_url() . '/plugins/datatables/dataTables.bootstrap.css');\n\t\t$this->output_head['js_extras'] = array(assets_url() . '/plugins/datatables/jquery.dataTables.min.js',\n\t\t\t\t\t\t\t\t\t\t\t\tassets_url() . '/plugins/datatables/dataTables.bootstrap.min.js');\n\t\t$this->output_head['js_function'] = array();\n\t\t$this->load->model('user_model');\n\t\t\n\t\t$this->load->view('global/header', $this->output_head);\n\t\t\n\t\t$this->output_data['title'] = 'Users Manager';\n\t\t$this->load->view('users', $this->output_data);\n\t\t$this->load->view('global/footer');\n\t}", "public function userDetail()\n {\n return view('admin.show_users')->with('users',User::all());\n \n }", "public function index()\n {\n return view('admin/user-table/all-user');\n }", "public function index()\n {\n return $this->users->getAll('first_name', 'asc', ['departments', 'sectors', 'meta']);\n }", "public function table()\n\t{\n\t\t$this->datatables->select('experiment_id, user_id_caller, id');\n\t\t$this->datatables->from('caller');\n\n\t\t$this->datatables->edit_column('experiment_id', '$1', 'experiment_get_link_by_id(experiment_id)');\n\t\t$this->datatables->edit_column('user_id_caller', '$1', 'user_get_link_by_id(user_id_caller)');\n\t\t$this->datatables->edit_column('id', '$1', 'caller_actions(id)');\n\n\t\techo $this->datatables->generate();\n\t}", "public function fetchData(){\n\n\t\t//get all the users'\n $user = DB::table('users')->get();\n\n //admin dashboard.\n $title = 'Fetch.';\n\n return View('accounts.fetchData', compact('user'))\n ->with('title', $title);\n\t}", "function renderTableData($users_info)\n {\n echo '\n \t<tr>\n \t<td class=\"column1\">' . $users_info[0] . '</td>\n \t<td class=\"column2\">' . $users_info[2] . '</td>\n \t<td class=\"column2\">' . $users_info[3] . '</td>\n \t<td class=\"column2\">' . $users_info[4] . '</td>\n \t<td class=\"column3\">' . $users_info[1] . '</td>\n \t<td class=\"column4\">' . $users_info[7] . ' ' . $users_info[8] . '</td>\n\t\t\t</tr>\n ';\n }", "public function viewAction()\n {\n $repo = $this->entityManager\n ->getRepository(Entity\\User::class);\n $id = $this->params()->fromRoute('id');\n $entity = $this->params()->fromRoute('entity', 'user');\n $user = $repo->getUser($id, $entity);\n return ['entity' => $user,'id' => $id ];\n }", "public function index()\n {\n $records = User::orderBy('id','ASC')->get();\n\n return view('admin.users.index')->with('records',$records);\n }", "public function anyData()\n {\n return Datatables::of(User::query())->make(true);\n }", "public function showRegistersTable() {\r\n\t\t$stmt = $this->connect()->query(\"SELECT * FROM registers\");\r\n\t\techo \"<h3>Registers Table</h3>\";\r\n\t\techo \"<table><tr><td>\" . \"athlete_id\" . \"</td><td>\" . \"competition_id\" . \"</td></tr>\";\r\n\t\twhile ($row = $stmt->fetch()) {\r\n\t\t\techo \"<tr><td>\" . $row['athlete_id'] . \"</td><td>\" . $row['competition_id'] . \"</td></tr>\"; \r\n\t\t}\r\n\t\techo \"</table>\";\r\n\t}", "function showUsersStatus($user){\n\t if (sizeof($this->members) == 1){\n\t $table = '<h4 class=\"text-warning\">\n No other members here...</h4>';\n\t } else {\n\t $table = '<table class=\"table table-striped table-hover\">\n\t\t\t\t<tHead>\n\t\t\t\t<tr>\n\t\t\t\t<th>Name</th><th>Status</th><th>Level</th>\n\t\t\t\t</tr>\n\t\t\t\t</tHead>\n\t\t\t\t<tBody>';\n\t foreach ($this->members as $member){\n\t if($member->getUserID() != $user->getUserID()){\n\t $table .= $member->getUserStatusAsRow();\n\t }\n\t }\n\t $table .= '\n\t\t\t\t</tBody></table>';\n\t }\n\t\t\n\t\treturn $table;\n\t}", "public function index()\n {\n $this->user_list();\n }", "public function index()\n {\n $table=\"user\";\n \n $msg['data']=$this->crudm->list_all($table);\n $msg['count']=$this->um->count_data();\n\n $msg['title']=\"List of all user\";\n\n echo json_encode($msg);\n }", "public function index()\n {\n //\n\t\t $users = DB::table('users')->get();\n\t\t print_r($users); die;\n }", "function print_user_name_results($display_count, $count, $query_result) {\n // Get the total number of matches\n $count_row = pg_fetch_row($count);\n $total_count = $count_row[0];\n // Update the display count to be the minimum between display count and total count.\n $display_count = $total_count < $display_count ? $total_count : $display_count; \n\n // Print results table.\n echo \"<table class=\\\"pop-over-table pure-table pure-table-bordered\\\">\";\n echo \"<thead><tr>\";\n echo \"<td>UID</td>\";\n echo \"<td>First Name</td>\";\n echo \"<td>Last Name</td>\";\n echo \"</tr></thead><tbody>\";\n while ($row = pg_fetch_row($query_result)) {\n echo \"<tr>\";\n $num = pg_num_fields($query_result);\n for ($i = 0; $i < $num; $i++) {\n // echo\"<td>\".$row[$i].\"</td>\";\n if ($i == 0) {\n echo '<td class=\"userinfo_uid\">'.$row[$i].'</td>';\n } else if ($i == 1) {\n echo '<td class=\"userinfo_first_name\">'.$row[$i].'</td>';\n } else if ($i == 2) {\n echo '<td class=\"userinfo_last_name\">'.$row[$i].'</td>';\n } else {\n echo\"<td>\".$row[$i].\"</td>\";\n }\n }\n echo \"<tr>\";\n }\n echo \"</tbody></table>\";\n\n // Echo display count summary.\n echo \"<p class=\\\"count_summary\\\">Showing: \".$display_count.\" of \".$total_count.\"</p>\";\n }", "public function showContactPersonsTable() {\r\n\t\t$stmt = $this->connect()->query(\"SELECT * FROM contact_person\");\r\n\t\techo \"<h3>Contact Person Table</h3>\";\r\n\t\techo \"<table><tr><td>\" . \"phone_number\" . \"</td><td>\" . \"email\" . \"</td></tr>\";\r\n\t\twhile ($row = $stmt->fetch()) {\r\n\t\t\techo \"<tr><td>\" . $row['phone_number'] . \"</td><td>\" . $row['email'] . \"</td></tr>\"; \r\n\t\t}\r\n\t\techo \"</table>\";\r\n\t}", "public function index()\n {\n $this->userlist();\n }", "public function listofUser()\n {\n return view('Admin.ShowallUser');\n }", "public function getListUser()\n {\n $users = User::query()->orderBy('created_at', 'desc');\n\n return Datatables::of($users)\n ->editColumn('name', function($users){\n if (Entrust::can([\"users-detail\"])) {\n return '<a onclick=\"viewUser(' . $users->id . ')\" data-toggle=\"modal\" href=\"#viewUser\">'.$users->name.'\n </a> ';\n }else{\n return $users->name;\n }\n })\n \n ->addColumn('created_at', function($user){\n $time = $user->created_at;\n $time_numb = strtotime($time);\n\n return date(\"H:i | d-m-Y\", $time_numb);\n })\n \n ->addColumn('action', function ($user) {\n\n $string = '';\n if (Entrust::can([\"users-manager\"])) {\n $string = $string . ' <a href=\"users/'. $user->id . '/roles\" class=\"btn green btn-xs\" style=\"text-transform:none;\" data-tooltip=\"tooltip\" title=\"Vai trò\">\n <i class=\"icon-lock ion\" aria-hidden=\"true\"></i> \n </a> ';\n\n $string = $string . ' <a onclick=\"editUser(' . $user->id . ')\" class=\"btn yellow btn-xs btn-withdrawal\" style=\"text-transform:none;\" data-toggle=\"modal\" href=\"#editUser\" data-tooltip=\"tooltip\" title=\"Cập nhật\">\n <i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i> \n </a> ';\n\n $string = $string . ' <a href=\"javascript:;\" data-id=\"'. $user->id .'\" type=\"button\" class=\"btn btn-xs red btn-delete\" style=\"text-transform:none;\" data-tooltip=\"tooltip\" title=\"Xóa\">\n <i class=\"fa fa-trash-o\"></i> \n </a> ';\n }\n\n return $string;\n })\n ->addIndexColumn()\n ->rawColumns(['action', 'name'])\n ->make(true);\n }", "public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "public function list()\n {\n $users = User::orderBy('id', 'asc')->with('role')->get();\n\n return Datatables::of($users)\n ->addIndexColumn()\n ->addColumn('action', function($row){\n\n $btn = '<button type=\"button\" class=\"btn btn-alt-info\" data-toggle=\"modal\" data-target=\"#modal-extra-large\">Launch Modal</button>';\n\n return $btn;\n })\n ->rawColumns(['action'])\n ->make(true);\n }", "public function view(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n\n $data = [];\n \n $user_id = $user['id'];\n $tree = false; \n $entity = $this->Users->get($user_id); \n if($this->Users->childCount($entity) > 0){\n $tree = true;\n } \n \n //Fields\n\t\t$fields = $this->{$this->main_model}->schema()->columns();\n \n if(isset($this->request->query['realm_id'])){\n $q_r = $this->{$this->main_model}->find()\n ->where([$this->main_model.'.id' => $this->request->query['realm_id']])\n ->contain(['Users'=> ['fields' => ['Users.username']]])\n ->first();\n if($q_r){ \n $owner_tree = $this->Users->find_parents($q_r->user_id);\n $data['owner'] = $owner_tree; \n foreach($fields as $field){\n\t $data[\"$field\"]= $q_r->{\"$field\"};\n\t\t } \n }\n \n if($q_r->user !== null){\n $data['username'] = \"<div class=\\\"fieldBlue\\\"> <b>\".$q_r->user->username.\"</b></div>\";\n }else{\n $data['username'] = \"<div class=\\\"fieldRed\\\"><i class='fa fa-exclamation'></i> <b>(ORPHANED)</b></div>\";\n }\n $data['show_owner'] = $tree;\n } \n $this->set(array(\n 'data' => $data,\n 'success' => true,\n '_serialize'=> array('success', 'data')\n ));\n }", "public function actionIndex()\n {\n \n $sql = \"SELECT u.id, u.username, u.email, u.status, u.full_name, u.business_name, u.phone_number, u.business_address, u.status, s.store_name as store_name FROM `user` u join user_store us on us.user_id = u.id join store s on s.store_id = us.store_id\";\n\n $count = Yii::$app->db->createCommand($sql)->queryScalar();\n\n $dataProvider = new SqlDataProvider([\n 'sql' => $sql,\n 'params' => [':status' => 1],\n 'totalCount' => $count,\n 'sort' => [\n 'attributes' => [\n 'store_name',\n 'username' => [\n 'asc' => ['first_name' => SORT_ASC, 'last_name' => SORT_ASC],\n 'desc' => ['first_name' => SORT_DESC, 'last_name' => SORT_DESC],\n 'default' => SORT_DESC,\n 'label' => 'Name',\n ],\n ],\n ],\n 'pagination' => [\n 'pageSize' => 20,\n ],\n ]);\n\n // $model = User::findBySql($sql); \n\n return $this->render('index', [\n 'model' => $dataProvider,\n \n ]);\n }", "public function showUser()\n {\n return view('admin.users-key.view');\n }", "public function list_user()\n\t{\n\t\tcheck_access_level_superuser();\n\t\t$data = [\n\t\t\t'list_user' => $this->user_m->get_cabang(),\n\t\t\t'list_cabang' => $this->data_m->get('tb_cabang')\n\t\t];\n\t\t$this->template->load('template2', 'user/list_user', $data);\n\t}", "public function index(){\n $users = User::paginate(10); \n return view('admin.layout.users_table_layout',compact([\"users\"]));\n }", "public function index()\n {\n if(Auth::user()->type != 'مدیر'){ return redirect()->back(); }\n /* Security Admin Panel */ \n $users = User::get();\n $instance_Model_user =new User();\n $names = $instance_Model_user->GetListAllNameColumns_ForTable();\n //dd($users);\n return view('admin.user.index',compact('users','names'));\n }", "public function index()\n\t{\n\t\t$data = DB::table('users')->get();\n\t\treturn view('backend.user.index',['data'=>$data]); \n\t}", "public function datatables()\n {\n $param = [\n 'url' => 'user',\n 'action' => ['show', 'edit', 'destroy']\n ];\n\n return Datatables::of(User::query())\n ->addColumn('action', function($data) use ($param) {\n if ($data->role == 'superadmin') {\n unset($param['action'][array_search('edit', $param['action'])]);\n unset($param['action'][array_search('destroy', $param['action'])]);\n }\n\n return generateAction($param, $data->username);\n })\n ->editColumn('role', function($data) {\n return ucwords($data->role);\n })\n ->addIndexColumn()\n ->make(true);\n }", "public function listForTable (){\r\n //generamo la query final que precisamos\r\n $queryResult= \"SELECT id,dni,nombre,apellido,mail FROM usuario.usuario ORDER BY id;\";\r\n\r\n //Ejecutamos la query\r\n $this->stmt=pg_query($this->link,$queryResult) or die(\"Error en la consulta,function listForTable :\".preg_last_error());\r\n\r\n return $this->stmt;\r\n }", "function displayUsers(){\n \n global $link;\n \n $query = \"SELECT * FROM users\";\n\n $result = mysqli_query($link, $query);\n\n if(mysqli_num_rows($result) == 0){\n\n echo \"<p class='display'>Sorry, There are no users on our site. Would you like to be our first user :)</p>\";\n\n }else{\n \n while($row = mysqli_fetch_assoc($result)){\n \n echo \"<p class='display'><a href='?page=users&userid=\".$row['id'].\"'>\".$row['email'].\"</a></p>\";\n \n }\n \n }\n \n }", "public function index()\n {\n //\n return DB::table('users')\n ->select('id_user as Identificación' ,'users.name as Nombre','users.email as Email', 'city as Ciudad', 'direction as Direciión','fotos as Fotos')\n ->get();\n }", "public function index()\n {\n $user = $this->permission(User::all(), 'id');\n\n return $this->showAll($user,User::class);\n }", "public function allUsers()\n\t{\n\t\t$data['users'] = $this->MainModel->selectAll('users', 'first_name');\n\t\t$this->load->view('layout/header');\n\t\t$this->load->view('layout/sidebar');\n\t\t$this->load->view('template/all-users', $data);\n\t\t$this->load->view('layout/footer');\n\t}", "public function getUser() {\n $data = DB::table('users')->select('*', 'id as id_tmp')->get();\n header(\"Content-type: application/json\");\n echo \"{\\\"data\\\":\" . json_encode($data) . \"}\";\n }", "public function selectuser(){\r\n\t\t$query = \"SELECT * FROM users\";\r\n\t\t$add_query = parent::get_results($query);\r\n\t\t\r\n\t\treturn $add_query;\r\n\t\t// echo '<pre>';\r\n\t\t// print_r( $add_query );\r\n\t\t// echo '</pre>';\r\n\t\t// exit;\r\n\t}", "public function userAccount()\n\t{\n $per_page = 4;\n $total_rows = (new Task())->countRows()->execute();\n $total_pages = ceil($total_rows / $per_page);\n $data = (new Task())->all('0','4')->execute();\n $pages = ['total_pages' => $total_pages, 'current_page' => 1];\n $data = [$data, $pages];\n View::render('userprofile', $data);\n\t}", "function case_all_supervisors(){?>\n\t\t\t<table border=\"1\" cellspacing=\"2\" cellpadding=\"2\">\n\t\t\t<tr><th>Supervisor Id</th><th>Supervisor Name</th><th>Phone Number</th></tr>\n\t\t\t<?php $sql = \"select * from supervisor\";\n\t\t\t$result = mysql_query($sql);\n\t\t\twhile($row = mysql_fetch_array($result)){?>\n\t\t\t\t<tr>\n\t\t\t\t<td><?php echo $row['emp_id']?></td>\n\t\t\t\t<td><?php echo $row['first_name']; echo ' '; echo $row['last_name'];?></td>\n\t\t\t\t<td><?php echo $row['phone']?></td>\n\t\t\t\t</tr>\n\t\t\t<?php }?>\n\t\t\t\n\t\t\t</table>\n\t\t<?php }", "public function index()\n {\n return view('contents.data_user');\n }", "public function index(UserDataTable $userDataTable)\n {\n return $userDataTable->render('users.index');\n }", "public function index()\n {\n $title = \"user\";\n\n $user = DB::table('users')->leftjoin('units', 'units.id', '=', 'users.id_unit')\n ->leftJoin('positions', 'positions.id', '=', 'users.id_jafung')\n ->select('users.id', 'users.nickname', 'users.fullname', 'users.nip', 'users.nik', 'users.gol', 'users.email', 'users.tmt', 'users.id_alam', 'users.id_jafung', 'users.id_jabpns', 'users.id_edu', 'users.id_unit', 'users.id_finger', 'users.jenis_peg',\n 'users.agama', 'users.tpt_lahir', 'users.tgl_lahir', 'users.gender', 'users.status', 'users.role', 'users.bio', 'users.photo', 'units.nama_unit', 'units.bagian', 'positions.jabatan', 'positions.kategori', 'positions.shifting')\n ->orderBy('users.id', 'asc')\n ->get();\n\n // return $query->join('units', 'id_unit', '=', 'id_unit')->paginate(10);\n return $user;\n }", "public function all_users_profile()\n {\n $em = $this->getDoctrine()->getManager();\n $data = $em->getRepository('AppBundle:User');\n\n //ROLE_REGULAR\n $regular = $data->findBy(array('group_id'=>1));\n\n //ROLE_GOLDEN\n $golden = $data->findBy(array('group_id'=>2));\n\n //ROLE_DIAMOND\n $diamond = $data->findBy(array('group_id'=>3));\n\n //ROLE_AGENT\n $agent = $data->findBy(array('group_id'=>4));\n\n\n return $this->render('FOSUserBundle:Clients:group.html.twig',array('regular'=>$regular,'golden'=>$golden,'diamond'=>$diamond,'agent'=>$agent));\n }", "function view() \n {\n $api = new Module_UserManagement_API();\n\n /* TODO: Check if administrator */\n $users = $api->getUsers();\n $view = Core_View::factory('users');\n\n $view->users = $users;\n echo $view->render();\n }", "public function listUser() {\n\n //select user where id=1 somente o 1º que encontrar, abaixo\n $user = User::where('id','=',1)->first();\n return view('listUser',[\n 'user' => $user\n //var visao => var controller\n ]);\n }", "function show_user() {\n require ('config.php');\n mysql_connect ($db_server, $db_user, $db_pass);\n mysql_select_db($db);\n\n $sql = 'SELECT * FROM `tbl_user`';\n $result = mysql_query($sql);\n\n $num = mysql_numrows($result);\n //mysql_close();\n\n $i = 0;\n echo '<center>';\n echo '<b>Utilisateur Regulier</b>';\n echo '<table width=90% border=1 bgcolor=gray><tr>\n <td width=9%><b><center><font color=red>ID</font></center></b></td>\n <td width=69%><b><center><font color=red>Utilisateur</font></center></b></td>\n <td width=22%><b><center><font color=red>Supprimer</font></center></b></td>';\n while ($i < $num) {\n $pseude = mysql_result ($result, $i, 'pseudo');\n $uid = mysql_result ($result, $i, 'ID');\n echo '<tr><td>'.$uid.'</td><td>'.$pseude.'</td><td><a href=\"supcompte.php?t=user&uid='.$uid.'\" target=_blank>X</a></td></tr>';\n $i++;\n }\n echo '</table><br><br>';\n echo '</center>';\n}", "function users(){\n\t$listado= mysql_query(\"select us.name as name, us.email as email , co.name as pais\n\tfrom users us\n\tjoin country co on co.Code=us.countryCode\");\n\t\n\t$i = 1;\n\t\n\twhile ($reg = mysql_fetch_array($listado)) {\n\t\techo '<tr>';\n\t\techo '<td >' . $i . '</td>';\n\t\techo '<td >' . mb_convert_encoding($reg['name'], \"UTF-8\") . '</td>';\n\t\techo '<td >' . mb_convert_encoding($reg['email'], \"UTF-8\") . '</td>';\n\t\techo '<td >' . mb_convert_encoding($reg['pais'], \"UTF-8\") . '</td>';\n\t\techo '</tr>';\n\t\t$i++;\n\t}\n}" ]
[ "0.7484739", "0.73283046", "0.727887", "0.7092597", "0.70847654", "0.70797956", "0.6998374", "0.6978516", "0.6967578", "0.6910536", "0.6892313", "0.6871144", "0.6845147", "0.6806365", "0.67916447", "0.6791573", "0.6697287", "0.667456", "0.66441905", "0.66440296", "0.6635218", "0.6634333", "0.6614838", "0.66017383", "0.6597554", "0.65967387", "0.6590369", "0.6560939", "0.6552375", "0.65378547", "0.6535399", "0.6524419", "0.65051615", "0.6500909", "0.64853615", "0.64829564", "0.6479125", "0.6478122", "0.64729947", "0.6468621", "0.64645076", "0.644569", "0.64297664", "0.642758", "0.6423397", "0.6409356", "0.6397698", "0.63867825", "0.63805556", "0.63630307", "0.63566273", "0.63562876", "0.6338904", "0.6335026", "0.63317615", "0.6325531", "0.63117355", "0.63096225", "0.6284548", "0.628345", "0.6280602", "0.6278914", "0.6272051", "0.62669855", "0.62638485", "0.62621546", "0.6260963", "0.6255935", "0.6255133", "0.6249965", "0.62487406", "0.62482494", "0.62443304", "0.6232422", "0.62317044", "0.6231267", "0.62284696", "0.6221691", "0.6218741", "0.62171936", "0.6213034", "0.6209818", "0.62081784", "0.62020266", "0.6201014", "0.61961913", "0.61914337", "0.61901057", "0.6188899", "0.6184332", "0.6180956", "0.618024", "0.61791426", "0.61780816", "0.61729705", "0.61666214", "0.61657715", "0.6164834", "0.6161925", "0.6157069", "0.6155232" ]
0.0
-1
showing of add form
public function create(){ $user = Auth::user()->admin; if($user == 0) { return redirect('home'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display_add() {\n $this->_addform->display();\n }", "public function addForm() {\n $this->view->displayForm();\n }", "public function renderAdd()\r\n\t{\r\n\t\t$this['tarifForm']['save']->caption = 'Přidat';\r\n\t}", "public function add()\n\t{\n\t\t$this->template('crud/add');\t\n\t}", "public function renderAdd()\r\n\t{\r\n\t\t$this['itemForm']['save']->caption = 'Přidat';\r\n $this->template->titul = self::TITUL_ADD;\r\n\t\t$this->template->is_addon = TRUE;\r\n\r\n\t}", "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}", "protected function addShowForm() \n {\n return view('dashboard.article.add');\n }", "public function addForm()\n {\n $this->getState()->template = 'displaygroup-form-add';\n $this->getState()->setData([\n 'help' => $this->getHelp()->link('DisplayGroup', 'Add')\n ]);\n }", "public function getAddForm();", "public function displayPageAddForm(){\n\n // Vérifie les données de champs dupliqués\n $this->handleDuplicateFields();\n\n // Vérifie les données post envoyées\n $this->handleAdd();\n\n // If there ia a modify var\n if(isset($_GET['modify']) && !empty($_GET['modify'])){\n\n $form = get_post($_GET['modify']);\n if($this->isForm($_GET['modify'])){\n\n $formMetas = get_post_meta($_GET['modify']);\n $formArgs = get_post_meta($_GET['modify'],'form-args');\n $formFields = get_post_meta($_GET['modify'],'form-fields');\n $submitArgs = get_post_meta($_GET['modify'],'form-submit-args');\n $formSendArgs = get_post_meta($_GET['modify'],'form-send-args');\n }else\n unset($form);\n\n }\n require_once __DIR__ . '/templates/add.php';\n\n }", "public function actionAdd()\n\t{\n\t\t$this->render('add');\n\t}", "public function add()\n {\n //renderView('add');\n }", "public function add(){\n $this->edit();\n }", "public function admin_add_new() {\n ?>\n <div class=\"wrap\">\n <h2><?php _e('Add New Form', 'swpm-form-builder'); ?></h2>\n <?php\n include_once( SWPM_FORM_BUILDER_PATH . 'includes/admin-new-form.php' );\n ?>\n </div>\n <?php\n }", "public function getAdd()\n\t{\n\t $form = \\FormBuilder::create($this->form, [\n 'method' => 'POST',\n 'model' => $this->getModelInstance(),\n 'url' => ($this->url_prefix.'/add')\n ]);\n return view($this->tpl_prefix.'add',array('catalog'=>$this), compact('form'));\n\t}", "public function addform()\n {\n \n //$this->session_manager->validateFashion(__METHOD__);\n \n $data['cate'] = $this->promo->promoSliderOptionCuisine($by_id=null,$platform=1);\n $data['promo_duration'] = $this->promo->promoDurationOption();\n $data['admin_info'] = $this->promo->adminInfo();\n \n $data['title_type']= 'New Promo Form';\n $data ['content_file']= 'promo_new';\n $data['pageheader'] = \"Add Promo\";\n $data['breadCrumbs'] = '<li class=\"breadcrumb-item\"><a href=\"'.site_url(\"jollofadmin/promos\").'\">Promos</a></li> <li class=\"breadcrumb-item active\">Add Promo</li>';\n $data['mainmenu'] = \"promos\";\n $this->load->view('jollof_admin/layout', $data);\n }", "public function showAdd()\n {\n return View::make('honeys.add');\n }", "public function permit_type_add_form()\n {\n $this->load->view('common/header');\n $this->load->view('permit/permittype/create_form');\n $this->load->view('common/footer');\n }", "public function add(){\n return view('employee.displayForm');\n }", "public function add() {\r\n $this->api->loadView('contact-form',\r\n array(\r\n 'row' => $this->model\r\n ));\r\n }", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "public function addForm()\n {\n return view('postsAdmin._postsAdmin_addForm');\n }", "public function actionAdd() {\n $this->setView('edit');\n }", "public function add()\n {\n $this->view->state = $this->request->has('id') ? 'Edit Row' : 'Add Row';\n return $this->view('add');\n }", "public function addForm()\n {\n //mengambil data kelas_keilmuan dari model Keilmuan.php berdasarkan id\n $keilmuan = Keilmuan::orderBy('id', 'desc')->get();\n\n //menampilkan data kelas_keilmuan yang dipanggil diatas untuk ditampilkan di form tambah data\n return view('admin.add')->with([\n 'keilmuan' => $keilmuan\n ]);\n }", "public function add(){\n\t\t\t$formAction = \"index.php?area=backend&controller=news&action=do_add\";\n\t\t\t//xuat du lieu ra view qua ham renderHTML\n\t\t\t$this->renderHTML(\"views/backend/add_edit_news.php\",array(\"formAction\"=>$formAction));\n\t\t}", "public function showAddForm()\n {\n $cmsInfo = [\n 'moduleTitle' => __(\"Master Data\"),\n 'subModuleTitle' => __(\"Module Management\"),\n 'subTitle' => __(\"Add Module\")\n ];\n\n $dynamic_route = Config::get('constants.defines.APP_MODULES_CREATE');\n return view('modules.edit_add', compact('cmsInfo', 'dynamic_route'));\n }", "public function add(): void\n {\n $exerciseforms = $this->exerciseformBLL->getAllExcerciseforms();\n\n $data = [\n 'exerciseforms' => $exerciseforms,\n 'name' => '',\n 'description' => '',\n 'repetitions' => '',\n 'sets' => ''\n ];\n\n $this->view('exercises/add', $data);\n }", "public function add(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$admin = $this->_map_posted_data();\n\t\t\t\t$this->adminrepository->insert($admin);\n\t\t\t\theader(\"Location: \".BASE_URL.\"admin/admin\");\n\n\t\t\t}else{\n\t\t\t\t$view_page =\"adminsview/add\";\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t\t}\n\t\t}", "public function showAddPage(){\n return view('add');\n }", "public function index() {\n $content = $this->lcopun->copun_add_form();\n $this->template->full_admin_html_view($content);\n }", "public function admin_add() {\r\n if(isset($this->data[$this->modelClass])) {\r\n\t\t\t$this->_message($this->{$this->modelClass}->bsSave($this->data, 'add'));\r\n }\r\n\t\t$this->render('admin_edit');\r\n }", "public function addform() {\n require_once 'modeles/etudiant_modele.php';\n require_once 'vues/etudiants/etudiants_addform_vue.php';\n }", "public function add(){\n if(Gate::authorize('isAdmin')){\n return view('data-perawat.FormInput');\n }\n }", "public function add()\n {\n $data = [\n 'property' => [\n 'template' => 'extracurricular_add',\n 'title' => 'Tambah Ekstrakurikuler',\n 'menu' => $this->menu->read(),\n ],\n 'data' => [],\n ];\n\n $this->load->view('template', $data);\n }", "public function add()\n {\n // récupérer les catégories pour l'affichage du <select>\n $categoryList = Category::findAll();\n // récupérer les types de produits pour l'affichage du <select>\n $typeList = Type::findAll();\n // récupérer les marques pour l'affichage du <select>\n $brandList = Brand::findAll();\n\n // compact est l'inverse d'extract, on s'en sert pour générer un array à partir de variables :\n // on fournit les noms (attention, sous forme de string) des variables à ajouter à l'array \n // les clés de ces valeurs seront les noms des variables\n $viewVars = compact('categoryList', 'typeList', 'brandList');\n $this->show('product/add', $viewVars);\n // équivaut à :\n // $this->show('product/add', [\n // 'categoryList' => $categoryList,\n // 'typeList' => $typeList,\n // 'brandList' => $brandList\n // ]);\n }", "public function addAction()\n {\n $post_request = (array) $this->postZingRequest();\n\n /** Handle the request */\n $errors = $this->_handleRequest($post_request);\n\n return $this->renderAdmin('ZingComponentGoogleMapsBundle:Default:form.html.twig', array_merge(\n array(\n 'zing_form_action' => 'Create',\n 'zing_form_errors' => $errors\n ),\n $post_request\n ));\n\n }", "public function add(){\n $outData['script']= CONTROLLER_NAME.\"/add\";\n $this->assign('output',$outData);\n $this->display();\n }", "function add()\n\t{\n\t\t// hien thi form them san pham\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/add');\n\t}", "public function get_add()\n { \n // Render the page\n View::make($this->bundle . '::product.add')->render();\n }", "public function addform()\n\t{\n\t\t\t$this->setMethod('post');\n\n\t\t\t\n\t\t\t$this->addElement('radio', 'status', array(\n\t\t\t\t'required' => true,\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'value' => '1' //key of multiOption\n\t\t\t));\n\t\t\n\t\t\n\n\t\t\t$this->addElement('textarea', 'Comment', array( \n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'maxlength' =>'50',\n\t\t\t\t\t\n\t\t\t\t\t'class' => 'validate[required] text-input',\n\t\t\t\t\t'decorators'=>Array(\n\t\t\t\t\t\t'ViewHelper','Errors'\n\t\t\t\t\t),\t\t \n\t\t\t));\n\n\t\t\t\n\n\t\t\t\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 add() {\n\t\t\n\t\t$this->template->content = View::instance(\"v_posts_add\");\n\t\t\n\t\t$client_files_body = Array(\n\t\t\t'/js/jquery.form.js',\n\t\t\t'/js/posts_add.js'\n\t\t);\n\t\t\n\t\t$this->template->client_files_body = Utils::load_client_files($client_files_body);\n\n\t\techo $this->template;\n\t\t\n\t}", "public function get_add(){\n return View::make('stance.add')->with('title', 'Submit a Stance')->with('subtitle', 'Try to make your views official party Stances');;\n }", "public function add()\n {\n if (Auth::guest()){\n return redirect()->back();\n }\n\n return view('add');\n }", "public function admin_add_new() {\n?>\n\t<div class=\"wrap\">\n\t\t<h2><?php _e( 'Add New Form', 'visual-form-builder-pro' ); ?></h2>\n<?php\n\t\tinclude_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/admin-new-form.php' );\n?>\n\t</div>\n<?php\n\t}", "public function setAddForm($addForm=true);", "function show_new_record() {\r\n if ($this->allow_new) {\r\n #~ echo \"<p><a href='{$_SERVER['PHP_SELF']}?m={$this->module}&amp;act=new&amp;go=\".urlencode($GLOBALS['full_self_url']).\"'>Insert new row</a>\";\r\n echo '<form method=POST action=\"'.$_SERVER['PHP_SELF'].'\">';\r\n echo '<input type=hidden name=\"m\" value=\"'.$this->module.'\">';\r\n echo '<input type=hidden name=\"act\" value=\"new\">';\r\n echo '<input type=hidden name=\"go\" value=\"'.htmlentities($GLOBALS['full_self_url']).'\">'; # url to go after successful submitation\r\n # if i'm a detail, get master-detail field's value and pass it to new-form\r\n if ($this->logical_parent) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->parentkey) { # foreign key always int\r\n echo '<input type=hidden name=\"sugg_field['.$colvar.']\" value=\"'.htmlentities($col->parentkey_value).'\">';\r\n }\r\n }\r\n }\r\n echo '<p>'.lang('Add').' <input type=text name=\"num_row\" size=2 value=\"1\"> '.lang($this->unit).' <input type=submit value=\"'.lang('Go').'\">';\r\n echo '</form>';\r\n }\r\n }", "function lb_show_add_record_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'add',\n\t\t)\n\t);\n}", "public function admin_add(){\n $content = $this->load->view(\"users/users_form\",\"\",true);\n echo Modules::run(\"template/load_admin\", \"Add New User\", $content);\n }", "public function addAction()\n {\n// $m = $this->baseView('view',['lside','passportAdmin'],['lside'=>['list' => $this->names,'base' => ''],'cont' => ['fsd']]);\n// $p = $cr->render($m,[]);\n $p = $this->add($this->model);\n return $this->baseView('view',['admin/lside','passport/admin/add'],['lside'=>['list' => $this->names,'base' => ''],'cont' => $p]);\n }", "public function add() {\n\n $this->set('add', true);\n\n if($this->request->is('post')){\n\n $result = $this->Task->save($this->request->data);\n if($result){\n $this->_setFlash('Task added successfully.', 'success');\n $this->redirect('/tasks');\n }\n else {\n $valError = $this->Task->validationErrorsAsString();\n $this->_setFlash(\"Unable to save this task. ${valError}\");\n }\n }\n\n $this->render('add-edit');\n }", "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 Add()\n\t{\n\t\t$this->load->view(\"admin/barang/tambah_barang\");\n\t}", "public function xadd() {\n\t\t$args = $this->getAllArguments ();\n\t\tif ($args ['view'] == 'forms') {\n\t\t\t$this->_redirect ( '_newForm' );\n\t\t} elseif ($args ['view'] == 'fields') {\n\t\t\t$this->_redirect ( '_newField' );\n\t\t} elseif ($args ['view'] == 'actions') {\n\t\t\t$this->_redirect ( '_newAction' );\n\t\t} else {\n\t\t\tparent::xadd ();\n\t\t}\n\t}", "protected function displayAddRoleForm()\n\t{\n\t\t$GLOBALS['ilTabs']->clearTargets();\n\n\t\t$form = $this->initRoleForm();\n\t\t$this->tpl->setContent($form->getHTML());\n\t}", "public function addAction() {\n\t\t$this->_forward('edit', null, null, array('id' => 0, 'model' => $this->_getParam('model')));\n\t}", "public function add(){\n\n\t $this->load->view('layouts/header');\n\t\t$this->load->view('layouts/aside');\n\t\t$this->load->view('admin/usuarios/add'); // se envia a la vista admin/laptops/add\n\t\t$this->load->view('layouts/footer');\n}", "public function add()\n {\n return view('pages.patient.form');\n }", "protected function instantAdd() {\r\n\t\t$this->redirect(array('action' => 'edit', 'id' => $this->{$this->modelClass}->bsAdd()));\r\n }", "public function add_record()\n {\n $data['main_content'] = $this->type.'/'.$this->viewname.'/add';\n\t $this->load->view($this->type.'/assets/template',$data);\n }", "public function add(){\n $article = ArticleFormValidation::getData();\n $add = null;\n \n if(!is_null($article)){\n $add = $this->model->add($article);\n }\n if($add){\n $msg = \"Article successfully added\";\n }else{\n $err = \"Error adding article\";\n }\n include 'views/article-form.php';\n }", "public function getAdd()\n {\n \treturn view(\"admin.user.add\");\n }", "public function addAction()\n {\n $form = $this->getForm('create');\n $entity = new Entity\\CourtClosing();\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n $view = new ViewModel();\n $view->form = $form;\n\n return $view;\n }", "public function getAdd()\n {\n return view(\"Policy::add-edit\");\n }", "public function add(){\n Auth::checkUserLogin();\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Add', 'Users');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = '';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Users';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Add';\n\n $this->_view->error = array();\n\n // If Form has been submitted process it\n\t\tif(!empty($_POST)){\n //if user selected cancel\n if(!empty($_POST['cancel'])){\n\t\t\t Url::redirect('users/index');\n\t\t }\n\n // Create new user\n $createData = $this->_model->createData($_POST);\n if(isset($createData['error']) && $createData['error'] != null){\n foreach($createData['error'] as $key => $error){\n $this->_view->error[$key] = $error;\n }\n }else{\n $this->_view->flash[] = \"User added successfully.\";\n Session::set('backofficeFlash', array($this->_view->flash, 'success'));\n Url::redirect('users/index');\n }\n\t\t}\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('users/add', 'layout');\n\t}", "public function showAddNewRecordPage() {\n\n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-add-show') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n $this->data['message'] = $this->session->flashdata('message');\n $this->set_view('user/add_new_record_page',$this->data);\n } else {\n echo \"access denied\";\n }\n }", "public function loan_form_add() {\n $bank_view = Bank::all();\n //dd($bank_view);\n\n $rental = view('ap.form.form_loan', compact('bank_view'));\n return view('ap_master')->with('maincontent', $rental);\n }", "public function insertView() {\n $uiObjectName = $this->type.'_Ui';\n $uiObject = new $uiObjectName($this->object);\n return $uiObject->renderForm(array('values'=>$this->values,\n 'action'=>url($this->type.'/insert', true),\n 'class'=>'formAdmin formAdminInsert'));\n }", "function insert() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm(TRUE);\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function add(){\n\t\tif(is_null($this->session->userdata('user')))\n\t\t\tredirect('/login', 'refresh');\n\n\t\t$this->load->view('header');\n\t\t$this->load->view('lead/add');\n\t\t$this->load->view('footer');\n\n\t}", "public function add() \n { \n $data['delivery_method'] = $this->delivery_methods->add();\n $data['action'] = 'delivery_method/save';\n \n $this->template->js_add('\n $(document).ready(function(){\n // binds form submission and fields to the validation engine\n $(\"#form_delivery_method\").parsley();\n });','embed');\n \n $this->template->render('delivery_method/form',$data);\n\n }", "public function add(){\n\n\t $data = array(\n\t \t 'laptops' =>$this->Laptop_model->getLaptops() ,\n\n\t \t );\n\n\t $this->load->view('layouts/header');\n\t\t$this->load->view('layouts/aside');\n\t\t$this->load->view('admin/prestamos/add',$data); // se envia a la vista admin/laptops/add\n\t\t$this->load->view('layouts/footer');\n}", "public function add() {\n\t\t$user_id = $this->UserAuth->getUserId();\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->request->data[\"Contact\"][\"user_id\"] = $user_id;\n\t\t\t$this->Contact->saveAssociated($this->request->data, array(\"deep\" => true));\n\t\t}\n\t\t\n\t\t$this->render('form');\n\t}", "public function add() {\n if($this->user->access_level != 3) {\n # If not, redirect them to the films index\n\t \tRouter::redirect(\"/films\");\n }\n \n # Setup view\n $this->template->content = View::instance('v_films_add');\n $this->template->title = \"DER | Add New Film\";\n \n # Pass in template-specific CSS files\n\t $this->template->client_files_head = '<link rel=\"stylesheet\" href=\"/css/bootstrap.css\" type=\"text/css\">\n\t \t<link rel=\"stylesheet\" href=\"/css/signin.css\" type=\"text/css\">\n\t \t<script type=\"text/javascript\" src=\"/js/app.js\"></script>';\n\n # Render template\n echo $this->template;\n }", "function addLevel()\n\t{\n\t\tglobal $tpl;\n\n\t\t$this->initLevelForm(\"create\");\n\t\t$tpl->setContent($this->form->getHTML());\n\t}", "public function addAction()\n {\n \t$form = MediaForm::create($this->get('form.context'), 'media');\n\n \treturn $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => new Media()));\n }", "public function index() {\n $content = $this->llocation->location_add_form();\n $this->template->full_admin_html_view($content);\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 addView()\n {\n return $this->render('Add');\n }", "public function addAction() {\n\t\t$form = new Default_Form_UserGroup ();\n\t\t$userGroup = new Default_Model_UserGroup ();\n\t\t$userGroupMapper = new Default_Model_Mapper_UserGroup ();\n\t\t$this->_save ( $form, self::$ADD_MODE );\n\t\tunset($form->getElement('modules')->required);\n\t\t$this->view->form = $form;\n\t\t$this->render ( \"add-edit\" );\n\t}", "public function action_add()\n\t{\n $data = $this->addSelectBoxMongoData();\n\t\tif (count(input::post()) > 0) {\n\t\t\t$params = input::post();\n\t\t\t$data['val'] = $params;\n\t\t\tif (empty($params['c_logo']) === false) {\n\t\t\t\tunlink(IMAGE_TEMP_PATH. $params['c_logo']);\n\t\t\t}\n\t\t}\n\t\t$this->common_view->set('content', View::forge('career/add', $data));\n\t\treturn $this->common_view;\n\t}", "public function add() \r\n\t{\r\n\t\t$data['header']['title'] = 'Add a new country';\r\n\t\t$data['footer']['scripts']['homescript.js'] = 'home';\r\n\t\t$data['view_name'] = 'country/country_add_view';\r\n\t\t$data['view_data'] = '';\r\n\t\t$this->load->view('country/page_view', $data);\r\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 showCompany_ADD() \n\t{\n\t\treturn view('company_add');\n \t\n\t}", "public function add(){\n\t\t$this->load->view('top');\n\t\t$this->load->view(\"timHPS/timHps_add\",$data);\n\t\t$this->load->view('bottom');\n\t}", "public function add(){\n\t\t\t\n\t\t\trequire_once('views/category/add.php');\n\t\t}", "public function addTaskForm()\n {\n $this->checkIfLoggedIn();\n\n return view('new-task', [\n 'titlePart' => '| Add a task',\n 'user' => session()->get('user')\n ]);\n }", "public function add() {\n\t\t$this->display ( 'admin/tag/add.html' );\n\t}", "function add()\r\n\t{\r\n\t\t$data['main_content'] = 'policy_add';\r\n\t\t$opt_load = array(\r\n\t\t\t'<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.datalabsecurity.com/webscan/resources/css/dashboardui.css\" />',\r\n\t\t\t'<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.datalabsecurity.com/webscan/resources/css/css3-buttons.css\" />',\r\n\t\t\t'<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.datalabsecurity.com/webscan/resources/css/progress.css\" />',\r\n\t\t\t'<script type=\"text/javascript\" src=\"http://www.datalabsecurity.com/webscan/resources/js/jquery-1.6.4.min.js\"></script>',\r\n\t\t\t'<script src=\"http://www.datalabsecurity.com/webscan/resources/js/jquery.easytabs.min.js\" type=\"text/javascript\"></script>',\r\n\t\t\t'<script type=\"text/javascript\" src=\"http://www.datalabsecurity.com/webscan/resources/js/progress.js\"></script>',\r\n\t\t\t);\r\n\t\t$opt_head = array(\r\n\t\t\t\"title\" => \"Policies\",\r\n\t\t\t\"opt_load\" => $opt_load,\r\n\t\t\t);\r\n\t\t$data['opt_head'] = $opt_head;\r\n\t\t$this->load->view('includes/template-beta', $data);\t\r\n\t}", "public function add() \n { \n $data['piutang'] = $this->piutangs->add();\n $data['action'] = 'piutang/save';\n \n $tmp_statuss = $this->statuss->get_all();\n foreach($tmp_statuss as $row){\n $statuss[$row['id']] = $row['status'];\n }\n $data['statuss'] = $statuss;\n \n $this->template->js_add('\n $(document).ready(function(){\n // binds form submission and fields to the validation engine\n $(\"#form_piutang\").parsley();\n });','embed');\n \n $this->template->render('piutang/form',$data);\n\n }", "public function addform()\n\t{\n \n\t\t$this->setMethod('post');\n\t\t $this->setAttrib('enctype', 'multipart/form-data');\n\n\t\t$this->addElement('file', 'upload_image', array( \n\t\t\t'label' => '',\n 'required' => false\n ));\n\n // Add the submit button\n $this->addElement('submit', 'submit', array(\n 'ignore' => true,\n 'label' => 'Submit',\n ));\n\n // And finally add some CSRF protection\n $this->addElement('hash', 'csrf', array(\n 'ignore' => true,\n ));\n\n\n\t}", "public function addAction() {\n\t\t$this->view->addLayoutVar(\"onglet\", 2);\n\t\t$uid = Annuaire_User::getCurrentUserId();\n\t\t$this->view->title = t_('Add');\n\t\t$db = Gears_Db::getDb();\n\t\t$clients = Array();\n\t\t$result = $db->fetchAll(\"SELECT * FROM ANNUAIRE_SOCIETE WHERE USER_ID = ?\", Array($uid));\n\t\tforeach ($result as $info) {\n\t\t\t$clients[$info['SOCIETE_ID']][0] = $info['SOCIETE_ID'];\n\t\t\t$clients[$info['SOCIETE_ID']][1] = $info['SOCIETE_NOM'];\n\t\t}\n\t\t$this->view->clients = ($clients);\n\t\t$this->view->addcontact = t_(\"Add a contact\");\n\t\t$this->view->name = t_(\"Name\");\n\t\t$this->view->firstname = t_(\"First Name\");\n\t\t$this->view->address = t_(\"Address\");\n\t\t$this->view->mail = t_(\"Mail\");\n\t\t$this->view->phone = t_(\"Phone Number\");\n\t\t$this->view->cell = t_(\"Cellphone number\");\n\t\t$this->view->fax = t_(\"Fax\");\n\t\t$this->view->site = t_(\"Website\");\n\t\t$this->view->comment = t_(\"Comment\");\n\t\t$this->view->society = t_(\"Companie\");\n\t\t$this->view->none = t_(\"none\");\n\t\t$this->view->send = t_(\"Send\");\n\t\t$this->view->addsociety = t_(\"Add a companie\");\n\t\t$this->view->activity = t_(\"Activity\");\n\t}", "public function addFormAction()\n {\n $template = 'BugglMainBundle:Admin\\TripTheme:form.html.twig';\n $form = $this->createFormBuilder()\n ->add('name', 'text',\n array('constraints' => new \\Symfony\\Component\\Validator\\Constraints\\NotBlank()))\n ->add('status','checkbox', array('required' => false))\n ->getForm();\n\n $html = $this->renderView($template, array('form' => $form->createView()));\n\n $data = array('html'=>$html);\n\n return new \\Symfony\\Component\\HttpFoundation\\JsonResponse($data, 200);\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 pendadaran_add()\n\t{\n\t\t$data = array( 'isi' \t=> 'pendadaran/pendadaran_add',\n\t\t\t\t\t\t'nav'\t=>\t'admin/v_nav_admin',\n\t\t\t\t\t\t'title' => 'Tampil Dashboard Admin');\n\t\t$this->load->view('layout/wrapper',$data);\n\t}", "public function add()\n {\n $data['action'] = $this->url->link('/admin/users-groups/submit');\n\n $data['pages'] = $this->getPermissionPages();\n\n return $this->view->render('admin/users-groups/form', $data);\n }", "function add_owner_input()\n {\n $data['heading'] = 'Add a new owner';\n\t\t$headerView = $this->global_model->get_standard_header_view();\n\t\t$this->load->view('owners/add_owner_input',$data);\n\t\t$this->load->view('footer_view');\n }", "public function add()\n {\n $db = db_connect();\n $data['table'] = $db->listTables();\n $data['MenuModel'] = $this->MenuModel->where('hirarki', 1)->findAll();\n $param['menu'] = $this->menu;\n $param['activeMenu'] = $this->activeMenu;\n\n if ($param['activeMenu']['akses_tambah'] == '0')\n {\n return redirect()->to('denied');\n }\n $param['page'] = view($this->path_view . 'page-add',$data);\n return view($this->theme, $param);\n }", "public function actionAdd(){\r\n \r\n }", "public function index()\n\t{\n\t\t$content = $this->lcustomer->customer_add_form();\n\t\t$this->template->full_admin_html_view($content);\n\t}", "public function add()\n {\n $update_data = $this->insert_global_model->globalinsert($this->tbl_exam_users_activity,array('user_id'=>$this->logged_in_user->id,\n 'activity_time'=>date('Y-m-d H:i:s'),'activity'=>'Add New Survey Question View'));\n // set page specific variables\n $page_info['title'] = 'Add New Question'. $this->site_name;\n $page_info['view_page'] = 'administrator/survey_question_form_view';\n $page_info['message_error'] = '';\n $page_info['message_success'] = '';\n $page_info['message_info'] = '';\n $page_info['is_edit'] = false;\n\n $this->_set_fields();\n $this->_set_rules();\n\n // determine messages\n if ($this->session->flashdata('message_error')) {\n $page_info['message_error'] = $this->session->flashdata('message_error');\n }\n\n if ($this->session->flashdata('message_success')) {\n $page_info['message_success'] = $this->session->flashdata('message_success');\n }\n\n // load view\n\t $this->load->view('administrator/layouts/default', $page_info);\n }" ]
[ "0.8637647", "0.85642475", "0.7751937", "0.7703067", "0.76892745", "0.76864004", "0.7684585", "0.7683317", "0.7649132", "0.7612327", "0.76013327", "0.7597881", "0.75277644", "0.7468245", "0.743779", "0.74364644", "0.74052405", "0.7366821", "0.7363904", "0.73630786", "0.73442453", "0.7330094", "0.7327674", "0.73128355", "0.729956", "0.7285516", "0.7257019", "0.7226676", "0.72141945", "0.7210283", "0.7198533", "0.71973974", "0.7186106", "0.7177114", "0.71153", "0.7094278", "0.708731", "0.7087275", "0.7058998", "0.7057426", "0.7043758", "0.70411015", "0.7026519", "0.7023695", "0.7018478", "0.70166886", "0.7014206", "0.7008432", "0.6996728", "0.69868857", "0.6983695", "0.69709176", "0.69613737", "0.6942578", "0.69424003", "0.6925288", "0.6915709", "0.69085926", "0.6907925", "0.6907316", "0.69014823", "0.68936867", "0.6876319", "0.6867784", "0.68567175", "0.68482274", "0.68353796", "0.68242556", "0.6816396", "0.68160737", "0.6804856", "0.6800894", "0.6800792", "0.67959005", "0.67896277", "0.6783519", "0.6782448", "0.6781328", "0.6779734", "0.6778059", "0.67684984", "0.67660856", "0.6757027", "0.6754352", "0.6752117", "0.6743369", "0.6739772", "0.6736268", "0.6725528", "0.6716569", "0.6709734", "0.67013884", "0.6694432", "0.6694186", "0.6685264", "0.6682761", "0.668257", "0.66815394", "0.6677197", "0.6676391", "0.66742545" ]
0.0
-1
Get the fields/elements defined in this form.
function getRenderableElementNames() { // The _elements list includes some items which should not be // auto-rendered in the loop -- such as "qfKey" and "buttons". These // items don't have labels. We'll identify renderable by filtering on // the 'label'. $elementNames = array(); foreach ($this->_elements as $element) { /** @var HTML_QuickForm_Element $element */ $label = $element->getLabel(); if (!empty($label)) { $elementNames[] = $element->getName(); } } return $elementNames; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fields() {\n\t\tif( !$this->fields ) {\n\t\t\t$this->fields = new Form/Fields( $this->id );\n\t\t}//end if\n\t\treturn $this->fields;\n\t}", "public function getFormFields()\n {\n return $this->form->getFields();\n }", "public function getFields()\n {\n return $this->getForm()->getFields();\n }", "public function retrieveFormFields()\n {\n return $this->start()->uri(\"/api/form/field\")\n ->get()\n ->go();\n }", "public function get_fields() {\r\n\t\treturn $this->fields;\r\n\t}", "public function get_fields() {\n\t\treturn $this->fields;\n\t}", "public function form_fields() {\n\t\treturn apply_filters( \"appthemes_{$this->box_id}_metabox_fields\", $this->form() );\n\t}", "function get_fields( ) {\n\t\treturn $this->fields_list;\n\t\t}", "public function get_fields() {\n return $this->fields;\n }", "public function getFields()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('fields');\n }", "function fields()\n\t{\n\t\treturn $this->_fields;\n\t}", "public function getFields() {\n\t\treturn $this->fields;\n\t}", "public function getFields() {\n\t\treturn $this->fields;\n\t}", "public function getFields()\n\t\t{\n\t\t\treturn $this->fields;\n\t\t}", "public function fields()\r\n {\r\n return $this->fields;\r\n }", "public function getFields()\n\t{\n\t\treturn $this->fields;\n\t}", "public function getFields()\n\t{\n\t\treturn $this->fields;\n\t}", "public function getElements() : array\n {\n return $this->formElements;\n }", "public function fields()\n {\n return $this->fields;\n }", "public function fields()\n {\n return $this->fields;\n }", "public function fields() {\n return $this->fields;\n }", "public function getFields()\r\n {\r\n return $this->fields;\r\n }", "public function form_elements() {\n\n\t\t\t// Instantiate Widget Inputs\n\t\t\t$form_elements = new Layers_Form_Elements();\n\n\t\t\t// Return design bar\n\t\t\treturn $form_elements;\n\n\t\t}", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function getFields()\n {\n return $this->fields;\n }", "public function fields() {\n // The fields are passed to the constructor for this plugin.\n return $this->fields;\n }", "public function getFields()\n {\n return $this->_fields;\n }", "public function getFields()\n {\n return $this->_fields;\n }", "public function getFields()\n\t{\n\t\treturn $this->_fields;\n\t}", "public function getFields()\n {\n return $this->arr_defined_fields;\n }", "protected function getFields()\n {\n return $this->fields;\n }", "protected function getFields()\n {\n return $this->fields;\n }", "public function getFormFields() {\n $fields = array(\n 'shapes[]' => array(\n 'type' => 'select',\n 'multiplicate' => '5',\n 'values' => array(\n '-' => '-',\n 'cube' => 'cube',\n 'round' => 'round',\n )\n ),\n 'width[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Width'\n ),\n 'higth[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Higth'\n ),\n 'x_position[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'X position'\n ),\n 'y_position[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Y position'\n ),\n 'red[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color red',\n ),\n 'green[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color green',\n ),\n 'blue[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color blue',\n ),\n 'size[]' => array(\n 'type' => 'text',\n 'multiplicate' => '1',\n 'label' => 'Size holst'\n ),\n 'enable[]' => array(\n 'type' => 'checkbox',\n 'multiplicate' => '5',\n 'label' => 'enable'\n )\n );\n return $fields;\n }", "public function getInputFields() {\n\t\treturn $this->inputFields;\n\t}", "public function getFields() : array {\n\t\treturn $this->fields;\n\t}", "public function getFields()\n {\n return $this->content->getFields();\n }", "public function getFields() {\n $field = $this->get('field');\n return null !== $field ? $field : array();\n }", "public function getFields()\n\t{\n\t\tif (!isset($this->_fields))\n\t\t{\n\t\t\t$this->_fields = array();\n\n\t\t\t$fieldLayoutFields = $this->getFieldLayout()->getFields();\n\n\t\t\tforeach ($fieldLayoutFields as $fieldLayoutField)\n\t\t\t{\n\t\t\t\t$field = $fieldLayoutField->getField();\n\t\t\t\t$field->required = $fieldLayoutField->required;\n\t\t\t\t$this->_fields[] = $field;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_fields;\n\t}", "protected function getFields()\n {\n return $this->Fields;\n }", "public function getFields(){\n\t\treturn $this->Fields;\n\t}", "public function getFields()\n {\n return isset($this->Fields) ? $this->Fields : null;\n }", "public static function getFields() {\n return array(\n new TextField( array(\n 'name' => 'name',\n 'public' => array(\n 'title' => 'Title',\n 'description' => 'The name of the link that the\n element will describe',\n ),\n ) ),\n new TextField( array(\n 'name' => 'blurb',\n 'public' => array(\n 'title' => 'Blurb',\n 'description' => 'Short blurb that can be displayed about\n the nature of the link',\n ),\n ) ),\n new TextField( array(\n 'name' => 'image',\n 'public' => array(\n 'title' => 'Image',\n 'description' => 'The image to be dispalyed on the front.',\n ),\n ) ),\n new TextField( array(\n 'name' => 'link',\n 'public' => array(\n 'title' => 'Link',\n 'description' => 'The actual link clicking the element will\n result in.',\n ),\n ) ),\n );\n }", "public static function getFields(){\n\t\treturn self::$fields;\n\t}", "public static function getFields() {\n return self::$fields;\n }", "public function getForm(): array\n {\n return $this->form;\n }", "protected function get_fields() {\n\t\treturn rwmb_get_registry( 'field' )->get_by_object_type( 'post' );\n\t}", "public static function form_fields(){\n\n \treturn [\n [\n \t'id'=> 'description',\n \t'name'=> 'description', \n \t'desc'=> 'Description', \n \t'val'=>\tnull, \n \t'type'=> 'text',\n \t'maxlength'=> 255,\n \t'required'=> 'required',\n ],\n\n [\n \t'id'=> 'rate',\n \t'name'=> 'rate', \n \t'desc'=> 'Discount Rate', \n \t'val'=>\tnull, \n \t'type'=> 'number',\n \t'min'=> 0,\n \t'max'=> 100,\n \t'step'=> '0.01',\n \t'required'=> 'required',\n ],\n\n [\n \t'id'=> 'stat',\n \t'name'=> 'stat', \n \t'desc'=> 'isActive', \n \t'val'=>1, \n \t'type'=> 'checkbox',\n ],\n ];\n\n }", "public function getForms()\n {\n return $this->form;\n }", "public function Fields()\n {\n foreach ($this->getExtraFields() as $field) {\n if (!$this->fields->fieldByName($field->getName())) {\n $this->fields->push($field);\n }\n }\n\n return $this->fields;\n }", "public function getAllFields()\n {\n return $this->fields;\n }", "public function &getFields() { return $this->fields; }", "protected function getCreateFormFields()\n {\n return $this->formFields();\n }", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "abstract public function get_gateway_form_fields();", "public function & getFields() {\n\t\treturn $this->fields;\n\t}", "public function getFormData()\n {\n return $this->_getApi()->getFormFields($this->_getOrder(), $this->getRequest()->getParams());\n }", "public function elements()\n {\n return [\n '@tree' => '.dd',\n '@form' => 'form[method=\"POST\"]',\n ];\n }", "public function getFieldStructure() {\n if (!$this->_topLevelId || !$this->_topLevelValue) {\n $this->_topLevelId = null;\n $this->_topLevelValue = null;\n }\n $a = $this->getFieldsStructureFull('sitestoreform', $this->_topLevelId, $this->_topLevelValue);\n\n return $this->getFieldsStructureFull('sitestoreform', $this->_topLevelId, $this->_topLevelValue);\n }", "public function getFields(): array\n {\n return $this->fields;\n }", "public function getFields(): array\n {\n return $this->fields;\n }", "public function getUsableFormFields()\n {\n $fields = array();\n\n // Get all form fields which can be used for MailChimp values\n $objFields = Database::getInstance()->prepare(\"SELECT id,name,label FROM tl_form_field WHERE pid=? AND (type=? OR type=? OR type=? OR type=? OR type=?) ORDER BY name ASC\")\n ->execute(Input::get('id'), 'text', 'hidden', 'select', 'radio', 'checkbox');\n\n $fields[] = '-';\n while ($objFields->next())\n {\n $k = $objFields->name;\n $v = $objFields->label;\n $v = strlen($v) ? $v.' ['.$k.']' : $k;\n $fields[$k] =$v;\n }\n\n return $fields;\n }", "abstract protected function getFormIntroductionFields();", "public function getFields()\n {\n if ($this->fields) {\n return $this->fields;\n }\n\n $this->fields = array(\n 'data_type_id',\n 'name',\n 'aliases',\n 'description',\n 'driver',\n );\n\n return $this->fields;\n }", "public function form() {\n\t\treturn array();\n\t}", "function getForm(){\r\n\t\t$data = [\r\n\t\t\t'EFORM' => [\r\n\t\t\t\t'formName' => $this->formName,\r\n\t\t\t\t'scope' => $this->scope,\r\n\t\t\t\t'_uid' => $this->uid,\r\n\t\t\t\t'elements' => $this->fields->getFormViewFields($this),\r\n\t\t\t\t'errors' => $this->errors,\r\n\t\t\t\t'buttons' => $this->buttons->get()\r\n\t\t\t]\r\n\t\t];\r\n\r\n\t\tif($this->actions){\r\n\t\t\t$data['EFORM']['actions'] = $this->actions->getForSmarty();\r\n\t\t}\r\n\t\tif(!empty($this->statuses)){\r\n\t\t\t$data['EFORM']['fieldStatuses'] = $this->statuses;\r\n\t\t}\r\n\r\n\t\t$view = new ViewElementClass();\r\n\t\t$view->type = 'form_start';\r\n\t\t$view->data = $data;\r\n\t\treturn $view;\r\n\t}", "protected function getFields() {\n return $this->getConfiguration()['settings']['fields'];\n }", "public function fields(){\n\t\treturn array();\n\t}", "public function elements()\n {\n return [\n '@email' => 'input[name=email]',\n '@passwd' => 'input[name=passwd]',\n ];\n }", "public function getFields() {\n\n $fields = array(\"consumer_id\" => array('required'=> true, 'type'=>'hidden', 'disableDecorator' => array('HtmlTag', 'Label', 'DtDdWrapper')),\n \"allergy\" => array('label'=>'Allergy', 'required'=> true),\n \"info\"=>array('label'=>'Info','required'=> false, 'attributes'=>array('rows'=>'4', 'cols'=>'8')));\n \n if( !empty( $this->_id ) ) {\n \n $fields['id'] = array('default'=>$this->_id, 'type'=>'hidden', 'required'=> true,\n 'disableDecorator' => array('HtmlTag', 'Label', 'DtDdWrapper')); \n }\n \n return $fields;\n }", "public function getFieldsList(){\n return $this->_get(1);\n }", "public function getFields() {\n\t\t$fields[] = array('name' => 'parent',\n\t\t\t'type' => 'string',\n\t\t\t'size' => 100,\n\t\t\t'notnull' => true);\n\t\t$fields[] = array('name' => 'parentid',\n\t\t\t'type' => 'integer',\n\t\t\t'notnull' => true);\n\t\t$fields[] = array('name' => 'name',\n\t\t\t'type' => 'string',\n\t\t\t'size' => 100,\n\t\t\t'notnull' => true);\n\t\t$fields[] = array('name' => 'value',\n\t\t\t'type' => 'string',\n\t\t\t'size' => 1000000,\n\t\t\t'notnull' => false);\n\n\t\treturn $fields;\n\t}", "public function getFields() {}", "public function getFields() {}", "public function getFields() {}", "public static function get_fields()\n {\n }", "public function getFormCustomFields(){\n\t}", "public function fields() : DeepList {\n return $this->_fields;\n }", "public function elements()\n {\n return [\n '@full_name' => 'full_name',\n '@email' => 'email',\n '@password' => 'password',\n '@phone' => 'phone',\n '@address' => 'address',\n '@submit' => 'Submit'\n ];\n }", "public function getFields()\n\t{\n\t\treturn [];\n\t}", "public function getFields() {\n return $this->program->getFields();\n }", "function getFields();", "public function getFields(): array\n {\n if ($this->_fields !== null) {\n return $this->_fields;\n }\n\n try {\n $id = $this->getFieldLayoutId();\n } catch (InvalidConfigException $e) {\n return [];\n }\n\n return $this->_fields = Craft::$app->getFields()->getFieldsByLayoutId($id);\n }", "public function getFields() {\n if($this->cachedFields == null) {\n $this->cachedFields = $this->createFields();\n }\n\n return $this->cachedFields;\n }", "public function getMyFormFields() {\n $aMyFieldsByForm = [];\n\n # Build Query to get User Based Columns\n $oFieldsSel = new Select(CoreEntityModel::$aEntityTables['user-form-fields']->getTable());\n $oFieldsSel->join(['core_field'=>'core_form_field'],'core_field.Field_ID = user_form_field.field_idfs');\n $oFieldsSel->where(['user_idfs'=>$this->getID()]);\n\n # Get My Fields from Database\n $oMyFieldsDB = CoreEntityModel::$aEntityTables['user-form-fields']->selectWith($oFieldsSel);\n\n foreach($oMyFieldsDB as $oField) {\n # Order By Form\n if(!array_key_exists($oField->form,$aMyFieldsByForm)) {\n $aMyFieldsByForm[$oField->form] = [];\n }\n $aMyFieldsByForm[$oField->form][$oField->Field_ID] = $oField;\n }\n\n return $aMyFieldsByForm;\n }", "public function instance_fields(){\n\t\treturn self::fields(get_class($this));\n\t}", "public function getForm();", "public function getFullSearchFields()\r\n\t{\r\n\t\t$file = AKHelper::_('path.get', null, $this->option) . '/models/forms/' . $this->list_name . '/search.xml';\r\n\t\t$file = JFile::exists($file) ? $file : AKHelper::_('path.get', null, $this->option) . '/models/forms/' . $this->list_name . '_search.xml';\r\n\r\n\t\t$xml = simplexml_load_file($file);\r\n\t\t$field = $xml->xpath('//field[@name=\"field\"]');\r\n\t\t$options = $field[0]->option;\r\n\r\n\t\t$fields = array();\r\n\r\n\t\tforeach ($options as $option):\r\n\t\t\t$attr = $option->attributes();\r\n\t\t\t$fields[] = $attr['value'];\r\n\t\tendforeach;\r\n\r\n\t\treturn $fields;\r\n\t}" ]
[ "0.82295287", "0.7936218", "0.7923623", "0.7858325", "0.7518411", "0.7487265", "0.7440453", "0.7420648", "0.741438", "0.73881453", "0.7360514", "0.7327193", "0.7327193", "0.7317606", "0.73152393", "0.730696", "0.730696", "0.7304057", "0.7291822", "0.7291822", "0.72860646", "0.7285684", "0.7281021", "0.7274218", "0.7274218", "0.7274218", "0.7274218", "0.7274218", "0.7274218", "0.7274218", "0.7274218", "0.7274218", "0.7274218", "0.7274218", "0.727261", "0.7265974", "0.7265974", "0.726488", "0.7232164", "0.72236633", "0.72236633", "0.722131", "0.71567285", "0.71521944", "0.7136208", "0.70973724", "0.70940113", "0.7064107", "0.7063326", "0.7058345", "0.7047621", "0.7036801", "0.7018326", "0.700103", "0.69931936", "0.6992135", "0.6983867", "0.6967689", "0.69598484", "0.6958818", "0.69452924", "0.6933529", "0.6933529", "0.6933529", "0.6933529", "0.6933529", "0.6933529", "0.69323266", "0.6927423", "0.6911688", "0.69074965", "0.69032997", "0.69012415", "0.69012415", "0.689585", "0.6862515", "0.68620473", "0.68415076", "0.6826991", "0.6808035", "0.68018764", "0.680105", "0.6781663", "0.6775262", "0.67739886", "0.67488456", "0.67488456", "0.67488456", "0.67432797", "0.67401063", "0.6727204", "0.672156", "0.6707922", "0.6704847", "0.6681855", "0.6665528", "0.66594815", "0.6656033", "0.6648909", "0.6644647", "0.6644636" ]
0.0
-1
single or multipie get base info
public static function get_base($id) { if (is_array($id)) { $records = \Base\Dao\UserTable::instance()->get($id, ['id', 'username', 'name']); $items = array(); foreach ($records as $item) { $item['id'] = intval($item['id']); $item['username'] = $item['username']; $item['name'] = $item['name']; $items[$item['id']] = $item; } return $items; } $result = \Base\Dao\UserTable::instance()->get_single($id); $result['id'] = intval($result['id']); $result['username'] = $result['username']; $result['name'] = $result['name']; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getBase ()\n {\n global $config;\n return $config->current['BASE'];\n }", "public function getBase() {\n\t\treturn $this->base;\n\t}", "public function getBase() {\n\t\treturn $this->base;\n\t}", "public function getBase() {\n\t\treturn $this->base;\n\t}", "public function getBase() {\n\t\treturn $this->base;\n\t}", "public function getBase() {\n\t\treturn $this->base;\n\t}", "public function getBase() {}", "public function getBase()\n\t{\n\t\treturn $this->base;\n\t}", "public function getBase() {\n return $this->base;\n }", "public function getBase() {\n return $this->base;\n }", "public function getBase()\n {\n return $this->base;\n }", "public function getBase()\n {\n return $this->base;\n }", "public function getBase()\n {\n return $this->base;\n }", "public function getBase()\n {\n return $this->get(self::_BASE);\n }", "public function getBase()\n {\n return $this->get(self::_BASE);\n }", "public function getBase()\n {\n return $this->get(self::_BASE);\n }", "public function getBase() {\n\n return $this->base;\n }", "public function getBase(): string\n {\n return $this->base;\n }", "public function base()\n {\n return $this->base;\n }", "abstract public function getPrimary();", "public function get_base( $type ) : string {\n switch ( $type ) {\n case 'name':\n return $this->get_basename();\n case 'path':\n return $this->get_base_path();\n case 'url':\n return $this->get_base_url();\n default:\n return '';\n }\n }", "public function get_base()\n\t{\n\t\t$base = NULL;\n\t\tif (isset($this->tables[0]))\n\t\t{\n\t\t\tforeach (self::$bases as $base_name => $tables)\n\t\t\t{\n\t\t\t\t$find = FALSE;\n\t\t\t\tif (is_array($tables))\n\t\t\t\t{\n\t\t\t\t\tforeach ($tables as $t)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($this->tables[0] == $t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$find = TRUE;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($find)\n\t\t\t\t{\n\t\t\t\t\t$base = $base_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $base;\n\t}", "public function getInfo();", "protected function getBase ($record) {\n\n // check if there is one or multiple matches for the base name\n $base = $record->getBase();\n if (! is_array($base))\n $base = array ($record->getBase());\n\n return $base;\n //===\n\n }", "public function getPrimary();", "function getInfo();", "protected function getBaseSingle ($record) {\n\n // check if there is one or multiple matches for the base name\n $base = $record->getBase();\n if (is_array($base))\n $base = $record->getWord();\n\n return $base;\n //===\n\n }", "public function getApiBase();", "public function getInformation();", "public abstract function getInfo () : string;", "public function getBASE($id)\n {\n $result = CVSS_OpenVas::where('id', $id)->first();\n\n if (empty($result->BASE)) {\n\n $this->calculateCVSS($id);\n }\n $result = CVSS_OpenVas::where('id', $id)->first();\n\n return $result->BASE;\n\n }", "public function getInfo() {}", "public function getInfo() {}", "function get_base()\n\t{\n\t\t$site_url = get_site_option('siteurl');\n\t\t$base = trim(preg_replace('#https?://[^/]+#ui', '', $site_url), '/');\n\n\t\t// @since 1.3.0 - guess min dir to check for any dir that we have to\n\t\t// remove from the base\n\t\t$this->_guess_min_dir();\n\n\t\t$this->base = !empty($this->remove_from_base)\n\t\t\t? preg_replace('#^' . $this->remove_from_base . '/?#ui', '', $base, 1)\n\t\t\t: $base;\n\t}", "public function getBase(): void {}", "public function get_base($element = array())\n {\n }", "public function get_base($element = array())\n {\n }", "public function find_base_dn() {\n $namingContext = $this->get_root_dse(array('defaultnamingcontext')); \n return $namingContext[0]['defaultnamingcontext'][0];\n }", "public function base()\n {\n if (!$this->base) {\n $this->base = monsters::find($this->id);\n }\n return $this->base;\n }", "function getBasesList(){\r\n \t$resourceUrl = \"/bases?Take=All\";\r\n\t\t$this->get($resourceUrl);\r\n\t\t// Check reponse 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 Bases Failed.\r\n\t\t\t\t\tStatus: %d\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$this->status_code,\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\treturn false;\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n }", "public function getApiBase()\n {\n return $this->config['api_base'];\n }", "public function base()\n {\n return $this->string;\n }", "function _dslm_get_base() {\n // Initialize an empty base.\n $base = '';\n\n // Try to get a base from one of the appropriate sources\n if ($base_check = drush_get_option('dslm-base', FALSE)) {\n // We have this wet with --drupal-base on the cli\n $base = $base_check;\n }\n elseif ($base_check = drush_get_option('dslm_base', FALSE)) {\n // We have this set in the drushrc.php file\n $base = $base_check;\n }\n else {\n // Last ditch is tp ise the environment variable if it's set.\n if (isset($_ENV['DSLM_BASE'])) {\n $base = $_ENV['DSLM_BASE'];\n } else {\n // If we got here and there wasn't an environment variable set, bail\n return FALSE;\n }\n }\n\n // PHP doesn't resolve ~ as the home directory.\n if (isset($_SERVER['HOME'])) {\n $base = preg_replace('/^\\~/', $_SERVER['HOME'], $base);\n }\n\n return $base;\n}", "private function baseName(){\n \n if ($this->baseName===null) {\n $this->baseName= implode('/', array_slice(explode('/', $_SERVER['SCRIPT_NAME']), 0, -1)) . '/';\n }\n return $this->baseName;\n\n }", "function base_url(){\n return BASE_URL;\n }", "public function get_base_object() {\n\t\treturn $this->_base_obj;\n\t}", "function get_base_url() {\n return $this->base_url;\n }", "public function getIsBase()\n\t{\n\t\treturn $this->isBase; \n\n\t}", "function getMaster();", "public function getLocationbase()\n {\n return $this->locationbase;\n }", "function get_master_id(){\r\n\t\t$result=$this->m_master_ambil_paket->get_master_id();\r\n\t\techo $result;\r\n\t}", "public function getByBaseId($baseId);", "abstract public function getPrimary(): array;", "abstract public function information();", "function base_path()\n {\n $paths = getPaths();\n\n return $paths['base'];\n }", "function set_base($val) {\n\t\t$this->base = $val;\n\t}", "public function info();", "public function info();", "protected function base()\n {\n return $this->use_production\n ? self::PRODUCTION_URI\n : self::DEVELOPMENT_URI;\n }", "private static function getMaster() {\n return self::getRandomPDOLB(self::MASTER);\n }", "function base_url(){\n $url = BASE_URL;\n return $url;\n }", "abstract public function infoAll();", "protected function urlBase()\n {\n return \"/bibs/{$this->bib->mms_id}/representations/{$this->representation_id}\";\n }", "abstract function get();", "public function getBaseURL()\n\t{\n\t\treturn $this->base_url;\n\t}", "private function somebody_set_us_up_the_base()\n\t{\n\t\tdefine('BASE', SELF.'?S='.ee()->session->session_id().'&amp;D=cp'); // cp url\n\t}", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "abstract public function get();", "function GetMainBaseFromURL()\n{\n\t$url = (!empty($_SERVER['HTTPS'])) ? \"https://\".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : \"http://\".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];\n\n\t$chars = preg_split('//', $url, -1, PREG_SPLIT_NO_EMPTY);\n\t$slash = 3; // 3rd slash\n\t$i = 0;\n\tforeach($chars as $key => $char)\n\t{\n\t\tif($char == '/')\n\t\t{\n\t\t $j = $i++;\n\t\t}\n\t\n\t\tif($i == 3)\n\t\t{\n\t\t $pos = $key; break;\n\t\t}\n\t}\n\tif($_REQUEST['CFSystem']['url_friendly'])\n\t{\n\t\t$url = (!empty($_SERVER['HTTPS'])) ? \"https://\".$_SERVER['SERVER_NAME']: \"http://\".$_SERVER['SERVER_NAME'];\n\t\t$main_base = rtrim($url.'/'.basename($_REQUEST['CFSystem']['baseurl']),'/');\n\t}\n\telse\n\t{\n\t\t$main_base = substr($url, 0, $pos);\n\t}\n\treturn $main_base.'/';\t\n}", "public function getLastBase() {\n\n if (\n ($bases = $this->getBases())\n && (is_array($bases))\n )\n return $bases[intval(count($bases)-1)];\n //===\n\n\n return NULL;\n //===\n\n }", "function base_url() {\n return Micro::get(Config::class)->get('app.base_url');\n }", "function GetBaseCurrency()\n\t{\n\t\t$result = $this->sendRequest(\"GetBaseCurrency\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "private static function base_url($path=NULL)\n {\n\t\tglobal $url;\n $fullurl=$url.$path;\n return $fullurl;\n\t}", "function lang_base_url()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->lang_base_url;\n\t}", "function lang_base_url()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->lang_base_url;\n\t}", "function grab(){\n\n\t\t$domains = explode(\",\",$this->conf->startUp[\"APPS.DOMAIN\"]);\n\t\tif(in_array(\"\".$_SERVER[\"HTTP_HOST\"],$domains)){\n\t\t\t$domain = $_SERVER[\"HTTP_HOST\"];\n\t\t}else{\n\t\t\t$domain = \"localhost\";\n\t\t}\t\n\n\t\t$bruto_url = $_SERVER[\"REQUEST_SCHEME\"].\"://\".\n\t\t\t$domain.$_SERVER[\"REQUEST_URI\"];\n\n\t\t$net_url = isset($bruto_url) ? $bruto_url : false;\n\n\t\tif($net_url)\n\t\t{\n\t\t\t//format HMVC [modules][controller ++model++views]\n\t\t\t//format MVC controler ++model++views\n\t\t\t$modeHMVC = self::$confStatic->startUp[\"APPS.MODULAR\"];\n\t\t\t$net_url \t= parse_url($net_url);\n\t\t\t$array_path = explode('/',ltrim($net_url['path'],'/'));\n\n\t\t\t$pageComponent=[];\n\t\t\tif($modeHMVC == \"true\"){ \n\t\t\t\t//jika dijalankan pada mode lokal atau online\n\t\t\t\tif($domain == \"localhost\" || $domain == \"127.0.0.1\"){\n\t\t\t\t\t$pageComponent['modul']\t\t= ucfirst($array_path[1]);\n\t\t\t\t\t$pageComponent['class'] \t= isset($array_path[2]) ? $array_path[2] : $this->conf->startUp[\"APPS.BASEPAGE\"];\n\t\t\t\t\t$pageComponent['func'] \t\t= isset($array_path[3]) ? $array_path[3] : $this->conf->startUp[\"APPS.FUNC\"];\n\t\t\t\t\t$pageComponent['params'] \t= isset($array_path[3]) ? array_slice($array_path,4) : null;\t\t\t\n\n\t\t\t\t}\n\t\t\t\t//jika tidak mode local\n\t\t\t\telse{\n\t\t\t\t\t$pageComponent['modul'] \t\t= ucfirst($array_path[0]);\n\t\t\t\t\t$pageComponent['class'] \t\t= isset($array_path[1]) ? $array_path[1] : $this->conf->startUp[\"APPS.BASEPAGE\"];\n\t\t\t\t\t$pageComponent['func'] \t\t\t= isset($array_path[2]) ? $array_path[2] : $this->conf->startUp[\"APPS.FUNC\"];\n\t\t\t\t\t$pageComponent['params']\t\t= isset($array_path[2]) ? array_slice($array_path,3) : null;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t//jika mode local\n\t\t\t\tif($domain == \"localhost\" || $domain == \"127.0.0.1\"){\n\t\t\t\t\t$pageComponent['modul'] \t\t= \"\";\n\t\t\t\t\t$pageComponent['class'] \t\t= $array_path[1];\n\t\t\t\t\t$pageComponent['func'] \t\t\t= isset($array_path[2]) ? $array_path[2] : $this->conf->startUp[\"APPS.FUNC\"];\n\t\t\t\t\t$pageComponent['params']\t\t= isset($array_path[2]) ? array_slice($array_path,3) : null;\n\t\t\t\t}\n\t\t\t\t//jika tidak mode lokal\n\t\t\t\telse{\n\t\t\t\t\t$pageComponent['modul'] \t\t= \"\";\n\t\t\t\t\t$pageComponent['class'] \t\t= $array_path[0];\n\t\t\t\t\t$pageComponent['func'] \t\t\t= isset($array_path[1]) ? $array_path[1] : $this->conf->startUp[\"APPS.FUNC\"];\n\t\t\t\t\t$pageComponent['params'] \t\t= isset($array_path[1]) ? array_slice($array_path,2) : null;\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\t$pageComponent = (object) $pageComponent;\n\n\n\t\t\tif(isset($net_url['query'])){\n\n\t\t\t\tparse_str($net_url['query'],$array_query_string);\n\t\t\t\treq::setQueryGET($array_query_string);\t\n\t\t\t\t//var_dump($array_query_string);\n\t\t\t}else{\n\t\t\t\t$array_query_string = [];\n\t\t\t\t//var_dump($array_query_string);\n\t\t\t}\n\n\t\t\tif($pageComponent->class==\"\"){$pageComponent->class = self::$confStatic->startUp[\"APPS.BASEPAGE\"];}\n\t\t\treq::setParamsFunc((array)$pageComponent->params);\n\t\t\tself::setupPage(self::$rutes,$pageComponent);\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"whoopppsss something went wrong\";\n\t\t\t//error whoopsss plugin\n\t\t}\n\t}", "function get_master_id(){\r\n\t\t$result=$this->m_master_jual_rawat->get_master_id();\r\n\t\techo $result;\r\n\t}", "private static function getUrlBase() {\n\t\tif(!isset(self::$usrBbase)) {\n\t\t\tself::$urlBase =\n\t\t\t\tself::getScheme()\n\t\t\t\t. '://'\n\t\t\t\t. self::getHost()\n\t\t\t\t. ((self::getPort() == 80 || self::getPort() == 443)\n\t\t\t\t\t? ''\n\t\t\t\t\t: ':'.self::getPort())\n\t\t\t\t. self::getBasePath();\n\t\t}\n\t\treturn self::$urlBase;\n\t}", "public function getinfo() { \n return $this->bitcoin->getinfo();\n }", "public function get_info()\n {\n return $this->_request('getinfo');\n }", "public function getImageBaseURL()\r\n {\r\n return $this->base_url;\r\n }", "function base_url($url = NULL){\n\t\tif ($url != NULL)\n\t\t{\n\t\t\t$baseurl = 'http://localhost/pkl/'.$url;\n\t\t}\n\t\telse\t\n\t\t{\n\t\t\t$baseurl = 'http://localhost/pkl/';\n\t\t}\n\t\t\n\t\treturn $baseurl;\n\t}", "protected function getAuthBase() {\n $region = $this->client->getClassConfig($this, 'region');\n if ($region == BattleNet_Config::REGION_CN) {\n return self::BATTLENET_URL_BASE_CHINA;\n }\n return str_replace('{region}', $region, self::BATTLENET_URL_BASE);\n }", "public function getBaseUri()\n {\n //return self::BASE_INT_URI\n return self::BASE_URI;\n }", "protected static function baseurl($path=NULL)\n {\n\t\t$res=self::base_url($path);\n\t\treturn $res;\n }", "public static function base()\n {\n\n static $base = false;\n\n if ($base === false) {\n\n $base = Config::get('monstra.base_url');\n\n // Try to autodetect base url if its not configured\n if ($base === '' && isset($_SERVER['HTTP_HOST'])) {\n\n $protocol = Request::isSecure() ? 'https' : 'http';\n\n $script = $_SERVER['SCRIPT_NAME'];\n\n $base = rtrim($protocol . '://' . $_SERVER['HTTP_HOST'] . str_replace(basename($script), '', $script), '/');\n }\n\n // Add index.php?\n !Config::get('monstra.clean_urls') && $base .= '/index.php';\n }\n\n return $base;\n }", "public static function getBaseURL(){\n return self::$baseURL;\n }", "abstract public function getUserInfo();", "function base_url($uri=null){\n\t$base_url = 'http://localhost/KoperasiSimpanPinjam/';\n\tif($uri == null){\n\t\treturn $base_url;\n\t}else{\n\t\treturn $base_url.$uri;\n\t}\n}", "abstract public function get() ;", "public function\tgetReferidoInfo(){\r\t\t\r\t\t$model_ref = $this->getModel( 'referido' );\r\t\t$idref = JRequest::getInt( 'idref' );\r\t\t\r\t\t$model_ref->instance( $idref );\r\t\t$inf_ref = $model_ref->getReferidoInf();\r\t\t\r\t\tif( !empty($inf_ref) ){\r\t\t\t\r\t\t\t$model_ref\r\t\t}\r\t\t\r\t}", "public function baseUrl()\n\t{\n\t\techo $_SERVER['SERVER_NAME'];\n\t}", "public function getBaseUrl() : string\n {\n return $this->base;\n }", "public function itemFullInfo(){\n // $img = $this->itemImg;\n\n // if ($img) {\n // $this->img_path = $this->itemImg->img_path;\n \n // }else{\n // $this->img_path = \"/images/default_bg.jpg\"; \n // }\n\n // if (file_exists('.'.$this->img_path)) {\n \n // }else{\n // $this->img_path = \"/images/default_bg.jpg\";\n // }\n\n if (file_exists('./images/products/thumb/'.$this->item.'.jpg')) {\n\n $this->img_path = \"/images/products/thumb/\".$this->item.\".jpg\";\n }else{\n $this->img_path = \"/images/default_bg.jpg\";\n }\n \n if (file_exists('./images/products/large/'.$this->item.'.jpg')) {\n\n $this->big = \"/images/products/large/\".$this->item.\".jpg\";\n }else{\n $this->big = \"/images/default_bg.jpg\";\n }\n return $this;\n }", "protected function getInfoModule() {}", "function get_base_url()\n{\n $url = explode('/',$_SERVER['REQUEST_URI']);\n $segmentOne = isset($url[0]) ? $url[0] : '';\n $segmentTwo = isset($url[1]) ? $url[1] : '';\n $url = 'http://localhost/' . ($segmentOne ? $segmentOne . '/' : '') . ($segmentTwo ? $segmentTwo : '') . '/';\n return $url;\n}", "public function getBase() {\n\t\t\t\n\t\t\treturn $this->tag;\n\t\t\t\n\t\t}" ]
[ "0.6622459", "0.6515291", "0.6515291", "0.6515291", "0.6515291", "0.6515291", "0.650271", "0.6496372", "0.6479303", "0.6479303", "0.64761674", "0.64761674", "0.64761674", "0.6469816", "0.6469816", "0.6469816", "0.6412655", "0.64036596", "0.6349667", "0.6258757", "0.62438065", "0.6172606", "0.6116918", "0.60992044", "0.6053491", "0.6006724", "0.5969007", "0.59548444", "0.5941661", "0.5891757", "0.58883494", "0.5884805", "0.5884805", "0.58476716", "0.5833861", "0.5792307", "0.5791372", "0.5780746", "0.57766753", "0.57561314", "0.57269675", "0.5724802", "0.5699851", "0.5682128", "0.5679143", "0.56757873", "0.5635648", "0.5618454", "0.56158435", "0.5599082", "0.558058", "0.55582345", "0.5555705", "0.55403966", "0.55277866", "0.5512515", "0.55032265", "0.55032265", "0.54932016", "0.54820275", "0.54654205", "0.5456281", "0.5444854", "0.5442019", "0.54419875", "0.54340607", "0.54340494", "0.54340494", "0.54340494", "0.54340494", "0.54340494", "0.54340494", "0.5418064", "0.5416842", "0.5409761", "0.5402866", "0.5398698", "0.53937817", "0.53937817", "0.53893703", "0.5388562", "0.5387912", "0.5387753", "0.5368766", "0.53653884", "0.53633803", "0.5363227", "0.5359823", "0.535518", "0.535108", "0.5349788", "0.5347793", "0.53435946", "0.53380173", "0.5327708", "0.53234226", "0.53224295", "0.5306514", "0.5305552", "0.53046334", "0.5301322" ]
0.0
-1
Provide valid properties which must result in a PropertyProcessor
public function validPropertyProvider(): array { return [ 'array' => ['array', ArrayProcessor::class], 'boolean' => ['boolean', BooleanProcessor::class], 'integer' => ['integer', IntegerProcessor::class], 'null' => ['null', NullProcessor::class], 'number' => ['number', NumberProcessor::class], 'object' => ['object', ObjectProcessor::class], 'string' => ['string', StringProcessor::class] ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function allowProperties() {}", "abstract protected function properties();", "function shouldSkipUnknownProperties() ;", "public function shouldSkipUnknownProperties() {}", "private function parseProperties(): void\n {\n $properties = $this->extractProperties();\n\n foreach ($properties as $property)\n {\n if ($property['docblock']===null)\n {\n $docId = null;\n }\n else\n {\n $docId = PhpAutoDoc::$dl->padDocblockInsertDocblock($property['docblock']['doc_line_start'],\n $property['docblock']['doc_line_end'],\n $property['docblock']['doc_docblock']);\n }\n\n PhpAutoDoc::$dl->padClassInsertProperty($this->clsId,\n $docId,\n $property['name'],\n Cast::toManInt($property['is_static']),\n $property['visibility'],\n $property['value'],\n $property['start'],\n $property['end']);\n }\n }", "public function allowAllProperties() {}", "abstract protected function get_properties();", "public function sanitizeProperties( $props )\n\t{\n\t\treturn $props;\n\t}", "public function checkProperties($conditions);", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if (!is_null($this->container['postProcessState']) && !preg_match(\"/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/\", $this->container['postProcessState'])) {\n $invalidProperties[] = \"invalid value for 'postProcessState', must be conform to the pattern /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.\";\n }\n\n if (!is_null($this->container['state']) && !preg_match(\"/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/\", $this->container['state'])) {\n $invalidProperties[] = \"invalid value for 'state', must be conform to the pattern /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.\";\n }\n\n if (!is_null($this->container['substate']) && !preg_match(\"/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/\", $this->container['substate'])) {\n $invalidProperties[] = \"invalid value for 'substate', must be conform to the pattern /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.\";\n }\n\n if (!is_null($this->container['type']) && !preg_match(\"/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/\", $this->container['type'])) {\n $invalidProperties[] = \"invalid value for 'type', must be conform to the pattern /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.\";\n }\n\n return $invalidProperties;\n }", "abstract protected function getProperties();", "public function testUnfilteredProperties()\n {\n $this->visit('/properties')\n ->see('Victorian townhouse')\n ->see('Five bedroom mill conversion')\n ->see('Shack in the desert');\n }", "private function mapProperties(): void\n {\n $this->properties = Collect::keyBy($this->collection->getProperties()->getValues(), 'identifier');\n }", "protected function mapProperties() : void {\n\t\t$this->propertyActions['translate'] = array();\n\t\t$properties = $this->reflectionClass->getProperties();\n\t\tforeach ($properties as $property) {\n\t\t\t$annotation = $this->annotationReader->getPropertyAnnotation($property, 'Henri\\Framework\\Annotations\\Annotation\\DBRecord');\n\t\t\tif (isset($property->name) && $annotation && isset($annotation->name)) {\n\t\t\t\t$this->propertyMap[$property->name] = $annotation->name;\n\n\t\t\t\t$propertyProps = new \\stdClass();\n\t\t\t\t$propertyProps->name = $annotation->name;\n\t\t\t\t$propertyProps->type = isset($annotation->type) && !empty($annotation->type) ? $annotation->type : 'text';\n\t\t\t\t$propertyProps->length = $annotation->length;\n\t\t\t\t$propertyProps->primary = $annotation->primary;\n\t\t\t\t$propertyProps->translate = $annotation->translate;\n\t\t\t\t$propertyProps->empty = $annotation->empty;\n\t\t\t\t$propertyProps->unique = $annotation->unique ?? false;\n\t\t\t\t$this->propertyProps[$property->name] = $propertyProps;\n\t\t\t}\n\n\t\t\tif (isset($property->name) && $annotation && isset($annotation->translate) && !empty($annotation->translate)) {\n\t\t\t\t// Set translate actions\n\t\t\t\t$this->propertyActions['translate'][$property->name] = $annotation->translate;\n\t\t\t}\n\n\t\t\t// Check for primary key\n\t\t\tif (isset($property->name) && $annotation && isset($annotation->primary)) {\n\t\t\t\tif ($annotation->primary && isset($this->primaryKey)) {\n\t\t\t\t\tthrow new Exception('Multiple primary keys found', 500);\n\t\t\t\t}\n\n\t\t\t\tif ($annotation->primary) {\n\t\t\t\t\t$this->primaryKey = $property->name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function initProps()\n {\n foreach ($this->cmds as $key => $parseValues) {\n $this->props[$key] = false;\n }\n\n foreach ($this->flags as $key => $parseValues) {\n $this->props[$key] = false;\n }\n }", "protected function getPropertiesValidators()\n {\n return [];\n }", "abstract public function field_props();", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getTransformAllowableValues();\n if (!in_array($this->container['transform'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'transform', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getWrapTextAllowableValues();\n if (!in_array($this->container['wrapText'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'wrapText', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getAnchoringTypeAllowableValues();\n if (!in_array($this->container['anchoringType'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'anchoringType', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getCenterTextAllowableValues();\n if (!in_array($this->container['centerText'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'centerText', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getTextVerticalTypeAllowableValues();\n if (!in_array($this->container['textVerticalType'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'textVerticalType', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getAutofitTypeAllowableValues();\n if (!in_array($this->container['autofitType'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'autofitType', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "protected function checkProperty(/**\n * File upload validation.\n *\n * If a $_FILES array is found in the request data,\n * iterate over all requested files and validate each\n * single file.\n */\n$value, /**\n * File upload validation.\n *\n * If a $_FILES array is found in the request data,\n * iterate over all requested files and validate each\n * single file.\n */\n$validators, /**\n * File upload validation.\n *\n * If a $_FILES array is found in the request data,\n * iterate over all requested files and validate each\n * single file.\n */\n$propertyName) {}", "public function skipUnknownProperties() {}", "abstract public function getProperties();", "abstract protected function propertyExists($name);", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n if ($this->container['use_async_pattern'] === null) {\n $invalid_properties[] = \"'use_async_pattern' can't be null\";\n }\n if ($this->container['source_file_name'] === null) {\n $invalid_properties[] = \"'source_file_name' can't be null\";\n }\n if ($this->container['source_file_content'] === null) {\n $invalid_properties[] = \"'source_file_content' can't be null\";\n }\n if ($this->container['copy_metadata'] === null) {\n $invalid_properties[] = \"'copy_metadata' can't be null\";\n }\n $allowed_values = [\"English\", \"Arabic\", \"Danish\", \"German\", \"Dutch\", \"Finnish\", \"French\", \"Hebrew\", \"Hungarian\", \"Italian\", \"Norwegian\", \"Portuguese\", \"Spanish\", \"Swedish\", \"Russian\"];\n if (!in_array($this->container['language'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'language', must be one of 'English', 'Arabic', 'Danish', 'German', 'Dutch', 'Finnish', 'French', 'Hebrew', 'Hungarian', 'Italian', 'Norwegian', 'Portuguese', 'Spanish', 'Swedish', 'Russian'.\";\n }\n\n $allowed_values = [\"Slow but accurate\", \"Faster and less accurate\", \"Fastest and least accurate\"];\n if (!in_array($this->container['performance'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'performance', must be one of 'Slow but accurate', 'Faster and less accurate', 'Fastest and least accurate'.\";\n }\n\n $allowed_values = [\"None\", \"Whitelist\", \"Blacklist\"];\n if (!in_array($this->container['characters_option'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'characters_option', must be one of 'None', 'Whitelist', 'Blacklist'.\";\n }\n\n return $invalid_properties;\n }", "protected function get_properties()\n\t{\n\t\t$schema = $this->module->model->extended_schema;\n\t\t$fields = $schema['fields'];\n\t\t$request = $this->request;\n\t\t$properties = array_intersect_key($request->params, $fields);\n\n\t\tforeach ($fields as $identifier => $definition)\n\t\t{\n\t\t\t$type = $definition['type'];\n\n\t\t\tif ($type == 'boolean')\n\t\t\t{\n\t\t\t\tif (!empty($definition['null']) && ($request[$identifier] === null || $request[$identifier] === ''))\n\t\t\t\t{\n\t\t\t\t\t$properties[$identifier] = null;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (empty($properties[$identifier]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$properties[$identifier] = false;\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$properties[$identifier] = filter_var($properties[$identifier], FILTER_VALIDATE_BOOLEAN);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($type == 'varchar')\n\t\t\t{\n\t\t\t\tif (empty($properties[$identifier]) || !is_string($properties[$identifier]))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$properties[$identifier] = trim($properties[$identifier]);\n\t\t\t}\n\t\t}\n\n\t\treturn $properties;\n\t}", "protected function clean_properties(){\n\t\tglobal $database;\n\t\t$clean_properties = array();\n\t\tforeach($this->properties() as $key => $value){\n\t\t\t$clean_properties[$key]=$database->escape_string($value);\t\n\t\t}\n\t\treturn $clean_properties;\t\n\t}", "public function skipProperties() {}", "abstract public function property($propertyIdent);", "public function allowAllPropertiesExcept() {}", "function processProperties($source){\n\t\tglobal $FEEDS_DIR, $reader, $con, $con2;\n\t\t$propertyDir = new DirectoryIterator($source);\n\t\tforeach ($propertyDir as $fileinfo) {\n\t\t if (!$fileinfo->isDot()) {\n\t\t \t$thisfile = $source.$fileinfo->getFilename();\n\t\t \tif(pathinfo($thisfile, PATHINFO_EXTENSION) == 'BLM' || pathinfo($thisfile, PATHINFO_EXTENSION) == 'blm')\n\t\t \t{\n\t\t \t\t$reader->batch($thisfile, $con, $con2);\n\t\t \t}\n\t\t }\n\t\t}\n\t}", "private function validateEntityTypePropertyAndPropValue() {\n $validateServ = new validate();\n\n #Because of how extension properties appear in the schema (as a seperate entity), we need to change the entity name\n if ($this->entityProperty == 'extensionproperties') {\n $objectType = $this->entityType . 'property';\n } else {\n $objectType = $this->entityType;\n }\n\n #Now we itterate through all the possible cases.\n #The first is that a entity key has been provided, currently only extension properties support this\n #The second is that there is no key, and a single value has been provided\n #The third is that a series of key/value pairs have been provided\n #The fourth is a delete where no array or value has been specified, this is only currently supported for extension properties\n #The final statement deals with the case where a key has been specified as well as multiple values or where both a single value and an array are set. Neither should happen.\n if (!is_null($this->entityPropertyKey) && !is_null($this->entityPropertyValue) && is_null($this->entityPropertyKVArray)) {\n #only currently supported for extension properties\n if ($this->entityProperty == 'extensionproperties') {\n $this->validateWithService($objectType,'name',$this->entityPropertyKey,$validateServ);\n $this->validateWithService($objectType,'value',$this->entityPropertyValue,$validateServ);\n } else {\n $this->exceptionWithResponseCode(400,\n \"The API currently only supports specifying a key in the url for extension properties. For help see: $this->docsURL\"\n );\n }\n } elseif (is_null($this->entityPropertyKey) && !is_null($this->entityPropertyValue) && is_null($this->entityPropertyKVArray)) {\n $this->validateWithService($objectType,$this->entityProperty,$this->entityPropertyValue,$validateServ);\n } elseif (is_null($this->entityPropertyKey) && is_null($this->entityPropertyValue) && !is_null($this->entityPropertyKVArray)) {\n #only currently supported for extension properties\n if ($this->entityProperty == 'extensionproperties') {\n foreach ($this->entityPropertyKVArray as $key => $value) {\n $this->validateWithService($objectType,'name',$key,$validateServ);\n #Values can be null in the case of DELETEs\n if (!(empty($value) && $this->requestMethod == 'DELETE')) {\n $this->validateWithService($objectType,'value',$value,$validateServ);\n }\n }\n unset($value);\n } else {\n $this->exceptionWithResponseCode(400,\n \"The API currently only supports specifying an array of values for extension properties. For help see: $this->docsURL\"\n );\n }\n } elseif (is_null($this->entityPropertyValue) && is_null($this->entityPropertyKVArray)) {\n #Only delete methods support not providing values of any kind\n if ($this->requestMethod == 'DELETE') {\n #only currently supported for extension properties\n if ($this->entityProperty != 'extensionproperties') {\n $this->exceptionWithResponseCode(400,\n \"The API currently only supports deleting without specifying values for extension properties. For help see: $this->docsURL\"\n );\n }\n } else {\n $this->exceptionWithResponseCode(400,\n \"For methods other than 'DELETE' a value or set of values must be provided. For help see: $this->docsURL\"\n );\n }\n\n } else {\n $this->exceptionWithResponseCode(500,\n \"The validation process has failed due to an error in the internal logic. Please contact the administrator.\"\n );\n }\n }", "private function init_properties( array $properties ) {\n\t\t// recursively filter null values\n\t\t$this->properties = Arrays::filter_recursive( $properties );\n\t\t// collect all attributes properties for this element\n\t\t$this->collect_attributes();\n\t}", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if (!is_null($this->container['currencyId']) && (mb_strlen($this->container['currencyId']) > 3)) {\n $invalidProperties[] = \"invalid value for 'currencyId', the character length must be smaller than or equal to 3.\";\n }\n\n if (!is_null($this->container['discountPercentage']) && ($this->container['discountPercentage'] > 1)) {\n $invalidProperties[] = \"invalid value for 'discountPercentage', must be smaller than or equal to 1.\";\n }\n\n if (!is_null($this->container['discountPercentage']) && ($this->container['discountPercentage'] < 0)) {\n $invalidProperties[] = \"invalid value for 'discountPercentage', must be bigger than or equal to 0.\";\n }\n\n if (!is_null($this->container['minOrderQuantity']) && ($this->container['minOrderQuantity'] < 0)) {\n $invalidProperties[] = \"invalid value for 'minOrderQuantity', must be bigger than or equal to 0.\";\n }\n\n if (!is_null($this->container['partNumber']) && (mb_strlen($this->container['partNumber']) > 30)) {\n $invalidProperties[] = \"invalid value for 'partNumber', the character length must be smaller than or equal to 30.\";\n }\n\n if (!is_null($this->container['price']) && ($this->container['price'] < 0)) {\n $invalidProperties[] = \"invalid value for 'price', must be bigger than or equal to 0.\";\n }\n\n if ($this->container['productSupplierId'] === null) {\n $invalidProperties[] = \"'productSupplierId' can't be null\";\n }\n if ((mb_strlen($this->container['productSupplierId']) > 8)) {\n $invalidProperties[] = \"invalid value for 'productSupplierId', the character length must be smaller than or equal to 8.\";\n }\n\n if (!is_null($this->container['purchaseSurchargePercentage']) && ($this->container['purchaseSurchargePercentage'] > 1)) {\n $invalidProperties[] = \"invalid value for 'purchaseSurchargePercentage', must be smaller than or equal to 1.\";\n }\n\n if (!is_null($this->container['purchaseSurchargePercentage']) && ($this->container['purchaseSurchargePercentage'] < 0)) {\n $invalidProperties[] = \"invalid value for 'purchaseSurchargePercentage', must be bigger than or equal to 0.\";\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n if ($this->container['jobId'] === null) {\r\n $invalidProperties[] = \"'jobId' can't be null\";\r\n }\r\n $allowedValues = $this->getXLanguageAllowableValues();\r\n if (!is_null($this->container['xLanguage']) && !in_array($this->container['xLanguage'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'xLanguage', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n if ($this->container['type'] === null) {\r\n $invalidProperties[] = \"'type' can't be null\";\r\n }\r\n $allowedValues = $this->getTypeAllowableValues();\r\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'type', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n $allowedValues = $this->getCompareTypeAllowableValues();\r\n if (!is_null($this->container['compareType']) && !in_array($this->container['compareType'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'compareType', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n $allowedValues = $this->getQueryTypeAllowableValues();\r\n if (!is_null($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'queryType', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n $allowedValues = $this->getObjectTypeAllowableValues();\r\n if (!is_null($this->container['objectType']) && !in_array($this->container['objectType'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'objectType', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n $allowedValues = $this->getCompareDetailTypeAllowableValues();\r\n if (!is_null($this->container['compareDetailType']) && !in_array($this->container['compareDetailType'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'compareDetailType', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n return $invalidProperties;\r\n }", "public function __construct(array $properties) {\n parent::__construct($properties);\n foreach ($properties as $property => $value) {\n switch ($property) {\n // Strings.\n case 'description_of_accident':\n case 'vin_number':\n case 'driver_first_name':\n case 'driver_last_name':\n case 'driver_dl_number':\n case 'describe_damage':\n case 'other_vin_number':\n case 'other_driver_first_name':\n case 'other_driver_last_name':\n case 'other_driver_dl_number':\n case 'other_describe_damage':\n case 'estimate_amount':\n case 'where_vehicle_can_be_seen':\n case 'when_vehicle_can_be_seen':\n $this->$property = $value;\n break;\n\n // Booleans.\n case 'child_seat':\n case 'child_seat_installed':\n case 'child_seat_sustain':\n $this->$property = (bool) $value;\n break;\n }\n }\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n// $allowedValues = $this->getTransactionUuidAllowableValues();\n// if (!is_null($this->container['transaction_uuid']) && !in_array($this->container['transaction_uuid'], $allowedValues, true)) {\n// $invalidProperties[] = sprintf(\n// \"invalid value for 'transaction_uuid', must be one of '%s'\",\n// implode(\"', '\", $allowedValues)\n// );\n// }\n//\n// $allowedValues = $this->getCurrencyAllowableValues();\n// if (!is_null($this->container['currency']) && !in_array($this->container['currency'], $allowedValues, true)) {\n// $invalidProperties[] = sprintf(\n// \"invalid value for 'currency', must be one of '%s'\",\n// implode(\"', '\", $allowedValues)\n// );\n// }\n//\n// $allowedValues = $this->getStatusDenomAllowableValues();\n// if (!is_null($this->container['status_denom']) && !in_array($this->container['status_denom'], $allowedValues, true)) {\n// $invalidProperties[] = sprintf(\n// \"invalid value for 'status_denom', must be one of '%s'\",\n// implode(\"', '\", $allowedValues)\n// );\n// }\n//\n// $allowedValues = $this->getDescriptionAllowableValues();\n// if (!is_null($this->container['description']) && !in_array($this->container['description'], $allowedValues, true)) {\n// $invalidProperties[] = sprintf(\n// \"invalid value for 'description', must be one of '%s'\",\n// implode(\"', '\", $allowedValues)\n// );\n// }\n//\n// $allowedValues = $this->getMerchantOpIdAllowableValues();\n// if (!is_null($this->container['merchant_op_id']) && !in_array($this->container['merchant_op_id'], $allowedValues, true)) {\n// $invalidProperties[] = sprintf(\n// \"invalid value for 'merchant_op_id', must be one of '%s'\",\n// implode(\"', '\", $allowedValues)\n// );\n// }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n if ($this->container['archived'] === null) {\n $invalidProperties[] = \"'archived' can't be null\";\n }\n if ($this->container['has_private_key'] === null) {\n $invalidProperties[] = \"'has_private_key' can't be null\";\n }\n if ($this->container['not_after'] === null) {\n $invalidProperties[] = \"'not_after' can't be null\";\n }\n if ($this->container['not_before'] === null) {\n $invalidProperties[] = \"'not_before' can't be null\";\n }\n if (!is_null($this->container['raw_data']) && !preg_match(\"/^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/\", $this->container['raw_data'])) {\n $invalidProperties[] = \"invalid value for 'raw_data', must be conform to the pattern /^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=)?$/.\";\n }\n\n if ($this->container['version'] === null) {\n $invalidProperties[] = \"'version' can't be null\";\n }\n return $invalidProperties;\n }", "public function clean_properties(){\n global $database;\n $clean_properties = array();\n foreach ($this->properties() as $key =>$value){\n $clean_properties[$key] =$database->escape_string($value);\n }\n \n return $clean_properties ; \n }", "protected function _verifyProps(\n array $properties, \n $addId = false,\n $entityClassName = null,\n $assocStep = false\n )\n {\n if($entityClassName == null){\n $entityClassName = $this->_entityClassName;\n $metaData = $this->_metaData;\n } else {\n $metaData = $this->_em->getClassMetadata($entityClassName);\n }\n \n // Add defualt Ids props to the list\n if($addId){\n $ids = $metaData->getIdentifier();\n foreach($ids as $idField){\n if(array_search($idField, $properties) === false){\n array_unshift($properties, $idField);\n }\n }\n }\n \n $filtered = array();\n \n foreach ($properties as $key => $value){\n\n if(is_int($key)){\n if(is_string($value)){\n if($metaData->hasField($value)){\n $filtered[] = $value;\n } elseif($metaData->hasAssociation($value)) {\n if($assocStep){\n throw new Exception(array(\n 'prop' => '@assocPropNotAllowed', \n 'extend' => 'sub property: ' . $value));\n } \n $entityClassNameAssoc = \n $metaData->getAssociationTargetClass($value);\n $metaDataAssoc = $this->_em\n ->getClassMetadata($entityClassNameAssoc);\n $filtered[$value] = $metaDataAssoc->getColumnNames(); \n } else {\n throw new Exception(array(\n 'prop' => '@propertyNotExist', \n 'extend' => 'Verify the name: ' . $value)); \n }\n } else {\n throw new Exception(array(\n 'prop' => '@dataNoValid', \n 'extend' => 'Bad formed the properties')); \n }\n } else {\n if($metaData->hasAssociation($key)){\n if($assocStep){\n throw new Exception(array(\n 'prop' => '@assocPropNotAllowed', \n 'extend' => 'sub property: ' . $key));\n }\n if(is_array($value)){\n $entityClassNameAssoc = \n $metaData->getAssociationTargetClass($key);\n if(!empty($value)){\n $assocProps = $this->_verifyProps($value, $addId, \n $entityClassNameAssoc, true);\n if(!empty($assocProps)){\n $filtered[$key] = $assocProps;\n }\n } else {\n $metaDataAssoc = $this->_em\n ->getClassMetadata($entityClassNameAssoc);\n $filtered[$key] = $metaDataAssoc->getColumnNames();\n }\n } else {\n throw new Exception(array(\n 'prop' => '@dataNoValid', \n 'extend' => 'Bad formed the properties')); \n } \n } else {\n throw new Exception(array(\n 'prop' => '@propertyNotExist', \n 'extend' => 'Verify the name: ' . $key)); \n }\n }\n }\n \n return $filtered;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n if ($this->container['priority'] === null) {\n $invalidProperties[] = \"'priority' can't be null\";\n }\n if ($this->container['type'] === null) {\n $invalidProperties[] = \"'type' can't be null\";\n }\n if ($this->container['stop_if_true'] === null) {\n $invalidProperties[] = \"'stop_if_true' can't be null\";\n }\n if ($this->container['above_average'] === null) {\n $invalidProperties[] = \"'above_average' can't be null\";\n }\n if ($this->container['color_scale'] === null) {\n $invalidProperties[] = \"'color_scale' can't be null\";\n }\n if ($this->container['data_bar'] === null) {\n $invalidProperties[] = \"'data_bar' can't be null\";\n }\n if ($this->container['formula1'] === null) {\n $invalidProperties[] = \"'formula1' can't be null\";\n }\n if ($this->container['formula2'] === null) {\n $invalidProperties[] = \"'formula2' can't be null\";\n }\n if ($this->container['icon_set'] === null) {\n $invalidProperties[] = \"'icon_set' can't be null\";\n }\n if ($this->container['operator'] === null) {\n $invalidProperties[] = \"'operator' can't be null\";\n }\n if ($this->container['style'] === null) {\n $invalidProperties[] = \"'style' can't be null\";\n }\n if ($this->container['text'] === null) {\n $invalidProperties[] = \"'text' can't be null\";\n }\n if ($this->container['time_period'] === null) {\n $invalidProperties[] = \"'time_period' can't be null\";\n }\n if ($this->container['top10'] === null) {\n $invalidProperties[] = \"'top10' can't be null\";\n }\n if ($this->container['link'] === null) {\n $invalidProperties[] = \"'link' can't be null\";\n }\n return $invalidProperties;\n }", "private function getProperties(){\n\n\n\t\t$props = get_post_meta(\n\t\t\t$this->post_id,\n\t\t\t'_column_props_'.$this->fullId,\n\t\t\ttrue\n\t\t);\n\n\n\n\t\t$defaults = $this->getDefaultColumnArgs();\n\t\t$props = wp_parse_args( $props, $defaults );\n\n\t\t$this->properties = $props;\n\n\t}", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n $allowedValues = $this->getRelativeHorizontalPositionAllowableValues();\n if (!in_array($this->container['relative_horizontal_position'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'relative_horizontal_position', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getRelativeVerticalPositionAllowableValues();\n if (!in_array($this->container['relative_vertical_position'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'relative_vertical_position', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getWrapTypeAllowableValues();\n if (!in_array($this->container['wrap_type'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'wrap_type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['amount'] === null) {\n $invalidProperties[] = \"'amount' can't be null\";\n }\n if ($this->container['category'] === null) {\n $invalidProperties[] = \"'category' can't be null\";\n }\n $allowedValues = $this->getCategoryAllowableValues();\n if (!is_null($this->container['category']) && !in_array($this->container['category'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'category', must be one of '%s'\",\n $this->container['category'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getDirectionAllowableValues();\n if (!is_null($this->container['direction']) && !in_array($this->container['direction'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'direction', must be one of '%s'\",\n $this->container['direction'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getPanEntryModeAllowableValues();\n if (!is_null($this->container['panEntryMode']) && !in_array($this->container['panEntryMode'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'panEntryMode', must be one of '%s'\",\n $this->container['panEntryMode'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getPlatformPaymentTypeAllowableValues();\n if (!is_null($this->container['platformPaymentType']) && !in_array($this->container['platformPaymentType'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'platformPaymentType', must be one of '%s'\",\n $this->container['platformPaymentType'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getPriorityAllowableValues();\n if (!is_null($this->container['priority']) && !in_array($this->container['priority'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'priority', must be one of '%s'\",\n $this->container['priority'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getProcessingTypeAllowableValues();\n if (!is_null($this->container['processingType']) && !in_array($this->container['processingType'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'processingType', must be one of '%s'\",\n $this->container['processingType'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getReasonAllowableValues();\n if (!is_null($this->container['reason']) && !in_array($this->container['reason'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'reason', must be one of '%s'\",\n $this->container['reason'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n if ($this->container['status'] === null) {\n $invalidProperties[] = \"'status' can't be null\";\n }\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'status', must be one of '%s'\",\n $this->container['status'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'type', must be one of '%s'\",\n $this->container['type'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "function getProperties($properties);", "public function testValid(): void\n {\n $validator = new PropertyValidator('foo');\n $result = $validator->validate((object)[\n 'foo' => 'bar',\n ]);\n\n $this->assertTrue($result->isValid());\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['min_char_length'] === null) {\n $invalidProperties[] = \"'min_char_length' can't be null\";\n }\n if ($this->container['max_char_length'] === null) {\n $invalidProperties[] = \"'max_char_length' can't be null\";\n }\n if ($this->container['min_item_count'] === null) {\n $invalidProperties[] = \"'min_item_count' can't be null\";\n }\n if ($this->container['max_item_count'] === null) {\n $invalidProperties[] = \"'max_item_count' can't be null\";\n }\n if ($this->container['min_value'] === null) {\n $invalidProperties[] = \"'min_value' can't be null\";\n }\n if ($this->container['max_value'] === null) {\n $invalidProperties[] = \"'max_value' can't be null\";\n }\n if ($this->container['min_date'] === null) {\n $invalidProperties[] = \"'min_date' can't be null\";\n }\n if ($this->container['max_date'] === null) {\n $invalidProperties[] = \"'max_date' can't be null\";\n }\n if ($this->container['aspect_ratio'] === null) {\n $invalidProperties[] = \"'aspect_ratio' can't be null\";\n }\n if ($this->container['min_width'] === null) {\n $invalidProperties[] = \"'min_width' can't be null\";\n }\n if ($this->container['min_height'] === null) {\n $invalidProperties[] = \"'min_height' can't be null\";\n }\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getRadioCheckTypeAllowableValues();\n if (!is_null($this->container['radioCheckType']) && !in_array($this->container['radioCheckType'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'radioCheckType', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getOriginAllowableValues();\n if (!is_null($this->container['origin']) && !in_array($this->container['origin'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'origin', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getInputTypeAllowableValues();\n if (!is_null($this->container['inputType']) && !in_array($this->container['inputType'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'inputType', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getBorderStyleAllowableValues();\n if (!is_null($this->container['borderStyle']) && !in_array($this->container['borderStyle'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'borderStyle', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getContentTypeAllowableValues();\n if (!is_null($this->container['contentType']) && !in_array($this->container['contentType'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'contentType', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getValidationAllowableValues();\n if (!is_null($this->container['validation']) && !in_array($this->container['validation'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'validation', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getDisplayFormatTypeAllowableValues();\n if (!is_null($this->container['displayFormatType']) && !in_array($this->container['displayFormatType'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'displayFormatType', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getAlignmentAllowableValues();\n if (!is_null($this->container['alignment']) && !in_array($this->container['alignment'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'alignment', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n $allowedValues = $this->getImageTypeAllowableValues();\r\n if (!is_null($this->container['imageType']) && !in_array($this->container['imageType'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'imageType', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n $allowedValues = $this->getResourceTypeAllowableValues();\r\n if (!is_null($this->container['resourceType']) && !in_array($this->container['resourceType'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'resourceType', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n $allowedValues = $this->getStatusAllowableValues();\r\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'status', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n $allowedValues = $this->getOwnTypeAllowableValues();\r\n if (!is_null($this->container['ownType']) && !in_array($this->container['ownType'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'ownType', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n $allowedValues = $this->getMemberStatusAllowableValues();\r\n if (!is_null($this->container['memberStatus']) && !in_array($this->container['memberStatus'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'memberStatus', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n return $invalidProperties;\r\n }", "protected function clean_properties(){\n global $database;\n\n $clean_properties = array();\n\n foreach ($this->properties() as $key => $value) {\n\n // the value is being escaped in cases of sql injections and etc.it is also being paired with the key \n $clean_properties[$key] = $database->escape_string($value);\n }\n\n return $clean_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = array();\n if ($this->container['name'] === null) {\n $invalid_properties[] = \"'name' can't be null\";\n }\n if ($this->container['type'] === null) {\n $invalid_properties[] = \"'type' can't be null\";\n }\n $allowed_values = array(\"text\", \"range\", \"category\");\n if (!in_array($this->container['type'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'type', must be one of #{allowed_values}.\";\n }\n\n if ($this->container['sort_type'] === null) {\n $invalid_properties[] = \"'sort_type' can't be null\";\n }\n $allowed_values = array(\"alphabetical\", \"count\", \"value\", \"size\");\n if (!in_array($this->container['sort_type'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'sort_type', must be one of #{allowed_values}.\";\n }\n\n if ($this->container['values'] === null) {\n $invalid_properties[] = \"'values' can't be null\";\n }\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if (!is_null($this->container['virtual_operator']) && (strlen($this->container['virtual_operator']) > 60)) {\n $invalidProperties[] = \"invalid value for 'virtual_operator', the character length must be smaller than or equal to 60.\";\n }\n\n if (!is_null($this->container['event_type']) && (strlen($this->container['event_type']) > 100)) {\n $invalidProperties[] = \"invalid value for 'event_type', the character length must be smaller than or equal to 100.\";\n }\n\n if (!is_null($this->container['result_status']) && (strlen($this->container['result_status']) > 100)) {\n $invalidProperties[] = \"invalid value for 'result_status', the character length must be smaller than or equal to 100.\";\n }\n\n if (!is_null($this->container['username']) && (strlen($this->container['username']) > 100)) {\n $invalidProperties[] = \"invalid value for 'username', the character length must be smaller than or equal to 100.\";\n }\n\n if (!is_null($this->container['property_value']) && (strlen($this->container['property_value']) > 450)) {\n $invalidProperties[] = \"invalid value for 'property_value', the character length must be smaller than or equal to 450.\";\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n if ($this->container['area'] === null) {\n $invalidProperties[] = \"'area' can't be null\";\n }\n if ($this->container['axis_between_categories'] === null) {\n $invalidProperties[] = \"'axis_between_categories' can't be null\";\n }\n if ($this->container['axis_line'] === null) {\n $invalidProperties[] = \"'axis_line' can't be null\";\n }\n if ($this->container['base_unit_scale'] === null) {\n $invalidProperties[] = \"'base_unit_scale' can't be null\";\n }\n if ($this->container['category_type'] === null) {\n $invalidProperties[] = \"'category_type' can't be null\";\n }\n if ($this->container['cross_at'] === null) {\n $invalidProperties[] = \"'cross_at' can't be null\";\n }\n if ($this->container['cross_type'] === null) {\n $invalidProperties[] = \"'cross_type' can't be null\";\n }\n if ($this->container['display_unit'] === null) {\n $invalidProperties[] = \"'display_unit' can't be null\";\n }\n if ($this->container['display_unit_label'] === null) {\n $invalidProperties[] = \"'display_unit_label' can't be null\";\n }\n if ($this->container['has_multi_level_labels'] === null) {\n $invalidProperties[] = \"'has_multi_level_labels' can't be null\";\n }\n if ($this->container['is_automatic_major_unit'] === null) {\n $invalidProperties[] = \"'is_automatic_major_unit' can't be null\";\n }\n if ($this->container['is_automatic_max_value'] === null) {\n $invalidProperties[] = \"'is_automatic_max_value' can't be null\";\n }\n if ($this->container['is_automatic_minor_unit'] === null) {\n $invalidProperties[] = \"'is_automatic_minor_unit' can't be null\";\n }\n if ($this->container['is_automatic_min_value'] === null) {\n $invalidProperties[] = \"'is_automatic_min_value' can't be null\";\n }\n if ($this->container['is_display_unit_label_shown'] === null) {\n $invalidProperties[] = \"'is_display_unit_label_shown' can't be null\";\n }\n if ($this->container['is_logarithmic'] === null) {\n $invalidProperties[] = \"'is_logarithmic' can't be null\";\n }\n if ($this->container['is_plot_order_reversed'] === null) {\n $invalidProperties[] = \"'is_plot_order_reversed' can't be null\";\n }\n if ($this->container['is_visible'] === null) {\n $invalidProperties[] = \"'is_visible' can't be null\";\n }\n if ($this->container['log_base'] === null) {\n $invalidProperties[] = \"'log_base' can't be null\";\n }\n if ($this->container['major_grid_lines'] === null) {\n $invalidProperties[] = \"'major_grid_lines' can't be null\";\n }\n if ($this->container['major_tick_mark'] === null) {\n $invalidProperties[] = \"'major_tick_mark' can't be null\";\n }\n if ($this->container['major_unit'] === null) {\n $invalidProperties[] = \"'major_unit' can't be null\";\n }\n if ($this->container['major_unit_scale'] === null) {\n $invalidProperties[] = \"'major_unit_scale' can't be null\";\n }\n if ($this->container['max_value'] === null) {\n $invalidProperties[] = \"'max_value' can't be null\";\n }\n if ($this->container['minor_grid_lines'] === null) {\n $invalidProperties[] = \"'minor_grid_lines' can't be null\";\n }\n if ($this->container['minor_tick_mark'] === null) {\n $invalidProperties[] = \"'minor_tick_mark' can't be null\";\n }\n if ($this->container['minor_unit'] === null) {\n $invalidProperties[] = \"'minor_unit' can't be null\";\n }\n if ($this->container['minor_unit_scale'] === null) {\n $invalidProperties[] = \"'minor_unit_scale' can't be null\";\n }\n if ($this->container['min_value'] === null) {\n $invalidProperties[] = \"'min_value' can't be null\";\n }\n if ($this->container['tick_label_position'] === null) {\n $invalidProperties[] = \"'tick_label_position' can't be null\";\n }\n if ($this->container['tick_labels'] === null) {\n $invalidProperties[] = \"'tick_labels' can't be null\";\n }\n if ($this->container['tick_label_spacing'] === null) {\n $invalidProperties[] = \"'tick_label_spacing' can't be null\";\n }\n if ($this->container['tick_mark_spacing'] === null) {\n $invalidProperties[] = \"'tick_mark_spacing' can't be null\";\n }\n if ($this->container['title'] === null) {\n $invalidProperties[] = \"'title' can't be null\";\n }\n if ($this->container['link'] === null) {\n $invalidProperties[] = \"'link' can't be null\";\n }\n return $invalidProperties;\n }", "public function testIsValidSuccessWithoutInvokedSetter()\n {\n $validator = new \\Magento\\Framework\\Validator\\Entity\\Properties();\n $this->assertTrue($validator->isValid($this->_object));\n }", "protected function buildPropertyInfoAlter() {\n }", "private function _property(EntityProperty $property) {\n static $marks = [\n Flags::IS_STATIC => \"ZEND_ACC_STATIC\",\n Flags::IS_PUBLIC => \"ZEND_ACC_PUBLIC\",\n Flags::IS_PROTECTED => \"ZEND_ACC_PROTECTED\",\n Flags::IS_PRIVATE => \"ZEND_ACC_PRIVATE\"\n ];\n $flags = [];\n foreach($marks as $mark => $flag) {\n if($property->flags & $mark) {\n $flags[] = $flag;\n }\n }\n $flags = implode(\" | \", $flags);\n switch($property->type) {\n case Types::INT:\n return \"REGISTER_CLASS_LONG_PROPERTY(ce_{$property->class->cname}, \\\"{$property->name}\\\", {$property->value}, {$flags});\";\n case Types::STRING:\n return \"REGISTER_CLASS_STRING_PROPERTY(ce_{$property->class->cname}, \\\"{$property->name}\\\", \\\"\".addslashes($property->value).\"\\\", {$flags});\";\n case Types::BOOLEAN:\n return \"REGISTER_CLASS_BOOL_PROPERTY(ce_{$property->class->cname}, \\\"{$property->name}\\\", \".intval($property->value).\", {$flags});\";\n case Types::NIL:\n return \"REGISTER_CLASS_NULL_PROPERTY(ce_{$property->class->cname}, \\\"{$property->name}\\\", {$flags});\";\n case Types::DOUBLE:\n return \"REGISTER_CLASS_DOUBLE_PROPERTY(ce_{$property->class->cname}, \\\"{$property->name}\\\", {$property->value}, {$flags});\";\n default:\n throw new \\LogicException(\"Unknown type $property\");\n }\n }", "public function init() {\n parent::init();\n\n $formatters = [];\n foreach ($this->propertyFormatters as $key => $property) {\n if (array_key_exists($key, Yii::$app->params)) {\n $formatters[Yii::$app->params[$key]] = $property;\n } else {\n $formatters[$key] = $property;\n }\n }\n $this->propertyFormatters = $formatters;\n\n // must be not null\n if ($this->uri === null) {\n throw new \\Exception(\"URI isn't set\");\n }\n\n if ($this->properties === null) {\n throw new \\Exception(\"Properties aren't set\");\n }\n\n // must be an array\n if (!is_array($this->properties)) {\n throw new \\Exception(\"Property list is not an array\");\n }\n\n $props = $this->properties;\n\n // Get alias from properties if specified and remove corresponding property\n if ($this->aliasProperty !== null) {\n foreach ($props as $i => $property) {\n\n if ($property->relation === $this->aliasProperty) {\n $this->alias = $property->value;\n\n array_splice($props, $i, 1);\n break;\n }\n }\n }\n\n // Construct fields attribute depending on relation order if specified\n if (is_array($this->relationOrder)) {\n foreach ($props as $i => $property) {\n $relationIndex = array_search($property->relation, $this->relationOrder);\n if ($relationIndex !== false) {\n $this->fields = $this->constructFields($this->fields, $property, $relationIndex);\n unset($props[$i]);\n }\n }\n }\n \n // Construct extra fields attribute based on unknown remaing properties\n foreach ($props as $i => $property) {\n $this->extraFields = $this->constructFields($this->extraFields, $property, $property->relation);\n }\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if (!is_null($this->container['iban']) && !preg_match(\"/[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}/\", $this->container['iban'])) {\n $invalidProperties[] = \"invalid value for 'iban', must be conform to the pattern /[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}/.\";\n }\n\n if (!is_null($this->container['bban']) && !preg_match(\"/[a-zA-Z0-9]{1,30}/\", $this->container['bban'])) {\n $invalidProperties[] = \"invalid value for 'bban', must be conform to the pattern /[a-zA-Z0-9]{1,30}/.\";\n }\n\n if (!is_null($this->container['msisdn']) && (mb_strlen($this->container['msisdn']) > 35)) {\n $invalidProperties[] = \"invalid value for 'msisdn', the character length must be smaller than or equal to 35.\";\n }\n\n if ($this->container['currency'] === null) {\n $invalidProperties[] = \"'currency' can't be null\";\n }\n if (!preg_match(\"/[A-Z]{3}/\", $this->container['currency'])) {\n $invalidProperties[] = \"invalid value for 'currency', must be conform to the pattern /[A-Z]{3}/.\";\n }\n\n if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 70)) {\n $invalidProperties[] = \"invalid value for 'name', the character length must be smaller than or equal to 70.\";\n }\n\n if (!is_null($this->container['display_name']) && (mb_strlen($this->container['display_name']) > 70)) {\n $invalidProperties[] = \"invalid value for 'display_name', the character length must be smaller than or equal to 70.\";\n }\n\n if (!is_null($this->container['product']) && (mb_strlen($this->container['product']) > 35)) {\n $invalidProperties[] = \"invalid value for 'product', the character length must be smaller than or equal to 35.\";\n }\n\n if (!is_null($this->container['bic']) && !preg_match(\"/[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}/\", $this->container['bic'])) {\n $invalidProperties[] = \"invalid value for 'bic', must be conform to the pattern /[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}/.\";\n }\n\n if (!is_null($this->container['linked_accounts']) && (mb_strlen($this->container['linked_accounts']) > 70)) {\n $invalidProperties[] = \"invalid value for 'linked_accounts', the character length must be smaller than or equal to 70.\";\n }\n\n $allowedValues = $this->getUsageAllowableValues();\n if (!is_null($this->container['usage']) && !in_array($this->container['usage'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'usage', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n if (!is_null($this->container['usage']) && (mb_strlen($this->container['usage']) > 4)) {\n $invalidProperties[] = \"invalid value for 'usage', the character length must be smaller than or equal to 4.\";\n }\n\n if (!is_null($this->container['details']) && (mb_strlen($this->container['details']) > 500)) {\n $invalidProperties[] = \"invalid value for 'details', the character length must be smaller than or equal to 500.\";\n }\n\n if (!is_null($this->container['owner_name']) && (mb_strlen($this->container['owner_name']) > 140)) {\n $invalidProperties[] = \"invalid value for 'owner_name', the character length must be smaller than or equal to 140.\";\n }\n\n return $invalidProperties;\n }", "protected function buildPropertyDefaults() {\n }", "public function __construct(array $properties) {\n foreach ($properties as $property => $value) {\n switch ($property) {\n // Strings.\n case 'numberOfFullTimeEmployees':\n case 'numberOfPartTimeEmployees':\n case 'annualRevenues':\n case 'occupiedPct':\n case 'occupiedArea':\n case 'openToPublicArea':\n case 'totalBuildingArea':\n case 'anyAreaLeasedToOthers':\n case 'occupancyDesc':\n $this->$property = $value;\n }\n }\n }", "public function __construct(array $properties) {\n foreach ($properties as $property => $value) {\n switch ($property) {\n // Strings.\n case 'ratingClassificationCode':\n case 'ratingClassificationDesc':\n case 'ratingClassificationDescCd':\n case 'numEmployeesFullTime':\n case 'numEmployeesPartTime':\n $this->$property = $value;\n break;\n\n // Booleans.\n case 'ifAnyRatingBasisIndicator':\n $this->$property = $value;\n break;\n\n // Floats.\n case 'rate':\n case 'exposure':\n case 'amount':\n $this->$property = $value;\n break;\n\n // PremiumBase objects.\n case 'premiumBasisCode':\n $this->$property = new PremiumBase($value);\n break;\n }\n }\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n if ($this->container['brightness'] === null) {\n $invalidProperties[] = \"'brightness' can't be null\";\n }\n if ($this->container['contrast'] === null) {\n $invalidProperties[] = \"'contrast' can't be null\";\n }\n if ($this->container['gammaCorrection'] === null) {\n $invalidProperties[] = \"'gammaCorrection' can't be null\";\n }\n if ($this->container['grayscale'] === null) {\n $invalidProperties[] = \"'grayscale' can't be null\";\n }\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n $allowed_values = [\"CREDIT_CARD\", \"CASH\", \"THIRD_PARTY_CARD\", \"NO_SALE\", \"SQUARE_WALLET\", \"SQUARE_GIFT_CARD\", \"UNKNOWN\", \"OTHER\"];\n if (!in_array($this->container['event_type'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'event_type', must be one of #{allowed_values}.\";\n }\n\n $allowed_values = [\"OTHER_BRAND\", \"VISA\", \"MASTERCARD\", \"AMERICAN_EXPRESS\", \"DISCOVER\", \"DISCOVER_DINERS\", \"JCB\", \"CHINA_UNIONPAY\", \"SQUARE_GIFT_CARD\"];\n if (!in_array($this->container['card_brand'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'card_brand', must be one of #{allowed_values}.\";\n }\n\n $allowed_values = [\"MANUAL\", \"SCANNED\", \"SQUARE_CASH\", \"SQUARE_WALLET\", \"SWIPED\", \"WEB_FORM\", \"OTHER\"];\n if (!in_array($this->container['entry_method'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'entry_method', must be one of #{allowed_values}.\";\n }\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n if (!is_null($this->container['billing_group_id']) && !preg_match(\"/^bg_[a-zA-Z0-9]+$/\", $this->container['billing_group_id'])) {\n $invalidProperties[] = \"invalid value for 'billing_group_id', must be conform to the pattern /^bg_[a-zA-Z0-9]+$/.\";\n }\n\n }\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n if ($this->container['name'] === null) {\n $invalidProperties[] = \"'name' can't be null\";\n }\n }\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 255)) {\n $invalidProperties[] = \"invalid value for 'description', the character length must be smaller than or equal to 255.\";\n }\n\n }\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n if ($this->container['schedule_type'] === null) {\n $invalidProperties[] = \"'schedule_type' can't be null\";\n }\n }\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n }\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n if ($this->container['use_type'] === null) {\n $invalidProperties[] = \"'use_type' can't be null\";\n }\n }\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n if ($this->container['auto_cancel_if_ncoa'] === null) {\n $invalidProperties[] = \"'auto_cancel_if_ncoa' can't be null\";\n }\n }\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n if ($this->container['id'] === null) {\n $invalidProperties[] = \"'id' can't be null\";\n }\n }\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n if (!preg_match(\"/^cmp_[a-zA-Z0-9]+$/\", $this->container['id'])) {\n $invalidProperties[] = \"invalid value for 'id', must be conform to the pattern /^cmp_[a-zA-Z0-9]+$/.\";\n }\n\n }\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n if ($this->container['is_draft'] === null) {\n $invalidProperties[] = \"'is_draft' can't be null\";\n }\n }\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n if ($this->container['creatives'] === null) {\n $invalidProperties[] = \"'creatives' can't be null\";\n }\n }\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n if ($this->container['date_created'] === null) {\n $invalidProperties[] = \"'date_created' can't be null\";\n }\n }\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n if ($this->container['date_modified'] === null) {\n $invalidProperties[] = \"'date_modified' can't be null\";\n }\n }\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n if ($this->container['object'] === null) {\n $invalidProperties[] = \"'object' can't be null\";\n }\n }\n $allowedValues = $this->getObjectAllowableValues();\n if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), \"fakeId\") === False)) {\n if (!is_null($this->container['object']) && !in_array($this->container['object'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'object', must be one of '%s'\",\n $this->container['object'],\n implode(\"', '\", $allowedValues)\n );\n }\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getAudioQualityAllowableValues();\n if (!is_null($this->container['audio_quality']) && !in_array($this->container['audio_quality'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'audio_quality', must be one of '%s'\",\n $this->container['audio_quality'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n if (!is_null($this->container['customer_key']) && (mb_strlen($this->container['customer_key']) > 15)) {\n $invalidProperties[] = \"invalid value for 'customer_key', the character length must be smaller than or equal to 15.\";\n }\n\n $allowedValues = $this->getDeviceAllowableValues();\n if (!is_null($this->container['device']) && !in_array($this->container['device'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'device', must be one of '%s'\",\n $this->container['device'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getLeaveReasonAllowableValues();\n if (!is_null($this->container['leave_reason']) && !in_array($this->container['leave_reason'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'leave_reason', must be one of '%s'\",\n $this->container['leave_reason'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getNetworkTypeAllowableValues();\n if (!is_null($this->container['network_type']) && !in_array($this->container['network_type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'network_type', must be one of '%s'\",\n $this->container['network_type'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getRoleAllowableValues();\n if (!is_null($this->container['role']) && !in_array($this->container['role'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'role', must be one of '%s'\",\n $this->container['role'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getScreenShareQualityAllowableValues();\n if (!is_null($this->container['screen_share_quality']) && !in_array($this->container['screen_share_quality'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'screen_share_quality', must be one of '%s'\",\n $this->container['screen_share_quality'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'status', must be one of '%s'\",\n $this->container['status'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getVideoQualityAllowableValues();\n if (!is_null($this->container['video_quality']) && !in_array($this->container['video_quality'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'video_quality', must be one of '%s'\",\n $this->container['video_quality'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['number'] === null) {\n $invalidProperties[] = \"'number' can't be null\";\n }\n if (!is_null($this->container['accounting_cost_code']) && (mb_strlen($this->container['accounting_cost_code']) > 20)) {\n $invalidProperties[] = \"invalid value for 'accounting_cost_code', the character length must be smaller than or equal to 20.\";\n }\n\n if ($this->container['quantity'] === null) {\n $invalidProperties[] = \"'quantity' can't be null\";\n }\n if ($this->container['quantity_unit_of_measure'] === null) {\n $invalidProperties[] = \"'quantity_unit_of_measure' can't be null\";\n }\n if ($this->container['unit_price'] === null) {\n $invalidProperties[] = \"'unit_price' can't be null\";\n }\n if ($this->container['gross_amount'] === null) {\n $invalidProperties[] = \"'gross_amount' can't be null\";\n }\n if ($this->container['net_amount'] === null) {\n $invalidProperties[] = \"'net_amount' can't be null\";\n }\n if ($this->container['item'] === null) {\n $invalidProperties[] = \"'item' can't be null\";\n }\n if (!is_null($this->container['note']) && (mb_strlen($this->container['note']) > 500)) {\n $invalidProperties[] = \"invalid value for 'note', the character length must be smaller than or equal to 500.\";\n }\n\n return $invalidProperties;\n }", "protected function _normalize_properties($properties) {\n if (!is_array($properties)) return false;\n foreach ($properties as $property_name => $default_value) {\n if (is_numeric($property_name)) {\n unset($properties[ $property_name ]);\n $property_name = $default_value;\n $default_value = null;\n $properties[ $property_name ] = $default_value;\n }\n }\n return $properties;\n }", "public function listInvalidProperties();", "function properties()\n {\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n if (!is_null($this->container['bookingReferenceNumber']) && (strlen($this->container['bookingReferenceNumber']) > 15)) {\n $invalid_properties[] = \"invalid value for 'bookingReferenceNumber', the character length must be smaller than or equal to 15.\";\n }\n\n if (!is_null($this->container['carrierName']) && (strlen($this->container['carrierName']) > 15)) {\n $invalid_properties[] = \"invalid value for 'carrierName', the character length must be smaller than or equal to 15.\";\n }\n\n if (!is_null($this->container['ticketNumber']) && (strlen($this->container['ticketNumber']) > 15)) {\n $invalid_properties[] = \"invalid value for 'ticketNumber', the character length must be smaller than or equal to 15.\";\n }\n\n if (!is_null($this->container['checkDigit']) && (strlen($this->container['checkDigit']) > 1)) {\n $invalid_properties[] = \"invalid value for 'checkDigit', the character length must be smaller than or equal to 1.\";\n }\n\n if (!is_null($this->container['extendedPaymentCode']) && (strlen($this->container['extendedPaymentCode']) > 3)) {\n $invalid_properties[] = \"invalid value for 'extendedPaymentCode', the character length must be smaller than or equal to 3.\";\n }\n\n if (!is_null($this->container['passengerName']) && (strlen($this->container['passengerName']) > 42)) {\n $invalid_properties[] = \"invalid value for 'passengerName', the character length must be smaller than or equal to 42.\";\n }\n\n if (!is_null($this->container['customerCode']) && (strlen($this->container['customerCode']) > 40)) {\n $invalid_properties[] = \"invalid value for 'customerCode', the character length must be smaller than or equal to 40.\";\n }\n\n if (!is_null($this->container['documentType']) && (strlen($this->container['documentType']) > 1)) {\n $invalid_properties[] = \"invalid value for 'documentType', the character length must be smaller than or equal to 1.\";\n }\n\n if (!is_null($this->container['documentNumber']) && (strlen($this->container['documentNumber']) > 14)) {\n $invalid_properties[] = \"invalid value for 'documentNumber', the character length must be smaller than or equal to 14.\";\n }\n\n if (!is_null($this->container['invoiceNumber']) && (strlen($this->container['invoiceNumber']) > 25)) {\n $invalid_properties[] = \"invalid value for 'invoiceNumber', the character length must be smaller than or equal to 25.\";\n }\n\n if (!is_null($this->container['additionalCharges']) && (strlen($this->container['additionalCharges']) > 20)) {\n $invalid_properties[] = \"invalid value for 'additionalCharges', the character length must be smaller than or equal to 20.\";\n }\n\n if (!is_null($this->container['totalFeeAmount']) && (strlen($this->container['totalFeeAmount']) > 12)) {\n $invalid_properties[] = \"invalid value for 'totalFeeAmount', the character length must be smaller than or equal to 12.\";\n }\n\n if (!is_null($this->container['clearingSequence']) && (strlen($this->container['clearingSequence']) > 2)) {\n $invalid_properties[] = \"invalid value for 'clearingSequence', the character length must be smaller than or equal to 2.\";\n }\n\n if (!is_null($this->container['clearingCount']) && (strlen($this->container['clearingCount']) > 2)) {\n $invalid_properties[] = \"invalid value for 'clearingCount', the character length must be smaller than or equal to 2.\";\n }\n\n if (!is_null($this->container['totalClearingAmount']) && (strlen($this->container['totalClearingAmount']) > 20)) {\n $invalid_properties[] = \"invalid value for 'totalClearingAmount', the character length must be smaller than or equal to 20.\";\n }\n\n if (!is_null($this->container['reservationSystemCode']) && (strlen($this->container['reservationSystemCode']) > 4)) {\n $invalid_properties[] = \"invalid value for 'reservationSystemCode', the character length must be smaller than or equal to 4.\";\n }\n\n if (!is_null($this->container['processIdentifier']) && (strlen($this->container['processIdentifier']) > 3)) {\n $invalid_properties[] = \"invalid value for 'processIdentifier', the character length must be smaller than or equal to 3.\";\n }\n\n if (!is_null($this->container['ticketIssueDate']) && (strlen($this->container['ticketIssueDate']) > 8)) {\n $invalid_properties[] = \"invalid value for 'ticketIssueDate', the character length must be smaller than or equal to 8.\";\n }\n\n if (!is_null($this->container['originalTicketNumber']) && (strlen($this->container['originalTicketNumber']) > 14)) {\n $invalid_properties[] = \"invalid value for 'originalTicketNumber', the character length must be smaller than or equal to 14.\";\n }\n\n if (!is_null($this->container['purchaseType']) && (strlen($this->container['purchaseType']) > 3)) {\n $invalid_properties[] = \"invalid value for 'purchaseType', the character length must be smaller than or equal to 3.\";\n }\n\n if (!is_null($this->container['creditReasonIndicator']) && (strlen($this->container['creditReasonIndicator']) > 1)) {\n $invalid_properties[] = \"invalid value for 'creditReasonIndicator', the character length must be smaller than or equal to 1.\";\n }\n\n if (!is_null($this->container['ticketChangeIndicator']) && (strlen($this->container['ticketChangeIndicator']) > 1)) {\n $invalid_properties[] = \"invalid value for 'ticketChangeIndicator', the character length must be smaller than or equal to 1.\";\n }\n\n if (!is_null($this->container['planNumber']) && (strlen($this->container['planNumber']) > 1)) {\n $invalid_properties[] = \"invalid value for 'planNumber', the character length must be smaller than or equal to 1.\";\n }\n\n if (!is_null($this->container['arrivalDate']) && (strlen($this->container['arrivalDate']) > 8)) {\n $invalid_properties[] = \"invalid value for 'arrivalDate', the character length must be smaller than or equal to 8.\";\n }\n\n if (!is_null($this->container['restrictedTicketDesciption']) && (strlen($this->container['restrictedTicketDesciption']) > 20)) {\n $invalid_properties[] = \"invalid value for 'restrictedTicketDesciption', the character length must be smaller than or equal to 20.\";\n }\n\n if (!is_null($this->container['exchangeTicketAmount']) && (strlen($this->container['exchangeTicketAmount']) > 12)) {\n $invalid_properties[] = \"invalid value for 'exchangeTicketAmount', the character length must be smaller than or equal to 12.\";\n }\n\n if (!is_null($this->container['exchangeTicketFeeAmount']) && (strlen($this->container['exchangeTicketFeeAmount']) > 12)) {\n $invalid_properties[] = \"invalid value for 'exchangeTicketFeeAmount', the character length must be smaller than or equal to 12.\";\n }\n\n if (!is_null($this->container['reservationType']) && (strlen($this->container['reservationType']) > 32)) {\n $invalid_properties[] = \"invalid value for 'reservationType', the character length must be smaller than or equal to 32.\";\n }\n\n if (!is_null($this->container['boardingFeeAmount']) && (strlen($this->container['boardingFeeAmount']) > 12)) {\n $invalid_properties[] = \"invalid value for 'boardingFeeAmount', the character length must be smaller than or equal to 12.\";\n }\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n $allowedValues = $this->getStyleIdentifierAllowableValues();\n if (!in_array($this->container['style_identifier'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'style_identifier', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getTextEffectAllowableValues();\n if (!in_array($this->container['text_effect'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'text_effect', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getUnderlineAllowableValues();\n if (!in_array($this->container['underline'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'underline', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n\n return $invalidProperties;\n }", "protected function buildPropertyInfo() {\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'type', must be one of '%s'\",\n $this->container['type'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'status', must be one of '%s'\",\n $this->container['status'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getPaymentMethodAllowableValues();\n if (!is_null($this->container['payment_method']) && !in_array($this->container['payment_method'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'payment_method', must be one of '%s'\",\n $this->container['payment_method'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getLanguageAllowableValues();\n if (!is_null($this->container['language']) && !in_array($this->container['language'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'language', must be one of '%s'\",\n $this->container['language'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n if (!is_null($this->container['language']) && (mb_strlen($this->container['language']) > 2)) {\n $invalidProperties[] = \"invalid value for 'language', the character length must be smaller than or equal to 2.\";\n }\n\n if (!is_null($this->container['language']) && (mb_strlen($this->container['language']) < 2)) {\n $invalidProperties[] = \"invalid value for 'language', the character length must be bigger than or equal to 2.\";\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getStrategyTypeAllowableValues();\n if (!is_null($this->container['strategy_type']) && !in_array($this->container['strategy_type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'strategy_type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getPriceTypeAllowableValues();\n if (!is_null($this->container['price_type']) && !in_array($this->container['price_type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'price_type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getRuleAllowableValues();\n if (!is_null($this->container['rule']) && !in_array($this->container['rule'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'rule', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function __construct(array $properties) {\n foreach ($properties as $property => $value) {\n switch ($property) {\n // Strings.\n case 'databaseId':\n case 'commercialName':\n case 'firstName':\n case 'lastName':\n case 'addressLine1':\n case 'addressLine2':\n case 'stateNameOrAbbreviation':\n case 'city':\n case 'zipCode':\n case 'eMail':\n case 'eMail2':\n case 'eMail3':\n case 'fax':\n case 'phone':\n case 'cellPhone':\n case 'smsPhone':\n case 'description':\n case 'website':\n case 'fein':\n case 'customerId':\n case 'insuredId':\n $this->$property = $value;\n break;\n\n // Booleans.\n case 'active':\n $this->$property = (bool) $value;\n break;\n\n // InsuredType objects.\n case 'type':\n $this->$property = new InsuredType($value);\n break;\n }\n }\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if (!is_null($this->container['accepted_user']) && !preg_match(\"/^[UW][A-Z0-9]{8}$/\", $this->container['accepted_user'])) {\n $invalidProperties[] = \"invalid value for 'accepted_user', must be conform to the pattern /^[UW][A-Z0-9]{8}$/.\";\n }\n\n if ($this->container['created'] === null) {\n $invalidProperties[] = \"'created' can't be null\";\n }\n if ($this->container['creator'] === null) {\n $invalidProperties[] = \"'creator' can't be null\";\n }\n if (!preg_match(\"/^[UW][A-Z0-9]{8}$/\", $this->container['creator'])) {\n $invalidProperties[] = \"invalid value for 'creator', must be conform to the pattern /^[UW][A-Z0-9]{8}$/.\";\n }\n\n if ($this->container['id'] === null) {\n $invalidProperties[] = \"'id' can't be null\";\n }\n if (!preg_match(\"/^[C][A-Z0-9]{8}$/\", $this->container['id'])) {\n $invalidProperties[] = \"invalid value for 'id', must be conform to the pattern /^[C][A-Z0-9]{8}$/.\";\n }\n\n if ($this->container['is_channel'] === null) {\n $invalidProperties[] = \"'is_channel' can't be null\";\n }\n if ($this->container['is_mpim'] === null) {\n $invalidProperties[] = \"'is_mpim' can't be null\";\n }\n if ($this->container['is_org_shared'] === null) {\n $invalidProperties[] = \"'is_org_shared' can't be null\";\n }\n if ($this->container['is_private'] === null) {\n $invalidProperties[] = \"'is_private' can't be null\";\n }\n if ($this->container['is_shared'] === null) {\n $invalidProperties[] = \"'is_shared' can't be null\";\n }\n if (!is_null($this->container['last_read']) && !preg_match(\"/^\\\\d{10}\\\\.\\\\d{6}$/\", $this->container['last_read'])) {\n $invalidProperties[] = \"invalid value for 'last_read', must be conform to the pattern /^\\\\d{10}\\\\.\\\\d{6}$/.\";\n }\n\n if ($this->container['members'] === null) {\n $invalidProperties[] = \"'members' can't be null\";\n }\n if ($this->container['name'] === null) {\n $invalidProperties[] = \"'name' can't be null\";\n }\n if ($this->container['name_normalized'] === null) {\n $invalidProperties[] = \"'name_normalized' can't be null\";\n }\n if ($this->container['purpose'] === null) {\n $invalidProperties[] = \"'purpose' can't be null\";\n }\n if ($this->container['topic'] === null) {\n $invalidProperties[] = \"'topic' can't be null\";\n }\n return $invalidProperties;\n }", "public function getRequiredProperties();", "abstract function appliedOnProperty(mixed $value = null): null|string|bool;", "protected function processProperties($data)\n {\n\n // Will hold the properties we are sending back\n $properties = [];\n\n // All of these are split on space\n $items = explode(' ', $data);\n\n // Iterate over the items\n foreach ($items as $item) {\n // Explode and make sure we always have 2 items in the array\n list($key, $value) = array_pad(explode('=', $item, 2), 2, '');\n\n // Convert spaces and other character changes\n $properties[$key] = utf8_encode(str_replace(\n [\n '\\\\s', // Translate spaces\n ],\n [\n ' ',\n ],\n $value\n ));\n }\n\n return $properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'status', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getTypeAllowableValues();\n if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getTaxOverrideTypeAllowableValues();\n if (!is_null($this->container['tax_override_type']) && !in_array($this->container['tax_override_type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'tax_override_type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getAdjustmentReasonAllowableValues();\n if (!is_null($this->container['adjustment_reason']) && !in_array($this->container['adjustment_reason'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'adjustment_reason', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n if (!is_null($this->container['country']) && (mb_strlen($this->container['country']) > 2)) {\n $invalidProperties[] = \"invalid value for 'country', the character length must be smaller than or equal to 2.\";\n }\n\n if (!is_null($this->container['country']) && (mb_strlen($this->container['country']) < 2)) {\n $invalidProperties[] = \"invalid value for 'country', the character length must be bigger than or equal to 2.\";\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if (!is_null($this->container['shipping_company']) && (mb_strlen($this->container['shipping_company']) > 100)) {\n $invalidProperties[] = \"invalid value for 'shipping_company', the character length must be smaller than or equal to 100.\";\n }\n\n if (!is_null($this->container['shipping_company']) && (mb_strlen($this->container['shipping_company']) < 0)) {\n $invalidProperties[] = \"invalid value for 'shipping_company', the character length must be bigger than or equal to 0.\";\n }\n\n if (!is_null($this->container['shipping_method']) && !preg_match(\"/(PickUpStore|Home|BoxReg|BoxUnreg|PickUpPoint|Own|Postal|DHLPackstation|Digital|Undefined)/\", $this->container['shipping_method'])) {\n $invalidProperties[] = \"invalid value for 'shipping_method', must be conform to the pattern /(PickUpStore|Home|BoxReg|BoxUnreg|PickUpPoint|Own|Postal|DHLPackstation|Digital|Undefined)/.\";\n }\n\n if (!is_null($this->container['tracking_number']) && (mb_strlen($this->container['tracking_number']) > 100)) {\n $invalidProperties[] = \"invalid value for 'tracking_number', the character length must be smaller than or equal to 100.\";\n }\n\n if (!is_null($this->container['tracking_number']) && (mb_strlen($this->container['tracking_number']) < 0)) {\n $invalidProperties[] = \"invalid value for 'tracking_number', the character length must be bigger than or equal to 0.\";\n }\n\n if (!is_null($this->container['tracking_uri']) && (mb_strlen($this->container['tracking_uri']) > 1024)) {\n $invalidProperties[] = \"invalid value for 'tracking_uri', the character length must be smaller than or equal to 1024.\";\n }\n\n if (!is_null($this->container['tracking_uri']) && (mb_strlen($this->container['tracking_uri']) < 0)) {\n $invalidProperties[] = \"invalid value for 'tracking_uri', the character length must be bigger than or equal to 0.\";\n }\n\n if (!is_null($this->container['return_shipping_company']) && (mb_strlen($this->container['return_shipping_company']) > 100)) {\n $invalidProperties[] = \"invalid value for 'return_shipping_company', the character length must be smaller than or equal to 100.\";\n }\n\n if (!is_null($this->container['return_shipping_company']) && (mb_strlen($this->container['return_shipping_company']) < 0)) {\n $invalidProperties[] = \"invalid value for 'return_shipping_company', the character length must be bigger than or equal to 0.\";\n }\n\n if (!is_null($this->container['return_tracking_number']) && (mb_strlen($this->container['return_tracking_number']) > 100)) {\n $invalidProperties[] = \"invalid value for 'return_tracking_number', the character length must be smaller than or equal to 100.\";\n }\n\n if (!is_null($this->container['return_tracking_number']) && (mb_strlen($this->container['return_tracking_number']) < 0)) {\n $invalidProperties[] = \"invalid value for 'return_tracking_number', the character length must be bigger than or equal to 0.\";\n }\n\n if (!is_null($this->container['return_tracking_uri']) && (mb_strlen($this->container['return_tracking_uri']) > 1024)) {\n $invalidProperties[] = \"invalid value for 'return_tracking_uri', the character length must be smaller than or equal to 1024.\";\n }\n\n if (!is_null($this->container['return_tracking_uri']) && (mb_strlen($this->container['return_tracking_uri']) < 0)) {\n $invalidProperties[] = \"invalid value for 'return_tracking_uri', the character length must be bigger than or equal to 0.\";\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'status', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getFilingFrequencyAllowableValues();\n if (!is_null($this->container['filing_frequency']) && !in_array($this->container['filing_frequency'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'filing_frequency', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getFilingTypeAllowableValues();\n if (!is_null($this->container['filing_type']) && !in_array($this->container['filing_type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'filing_type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getAccrualTypeAllowableValues();\n if (!is_null($this->container['accrual_type']) && !in_array($this->container['accrual_type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'accrual_type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['sequence_number'] === null) {\n $invalidProperties[] = \"'sequence_number' can't be null\";\n }\n if ($this->container['org_code'] === null) {\n $invalidProperties[] = \"'org_code' can't be null\";\n }\n if ($this->container['book'] === null) {\n $invalidProperties[] = \"'book' can't be null\";\n }\n if ($this->container['major'] === null) {\n $invalidProperties[] = \"'major' can't be null\";\n }\n if ($this->container['minor'] === null) {\n $invalidProperties[] = \"'minor' can't be null\";\n }\n if ($this->container['method'] === null) {\n $invalidProperties[] = \"'method' can't be null\";\n }\n if ($this->container['depreciate'] === null) {\n $invalidProperties[] = \"'depreciate' can't be null\";\n }\n if ($this->container['life_years'] === null) {\n $invalidProperties[] = \"'life_years' can't be null\";\n }\n if ($this->container['life_months'] === null) {\n $invalidProperties[] = \"'life_months' can't be null\";\n }\n if ($this->container['convention'] === null) {\n $invalidProperties[] = \"'convention' can't be null\";\n }\n if ($this->container['switch_to_straight_line'] === null) {\n $invalidProperties[] = \"'switch_to_straight_line' can't be null\";\n }\n if ($this->container['auto_create'] === null) {\n $invalidProperties[] = \"'auto_create' can't be null\";\n }\n if ($this->container['entered_on'] === null) {\n $invalidProperties[] = \"'entered_on' can't be null\";\n }\n if ($this->container['entered_by'] === null) {\n $invalidProperties[] = \"'entered_by' can't be null\";\n }\n if ($this->container['changed_on'] === null) {\n $invalidProperties[] = \"'changed_on' can't be null\";\n }\n if ($this->container['changed_by'] === null) {\n $invalidProperties[] = \"'changed_by' can't be null\";\n }\n if ($this->container['salvage_percentage'] === null) {\n $invalidProperties[] = \"'salvage_percentage' can't be null\";\n }\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['campaign_id'] === null) {\n $invalidProperties[] = \"'campaign_id' can't be null\";\n }\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'status', must be one of '%s'\",\n $this->container['status'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n if ($this->container['brand_id'] === null) {\n $invalidProperties[] = \"'brand_id' can't be null\";\n }\n if ((mb_strlen($this->container['brand_id']) > 8)) {\n $invalidProperties[] = \"invalid value for 'brand_id', the character length must be smaller than or equal to 8.\";\n }\n\n if ($this->container['usecase'] === null) {\n $invalidProperties[] = \"'usecase' can't be null\";\n }\n if ((mb_strlen($this->container['usecase']) > 20)) {\n $invalidProperties[] = \"invalid value for 'usecase', the character length must be smaller than or equal to 20.\";\n }\n\n if ($this->container['description'] === null) {\n $invalidProperties[] = \"'description' can't be null\";\n }\n if ((mb_strlen($this->container['description']) > 4096)) {\n $invalidProperties[] = \"invalid value for 'description', the character length must be smaller than or equal to 4096.\";\n }\n\n if (!is_null($this->container['sample1']) && (mb_strlen($this->container['sample1']) > 1024)) {\n $invalidProperties[] = \"invalid value for 'sample1', the character length must be smaller than or equal to 1024.\";\n }\n\n if (!is_null($this->container['sample2']) && (mb_strlen($this->container['sample2']) > 1024)) {\n $invalidProperties[] = \"invalid value for 'sample2', the character length must be smaller than or equal to 1024.\";\n }\n\n if (!is_null($this->container['sample3']) && (mb_strlen($this->container['sample3']) > 1024)) {\n $invalidProperties[] = \"invalid value for 'sample3', the character length must be smaller than or equal to 1024.\";\n }\n\n if (!is_null($this->container['sample4']) && (mb_strlen($this->container['sample4']) > 1024)) {\n $invalidProperties[] = \"invalid value for 'sample4', the character length must be smaller than or equal to 1024.\";\n }\n\n if (!is_null($this->container['sample5']) && (mb_strlen($this->container['sample5']) > 1024)) {\n $invalidProperties[] = \"invalid value for 'sample5', the character length must be smaller than or equal to 1024.\";\n }\n\n if (!is_null($this->container['message_flow']) && (mb_strlen($this->container['message_flow']) > 2048)) {\n $invalidProperties[] = \"invalid value for 'message_flow', the character length must be smaller than or equal to 2048.\";\n }\n\n if (!is_null($this->container['help_message']) && (mb_strlen($this->container['help_message']) > 255)) {\n $invalidProperties[] = \"invalid value for 'help_message', the character length must be smaller than or equal to 255.\";\n }\n\n if (!is_null($this->container['optin_keywords']) && (mb_strlen($this->container['optin_keywords']) > 255)) {\n $invalidProperties[] = \"invalid value for 'optin_keywords', the character length must be smaller than or equal to 255.\";\n }\n\n if (!is_null($this->container['optout_keywords']) && (mb_strlen($this->container['optout_keywords']) > 255)) {\n $invalidProperties[] = \"invalid value for 'optout_keywords', the character length must be smaller than or equal to 255.\";\n }\n\n if (!is_null($this->container['help_keywords']) && (mb_strlen($this->container['help_keywords']) > 255)) {\n $invalidProperties[] = \"invalid value for 'help_keywords', the character length must be smaller than or equal to 255.\";\n }\n\n if (!is_null($this->container['optin_message']) && (mb_strlen($this->container['optin_message']) > 255)) {\n $invalidProperties[] = \"invalid value for 'optin_message', the character length must be smaller than or equal to 255.\";\n }\n\n if (!is_null($this->container['optout_message']) && (mb_strlen($this->container['optout_message']) > 255)) {\n $invalidProperties[] = \"invalid value for 'optout_message', the character length must be smaller than or equal to 255.\";\n }\n\n return $invalidProperties;\n }", "public function testGetAllProperties() : void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"property\");\n\n\t\t//make a valid property uuid\n\t\t$propertyId = generateUuidV4();\n\n\t\t//make a new property with valid entries\n\t\t$property = new Property($propertyId, $this->VALID_PROPERTYCITY, $this->VALID_PROPERTYCLASS, $this->VALID_PROPERTYLATITUDE, $this->VALID_PROPERTYLONGITUDE, $this->VALID_PROPERTYSTREETADDRESS, $this->VALID_PROPERTYVALUE);\n\n\t\t//insert property\n\t\t$property->insert($this->getPDO());\n\n\t\t//grab data from MySQL and check expectations\n\t\t$results = Property::getAllProperties($this->getPDO());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"property\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"GoGitters\\\\ApciMap\\\\Property\", $results);\n\n\t\t//grab the property from the array and validate it\n\t\t$pdoProperty = $results[0];\n\t\t$this->assertEquals($pdoProperty->getPropertyId()->toString(), $propertyId->toString());\n\t\t$this->assertEquals($pdoProperty->getPropertyCity(), $this->VALID_PROPERTYCITY);\n\t\t$this->assertEquals($pdoProperty->getPropertyClass(), $this->VALID_PROPERTYCLASS);\n\t\t$this->assertEquals($pdoProperty->getPropertyLatitude(), $this->VALID_PROPERTYLATITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyLongitude(), $this->VALID_PROPERTYLONGITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyStreetAddress(), $this->VALID_PROPERTYSTREETADDRESS);\n\t\t$this->assertEquals($pdoProperty->getPropertyValue(), $this->VALID_PROPERTYVALUE);\n\t}", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n $allowed_values = $this->getBootOrderAllowableValues();\n if (!in_array($this->container['boot_order'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'boot_order', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getFirewallAllowableValues();\n if (!in_array($this->container['firewall'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'firewall', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getVideoModelAllowableValues();\n if (!in_array($this->container['video_model'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'video_model', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getVncAllowableValues();\n if (!in_array($this->container['vnc'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'vnc', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n return $invalid_properties;\n }", "function __construct( $props = [] ) {\n $this->studiesToRamRatio = 1000;\n $this->ramToStudiesRatioMB = 500;\n $this->ram1GbPerHourCost = 0.00553;\n $this->storageUsePerStudyInMb = 10;\n $this->storage1GbPerMonthCost = 0.10;\n\n // Set property value if given\n foreach( $props as $name => $value ) :\n if( property_exists ( $this, $name) ) :\n $this->$name = $value;\n endif;\n endforeach;\n\n $this->ramPerStudyCostIn1Day = $this->computeRamPerStudyCostIn1Day();\n \n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n $allowed_values = [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"];\n if (!in_array($this->container['bill_expenses'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'bill_expenses', must be one of #{allowed_values}.\";\n }\n\n if (!is_null($this->container['billing_attention']) && (strlen($this->container['billing_attention']) > 50)) {\n $invalid_properties[] = \"invalid value for 'billing_attention', the character length must be smaller than or equal to 50.\";\n }\n\n if ($this->container['billing_method'] === null) {\n $invalid_properties[] = \"'billing_method' can't be null\";\n }\n $allowed_values = [\"ActualRates\", \"FixedFee\", \"NotToExceed\", \"OverrideRate\"];\n if (!in_array($this->container['billing_method'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'billing_method', must be one of #{allowed_values}.\";\n }\n\n $allowed_values = [\"WorkRole\", \"StaffMember\"];\n if (!in_array($this->container['billing_rate_type'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'billing_rate_type', must be one of #{allowed_values}.\";\n }\n\n $allowed_values = [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"];\n if (!in_array($this->container['bill_products'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'bill_products', must be one of #{allowed_values}.\";\n }\n\n $allowed_values = [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"];\n if (!in_array($this->container['bill_time'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'bill_time', must be one of #{allowed_values}.\";\n }\n\n if ($this->container['board'] === null) {\n $invalid_properties[] = \"'board' can't be null\";\n }\n $allowed_values = [\"ActualHours\", \"BillableHours\"];\n if (!in_array($this->container['budget_analysis'], $allowed_values)) {\n $invalid_properties[] = \"invalid value for 'budget_analysis', must be one of #{allowed_values}.\";\n }\n\n if ($this->container['company'] === null) {\n $invalid_properties[] = \"'company' can't be null\";\n }\n if (!is_null($this->container['customer_po']) && (strlen($this->container['customer_po']) > 50)) {\n $invalid_properties[] = \"invalid value for 'customer_po', the character length must be smaller than or equal to 50.\";\n }\n\n if ($this->container['estimated_end'] === null) {\n $invalid_properties[] = \"'estimated_end' can't be null\";\n }\n if ($this->container['estimated_start'] === null) {\n $invalid_properties[] = \"'estimated_start' can't be null\";\n }\n if ($this->container['name'] === null) {\n $invalid_properties[] = \"'name' can't be null\";\n }\n if ((strlen($this->container['name']) > 100)) {\n $invalid_properties[] = \"invalid value for 'name', the character length must be smaller than or equal to 100.\";\n }\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getFieldAllowableValues();\n if (!is_null($this->container['field']) && !in_array($this->container['field'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'field', must be one of '%s'\",\n $this->container['field'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getOpAllowableValues();\n if (!is_null($this->container['op']) && !in_array($this->container['op'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'op', must be one of '%s'\",\n $this->container['op'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n if ($this->container['text'] === null) {\r\n $invalidProperties[] = \"'text' can't be null\";\r\n }\r\n if ($this->container['textOriginal'] === null) {\r\n $invalidProperties[] = \"'textOriginal' can't be null\";\r\n }\r\n if ($this->container['textNormalised'] === null) {\r\n $invalidProperties[] = \"'textNormalised' can't be null\";\r\n }\r\n if (!is_null($this->container['score']) && ($this->container['score'] > 1E+2)) {\r\n $invalidProperties[] = \"invalid value for 'score', must be smaller than or equal to 1E+2.\";\r\n }\r\n if (!is_null($this->container['score']) && ($this->container['score'] < 0)) {\r\n $invalidProperties[] = \"invalid value for 'score', must be bigger than or equal to 0.\";\r\n }\r\n return $invalidProperties;\r\n }", "private function _passed_config_test() {\n\t\tif ( ! is_subclass_of( $this, 'SN_Type_Base' ) )\n\t\t\treturn false;\n\n\t\t$errors = array();\n\t\t$required_properties = array(\n\t\t\t'post_type' => $this->post_type,\n\t\t\t'post_type_title' => $this->post_type_title,\n\t\t\t'post_type_single' => $this->post_type_single,\n\t\t);\n\n\t\tforeach ( $required_properties as $property_name => $property ) {\n\t\t\tif ( is_null( $property ) )\n\t\t\t\t$errors[] = \"Property {$property_name} has not been set in your sub-class.\\n\";\n\t\t} // foreach()\n\n\t\tif ( empty( $errors ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tforeach ( $errors as $error )\n\t\t\t\techo esc_html( $error );\n\t\t} // if/each()\n\n\t\treturn false;\n\t}", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n\n if (!is_null($this->container['funda_postal_code']) && (mb_strlen($this->container['funda_postal_code']) > 7)) {\n $invalidProperties[] = \"invalid value for 'funda_postal_code', the character length must be smaller than or equal to 7.\";\n }\n\n if (!is_null($this->container['funda_street']) && (mb_strlen($this->container['funda_street']) > 43)) {\n $invalidProperties[] = \"invalid value for 'funda_street', the character length must be smaller than or equal to 43.\";\n }\n\n if (!is_null($this->container['funda_locality']) && (mb_strlen($this->container['funda_locality']) > 24)) {\n $invalidProperties[] = \"invalid value for 'funda_locality', the character length must be smaller than or equal to 24.\";\n }\n\n return $invalidProperties;\n }", "protected function cleanProperties()\n {\n global $database;\n\n $clean_properties = array();\n\n foreach ($this->properties() as $key => $value) {\n $clean_properties[$key] = $database->escapeString($value);\n }\n\n return $clean_properties;\n }", "protected function cleanProperties()\n {\n global $database;\n\n $clean_properties = array();\n\n foreach ($this->properties() as $key => $value) {\n $clean_properties[$key] = $database->escapeString($value);\n }\n\n return $clean_properties;\n }", "public function shouldSkipUnknownProperties(): bool\n {\n return $this->skipUnknownProperties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n if ($this->container['code'] === null) {\n $invalid_properties[] = \"'code' can't be null\";\n }\n if ($this->container['discount_type'] === null) {\n $invalid_properties[] = \"'discount_type' can't be null\";\n }\n $allowed_values = $this->getDiscountTypeAllowableValues();\n if (!in_array($this->container['discount_type'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'discount_type', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n if ($this->container['name'] === null) {\n $invalid_properties[] = \"'name' can't be null\";\n }\n if ($this->container['type'] === null) {\n $invalid_properties[] = \"'type' can't be null\";\n }\n $allowed_values = $this->getTypeAllowableValues();\n if (!in_array($this->container['type'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'type', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n if ($this->container['unique_key'] === null) {\n $invalid_properties[] = \"'unique_key' can't be null\";\n }\n if ($this->container['value'] === null) {\n $invalid_properties[] = \"'value' can't be null\";\n }\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getMembershipOptionAllowableValues();\n if (!is_null($this->container['membershipOption']) && !in_array($this->container['membershipOption'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'membershipOption', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getChatSecurityAllowableValues();\n if (!is_null($this->container['chatSecurity']) && !in_array($this->container['chatSecurity'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'chatSecurity', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getHomepageAllowableValues();\n if (!is_null($this->container['homepage']) && !in_array($this->container['homepage'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'homepage', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getDefaultPublicityAllowableValues();\n if (!is_null($this->container['defaultPublicity']) && !in_array($this->container['defaultPublicity'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'defaultPublicity', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function setProperties($properties)\n {\n\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getPhoneNumberQualityAllowableValues();\n if (!is_null($this->container['phoneNumberQuality']) && !in_array($this->container['phoneNumberQuality'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'phoneNumberQuality', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getPhoneNumberNameStatusAllowableValues();\n if (!is_null($this->container['phoneNumberNameStatus']) && !in_array($this->container['phoneNumberNameStatus'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'phoneNumberNameStatus', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties() {\n\n $invalidProperties = [];\n\n /*\n * Any needed validation goes here. If a property requires no validation\n * (e.g. it's OK for it to be empty) then it may be omitted.\n */\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n $allowedValues = $this->getMethodOfPaymentAllowableValues();\n if (\n !is_null($this->container['method_of_payment']) &&\n !in_array(strtoupper($this->container['method_of_payment']), $allowedValues, true)\n ) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'method_of_payment', must be one of '%s'\",\n $this->container['method_of_payment'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n if (!is_null($this->container['import_containers']) && (mb_strlen($this->container['import_containers']) > 64)) {\n $invalidProperties[] = \"invalid value for 'import_containers', the character length must be smaller than or equal to 64.\";\n }\n\n $allowedValues = $this->getHandlingInstructionsAllowableValues();\n if (\n !is_null($this->container['handling_instructions']) &&\n !in_array(strtoupper($this->container['handling_instructions']), $allowedValues, true)\n ) {\n $invalidProperties[] = sprintf(\n \"invalid value '%s' for 'handling_instructions', must be one of '%s'\",\n $this->container['handling_instructions'],\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function __construct(array $data)\n {\n foreach($this->attributes() as $property => $type) {\n if (!isset($data[$property])) {\n continue;\n }\n\n if ($type === Type::STRING || $type === Type::ANY) {\n $this->_properties[$property] = $data[$property];\n } elseif ($type === Type::BOOLEAN) {\n if (!\\is_bool($data[$property])) {\n $this->_errors[] = \"property '$property' must be boolean, but \" . gettype($data[$property]) . \" given.\";\n continue;\n }\n $this->_properties[$property] = (bool) $data[$property];\n } elseif (\\is_array($type)) {\n if (!\\is_array($data[$property])) {\n $this->_errors[] = \"property '$property' must be array, but \" . gettype($data[$property]) . \" given.\";\n continue;\n }\n switch (\\count($type)) {\n case 1:\n // array\n $this->_properties[$property] = [];\n foreach($data[$property] as $item) {\n if ($type[0] === Type::STRING) {\n if (!is_string($item)) {\n $this->_errors[] = \"property '$property' must be array of strings, but array has \" . gettype($item) . \" element.\";\n }\n $this->_properties[$property][] = $item;\n } elseif ($type[0] === Type::ANY || $type[0] === Type::BOOLEAN || $type[0] === Type::INTEGER) { // TODO simplify handling of scalar types\n $this->_properties[$property][] = $item;\n } else {\n // TODO implement reference objects\n $this->_properties[$property][] = new $type[0]($item);\n }\n }\n break;\n case 2:\n // map\n if ($type[0] !== Type::STRING) {\n throw new \\Exception('Invalid map key type: ' . $type[0]);\n }\n $this->_properties[$property] = [];\n foreach($data[$property] as $key => $item) {\n if ($type[1] === 'string') {\n if (!is_string($item)) {\n $this->_errors[] = \"property '$property' must be map<string, string>, but entry '$key' is of type \" . \\gettype($item) . '.';\n }\n $this->_properties[$property][$key] = $item;\n } elseif ($type[1] === Type::ANY || $type[1] === Type::BOOLEAN || $type[1] === Type::INTEGER) { // TODO simplify handling of scalar types\n $this->_properties[$property][$key] = $item;\n } else {\n // TODO implement reference objects\n $this->_properties[$property][$key] = new $type[1]($item);\n }\n }\n break;\n }\n } else {\n $this->_properties[$property] = new $type($data[$property]);\n }\n unset($data[$property]);\n }\n foreach($data as $additionalProperty => $value) {\n $this->_properties[$additionalProperty] = $value;\n }\n }" ]
[ "0.66310084", "0.64890844", "0.62032616", "0.6128429", "0.5994572", "0.5977762", "0.59675634", "0.59599245", "0.59554213", "0.59212184", "0.5880668", "0.58369845", "0.5812428", "0.57343334", "0.57325906", "0.57187444", "0.56949794", "0.56873643", "0.5628341", "0.5628136", "0.5623489", "0.55582356", "0.55492663", "0.5537467", "0.5531801", "0.5510481", "0.5504734", "0.5492162", "0.5490705", "0.548348", "0.54718447", "0.5469766", "0.5454262", "0.5449268", "0.5437618", "0.54341155", "0.54340136", "0.5419447", "0.54051703", "0.53921556", "0.5379499", "0.5374099", "0.5365863", "0.53578204", "0.53433585", "0.53163517", "0.53162915", "0.5315242", "0.53058875", "0.5278094", "0.52696496", "0.5255401", "0.5248653", "0.5238044", "0.52344096", "0.52342004", "0.523037", "0.5227622", "0.522529", "0.5223515", "0.5220031", "0.5218623", "0.52184486", "0.52177614", "0.52152425", "0.52091986", "0.52076554", "0.52070117", "0.52057034", "0.5200745", "0.51982135", "0.519429", "0.51918304", "0.5189156", "0.51884687", "0.51882225", "0.5187325", "0.5184161", "0.5183672", "0.5179237", "0.5176198", "0.5175683", "0.51712173", "0.5169932", "0.5159968", "0.51531917", "0.515073", "0.515062", "0.5150183", "0.5145364", "0.5144173", "0.5144173", "0.51428086", "0.5142065", "0.5141966", "0.51411194", "0.51293194", "0.51258266", "0.51257616", "0.51221406" ]
0.6949544
0
Display a listing of the resource.
public function index(Request $request) { if(Auth::user()->cannot('view.user')) { return view('errors.permission'); die; } $data = User::with('roles'); //## Filter By Column ########################################################################################## if(!empty($request->input('srch_name'))) { $data = $data->where('name', 'LIKE', '%' . $request->input('srch_name') . '%'); } if(!empty($request->input('srch_email'))) { $data = $data->where('email', 'LIKE', '%' . $request->input('srch_email') . '%'); } if(!empty($request->input('srch_language'))) { $data = $data->where('language', $request->input('srch_language')); } if(!empty($request->input('srch_status'))) { $data = $data->where('status', $request->input('srch_status')); } if(!Auth::user()->isRole('admin')) { $data = $data->where('id', '>', 1); } //## Sort By Column ############################################################################################ if(!empty($request->input('srch_name_sort'))) { $data = $data->orderBy('name', $request->input('srch_name_sort')); } elseif(!empty($request->input('srch_email_sort'))) { $data = $data->orderBy('email', $request->input('srch_email_sort')); } elseif(!empty($request->input('srch_language_sort'))) { $data = $data->orderBy('language', $request->input('srch_language_sort')); } else { $data = $data->orderBy('name', 'desc'); } //## Paginate ################################################################################################## $paginate = 20; if(!empty($request->input('srch_paginate'))) { $paginate = $request->input('srch_paginate') == '*' ? $data->count() : $request->input('srch_paginate'); } $data = $data->paginate($paginate); $filter = $request->except('_token'); $filter['srch_paginate'] = $paginate; if ($request->ajax()) { return response()->json(View::make('admin.user.grid', [ 'data' => $data, 'filter' => $filter, ])->render()); } $roles = Role::pluck('name', 'id'); return view('admin.user.index', compact('data', 'roles')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { if(Auth::user()->cannot('create.user')) { return view('errors.permission'); die; } /*if(!accessIp(\Request::ip())) { return view('errors.blocked_ip'); die; }*/ $roles = Role::pluck('name', 'id'); return view('admin.user.create', compact('roles')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $input = $request->except('confirm-password', 'roles'); $messages = [ 'name.required' => trans('user.err_name_required'), 'email.required' => trans('user.err_email_required'), 'email.unique' => trans('user.err_email_unique'), 'password.required' => trans('user.err_password_required'), 'password.min' => trans('user.err_password_min'), 'password.confirmed' => trans('user.err_password_confirmed'), 'password_confirmation.required' => trans('user.err_password_confirmation_required'), 'roles.required' => trans('user.err_roles_required') ]; $validator = Validator::make($request->all(), [ 'name' => 'required', 'email' => 'required|unique:users,email', 'password' => 'required|min:6|confirmed', 'password_confirmation' => 'required', 'roles' => 'required', ], $messages); if($validator->fails()){ if($request->ajax()) { return response()->json(['hasError' => true, 'errorMessage' => $validator->errors()]); } return \Redirect::back()->withInput()->withErrors($validator); } $input['password'] = Hash::make($input['password']); $user = User::create($input); foreach ($request->input('roles') as $key => $value) { $user->attachRoles($value); } if($request->ajax()) { switch ($request->input('save')) { case 1 : return response()->json(['redirectPath' => url('panel/user')]); case 2 : return response()->json(['redirectPath' => url('panel/user/create')]); case 3: return response()->json(['redirectPath' => url('panel/user/' . $user->id . '/edit')]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($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) { if(Auth::user()->cannot('edit.user')) { return view('errors.permission'); die; } /*if(!accessIp(\Request::ip())) { return view('errors.blocked_ip'); die; }*/ $roles = new Role(); if(!Auth::user()->isRole('admin')) { $roles = $roles->where('id', '>', 1); } $roles = $roles->pluck('name', 'id'); $data = User::with('roles')->find($id); foreach($data->roles as $role) { $selected_roles[] = $role->id; } return view('admin.user.edit', compact('roles', 'data', 'selected_roles')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $messages = [ 'name.required' => trans('user.err_name_required'), 'email.required' => trans('user.err_email_required'), 'email.unique' => trans('user.err_email_unique'), 'password.required' => trans('user.err_password_required'), 'password.min' => trans('user.err_password_min'), 'password.confirmed' => trans('user.err_password_confirmed'), 'password_confirmation.required' => trans('user.err_password_confirmation_required'), 'roles.required' => trans('user.err_roles_required') ]; $user = User::find($id); $input = $request->all(); $rules = [ 'name' => 'required', 'email' => 'required|unique:users,email,'.$user->id, 'roles' => 'required', ]; if(!empty($request->input('password'))) { $rules['password'] = 'required|min:6|confirmed'; $rules['password_confirmation'] = 'required'; } $validator = Validator::make($request->all(), $rules, $messages); if($validator->fails()){ if($request->ajax()) { return response()->json(['hasError' => true, 'errorMessage' => $validator->errors()]); } return \Redirect::back()->withInput()->withErrors($validator); } if(!empty($request->input('password'))) { $user->password = Hash::make($input['password']); } $user->name = $request->input('name'); $user->email = $request->input('email'); $user->status = $request->input('status'); $user->language = $request->input('language'); $user->save(); if(!$request->has('id')) { $user->detachRoles(); foreach ($request->input('roles') as $key => $value) { $user->attachRoles($value); } } //return var_dump($request->ajax());die; return redirect()->back(); if($request->ajax()) { switch ($request->input('save')) { case 1 : return response()->json(['redirectPath' => url('panel/user')]); case 2 : return response()->json(['redirectPath' => url('panel/user/create')]); case 3: return response()->json(['redirectPath' => url('panel/user/' . $user->id . '/edit')]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { if(Auth::user()->cannot('delete.user')) { return view('errors.permission'); die; } /*if(!accessIp(\Request::ip())) { return view('errors.blocked_ip'); die; }*/ $ids = explode(',', $id); if(count($ids) < 1) { return response()->json([ 'hasError' => true, 'errorMsg' => trans('general.no_items_selected') ]); } foreach ($ids as $id) { $canDelete[] = $id; User::destroy($id); } return response()->json(['deleted' => $canDelete]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Run the database seeds.
public function run() { $barang = [ ['nama'=>'Honda Vario', 'varian'=>'150CC', 'harga_beli'=>'23000000','harga_jual'=>'17000000'], ['nama'=>'Honda Beat', 'varian'=>'150CC', 'harga_beli'=>'22000000','harga_jual'=>'15000000'], ['nama'=>'Honda CRF', 'varian'=>'150CC', 'harga_beli'=>'37000000','harga_jual'=>'30000000'], ['nama'=>'Yamaha NMAX', 'varian'=>'155CC', 'harga_beli'=>'32000000','harga_jual'=>'26000000'], ['nama'=>'Yamaha WR', 'varian'=>'155CC', 'harga_beli'=>'38000000','harga_jual'=>'32000000'] ]; DB::table('barangs')->insert($barang); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.7891453", "0.7890965", "0.7862504", "0.78414804", "0.78414804", "0.7837965", "0.78248763", "0.7812292", "0.7809632", "0.77928597", "0.7788316", "0.7781619", "0.77815884", "0.7763308", "0.7754035", "0.7717961", "0.7717961", "0.77171147", "0.77138597", "0.7705001", "0.7693082", "0.7692783", "0.76915383", "0.76909506", "0.76733255", "0.7667128", "0.7665592", "0.7656238", "0.7650853", "0.764326", "0.76431626", "0.76431614", "0.7635147", "0.76311624", "0.76294273", "0.7627076", "0.76207024", "0.76207024", "0.76139116", "0.76036394", "0.76035625", "0.76035625", "0.76032084", "0.7602515", "0.76007926", "0.75971127", "0.7588128", "0.7586303", "0.7581912", "0.7563037", "0.7554785", "0.75526226", "0.755171", "0.75436753", "0.75432944", "0.7540682", "0.7538806", "0.75280696", "0.751548", "0.75149626", "0.7501161", "0.74959517", "0.74956346", "0.74911124", "0.7489147", "0.74858016", "0.748033", "0.7478443", "0.7472642", "0.7472576", "0.7465409", "0.7464371", "0.74630046", "0.7462218", "0.7461453", "0.7449168", "0.74399257", "0.74358094", "0.7433247", "0.7432659", "0.74248093" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { $rules = [ 'title' => 'required|max:255|unique:categories,title,'.$this->route('category'), 'slug' => 'required|max:255|unique:categories,slug,'.$this->route('category') ]; switch($this->method()) { case 'PUT': case 'PATCH': $rules['slug'] = '';//'required|unique:instructions,slug,'.$this->route('instruction'); break; } return $rules; // return [ // 'title' => 'required|max:255|unique:categories,title,'.$this->route('category'), // 'slug' => 'required|max:255|unique:categories,slug,'.$this->route('category') // // ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => 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'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\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'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\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}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\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 static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\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\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7675849", "0.76724476", "0.76665044", "0.7657698", "0.7641827", "0.7630892", "0.76293766", "0.7617708", "0.76102096", "0.7607475", "0.7602442", "0.7598732", "0.7597544", "0.75924", "0.75915384", "0.7588146", "0.7581354", "0.7555758", "0.755526", "0.7551423", "0.7546329", "0.7541439", "0.75366044", "0.75363225", "0.7530296", "0.7517988", "0.75155175", "0.7508439", "0.75069886", "0.7505724", "0.749979", "0.7495976", "0.74949056", "0.7492888", "0.7491117", "0.74901396", "0.7489651", "0.7486808", "0.7486108", "0.7479687", "0.7478561", "0.7469412", "0.74635684", "0.74619836", "0.7461325", "0.74591017", "0.7455279", "0.745352", "0.7453257", "0.7449877", "0.74486", "0.7441391", "0.7440429", "0.7435489", "0.7435326", "0.74341524", "0.7430354", "0.7429103", "0.7423808", "0.741936", "0.74152505", "0.7414828", "0.741382", "0.74126065", "0.74105227", "0.740555", "0.7404385", "0.74040926", "0.74015605", "0.73905706", "0.73837525", "0.73732615", "0.7371123", "0.7369176", "0.73619753", "0.73554605", "0.73448825", "0.7344659", "0.73427117", "0.73357755" ]
0.0
-1
WHMCS eNom price sync addon module Copyright (C) 2016 Duco Hosting This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see < STUB FUNCTION for PHPStorm code completion Log module action to WHMCS module log
function LogModuleCall($module, $action, $request, $response, $processedData, $replaceVars) { // STUB }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function plugin_fin_smscoin_install($action) {\r\n\r\n\tglobal $lang;\r\n\tif ($action != 'autoapply')\r\n\t\tloadPluginLang('fin_smscoin', 'config', '', '', ':');\r\n\t// Fill DB_UPDATE configuration scheme\r\n\t$db_update = array(\r\n\t\tarray(\r\n\t\t\t'table' => 'fin_smscoin_history',\r\n\t\t\t'key' => 'primary key(id)',\r\n\t\t\t'action' => 'cmodify',\r\n\t\t\t'fields' => array(\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'id', 'type' => 'int not null auto_increment'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'success', 'type' => 'int', 'params' => 'default \"0\"'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'dt', 'type' => 'datetime'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'purse', 'type' => 'int'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'order_id', 'type' => 'int'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'amount', 'type' => 'float'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'clear_amount', 'type' => 'int'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'inv', 'type' => 'bigint'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'phone', 'type' => 'char(32)'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'sign_v2', 'type' => 'char(32)'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'ip', 'type' => 'char(15)'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'userid', 'type' => 'int'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'sum', 'type' => 'float'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'trid', 'type' => 'int'),\r\n\t\t\t)\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'table' => 'fin_smscoin_transactions',\r\n\t\t\t'key' => 'primary key(id)',\r\n\t\t\t'action' => 'cmodify',\r\n\t\t\t'fields' => array(\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'id', 'type' => 'int not null auto_increment'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'dt', 'type' => 'datetime'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'userid', 'type' => 'int'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'username', 'type' => 'char(100)'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'amount', 'type' => 'float'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'profit', 'type' => 'float'),\r\n\t\t\t)\r\n\t\t),\r\n\t);\r\n\t// Apply requested action\r\n\tswitch ($action) {\r\n\t\tcase 'confirm':\r\n\t\t\tgenerate_install_page('fin_smscoin', $lang['fin_smscoin:desc_install']);\r\n\t\t\tbreak;\r\n\t\tcase 'autoapply':\r\n\t\tcase 'apply':\r\n\t\t\tif (fixdb_plugin_install('fin_smscoin', $db_update, 'install', ($action == 'autoapply') ? true : false)) {\r\n\t\t\t\tplugin_mark_installed('fin_smscoin');\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\treturn true;\r\n}", "function log_plugin_ ($parameter, $option=0) {\r\n\t global $db, $user_data, $pub_user, $pub_pluginversion, $pub_gametype;\r\n global $fp;\r\n \r\n\t if (defined(\"OGS_PLUGIN_DEBUG\")) fwrite($fp, \"Entrée log_plugin_\\n\");\r\n\t setlocale(LC_TIME, 'fr_FR.ISO-8859-1');\r\n\r\n switch($pub_gametype) {\r\n case 'eunivers': $gamename = \" E-Univers\" ; break;\r\n case 'ogame': $gamename = \" Ogame\" ; break;\r\n default : $gamename = \"\"; break;\r\n }\r\n\r\n switch ($parameter) {\r\n\t\t/* ----------- Gestion systèmes solaire et rapports ----------- */\r\n\t\tcase 'load_system_OGS' :\r\n\t\t list($lsystem, $num_plan ) = $option;\r\n $line = $pub_user.\" charge \".$num_plan.\" planètes du système$gamename \".$lsystem.\" via l'extension FireSpy (\".$pub_pluginversion.\")\";\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'load_system_OGS_cdr' :\r\n\t\t list($lsystem, $num_plan ) = $option;\r\n $line = $pub_user.\" charge \".$num_plan.\" planètes du système$gamename \".$lsystem.\" via l'extension FireSpy ($pub_pluginversion)\".($parameter=='load_system_OGS_cdr' ? \" avec mise à jour des champs de ruines.\":\"\");\r\n\t\tbreak;\r\n\t\t//\r\n\t\tcase 'load_spy_OGS' :\r\n\t\t $line = $pub_user.\" charge \".($option>0 ? $option:'aucun').\" rapport\".($option>0 ? 's':'').\" d'espionnage$gamename via l'extension FireSpy (\".$pub_pluginversion.\")\";\r\n\t\tbreak;\r\n\t\t/* ----------- Gestion des membres ----------- */\r\n\t\tcase 'login_ogsplugin_new' :\r\n\t\t $line = \"Connexion de \".$pub_user.\" via l'extension FireSpy (\".$pub_pluginversion.\")\";\r\n\t\tbreak;\r\n\t\tcase 'login_ogsplugin_upd' :\r\n\t\t $line = \"Connexion de \".$pub_user.\" via l'extension FireSpy (\".$pub_pluginversion.\")[renouvellement de session]\";\r\n\t\tbreak;\r\n\t\t/* ----------- Classement ----------- */\r\n\t\tcase 'load_allyhistory_OGS':\r\n\t\t list($par_allytag, $timestamp, $lcountlines) = $option;\r\n $date = strftime(\"%d %b %Y %Hh\", $timestamp);\r\n\t\t $line = $pub_user.\" envoie le classement alliance$gamename \".$par_allytag.\" du \".$date.\" via l'extension FireSpy (\".$pub_pluginversion.\") [\".$lcountlines.\" membres]\";\r\n\t\tbreak;\r\n //\r\n case 'load_rank_OGS' :\r\n\t\t list( $par_whoseranking, $typerank, $intervranking, $timestamp, $countrank) = $option;\r\n\t\t //\r\n\t\t switch($par_whoseranking) {\r\n case 0: $par_whoseranking = \"joueurs\";break;\r\n\t\t case 1: $par_whoseranking = \"alliances\";break;\r\n\t\t default: $par_whoseranking = \"indéterminé(a/j)\";\r\n }\r\n switch ($typerank) {\r\n \t\t\t case \"general\": $typerank = \"général\";break;\r\n \t\t\t case \"fleet\": $typerank = \"flotte\";break;\r\n \t\t\t case \"research\": $typerank = \"recherche\";break;\r\n \t\t\t default: $typerank = \"indéterminé(g/f/r/a)\";\r\n\t\t }\r\n $date = strftime(\"%d %b %Y %Hh\", $timestamp);\r\n\t\t $line = $pub_user.\" envoie le classement$gamename \".$par_whoseranking.\"[$intervranking]($typerank) du \".$date.\" via l'extension FireSpy (\".$pub_pluginversion.\") [\".$countrank.\" lignes]\";\r\n\t\tbreak;\r\n\t\t/* ----------------------------------------- */\r\n\t\t// user_load_building, user_load_technos, user_load_shipyard, user_load_fleet, user_load_defense, user_load_planet_empire, user_load_moon_empire\r\n case 'user_load_buildings' :\r\n\t\t // $pub_planetsource\r\n\t\t $date = strftime(\"%d %b %Y %Hh\", $timestamp);\r\n\t\t $line = $pub_user.\" met à jour sa page bâtiments$gamename pour \".$option.\" via l'extension FireSpy (\".$pub_pluginversion.\")\";\r\n\t\tbreak;\r\n\r\n case 'user_load_technos' :\r\n\t\t $line = $pub_user.\" met à jour sa page technologie$gamename via l'extension FireSpy (\".$pub_pluginversion.\")\";\r\n\t\tbreak;\r\n\r\n case 'user_load_shipyard' :\r\n\t\t $line = $pub_user.\" met à jour sa page chantier$gamename spatial pour \".$option.\" via l'extension FireSpy (\".$pub_pluginversion.\")\";\r\n\t\tbreak;\r\n \r\n case 'user_load_fleet' :\r\n\t\t $line = $pub_user.\" met à jour sa page flotte$gamename pour \".$option.\" via l'extension FireSpy (\".$pub_pluginversion.\")\";\r\n\t\tbreak;\r\n \r\n case 'user_load_defense' :\r\n\t\t $line = $pub_user.\" met à jour sa page défense$gamename pour \".$option.\" via l'extension FireSpy (\".$pub_pluginversion.\")\";\r\n\t\tbreak;\r\n \r\n case 'user_load_planet_empire' :\r\n\t\t $line = $pub_user.\" met à jour sa page empire$gamename pour l'ensemble de ses planètes via l'extension FireSpy (\".$pub_pluginversion.\")\";\r\n\t\tbreak;\r\n\t\t\r\n\t\t//user_load_eunivglobalview\r\n case 'user_load_eunivglobalview' :\r\n\t\t $line = $pub_user.\" met à jour sa Vue Globale Empire($gamename) via l'extension FireSpy (\".$pub_pluginversion.\")\";\r\n\t\tbreak;\r\n\t\t\r\n case 'user_load_moon_empire' :\r\n\t\t $line = $pub_user.\" met à jour sa page empire$gamename pour l'ensemble de ses lunes via l'extension FireSpy (\".$pub_pluginversion.\")\";\r\n\t\tbreak;\r\n\t\t\r\n case 'update_planet_overview' :\r\n\t\t $line = $pub_user.\" met à jour ses caractéristiques de planète/lune$gamename pour \".$option.\" via l'extension FireSpy (\".$pub_pluginversion.\")\";\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'unallowedconnattempt_OGS' :\r\n\t\t list( $par_user_name, $par_user_password, $par_user_ip) = $option;\r\n\t\t $date = strftime(\"%d %b %Y %Hh\", $timestamp);\r\n\t\t $line = $par_user_name.\" (\".$par_user_ip.\") a tenté de se connecter sans autorisation via l'extension FireSpy (\".$pub_pluginversion.\")\";\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'unattendedgameserver_OGS' :\r\n\t\t list( $par_user_name, $par_user_ip) = $option;\r\n\t\t $date = strftime(\"%d %b %Y %Hh\", $timestamp);\r\n\t\t $line = $par_user_name.\" (\".$par_user_ip.\") a tenté d'envoyer des données d'un autre univers via l'extension FireSpy (\".$pub_pluginversion.\")!\";\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'unattendedgametype_OGS' :\r\n\t\t list( $par_user_name, $par_user_ip) = $option;\r\n\t\t $date = strftime(\"%d %b %Y %Hh\", $timestamp);\r\n\t\t $line = $par_user_name.\" (\".$par_user_ip.\") a tenté d'envoyer des données d'un autre jeu en ligne via l'extension FireSpy (\".$pub_pluginversion.\")!\";\r\n\t\tbreak;\r\n\r\n\t\tcase 'debug' :\r\n\t\t $line = 'DEBUG : '.$option;\r\n\t\tbreak;\r\n\t\t//\r\n\t\tdefault:\r\n\t\t $line = 'Erreur appel fichier log depuis script plugin OGSPY ('.$pub_pluginversion.') - '.$parameter.' - '.print_r($option);\r\n\t\tbreak;\r\n\t}\r\n\t$fichier = \"log_\".date(\"ymd\").'.log';\r\n\t$line = \"/*\".date(\"d/m/Y H:i:s\").'*/ '.$line; // 11/06/07 -> addslashes retiré\r\n\twrite_file(PATH_LOG_TODAY.$fichier, \"a\", $line);\r\n}", "function acf_dev_log()\n{\n}", "function INSTALL($e) { $s=$im='';\n\n\nif($GLOBALS['admin']) {\n\n$GLOBALS['article']['template']='blank';\n\n\nSTYLES(\"mod\",\"\n.iDIR,.iYES,.iNON,.iDEL,.iUPD,.iADD { cursor:pointer; clear:left;float:left; }\n.iNON {color: #aaa}\n.iDEL {color: red}\n.iYES,.iUPD {color: green}\n.iADD {color: rgb(0,255,0)}\n.iNON,.iSS {text-decoration:line-through}\n.iNON:before,.iNON:after,.iSS:before,.iSS:after {content:' '}\n.iYES,.iOK {text-decoration:none}\n\n.iDIR {font-weight: bold; float:left; valign:top; }\n.iT {float:left;margin-top:20pt;}\n\n.p1 { color: #3F3F3F; text-decoration: line-through; background: #DFDFDF; } /* вычеркнутый */\n.p2 { background: #FFD0C0; } /* вставленный */\n\n\");\n\n $upgrade=gglob($GLOBALS['host_module'].\"install/*.php\");\n foreach($upgrade as $l) { $xi=explode('/',$l); $m=array_pop($xi);\n\t\t$im.=\"'$m',\";\n\t\t$s.=\"<div class='mod' id='module__$m'>\".$m.\"</div>\";\n\t}\n\nSCRIPTS(\"mod\",\"\nvar install_modules_n=0;\nfunction check_mod_do() { if(typeof install_modules[install_modules_n] == 'undefined') { install_modules_n=0; return; }\n\tvar m=install_modules[install_modules_n++];\n\tzabil('module__'+m,'<img src='+www_design+'img/ajax.gif>'+vzyal('module__'+m));\n\tmajax('module.php',{mod:'INSTALL',a:'testmod',module:m});\n}\nvar install_modules=[\".trim($im,',').\"];\n\nvar timestart;\nfunction dodo(module,allwork,time,skip,aram) {\n\tif(skip) {\n\t\tvar timenow = new Date();\n\t\tvar t=timenow.getTime()-timestart.getTime();\n\t\tvar e=parseInt((t/skip)*allwork)-t;\n\t\tzabilc('timet',' &nbsp; &nbsp; &nbsp; осталось: '+pr_time(e)+' сек');\n\t} else { timestart = new Date(); }\n\tvar ara={mod:'INSTALL',a:'do',module:module,allwork:allwork,time:time,skip:skip};\n\tif(typeof(aram)=='object') for(var i in aram) ara[i]=aram[i];\n\tmajax('module.php',ara);\n}\n\nfunction pr_time(t) { var N=new Date(); N.setTime(t); var s=pr00(N.getUTCSeconds());\n\tif(N.getUTCMinutes()) s=pr00(N.getUTCMinutes())+':'+s;\n\tif(N.getUTCHours()) s=pr00(N.getUTCHours())+':'+s;\n\treturn s;\n} function pr00(n){return ((''+n).length<2?'0'+n:n)}\n\n\npage_onstart.push('check_mod_do()');\n\n\");\n\n}\n\nreturn \"<table width=100% style='border: 1px dotted red'>\n<tr valign=top>\n\t<td>\n\t\t\n\t\t<div id='mesto_module'>$s</div>\n\t</td>\n\t<td width='100%'><div id='mesto_otvet'>\".admin_login().\"</div></td>\n</tr></table>\";\n\n}", "function pm_demo_install() {\t\t\n\t\t//create llog\n\t\t$array = array();\n\t\t//add log to database\n\t\tself::createLog($array);\n }", "function userclass2_adminlog($msg_num='00', $woffle='')\n{\n\te107::getAdminLog()->log_event('UCLASS_'.$msg_num,$woffle,E_LOG_INFORMATIVE,'');\n}", "function main() {\n\t\t// Initializes the module. Done in this function because we may need to re-initialize if data is submitted!\n\t\tglobal $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\t\t\n\t\t\n\t\t\n\t\tif (t3lib_div::_GP('submit')=='') {\n\t\t\t\n\t\t\t$extList = $this->getExtList();\n\t\t\t\n\t\t\t$option = '<option value=\"\">Select:</option>';\n\t\t\tforeach($extList AS $extItem){\n\t\t\t\t$option .= '<option value=\"'.$extItem.'\">'.$extItem.'</option>';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$content='<form>';\n\t\t\t$content.='<input type=\"hidden\" name=\"SET[function]\" value=\"tx_disckickstarter_modfunc1\">';\n\t\t\t$content.='<select name=\"actualkey\">';\n\t\t\t$content.=$option;\n\t\t\t$content.='</select>';\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$content.='Copy to key:<input name=\"newkey\">';\n\t\t\t$content.='<input type=\"submit\" name=\"submit\" value=\"do it\"></form>';\n\t\t\t\n\t\t\t$content .='<h3>What it does</h3><ul><li>All files and folders are copied to the new extension folder: typo3conf/ext/****</li>';\n\t\t\t$content .='<li>In every file the appearance of the extensionname is replaced:<ul><li>old_key -> new_key</li><li>tx_oldkey -> tx_newkey</li></ul></ul>';\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$actualkey=t3lib_div::_GP('actualkey');\n\t\t\t$newkey=t3lib_div::_GP('newkey');\n\t\t\tif (strcmp($newkey,'') && strcmp($actualkey,''))\t{\n\t\t\t\t//$from=t3lib_extMgm::extPath($actualkey);\n\t\t\t\t$from=PATH_site.'typo3conf/ext/'.$actualkey.'/';\n\t\t\t\t$to=PATH_site.'typo3conf/ext/'.$newkey.'/';\n\t\t\t\t$renames=array();\n\t\t\t\t$renames['tx_'.str_replace('_','',$actualkey)]='tx_'.str_replace('_','',$newkey);\n\t\t\t\t$renames[$actualkey]=$newkey;\n\t\t\t\t\n\t\t\t\t$content.='From: '.$from.' To:'.$to;\n\t\t\t\t\n\t\t\t\t$content.=$this->copyAllFilesWithRename($from,$to,$renames);\n\t\t\t\t$content.='<hr>';\n\t\t\t\tforeach($this->debug as $debug) {\n\t\t\t\t\t$content.=$debug.'<br>';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$content.='Please enter two valid Extensionkeys, and be sure that the actual extension is installed';\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t\n\t\t\n\t\t$theOutput.=$this->pObj->doc->spacer(5);\n\t\t$theOutput.=$this->pObj->doc->section($LANG->getLL(\"title\"),$content,0,1);\n\t\t\n\t\t\n\t\t/*\n\t\t$menu=array();\n\t\t$menu[]=t3lib_BEfunc::getFuncCheck($this->wizard->pObj->id,\"SET[tx_disckickstarter_modfunc1_check]\",$this->wizard->pObj->MOD_SETTINGS[\"tx_disckickstarter_modfunc1_check\"]).$LANG->getLL(\"checklabel\");\n\t\t$theOutput.=$this->pObj->doc->spacer(5);\n\t\t$theOutput.=$this->pObj->doc->section(\"Menu\",implode(\" - \",$menu),0,1);\n\t\t*/\n\t\t\n\t\t\n\t\treturn $theOutput;\n\t}", "function firephp_ep_log()\n{\n global $REX, $firephp;\n\n ob_start();\n\n if(!$firephp) {\n $firephp = firephp_init();\n }\n\n // EP LOG\n ////////////////////////////////////////////////////////////////////////////\n if(is_object($firephp))\n {\n if(isset($REX['EXTENSION_POINT_LOG']))\n {\n $focus = explode(',',$REX[\"ADDON\"][\"__firephp\"][\"settings\"][\"ep_log_focus\"]);\n if(count($focus)===1 && $focus[0]==''){\n $focus = null;\n }\n\n function focus_match($name,$focus){\n foreach($focus as $pattern){\n $pattern = str_replace('*','(.)*',$pattern);\n if(preg_match('/'.$pattern.'/',$name)){\n return true;\n }\n }\n return false;\n }\n\n $registered_eps = array();\n $table = array();\n $table[] = array('#','Type','Timing','ExtensionPoint','Callable','$subject','$params','$read_only','$REX[EXTENSIONS]','$result');\n\n foreach($REX['EXTENSION_POINT_LOG'] as $k=>$v)\n {\n $i = $k+1;\n switch($v['type'])\n {\n case'EP':\n if($focus!==null && (!in_array($v['name'],$focus) && focus_match($v['name'],$focus)===false) ) {\n break;\n }\n $registered_eps[] = $v['name'];\n $table[] = array($i,$v['type'],'–',$v['name'],'–',$v['$subject'],$v['$params'],$v['$read_only'],$v['$REX[EXTENSIONS]'],$v['$result']);\n break;\n\n case'EXT':\n if($focus!==null && (!in_array($v['name'],$focus) && focus_match($v['name'],$focus)===false) ) {\n break;\n }\n $timing = in_array($v['name'],$registered_eps) ? 'late' : 'ok';\n if(is_array($v['$callable']))\n {\n if(is_object($v['$callable'][0])){\n $v['$callable'][0] = get_class($v['$callable'][0]);\n }\n $v['$callable'] = implode('::',$v['$callable']);\n }\n $table[] = array($i,$v['type'],$timing,$v['name'],$v['$callable'],'–',$v['$params'],'–','–','–');\n break;\n }\n }\n\n $firephp->table('EP LOG ('.$i.' calls)',$table);\n }\n else\n {\n $firephp->warn('EP Log nicht verfügbar.. vermutl. ist die gepatchte Datei \"function_rex_extension.inc.php\" nicht installiert worden.');\n }\n }\n\n}", "function xoops_module_update_xortify(&$module) {\r\n\t\r\n\t$sql[] = \"CREATE TABLE `\".$GLOBALS['xoopsDB']->prefix('xortify_log').\"` (\r\n\t\t\t `lid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\r\n\t\t\t `uid` mediumint(8) unsigned NOT NULL DEFAULT '0',\r\n\t\t\t `uname` varchar(64) DEFAULT NULL,\r\n\t\t\t `email` varchar(255) DEFAULT NULL,\r\n\t\t\t `ip4` varchar(15) NOT NULL DEFAULT '0.0.0.0',\r\n\t\t\t `ip6` varchar(128) NOT NULL DEFAULT '0:0:0:0:0:0',\r\n\t\t\t `proxy-ip4` varchar(64) NOT NULL DEFAULT '0.0.0.0',\r\n\t\t\t `proxy-ip6` varchar(128) NOT NULL DEFAULT '0:0:0:0:0:0',\r\n\t\t\t `network-addy` varchar(255) NOT NULL DEFAULT '',\r\n\t\t\t `provider` varchar(128) NOT NULL DEFAULT '',\r\n\t\t\t `agent` varchar(255) NOT NULL DEFAULT '',\r\n\t\t\t `extra` text,\r\n\t\t\t `date` int(12) NOT NULL DEFAULT '0',\r\n\t\t\t `action` enum('banned','blocked','monitored') NOT NULL DEFAULT 'monitored',\r\n\t\t\t PRIMARY KEY (`lid`),\r\n\t\t\t KEY `uid` (`uid`),\r\n\t\t\t KEY `ip` (`ip4`,`ip6`(16),`proxy-ip4`,`proxy-ip6`(16)),\r\n\t\t\t KEY `provider` (`provider`(15)),\r\n\t\t\t KEY `date` (`date`),\r\n\t\t\t KEY `action` (`action`)\r\n\t\t\t) ENGINE=INNODB DEFAULT CHARSET=utf8\";\r\n\r\n\t$sql[] = \"CREATE TABLE `\".$GLOBALS['xoopsDB']->prefix('xortify_servers').\"` (\r\n\t\t\t `sid` mediumint(32) unsigned NOT NULL AUTO_INCREMENT,\r\n\t\t\t `server` varchar(255) NOT NULL DEFAULT '',\r\n\t\t\t `replace` varchar(255) NOT NULL DEFAULT '',\r\n\t\t\t `search` varchar(64) NOT NULL DEFAULT '',\r\n\t\t\t `online` tinyint(1) DEFAULT '0',\r\n\t\t\t `polled` int(12) NOT NULL DEFAULT '0',\r\n\t\t\t `user` varchar(64) NOT NULL DEFAULT '',\r\n\t\t\t `pass` varchar(32) NOT NULL DEFAULT '',\r\n\t\t\t PRIMARY KEY (`sid`)\r\n\t\t\t) ENGINE=INNODB DEFAULT CHARSET=utf8\";\r\n\t\r\n\r\n\t$sql[] = \"CREATE TABLE `\".$GLOBALS['xoopsDB']->prefix('xortify_emails').\"` (\r\n\t\t\t`eid` mediumint(32) unsigned NOT NULL AUTO_INCREMENT,\r\n\t\t\t`email` varchar(255) NOT NULL DEFAULT '',\r\n\t\t\t`uid` int(13) NOT NULL DEFAULT '0',\r\n\t\t\t`count` int(26) NOT NULL DEFAULT '1',\r\n\t\t\t`encounter` int(13) NOT NULL DEFAULT '0',\r\n\t\t\tPRIMARY KEY (`eid`)\r\n\t\t\t) ENGINE=INNODB DEFAULT CHARSET=utf8\";\r\n\t\r\n\t$sql[] = \"CREATE TABLE `\".$GLOBALS['xoopsDB']->prefix('xortify_emails_links').\"` (\r\n\t\t\t`elid` mediumint(64) unsigned NOT NULL AUTO_INCREMENT,\r\n\t\t\t`eid` mediumint(32) unsigned NOT NULL DEFAULT '0',\r\n\t\t\t`uid` int(13) NOT NULL DEFAULT '0',\r\n\t\t\t`ip` varchar(128) NOT NULL DEFAULT '127.0.0.1',\r\n\t\t\tPRIMARY KEY (`elid`)\r\n\t\t\t) ENGINE=INNODB DEFAULT CHARSET=utf8\";\r\n\t\t\t\t\r\n\tforeach($sql as $id => $question)\r\n\t\tif ($GLOBALS['xoopsDB']->queryF($question))\r\n\t\t\txoops_error($question, 'SQL Executed Successfully!!!');\r\n\t\t\t\r\n\txoops_load(\"xoopscache\");\t\r\n\t$GLOBALS['xoopsCache']->delete('xortify_bans_protector');\r\n\t\r\n\tif (defined('XORTIFY_INSTANCE_KEY'))\r\n\t\tif (strlen(constant('XORTIFY_INSTANCE_KEY'))==0 ||\r\n\t\t\t\tconstant('XORTIFY_INSTANCE_KEY')=='00000-00000-00000-00000-00000') {\r\n\t\t\tinclude_once $GLOBALS['xoops']->path('/modules/xortify/include/functions.php');\r\n\t\t\t$key = md5(XOOPS_LICENSE_KEY . microtime(true) . XOOPS_ROOT_PATH . XOOPS_VAR_PATH . XOOPS_DB_HOST . XOOPS_DB_NAME . XOOPS_DB_PREFIX . XOOPS_DB_USER . XOOPS_DB_PASS);\r\n\t\t\t$start = mt_rand(0, 31-25);\r\n\t\t\tif ($pos==5&&$i<24) {\r\n\t\t\t\t$instance .= mt_rand(0,3)<2?strtolower($key[$start+$i]):strtoupper($key[$start+$i]);\r\n\t\t\t\t$pos++;\r\n\t\t\t\tif ($pos==5) {\r\n\t\t\t\t\t$pos=0;\r\n\t\t\t\t\t$instance .= '-';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (writeInstanceKey($instance)==false) {\r\n\t\t\t\txoops_error(_XOR_MI_XORTIFY_INSTANCE_KEY_WASNOTWRITTEN);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t$module_handler =& xoops_gethandler('module');\r\n\t$config_handler =& xoops_gethandler('config');\r\n\t$configitem_handler =& xoops_gethandler('configitem');\r\n\tif (!is_object($GLOBALS['protector']))\r\n\t\t$GLOBALS['protector'] = $module_handler->getByDirname('protector');\r\n\t\r\n\tif (!empty($GLOBALS['protector'])) {\r\n\t\r\n\t\t$criteria = new CriteriaCompo(new Criteria('conf_modid', $GLOBALS['protector']->getVar('mid')));\r\n\t\t$criteria->add(new Criteria('conf_name', 'contami_action'));\r\n\t\t$GLOBALS['protectorConfig'] = $configitem_handler->getObjects($criteria);\r\n\t\tif (isset($GLOBALS['protectorConfig'][0])) {\r\n\t\t\t$GLOBALS['protectorConfig'][0]->setVar('conf_value', 15);\r\n\t\t\t$configitem_handler->insert($GLOBALS['protectorConfig'][0], true);\r\n\t\t}\r\n\t\r\n\t\r\n\t\t$criteria = new CriteriaCompo(new Criteria('conf_modid', $GLOBALS['protector']->getVar('mid')));\r\n\t\t$criteria->add(new Criteria('conf_name', 'isocom_action'));\r\n\t\t$GLOBALS['protectorConfig'] = $configitem_handler->getObjects($criteria);\r\n\t\tif (isset($GLOBALS['protectorConfig'][0])) {\r\n\t\t\t$GLOBALS['protectorConfig'][0]->setVar('conf_value', 15);\r\n\t\t\t$configitem_handler->insert($GLOBALS['protectorConfig'][0], true);\r\n\t\t}\r\n\t\r\n\t\r\n\t\t$criteria = new CriteriaCompo(new Criteria('conf_modid', $GLOBALS['protector']->getVar('mid')));\r\n\t\t$criteria->add(new Criteria('conf_name', 'union_action'));\r\n\t\t$GLOBALS['protectorConfig'] = $configitem_handler->getObjects($criteria);\r\n\t\tif (isset($GLOBALS['protectorConfig'][0])) {\r\n\t\t\t$GLOBALS['protectorConfig'][0]->setVar('conf_value', 15);\r\n\t\t\t$configitem_handler->insert($GLOBALS['protectorConfig'][0], true);\r\n\t\t}\r\n\t\r\n\t\r\n\t\t$criteria = new CriteriaCompo(new Criteria('conf_modid', $GLOBALS['protector']->getVar('mid')));\r\n\t\t$criteria->add(new Criteria('conf_name', 'dos_craction'));\r\n\t\t$GLOBALS['protectorConfig'] = $configitem_handler->getObjects($criteria);\r\n\t\tif (isset($GLOBALS['protectorConfig'][0])) {\r\n\t\t\t$GLOBALS['protectorConfig'][0]->setVar('conf_value', 'bip');\r\n\t\t\t$configitem_handler->insert($GLOBALS['protectorConfig'][0], true);\r\n\t\t}\r\n\t\r\n\t\t$criteria = new CriteriaCompo(new Criteria('conf_modid', $GLOBALS['protector']->getVar('mid')));\r\n\t\t$criteria->add(new Criteria('conf_name', 'stopforumspam_action'));\r\n\t\t$GLOBALS['protectorConfig'] = $configitem_handler->getObjects($criteria);\r\n\t\tif (isset($GLOBALS['protectorConfig'][0])) {\r\n\t\t\t$GLOBALS['protectorConfig'][0]->setVar('conf_value', 'bip');\r\n\t\t\t$configitem_handler->insert($GLOBALS['protectorConfig'][0], true);\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn true;\t\t\t\t\r\n}", "function get_admin_log_action($logitem)\n{\n\tglobal $lang, $plugins, $mybb;\n\n\t$logitem['module'] = str_replace('/', '-', $logitem['module']);\n\tlist($module, $action) = explode('-', $logitem['module']);\n\t$lang_string = 'admin_log_'.$module.'_'.$action.'_'.$logitem['action'];\n\n\t// Specific page overrides\n\tswitch($lang_string)\n\t{\n\t\t// == CONFIG ==\n\t\tcase 'admin_log_config_banning_add': // Banning IP/Username/Email\n\t\tcase 'admin_log_config_banning_delete': // Removing banned IP/username/emails\n\t\t\tswitch($logitem['data'][2])\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\t$lang_string = 'admin_log_config_banning_'.$logitem['action'].'_ip';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$lang_string = 'admin_log_config_banning_'.$logitem['action'].'_username';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$lang_string = 'admin_log_config_banning_'.$logitem['action'].'_email';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'admin_log_config_help_documents_add': // Help documents and sections\n\t\tcase 'admin_log_config_help_documents_edit':\n\t\tcase 'admin_log_config_help_documents_delete':\n\t\t\t$lang_string .= \"_{$logitem['data'][2]}\"; // adds _section or _document\n\t\t\tbreak;\n\n\t\tcase 'admin_log_config_languages_edit': // Editing language variables\n\t\t\t$logitem['data'][1] = basename($logitem['data'][1]);\n\t\t\tif($logitem['data'][2] == 1)\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_config_languages_edit_admin';\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'admin_log_config_mycode_toggle_status': // Custom MyCode toggle activation\n\t\t\tif($logitem['data'][2] == 1)\n\t\t\t{\n\t\t\t\t$lang_string .= '_enabled';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$lang_string .= '_disabled';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'admin_log_config_plugins_activate': // Installing plugin\n\t\t\tif($logitem['data'][1])\n\t\t\t{\n\t\t\t\t$lang_string .= '_install';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'admin_log_config_plugins_deactivate': // Uninstalling plugin\n\t\t\tif($logitem['data'][1])\n\t\t\t{\n\t\t\t\t$lang_string .= '_uninstall';\n\t\t\t}\n\t\t\tbreak;\n\t\t// == FORUM ==\n\t\tcase 'admin_log_forum_attachments_delete': // Deleting attachments\n\t\t\tif($logitem['data'][2])\n\t\t\t{\n\t\t\t\t$lang_string .= '_post';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'admin_log_forum_management_copy': // Forum copy\n\t\t\tif($logitem['data'][4])\n\t\t\t{\n\t\t\t\t$lang_string .= '_with_permissions';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'admin_log_forum_management_': // add mod, permissions, forum orders\n\t\t\t// first parameter already set with action\n\t\t\t$lang_string .= $logitem['data'][0];\n\t\t\tif($logitem['data'][0] == 'orders' && $logitem['data'][1])\n\t\t\t{\n\t\t\t\t$lang_string .= '_sub'; // updating forum orders in a subforum\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'admin_log_forum_moderation_queue_': //moderation queue\n\t\t\t// first parameter already set with action\n\t\t\t$lang_string .= $logitem['data'][0];\n\t\t\tbreak;\n\t\t// == HOME ==\n\t\tcase 'admin_log_home_preferences_': // 2FA\n\t\t\t$lang_string .= $logitem['data'][0]; // either \"enabled\" or \"disabled\"\n\t\t\tbreak;\n\t\t// == STYLE ==\n\t\tcase 'admin_log_style_templates_delete_template': // deleting templates\n\t\t\t// global template set\n\t\t\tif($logitem['data'][2] == -1)\n\t\t\t{\n\t\t\t\t$lang_string .= '_global';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'admin_log_style_templates_edit_template': // editing templates\n\t\t\t// global template set\n\t\t\tif($logitem['data'][2] == -1)\n\t\t\t{\n\t\t\t\t$lang_string .= '_global';\n\t\t\t}\n\t\t\tbreak;\n\t\t// == TOOLS ==\n\t\tcase 'admin_log_tools_adminlog_prune': // Admin Log Pruning\n\t\t\tif($logitem['data'][1] && !$logitem['data'][2])\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_tools_adminlog_prune_user';\n\t\t\t}\n\t\t\telseif($logitem['data'][2] && !$logitem['data'][1])\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_tools_adminlog_prune_module';\n\t\t\t}\n\t\t\telseif($logitem['data'][1] && $logitem['data'][2])\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_tools_adminlog_prune_user_module';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'admin_log_tools_modlog_prune': // Moderator Log Pruning\n\t\t\tif($logitem['data'][1] && !$logitem['data'][2])\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_tools_modlog_prune_user';\n\t\t\t}\n\t\t\telseif($logitem['data'][2] && !$logitem['data'][1])\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_tools_modlog_prune_forum';\n\t\t\t}\n\t\t\telseif($logitem['data'][1] && $logitem['data'][2])\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_tools_modlog_prune_user_forum';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'admin_log_tools_backupdb_backup': // Create backup\n\t\t\tif($logitem['data'][0] == 'download')\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_tools_backupdb_backup_download';\n\t\t\t}\n\t\t\t$logitem['data'][1] = '...'.substr($logitem['data'][1], -20);\n\t\t\tbreak;\n\t\tcase 'admin_log_tools_backupdb_dlbackup': // Download backup\n\t\t\t$logitem['data'][0] = '...'.substr($logitem['data'][0], -20);\n\t\t\tbreak;\n\t\tcase 'admin_log_tools_backupdb_delete': // Delete backup\n\t\t\t$logitem['data'][0] = '...'.substr($logitem['data'][0], -20);\n\t\t\tbreak;\n\t\tcase 'admin_log_tools_optimizedb_': // Optimize DB\n\t\t\t$logitem['data'][0] = @implode(', ', my_unserialize($logitem['data'][0]));\n\t\t\tbreak;\n\t\tcase 'admin_log_tools_recount_rebuild_': // Recount and rebuild\n\t\t\t$detail_lang_string = $lang_string.$logitem['data'][0];\n\t\t\tif(isset($lang->$detail_lang_string))\n\t\t\t{\n\t\t\t\t$lang_string = $detail_lang_string;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'admin_log_tools_spamlog_prune': // Spam Log Pruning\n\t\t\tif($logitem['data'][1] && !$logitem['data'][2])\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_tools_spamlog_prune_user';\n\t\t\t}\n\t\t\telseif($logitem['data'][2] && !$logitem['data'][1])\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_tools_spamlog_prune_email';\n\t\t\t}\n\t\t\telseif($logitem['data'][1] && $logitem['data'][2])\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_tools_spamlog_prune_user_email';\n\t\t\t}\n\t\t\tbreak;\n\t\t// == USERS ==\n\t\tcase 'admin_log_user_admin_permissions_edit': // editing default/group/user admin permissions\n\t\t\tif($logitem['data'][0] > 0)\n\t\t\t{\n\t\t\t\t// User\n\t\t\t\t$lang_string .= '_user';\n\t\t\t}\n\t\t\telseif($logitem['data'][0] < 0)\n\t\t\t{\n\t\t\t\t// Group\n\t\t\t\t$logitem['data'][0] = abs($logitem['data'][0]);\n\t\t\t\t$lang_string .= '_group';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'admin_log_user_admin_permissions_delete': // deleting group/user admin permissions\n\t\t\tif($logitem['data'][0] > 0)\n\t\t\t{\n\t\t\t\t// User\n\t\t\t\t$lang_string .= '_user';\n\t\t\t}\n\t\t\telseif($logitem['data'][0] < 0)\n\t\t\t{\n\t\t\t\t// Group\n\t\t\t\t$logitem['data'][0] = abs($logitem['data'][0]);\n\t\t\t\t$lang_string .= '_group';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'admin_log_user_awaiting_activation_activate':\n\t\t\tif($logitem['data'][0] == 'deleted')\n\t\t\t{\n\t\t\t\t$lang_string .= '_deleted';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$lang_string .= '_activated';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'admin_log_user_banning_': // banning\n\t\t\tif($logitem['data'][2] == 0)\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_user_banning_add_permanent';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$logitem['data'][2] = my_date($mybb->settings['dateformat'], $logitem['data'][2]);\n\t\t\t\t$lang_string = 'admin_log_user_banning_add_temporary';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'admin_log_user_groups_join_requests':\n\t\t\tif($logitem['data'][0] == 'approve')\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_user_groups_join_requests_approve';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_user_groups_join_requests_deny';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'admin_log_user_users_inline_banned':\n\t\t\tif($logitem['data'][1] == 0)\n\t\t\t{\n\t\t\t\t$lang_string = 'admin_log_user_users_inline_banned_perm';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$logitem['data'][1] = my_date($mybb->settings['dateformat'], $logitem['data'][1]);\n\t\t\t\t$lang_string = 'admin_log_user_users_inline_banned_temp';\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\t$plugin_array = array('logitem' => &$logitem, 'lang_string' => &$lang_string);\n\t$plugins->run_hooks(\"admin_tools_get_admin_log_action\", $plugin_array);\n\n foreach($logitem['data'] as $key => $value)\n {\n $logitem['data'][$key] = htmlspecialchars_uni($value);\n }\n\n\tif(isset($lang->$lang_string))\n\t{\n\t\tarray_unshift($logitem['data'], $lang->$lang_string); // First parameter for sprintf is the format string\n\t\t$string = call_user_func_array(array($lang, 'sprintf'), $logitem['data']);\n\t\tif(!$string)\n\t\t{\n\t\t\t$string = $lang->$lang_string; // Fall back to the one in the language pack\n\t\t}\n\t}\n\telse\n\t{\n\t\tif(isset($logitem['data']['type']) && $logitem['data']['type'] == 'admin_locked_out')\n\t\t{\n\t\t\t$string = $lang->sprintf($lang->admin_log_admin_locked_out, (int) $logitem['data']['uid'], htmlspecialchars_uni($logitem['data']['username']));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Build a default string\n\t\t\t$string = $logitem['module'].' - '.$logitem['action'];\n\t\t\tif(is_array($logitem['data']) && count($logitem['data']) > 0)\n\t\t\t{\n\t\t\t\t$string .= '('.implode(', ', $logitem['data']).')';\n\t\t\t}\n\t\t}\n\t}\n\treturn $string;\n}", "function harvest_debug( $log ) {\n\tadd_action( 'admin_notices', function( $log ){\n\t\techo '<div class=\"error\"><p><code>'. $log .'</code></p></div>';\n\t} );\n}", "function changeLogs() {\n\n }", "protected function AutoLog(){\r\n \r\n //DEPRECATED for test\r\n \r\n }", "function upload_GenLicenceMod(){\n\n\tif(!extension_loaded('php_fidelylic'))\n\t\t//dl('php_fidelylic.dll');\n\t$module = 'php_fidelylic';\n\tif (extension_loaded($module))\n\t\t $str = \"module loaded\";\n\telse\n\t\t$str = \"Module $module is not compiled into PHP\";\n\n}", "public function initModuleCode() {\n $this->module_code = 'wk_pricealert';\n }", "function log_event($action) {\n\t$now = new DateTime();\t\n\tfile_put_contents(WP_PLUGIN_DIR.\"/StandardsReader/cron_log.txt\", \"|\" . $now->format('Y-m-d H:i:s') . \" \". $action . \"\\r\\n\", FILE_APPEND | LOCK_EX);\n}", "function logAction($action) {\n\tglobal $dbLog;\n\n\t$dbLog->exec('INSERT INTO log (descripcion) VALUES (\"'.$action.'\")');\n}", "function upgrade_550()\n {\n }", "function admin_modify() {\r\n\t\tglobal $wpdb, $current_user;\r\n\r\n\t\tif ( !is_super_admin() ) {\r\n\t\t\techo \"<p>\" . __('Nice Try...', 'psts') . \"</p>\"; //If accessed properly, this message doesn't appear.\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//add manual log entries\r\n\t\tif ( isset($_POST['log_entry']) ) {\r\n\t\t\t$this->log_action( (int)$_GET['bid'], $current_user->display_name . ': \"' . strip_tags(stripslashes($_POST['log_entry'])) . '\"' );\r\n\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Log entry added.', 'psts').'</p></div>';\r\n\t\t}\r\n\t\t\t\t\r\n //extend blog\r\n if ( isset($_POST['psts_extend']) ) {\r\n check_admin_referer('psts_extend'); //check nonce\r\n\r\n if ( isset($_POST['extend_permanent']) ) {\r\n $extend = 9999999999;\r\n } else {\r\n\t\t\t\t$months = $_POST['extend_months'];\r\n\t\t\t\t$days = $_POST['extend_days'];\r\n\t\t\t\t$extend = strtotime(\"+$months Months $days Days\") - time();\r\n\t\t\t}\r\n\t\t\t$this->extend((int)$_POST['bid'], $extend, __('Manual', 'psts'), $_POST['extend_level']);\r\n\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Site Extended.', 'psts').'</p></div>';\r\n\t\t}\t\t\r\n\t\t\t\r\n\t\tif ( isset($_POST['psts_transfer_pro']) ) {\r\n\t\t\t$new_bid = (int)$_POST['new_bid'];\r\n\t\t\t$current_bid = (int)$_GET['bid'];\r\n\t\t\tif ( !$new_bid ) {\r\n\t\t\t\techo '<div id=\"message\" class=\"error\"><p>'.__('Please enter the Blog ID of a site to transfer too.', 'psts').'</p></div>';\r\n\t\t\t} else if ( is_pro_site($new_bid) ) {\r\n\t\t\t\techo '<div id=\"message\" class=\"error\"><p>'.__('Could not transfer Pro Status: The chosen site already is a Pro Site. You must remove Pro status and cancel any existing subscriptions tied to that site.', 'psts').'</p></div>';\r\n\t\t\t} else {\r\n\t\t\t\t$current_level = $wpdb->get_row(\"SELECT * FROM {$wpdb->base_prefix}pro_sites WHERE blog_ID = '$current_bid'\");\r\n\t\t\t\t$new_expire = $current_level->expire - time();\r\n\t\t\t\t$this->extend($new_bid, $new_expire, $current_level->gateway, $current_level->level, $current_level->amount);\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->base_prefix}pro_sites SET term = '{$current_level->term}' WHERE blog_ID = '$new_bid'\");\r\n\t\t\t\t$this->withdraw($current_bid);\r\n\t\t\t\t$this->log_action( $current_bid, sprintf(__('Pro Status transferred by %s to BlogID: %d', 'psts'), $current_user->display_name, $new_bid) );\r\n\t\t\t\t$this->log_action( $new_bid, sprintf(__('Pro Status transferred by %s from BlogID: %d', 'psts'), $current_user->display_name, $current_bid) );\r\n\t\t\t\tdo_action('psts_transfer_pro', $current_bid, $new_bid); //for gateways to hook into for api calls, etc.\r\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.sprintf(__('Pro Status transferred to BlogID: %d', 'psts'), (int)$_POST['new_bid']).'</p></div>';\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\t//remove blog\r\n if ( isset($_POST['psts_modify']) ) {\r\n check_admin_referer('psts_modify'); //check nonce\r\n\r\n do_action('psts_modify_process', (int)$_POST['bid']);\r\n\r\n if ( isset($_POST['psts_remove']) ) {\r\n $this->withdraw((int)$_POST['bid']);\r\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Pro Site Status Removed.', 'psts').'</p></div>';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( isset($_POST['psts_receipt']) ) {\r\n $this->email_notification((int)$_POST['bid'], 'receipt', $_POST['receipt_email']);\r\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Email receipt sent.', 'psts').'</p></div>';\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t\t\r\n\t\t//check blog_id\r\n\t\tif( isset( $_GET['bid'] ) ) {\r\n\t\t\t$blog_count = $wpdb->get_var(\"SELECT COUNT(*) FROM {$wpdb->base_prefix}blogs WHERE blog_ID = '\" . (int)$_GET['bid'] . \"'\");\r\n\t\t\tif ( !$blog_count ) {\r\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>'.__('Invalid blog ID. Please try again.', 'psts').'</p></div>';\r\n \t\t$blog_id = false;\r\n\t\t\t} else {\r\n\t\t\t\t$blog_id = (int)$_GET['bid'];\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$blog_id = false;\r\n\t\t}\r\n\r\n\t\t?>\r\n\t\t<div class=\"wrap\">\r\n\t\t<script type=\"text/javascript\">\r\n \t jQuery(document).ready(function () {\r\n \t\t jQuery('input.psts_confirm').click(function() {\r\n var answer = confirm(\"<?php _e('Are you sure you really want to do this?', 'psts'); ?>\")\r\n if (answer){\r\n return true;\r\n } else {\r\n return false;\r\n };\r\n });\r\n \t\t});\r\n \t</script>\r\n \t<div class=\"icon32\"><img src=\"<?php echo $this->plugin_url . 'images/modify.png'; ?>\" /></div>\r\n <h2><?php _e('Pro Sites Management', 'psts'); ?></h2>\r\n\r\n <?php if ( $blog_id ) { ?>\r\n \t<h3><?php _e('Manage Site', 'psts') ?>\r\n\t\t\t<?php\r\n if ($name = get_blog_option($blog_id, 'blogname'))\r\n echo ': '.$name.' (Blog ID: '.$blog_id.')';\r\n\r\n echo '</h3>';\r\n\r\n \t\t$levels = (array)get_site_option('psts_levels');\r\n \t\t$current_level = $this->get_level($blog_id);\r\n $expire = $this->get_expire($blog_id);\r\n $result = $wpdb->get_row(\"SELECT * FROM {$wpdb->base_prefix}pro_sites WHERE blog_ID = '$blog_id'\");\r\n if ($result) {\r\n\t\t\t\tif ($result->term == 1 || $result->term == 3 || $result->term == 12)\r\n\t $term = sprintf(__('%s Month', 'psts'), $result->term);\r\n\t else\r\n\t $term = $result->term;\r\n\t\t\t} else {\r\n\t\t\t\t$term = 0;\r\n\t\t\t}\r\n\r\n if ($expire && $expire > time()) {\r\n echo '<p><strong>'.__('Current Pro Site', 'psts').'</strong></p>';\r\n\r\n echo '<ul>';\r\n\t\t\t\tif ($expire > 2147483647)\r\n\t\t\t\t\techo '<li>'.__('Pro Site privileges will expire: <strong>Never</strong>', 'psts').'</li>';\r\n\t\t\t\telse\r\n \techo '<li>'.sprintf(__('Pro Site privileges will expire on: <strong>%s</strong>', 'psts'), date_i18n(get_option('date_format'), $expire)).'</li>';\r\n\r\n echo '<li>'.sprintf(__('Level: <strong>%s</strong>', 'psts'), $current_level . ' - ' . @$levels[$current_level]['name']).'</li>';\r\n if ($result->gateway)\r\n\t\t\t\t\techo '<li>'.sprintf(__('Payment Gateway: <strong>%s</strong>', 'psts'), $result->gateway).'</li>';\r\n if ($term)\r\n \techo '<li>'.sprintf(__('Payment Term: <strong>%s</strong>', 'psts'), $term).'</li>';\r\n echo '</ul>';\r\n\r\n } else if ($expire && $expire <= time()) {\r\n echo '<p><strong>'.__('Expired Pro Site', 'psts').'</strong></p>';\r\n\r\n echo '<ul>';\r\n echo '<li>'.sprintf(__('Pro Site privileges expired on: <strong>%s</strong>', 'psts'), date_i18n(get_option('date_format'), $expire)).'</li>';\r\n\r\n echo '<li>'.sprintf(__('Previous Level: <strong>%s</strong>', 'psts'), $current_level . ' - ' . @$levels[$current_level]['name']).'</li>';\r\n if ($result->gateway)\r\n\t\t\t\t\techo '<li>'.sprintf(__('Previous Payment Gateway: <strong>%s</strong>', 'psts'), $result->gateway).'</li>';\r\n if ($term)\r\n\t\t\t\t\techo '<li>'.sprintf(__('Previous Payment Term: <strong>%s</strong>', 'psts'), $term).'</li>';\r\n echo '</ul>';\r\n\r\n } else {\r\n echo '<p><strong>\"'.get_blog_option($blog_id, 'blogname').'\" '.__('has never been a Pro Site.', 'psts').'</strong></p>';\r\n }\r\n\r\n\t\t//meta boxes hooked by gateway plugins\r\n if ( has_action('psts_subscription_info') || has_action('psts_subscriber_info') ) { ?>\r\n <div class=\"metabox-holder\">\r\n <?php if ( has_action('psts_subscription_info') ) { ?>\r\n\t\t\t<div style=\"width: 49%;\" class=\"postbox-container\">\r\n <div class=\"postbox\">\r\n <h3 class='hndle'><span><?php _e('Subscription Information', 'psts'); ?></span></h3>\r\n <div class=\"inside\">\r\n <?php do_action('psts_subscription_info', $blog_id); ?>\r\n </div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<?php } ?>\r\n\r\n <?php if ( has_action('psts_subscriber_info') ) { ?>\r\n <div style=\"width: 49%;margin-left: 2%;\" class=\"postbox-container\">\r\n <div class=\"postbox\">\r\n <h3 class='hndle'><span><?php _e('Subscriber Information', 'psts'); ?></span></h3>\r\n <div class=\"inside\">\r\n \t<?php do_action('psts_subscriber_info', $blog_id); ?>\r\n </div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<?php } ?>\r\n\r\n <div class=\"clear\"></div>\r\n </div>\r\n <?php } ?>\r\n\r\n\t <div id=\"poststuff\" class=\"metabox-holder\">\r\n\t <div class=\"postbox\">\r\n\t <h3 class='hndle'><span><?php _e('Account History', 'psts') ?></span></h3>\r\n\t <div class=\"inside\">\r\n\t <span class=\"description\"><?php _e('This logs basically every action done in the system regarding the site for an audit trail.', 'psts'); ?></span>\r\n\t <div style=\"height:150px;overflow:auto;margin-top:5px;margin-bottom:5px;\">\r\n\t <table class=\"widefat\">\r\n\t <?php\r\n\t $log = get_blog_option($blog_id, 'psts_action_log');\r\n\t if (is_array($log) && count($log)) {\r\n\t $log = array_reverse($log, true);\r\n\t foreach ($log as $timestamp => $memo) {\r\n\t $class = (isset($class) && $class == 'alternate') ? '' : 'alternate';\r\n\t echo '<tr class=\"'.$class.'\"><td><strong>' . date_i18n( __('Y-m-d g:i:s a', 'psts'), $timestamp ) . '</strong></td><td>' . esc_html($memo) . '</td></tr>';\r\n\t\t\t\t\t\t\t\t}\r\n\t } else {\r\n\t echo '<tr><td colspan=\"2\">'.__('No history recorded for this site yet.', 'psts').'</td></tr>';\r\n\t }\r\n\t\t\t\t\t\t\t?>\r\n\t </table>\r\n\t </div>\r\n\t\t\t\t\t<form method=\"post\" action=\"\">\r\n\t\t\t\t\t\t<input type=\"text\" placeholder=\"Add a custom log entry...\" name=\"log_entry\" style=\"width:91%;\" /> <input type=\"submit\" class=\"button-secondary\" name=\"add_log_entry\" value=\"<?php _e('Add &raquo;', 'psts') ?>\" style=\"width:8%;float:right;\" />\r\n\t\t\t\t\t</form>\r\n\t </div>\r\n\t </div>\r\n\t </div>\r\n\r\n\r\n <div id=\"poststuff\" class=\"metabox-holder\">\r\n\r\n <div style=\"width: 49%;\" class=\"postbox-container\">\r\n <div class=\"postbox\">\r\n\t\t <h3 class='hndle'><span><?php _e('Manually Extend Pro Site Status', 'psts') ?></span></h3>\r\n\t\t <div class=\"inside\">\r\n\t\t <span class=\"description\"><?php _e('Please note that these changes will not adjust the payment dates or level for any existing subscription.', 'psts'); ?></span>\r\n\t\t <form method=\"post\" action=\"\">\r\n\t\t <table class=\"form-table\">\r\n\t\t <?php wp_nonce_field('psts_extend') ?>\r\n\t\t <input type=\"hidden\" name=\"bid\" value=\"<?php echo $blog_id; ?>\" />\r\n\t\t <tr valign=\"top\">\r\n\t\t <th scope=\"row\"><?php _e('Period', 'psts') ?></th>\r\n\t\t <td><select name=\"extend_months\">\r\n\t\t \t<?php\r\n\t\t \t\tfor ( $counter = 0; $counter <= 36; $counter += 1) {\r\n\t\t echo '<option value=\"' . $counter . '\">' . $counter . '</option>' . \"\\n\";\r\n\t\t \t\t}\r\n\t\t ?>\r\n\t\t </select><?php _e('Months', 'psts'); ?>\r\n\t\t <select name=\"extend_days\">\r\n\t\t \t<?php\r\n\t\t \t\tfor ( $counter = 0; $counter <= 30; $counter += 1) {\r\n\t\t echo '<option value=\"' . $counter . '\">' . $counter . '</option>' . \"\\n\";\r\n\t\t \t\t}\r\n\t\t ?>\r\n\t\t </select><?php _e('Days', 'psts'); ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php _e('or', 'psts'); ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n\t\t <label><input type=\"checkbox\" name=\"extend_permanent\" value=\"1\" /> <?php _e('Permanent', 'psts'); ?></label>\r\n\t\t <br /><?php _e('Period you wish to extend the site. Leave at zero to only change the level.', 'psts'); ?></td>\r\n\t\t </tr>\r\n\t\t <tr valign=\"top\">\r\n\t\t <th scope=\"row\"><?php _e('Level', 'psts') ?></th>\r\n\t\t <td><select name=\"extend_level\">\r\n\t\t \t<?php\r\n \t\tforeach ($levels as $level => $value) {\r\n\t\t\t\t\t\t\t\t?><option value=\"<?php echo $level; ?>\"<?php selected($current_level, $level) ?>><?php echo $level . ': ' . esc_attr($value['name']); ?></option><?php\r\n\t\t\t\t\t\t\t}\r\n\t\t ?>\r\n\t\t </select>\r\n\t\t <br /><?php _e('Choose what level the site should have access to.', 'psts'); ?></td>\r\n\t\t </tr>\r\n\t\t <tr valign=\"top\">\r\n\t\t\t\t\t\t\t<td colspan=\"2\" style=\"text-align:right;\"><input class=\"button-primary\" type=\"submit\" name=\"psts_extend\" value=\"<?php _e('Extend &raquo;', 'psts') ?>\" /></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t </table>\r\n\t\t\t\t\t<hr />\r\n\t\t <table class=\"form-table\">\r\n\t\t <tr valign=\"top\">\r\n\t\t\t\t\t\t\t<td><label>Transfer Pro status to Blog ID: <input type=\"text\" name=\"new_bid\" size=\"3\" /></label></td>\r\n\t\t\t\t\t\t\t<td style=\"text-align:right;\"><input class=\"button-primary psts_confirm\" type=\"submit\" name=\"psts_transfer_pro\" value=\"<?php _e('Transfer &raquo;', 'psts') ?>\" /></td>\r\n\t\t\t\t\t\t</tr>\r\n\t\t </table>\r\n\t\t </form>\r\n\t\t </div>\r\n\t\t\t</div>\r\n\t </div>\r\n\r\n <?php if ( is_pro_site($blog_id) || has_action('psts_modify_form') ) { ?>\r\n\t <div style=\"width: 49%;margin-left: 2%;\" class=\"postbox-container\">\r\n\t <div class=\"postbox\">\r\n\t <h3 class='hndle'><span><?php _e('Modify Pro Site Status', 'psts') ?></span></h3>\r\n\t <div class=\"inside\">\r\n\t <form method=\"post\" action=\"\">\r\n\t <?php wp_nonce_field('psts_modify') ?>\r\n\t\t\t\t\t<input type=\"hidden\" name=\"bid\" value=\"<?php echo $blog_id; ?>\" />\r\n\r\n <?php do_action('psts_modify_form', $blog_id); ?>\r\n\r\n\t\t\t\t\t<?php if ( is_pro_site($blog_id) ) { ?>\r\n <p><label><input type=\"checkbox\" name=\"psts_remove\" value=\"1\" /> <?php _e('Remove Pro status from this site.', 'psts'); ?></label></p>\r\n\t \t\t<?php } ?>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<?php if ($last_payment = $this->last_transaction($blog_id)) { ?>\r\n\t\t\t\t\t<p><label><input type=\"checkbox\" name=\"psts_receipt\" value=\"1\" /> <?php _e('Email a receipt copy for last payment to:', 'psts'); ?> <input type=\"text\" name=\"receipt_email\" value=\"<?php echo get_blog_option($blog_id, 'admin_email'); ?>\" /></label></p>\r\n\t\t\t\t\t<?php } ?>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<p class=\"submit\">\r\n\t <input type=\"submit\" name=\"psts_modify\" class=\"button-primary psts_confirm\" value=\"<?php _e('Modify &raquo;', 'psts') ?>\" />\r\n\t </p>\r\n\t </form>\r\n\t </div>\r\n\t </div>\r\n\t </div>\r\n <?php } ?>\r\n </div>\r\n <?php\r\n\r\n\t\t//show blog_id form\r\n } else {\r\n ?>\r\n <div class=\"metabox-holder\">\r\n\t <div class=\"postbox\">\r\n\t <h3 class='hndle'><span><?php _e('Manage a Site', 'psts') ?></span></h3>\r\n\t <div class=\"inside\">\r\n\t <form method=\"get\" action=\"\">\r\n\t <table class=\"form-table\">\r\n\t <input type=\"hidden\" name=\"page\" value=\"psts\" />\r\n\t <tr valign=\"top\">\r\n\t <th scope=\"row\"><?php _e('Blog ID:', 'psts') ?></th>\r\n\t <td><input type=\"text\" size=\"17\" name=\"bid\" value=\"\" /> <input type=\"submit\" value=\"<?php _e('Continue &raquo;', 'psts') ?>\" /></td></tr>\r\n\t </table>\r\n\t </form>\r\n\t\t\t\t\t<hr />\r\n\t\t\t\t\t<form method=\"get\" action=\"sites.php\" name=\"searchform\">\r\n\t <table class=\"form-table\">\r\n\t <tr valign=\"top\">\r\n\t <th scope=\"row\"><?php _e('Or search for a site:', 'psts') ?></th>\r\n\t <td><input type=\"text\" size=\"17\" value=\"\" name=\"s\"/> <input type=\"submit\" value=\"<?php _e('Search Sites &raquo;', 'psts') ?>\" id=\"submit_sites\" name=\"submit\"/></td></tr>\r\n\t </table>\r\n\t </form>\r\n\t </div>\r\n\t </div>\r\n </div>\r\n <?php\r\n }\r\n echo '</div>';\r\n\t}", "function account_log()\n {\n }", "function security_module_callback(){\n _e('Configure Security Module', 'se');\n}", "function __construct() {\n $this->name=\"AliIPRelays\";\n $this->title=\"Ali IP Реле\";\n $this->lastsate=array();\n $this->module_category=\"<#LANG_SECTION_DEVICES#>\";\n $this->checkInstalled();\n}", "function EventLog($page,$action,$orignal_value,$new_value)\n{\n\t\t$email = $_SESSION['user_email'];\n\t\t$ipaddress = getUserIP();\n\t\t\n\t\t$data = sprintf(\"%s,%s,%s,%s,%s\" . PHP_EOL, $ipaddress,date(\"F j Y g:i a\"), $email, $page, $action);\n\t\t\n\t\t//file_put_contents($_SERVER['DOCUMENT_ROOT'] .'/log.txt', $data, FILE_APPEND);\t\t\n\t\tfile_put_contents('log.txt', $data, FILE_APPEND);\t\t\t\n\t\t\n\t\t\n}", "function upgrade_500()\n {\n }", "function paymentech() {\n global $order;\n $this->code = 'paymentech';\n // Payment module title in Admin\n $this->title = MODULE_PAYMENT_PAYMENTECH_TEXT_TITLE;\n if (MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_CAD == '' && MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_USD == '') {\n $this->title .= '<span class=\"alert\"> (Not Configured)</span>'; \n } elseif (MODULE_PAYMENT_PAYMENTECH_TESTMODE == 'Test') {\n $this->title .= '<span class=\"alert\"> (in Testing mode)</span>';\n }\n $this->description = MODULE_PAYMENT_PAYMENTECH_TEXT_DESCRIPTION; // Descriptive Info about module in Admin\n $this->enabled = ((MODULE_PAYMENT_PAYMENTECH_STATUS == 'True') ? true : false); // Whether the module is installed or not\n $this->sort_order = MODULE_PAYMENT_PAYMENTECH_SORT_ORDER; // Sort Order of this payment option on the customer payment page\n\n if ((int)MODULE_PAYMENT_PAYMENTECH_ORDER_STATUS_ID > 0) {\n $this->order_status = MODULE_PAYMENT_PAYMENTECH_ORDER_STATUS_ID;\n }\n\n\t// save the information\n\t// Card numbers are not saved, instead keep the first and last four digits and fill middle with *'s\n\t$card_number = trim($_POST['paymentech_field_1']);\n\t$card_number = substr($card_number, 0, 4) . '********' . substr($card_number, -4);\n\t$this->payment_fields = implode(':',array($_POST['paymentech_field_0'], $card_number, $_POST['paymentech_field_2'], $_POST['paymentech_field_3'], $_POST['paymentech_field_4']));\n\n\t$this->AVSRespCode = array(\n\t\t'1 ' => \"No address supplied\",\n\t\t'2 ' => \"Bill-to address did not pass Auth Host edit checks\",\n\t\t'3 ' => \"AVS not performed\",\n\t\t'4 ' => \"Issuer does not participate in AVS\",\n\t\t'R ' => \"Issuer does not participate in AVS\",\n\t\t'5 ' => \"Edit-error - AVS data is invalid\",\n\t\t'6 ' => \"System unavailable or time-out\",\n\t\t'7 ' => \"Address information unavailable\",\n\t\t'8 ' => \"Transaction Ineligible for AVS\",\n\t\t'9 ' => \"Zip Match / Zip4 Match / Locale match\",\n\t\t'A ' => \"Zip Match / Zip 4 Match / Locale no match\",\n\t\t'B ' => \"Zip Match / Zip 4 no Match / Locale match\",\n\t\t'C ' => \"Zip Match / Zip 4 no Match / Locale no match\",\n\t\t'D ' => \"Zip No Match / Zip 4 Match / Locale match\",\n\t\t'E ' => \"Zip No Match / Zip 4 Match / Locale no match\",\n\t\t'F ' => \"Zip No Match / Zip 4 No Match / Locale match\",\n\t\t'G ' => \"No match at all\",\n\t\t'H ' => \"Zip Match / Locale match\",\n\t\t'J ' => \"Issuer does not participate in Global AVS\", \n\t\t'JA' => \"International street address and postal match\",\n\t\t'JB' => \"International street address match. Postal code not verified.\",\n\t\t'JC' => \"International street address and postal code not verified.\",\n\t\t'JD' => \"International postal code match. Street address not verified.\",\n\t\t'M1' => \"Cardholder name matches\",\n\t\t'M2' => \"Cardholder name, billing address, and postal code matches\",\n\t\t'M3' => \"Cardholder name and billing code matches\",\n\t\t'M4' => \"Cardholder name and billing address match\",\n\t\t'M5' => \"Cardholder name incorrect, billing address and postal code match\",\n\t\t'M6' => \"Cardholder name incorrect, billing address matches\",\n\t\t'M7' => \"Cardholder name incorrect, billing address matches\",\n\t\t'M8' => \"Cardholder name, billing address and postal code are all incorrect\",\n\t\t'N3' => \"Address matches, ZIP not verified\",\n\t\t'N4' => \"Address and ZIP code match (International only)\",\n\t\t'N5' => \"Address not verified (International only)\",\n\t\t'N6' => \"Address and ZIP code match (International only)\",\n\t\t'N7' => \"ZIP matches, address not verified\",\n\t\t'N8' => \"Address and ZIP code match (International only)\",\n\t\t'UK' => \"Unknown\",\n\t\t'X ' => \"Zip Match / Zip 4 Match / Address Match\",\n\t\t'Y ' => \"Not Performed\",\n\t\t'Z ' => \"Zip Match / Locale no match\");\n\n\t$this->CVV2RespCode = array(\n\t\t'M' => \"CVV Match\",\n\t\t'N' => \"CVV No match\",\n\t\t'P' => \"Not processed\",\n\t\t'S' => \"Should have been present\",\n\t\t'U' => \"Unsupported by issuer\",\n\t\t'I' => \"Invalid\",\n\t\t'Y' => \"Invalid\");\n\n }", "function main()\t{\n\n\t\t$content = '';\n\n\t\t$content .= '<br /><b>Change table tx_realurl_redirects:</b><br />\n\t\tRemove the field url_hash from the table tx_realurl_redirects, <br />because it\\'s not needed anymore and it\\'s replaced by the standard TCA field uid as soon as you do <br />the DB updates by the extension manager in the main view of this extension.<br /><br />ALTER TABLE tx_realurl_redirects DROP url_hash<br />ALTER TABLE tx_realurl_redirects ADD uid int(11) auto_increment PRIMARY KEY';\n\t\t\n\t\t$import = t3lib_div::_GP('update');\n\n\t\tif ($import == 'Update') {\n\t\t\t$result = $this->updateRedirectsTable();\n\t\t\t$content2 .= '<br /><br />';\n\t\t\t$content2 .= '<p>Result: '.$result.'</p>';\n\t\t\t$content2 .= '<p>Done. Please accept the update suggestions of the extension manager now!</p>';\n\t\t} else {\n\t\t\t$content2 = '</form>';\n\t\t\t$content2 .= '<form action=\"'.htmlspecialchars(t3lib_div::linkThisScript()).'\" method=\"post\">';\n\t\t\t$content2 .= '<br /><br />';\n\t\t\t$content2 .= '<input type=\"submit\" name=\"update\" value=\"Update\" />';\n\t\t\t$content2 .= '</form>';\n\t\t} \n\n\t\treturn $content.$content2;\n\t}", "public function ApplyChanges() {\n parent::ApplyChanges();\n\n $ModulInfo = IPS_GetInstance($this->InstanceID);\n $ModulName = $ModulInfo['ModuleInfo']['ModuleName'];\n\n $HourUpdateTimer = $this->ReadPropertyInteger(\"IntervalUpdateTimer\");\n $HourNotificationTimer = $this->ReadPropertyInteger(\"IntervalNotificationTimer\");\n $MinuteUpdateTimer = $this->ReadPropertyInteger(\"IntervalUpdateTimerMinute\");\n $MinuteNotificationTimer = $this->ReadPropertyInteger(\"IntervalNotificationTimerMinute\");\n $HourResetTimer = $this->ReadPropertyInteger(\"IntervalHtmlResetColorTodayTimer\");\n $EnableResetTimer = $this->ReadPropertyBoolean(\"cbxHtmlResetColorToday\");\n \n If ((($HourUpdateTimer > 23) || ($HourNotificationTimer > 23)) || (($HourUpdateTimer < 0) || ($HourNotificationTimer < 0)))\n {\n $this->SetStatus(202);\n $this->SendDebug($ModulName, $this->Translate(\"The hour of a time is wrong!\"), 0);\n }\n else {\n $this->SetStatus(102);\n }\n\n $this->SetNewTimerInterval($HourUpdateTimer.\":\".$MinuteUpdateTimer.\":17\", \"UpdateTimer\");\n $this->SetNewTimerInterval($HourUpdateTimer.\":\".$MinuteNotificationTimer.\":07\", \"NotificationTimer\");\n If($EnableResetTimer)\n {\n $this->SetNewTimerInterval($HourResetTimer.\":\".\"00\".\":14\", \"ResetFontTimer\");\n }\n If ($this->ReadPropertyBoolean(\"cbxGS\"))\n {\n $this->RegisterVariableString(\"YellowBagTime\", $this->Translate(\"Packaging waste event\"));\n $this->RegisterVariableString(\"YellowBagTimes\", $this->Translate(\"Packaging waste\"), \"~TextBox\");\n $this->EnableAction(\"YellowBagTimes\");\n }\n Else\n {\n $this->UnregisterVariable(\"YellowBagTimes\");\n $this->UnregisterVariable(\"YellowBagTime\");\n }\n If ($this->ReadPropertyBoolean(\"cbxHM\"))\n {\n $this->RegisterVariableString(\"WasteTime\", $this->Translate(\"Household garbage event\"));\n $this->RegisterVariableString(\"WasteTimes\", $this->Translate(\"Household garbage\"), \"~TextBox\");\n $this->EnableAction(\"WasteTimes\");\n }\n Else\n {\n $this->UnregisterVariable(\"WasteTimes\");\n $this->UnregisterVariable(\"WasteTime\");\n }\n If ($this->ReadPropertyBoolean(\"cbxPP\"))\n {\n $this->RegisterVariableString(\"PaperTime\", $this->Translate(\"Cardboard bin event\"));\n $this->RegisterVariableString(\"PaperTimes\", $this->Translate(\"Cardboard bin\"), \"~TextBox\");\n $this->EnableAction(\"PaperTimes\");\n }\n Else\n {\n $this->UnregisterVariable(\"PaperTimes\");\n $this->UnregisterVariable(\"PaperTime\");\n }\n\n If ($this->ReadPropertyBoolean(\"cbxBO\"))\n {\n $this->RegisterVariableString(\"BioTime\", $this->Translate(\"Organic waste event\"));\n $this->RegisterVariableString(\"BioTimes\", $this->Translate(\"Organic waste\"), \"~TextBox\");\n $this->EnableAction(\"BioTimes\");\n }\n Else\n {\n $this->UnregisterVariable(\"BioTime\");\n $this->UnregisterVariable(\"BioTimes\");\n }\n If ($this->ReadPropertyBoolean(\"cbxPT\"))\n {\n $this->RegisterVariableString(\"PollutantsTime\", $this->Translate(\"Pollutants event\"));\n $this->RegisterVariableString(\"PollutantsTimes\", $this->Translate(\"Pollutants\"), \"~TextBox\");\n $this->EnableAction(\"PollutantsTimes\");\n }\n Else\n {\n $this->UnregisterVariable(\"PollutantsTimes\");\n $this->UnregisterVariable(\"PollutantsTime\");\n }\n }", "function run_edd_ecologi() {\n\n $plugin = new Typewheel_EDD_Ecologi();\n $plugin->run();\n\n // include class for managing EDD licensing\n // see https://github.com/wpstars/EDD_Client\n\n require_once( 'includes/EDD_Client/EDD_Client_Init.php' );\n $licensed = new EDD_Client_Init( __FILE__, TYPEWHEEL_EDDE_STORE_URL );\n\n}", "private function _module()\n\t{\n\t\t$sCacheModules = PHPFOX_DIR_FILE . 'log' . PHPFOX_DS . 'installer_modules.php';\n\t\tif (!file_exists($sCacheModules))\n\t\t{\n\t\t\t// Something went wrong...\n\t\t}\t\t\n\t\trequire_once($sCacheModules);\n\n\t\t$sModuleLog = PHPFOX_DIR_CACHE . 'installer_completed_modules.log';\n\t\t$aInstalled = array();\n\t\tif (file_exists($sModuleLog))\n\t\t{\n\t\t\t$aLines = file($sModuleLog);\n\t\t\tforeach ($aLines as $sLine)\n\t\t\t{\n\t\t\t\t$sLine = trim($sLine);\n\t\t\n\t\t\t\tif (empty($sLine))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$aInstalled[$sLine] = true;\n\t\t\t}\n\t\t}\n\n\t\t$bInstallAll = (defined('PHPFOX_INSTALL_ALL_MODULES') ? true : false);\n\t\t$oModuleProcess = Phpfox::getService('admincp.module.process');\n\t\t$hFile = fopen($sModuleLog, 'a+');\t\n\t\t$iCnt = 0;\n\t\t$sMessage = '';\n\t\t$sInstalledModule = '';\n\t\tforeach ($aModules as $sModule)\n\t\t{\n\t\t\tif (isset($aInstalled[$sModule]))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$iCnt++;\t\t\t\n\t\t\t$sInstalledModule .= $sModule . \"\\n\";\n\t\t\t$sMessage .= \"<li>\" . $sModule . \"</li>\";\n\n\t\t\t$oModuleProcess->install($sModule, array('insert' => true));\n\t\t\n\t\t\tif ($bInstallAll === false && $iCnt == 5)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfwrite($hFile, $sInstalledModule);\n\t\tfclose($hFile);\n\t\t\n\t\tif ($this->_bUpgrade)\n\t\t{\n\t\t\treturn ($iCnt === 0 ? true : false);\n\t\t}\n\n\t\t// No more modules to install then lets send them to the final step\n\t\tif ($iCnt === 0 || defined('PHPFOX_INSTALL_ALL_MODULES'))\n\t\t{\n\t\t\t$this->_pass();\n\t\t\t\n\t\t\tunlink($sModuleLog);\n\t\t\t\n\t\t\t$this->_oTpl->assign(array(\n\t\t\t\t\t'sMessage' => 'All modules installed...',\n\t\t\t\t\t'sNext' => $this->_step('post')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\telse \n\t\t{\t\t\n\t\t\t$this->_oTpl->assign(array(\n\t\t\t\t\t'sMessage' => 'Installed Module(s): <div class=\"label_flow\" style=\"height:200px;\"><ul>' . $sMessage . '</ul></div>',\n\t\t\t\t\t'sNext' => $this->_step('module')\n\t\t\t\t)\n\t\t\t);\t\n\t\t}\n\t}", "public function log($msg)\n {\n ToolsAbstract::log($msg, 'product-sync-biz.log');\n }", "function upgrade_101()\n {\n }", "public function onLogin() {\nglobal $_LW;\n$module_config=&$_LW->REGISTERED_MODULES['appointments']; // get the config for this module\nif (!$revision=$_LW->isInstalledModule('appointments')) { // if module is not installed\n\t$_LW->dbo->sql('CREATE TABLE IF NOT EXISTS livewhale_appointments (id int(11) NOT NULL auto_increment, title varchar(255) NOT NULL default \"\", date_created datetime NOT NULL, last_modified datetime NOT NULL, last_user int(11) NOT NULL, created_by int(11) default NULL, PRIMARY KEY (id), KEY title (title)) ENGINE=INNODB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'); // install module tables\n\t$_LW->dbo->sql('CREATE TABLE IF NOT EXISTS livewhale_appointments2any (id1 int(11) NOT NULL, id2 int(11) NOT NULL, type varchar(255) NOT NULL, registration_id int(11) default NULL, PRIMARY KEY (id1,id2,type), KEY id1 (id1), KEY id2 (id2)) ENGINE=INNODB DEFAULT CHARSET=utf8;');\n\tif ($_LW->hasTables(['livewhale_appointments', 'livewhale_appointments2any'])) { // register module in modules table\n\t\t$_LW->dbo->sql('INSERT INTO livewhale_modules VALUES(NULL,\"appointments\",'.(float)$module_config['revision'].');');\n\t};\n}\nelse { // else if module is installed\n\tif ($revision!=$module_config['revision'] && empty($_LW->_GET['lw_auth'])) { // upgrade previous revisions\n\t\t/*\n\t\tinclude $_LW->INCLUDES_DIR_PATH.'/core/modules/appointments/includes/upgrade.php';\n\t\t$_LW->dbo->sql('UPDATE livewhale_modules SET revision='.(float)$module_config['revision'].' WHERE name=\"appointments\";');\n\t\t$_LW->logError('Upgraded appointments module', false, true);\n\t\t*/\n\t};\n};\n}", "function moduleContent()\t{\n\t\tif(!is_array($GLOBALS[\"TYPO3_CONF_VARS\"][\"SYS\"][\"nodes\"])){\n\t\t $content=\"<h2 style=\\\"color:red;\\\">NO SERVERS CONFIGURED, PLASE SETUP YOUR NODES IN localconf.php</h2>\";\n\t\t $this->content.=$this->doc->section(\"No servers available\",$content,0,1);\n\t\t return;\n\t\t}\n\t\tswitch((string)$this->MOD_SETTINGS[\"function\"])\t{\n\t\t\tcase 2:\n /*\n\t\t\t\t$content=\"<div align=center><strong>Hello World!</strong></div><br />\n\t\t\t\t\tThe 'Kickstarter' has made this module automatically, it contains a default framework for a backend module but apart from it does nothing useful until you open the script '\".substr(t3lib_extMgm::extPath(\"typo3_cluster\"),strlen(PATH_site)).\"mod1/index.php' and edit it!\n\t\t\t\t\t<HR>\n\t\t\t\t\t<br />This is the GET/POST vars sent to the script:<br />\".\n\t\t\t\t\t\"GET:\".t3lib_div::view_array($_GET).\"<br />\".\n\t\t\t\t\t\"POST:\".t3lib_div::view_array($_POST).\"<br />\".\n\t\t\t\t\t\"\";\n */\n \n\t\t\t $mode=$_POST[\"mode\"];\n\t\t\t if (stristr(\"update\",$mode)){\n\t\t\t\t $file=$_POST[\"updfile\"];\n\t\t\t\t $servers=$_POST[\"server_selected\"];\n\t\t\t\t $this->content.=$this->updateServers($file,$servers);\n\t\t\t }else{\n\t\t\t\t $content=$this->getUpdateform($mode);\n\t\t\t\t $this->content.=$this->doc->section(\"Update typo3conf to all servers:\",$content,0,1);\n\t\t\t }\n \n\t\t\t break;\n\n\t\t\tcase 1:\n\t\t\t foreach($GLOBALS[\"TYPO3_CONF_VARS\"][\"SYS\"][\"nodes\"] as $node){\t\t\t\t\n\t\t\t\t $start=$this->getmicrotime();\n\t\t\t\t $testhandler=@fopen(\"http://{$node['host']}/index.php?eID=cluster_worker&action=systemStatus&typo3_cluster_execute=1\",\"r\");\n\t\t\t\t if(!$testhandler){\n\t\t\t\t $nodestat[$node['host']]['alive']=false;\n\t\t\t\t }else{\n\t\t\t\t $nodestat[$node['host']]['alive']=true;\n\t\t\t\t $nodestat[$node['host']]['ping']=$this->getmicrotime() - $start;\t\t\t\t \n\t\t\t\t $nodestat[$node['host']]['sys']=fread($testhandler,8192);\n\t\t\t\t fclose($testhandler);\n\t\t\t\t }\t \t\t\t\t\n\t\t\t }\n\t\t\t \n\t\t\t \n\t\t\t $content=\"<table align=\\\"center\\\" border=\\\"1\\\" cellpadding=\\\"8\\\"><tr><th>Host:</th><th>Status:</th><th>Ping:</th><th>System Status:</th></tr>\";\n\t\t\t foreach($nodestat as $host=>$nodedata){\n\t\t\t\tif($nodedata['alive']){\n\t\t\t\t $status=\"<span style=\\\"color:#0F0;font-weight:bold;\\\">ALIVE</span>\";\n\t\t\t\t $ping=round(($nodedata['ping']*1000)).\" ms\";\n\t\t\t\t $sys=\"<span style=\\\"font-family:Courier New,fixed;font-size:11px;\\\">{$nodedata['sys']}</span>\";\n\t\t\t\t}else{\n\t\t\t\t $status=\"<span style=\\\"color:#F00;font-weight:bold;\\\">DEAD</span>\";\n\t\t\t\t $ping=\"N/A\";\n\t\t\t\t $sys=\"N/A\";\n\t\t\t\t}\n\t\t\t\t$content.=\"<tr><td>$host</td><td>$status</td><td>$ping</td><td>$sys</td></tr>\";\n\t\t\t }\t\t\t \n\t\t\t $content.=\"</table>\";\n\t\t\t $this->content.=$this->doc->section(\"Check cluster health:\",$content,0,1);\n\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$content=\"<div align=center><strong>Menu item #3...</strong></div>\";\n\t\t\t\t$this->content.=$this->doc->section(\"Message #3:\",$content,0,1);\n\t\t\tbreak;\n\t\t}\n\t}", "function cms_shutdown_function()\n{\n $error = error_get_last();\n if( $error['type'] == E_ERROR || $error['type'] == E_USER_ERROR )\n {\n $str = 'ERROR DETECTED: '.$error['message'].' at '.$error['file'].':'.$error['line'];\n debug_to_log($str);\n $db = cmsms()->GetDb();\n if( is_object($db) )\n\t{\n\t // put mention into the admin log\n\t audit('','ERROR',$str);\n\t}\n }\n}", "function upgrade_300()\n {\n }", "function execute()\n {\n\tplugin::execute();\n\n $smarty= get_smarty();\n $display= \"\";\n\n if((isset($_POST['StartImport']))&&(isset($_FILES['importFile']))){\n $filename = gosa_file_name($_FILES['importFile']['tmp_name']);\n $this->LogoffData = file_get_contents($filename);\n @unlink($filename);\n }\n\n if(isset($_GET['getLogoffData'])){\n send_binary_content($this->LogoffData, $this->real_LogoffName);\n }\n\n /* Create download button*/\n if($this->dn != \"new\" && $this->LogoffData != \"\"){\n $smarty->assign(\"DownMe\",\"<a href='?plug=\".$_GET['plug'].\"&getLogoffData'>\n <img src='images/save.png' alt='\"._(\"Download\").\"' title='\"._(\"Download\").\"' border=0 class='center'>\n </a>\");\n }else{\n $smarty->assign(\"DownMe\",\"\");\n }\n\n foreach($this->attributes as $attr){\n $smarty->assign($attr,$this->$attr);\n if($this->$attr){\n $smarty->assign($attr.\"CHK\",\" checked \");\n }else{\n $smarty->assign($attr.\"CHK\",\"\");\n }\n }\n $prios=array(1,2,3,4,5,6,7,8,9,10);\n $smarty->assign(\"LogoffPrioritys\",$prios);\n $smarty->assign(\"LogoffPriorityKeys\",$prios);\n\n if(!$this->nameIsEditable){\n $smarty->assign(\"LogoffNameACL\",\" disabled \");\n }else{\n $smarty->assign(\"LogoffNameACL\",\"\");\n }\n \n\n $display.= $smarty->fetch(get_template_path('logoffManagement.tpl', TRUE,dirname(__FILE__)));\n return($display);\n }", "function TrackingCode()\r\n\t{\r\n\t\tglobal $_SETTINGS;\r\n\t\t$code = lookupDbValue('settings', 'value', 'Tracking Code', 'name');\r\n\t\techo\"$code\";\r\n\t}", "function upgrade_100()\n {\n }", "function _debugActions($response, $order_time= '', $sessID = '') {\r\n global $db, $messageStack;\r\n if ($order_time == '') $order_time = date(\"F j, Y, g:i a\");\r\n // convert output to 1-based array for easier understanding:\r\n $resp_output = array_reverse($response);\r\n $resp_output[] = 'Response from gateway';\r\n $resp_output = array_reverse($resp_output);\r\n\r\n // DEBUG LOGGING\r\n $errorMessage = date('M-d-Y h:i:s') . \r\n \"\\n=================================\\n\\n\" . \r\n ($this->commError !='' ? 'Comm results: ' . $this->commErrNo . ' ' . $this->commError . \"\\n\\n\" : '') . \r\n 'Response Code: ' . $response[0] . \".\\nResponse Text: \" . $response[3] . \"\\n\\n\" . \r\n 'Sending to Authorizenet: ' . print_r($this->reportable_submit_data, true) . \"\\n\\n\" . \r\n 'Results Received back from Authorizenet: ' . print_r($resp_output, true) . \"\\n\\n\" . \r\n 'CURL communication info: ' . print_r($this->commInfo, true) . \"\\n\";\r\n if (CURL_PROXY_REQUIRED == 'True') \r\n $errorMessage .= 'Using CURL Proxy: [' . CURL_PROXY_SERVER_DETAILS . '] with Proxy Tunnel: ' .($this->proxy_tunnel_flag ? 'On' : 'Off') . \"\\n\";\r\n $errorMessage .= \"\\nRAW data received: \\n\" . $this->authorize . \"\\n\\n\";\r\n\r\n if (strstr(MODULE_PAYMENT_AUTHORIZENET_ECHECK_DEBUGGING, 'Log') || strstr(MODULE_PAYMENT_AUTHORIZENET_ECHECK_DEBUGGING, 'All') || (defined('AUTHORIZENET_DEVELOPER_MODE') && in_array(AUTHORIZENET_DEVELOPER_MODE, array('on', 'certify'))) || true) {\r\n $key = $response[6] . '_' . time() . '_' . zen_create_random_value(4);\r\n $file = $this->_logDir . '/' . 'AuthNetECheck_Debug_' . $key . '.log';\r\n $fp = @fopen($file, 'a');\r\n @fwrite($fp, $errorMessage);\r\n @fclose($fp);\r\n }\r\n if (($response[0] != '1' && stristr(MODULE_PAYMENT_AUTHORIZENET_ECHECK_DEBUGGING, 'Alerts')) || strstr(MODULE_PAYMENT_AUTHORIZENET_ECHECK_DEBUGGING, 'Email')) {\r\n zen_mail(STORE_NAME, STORE_OWNER_EMAIL_ADDRESS, 'Authorizenet-eCheck Alert ' . $response[7] . ' ' . date('M-d-Y h:i:s') . ' ' . $response[6], $errorMessage, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, array('EMAIL_MESSAGE_HTML'=>nl2br($errorMessage)), 'debug');\r\n }\r\n\r\n // DATABASE SECTION\r\n // Insert the send and receive response data into the database.\r\n // This can be used for testing or for implementation in other applications\r\n // This can be turned on and off if the Admin Section\r\n if (MODULE_PAYMENT_AUTHORIZENET_ECHECK_STORE_DATA == 'True'){\r\n $db_response_text = $response[3] . ($this->commError !='' ? ' - Comm results: ' . $this->commErrNo . ' ' . $this->commError : '');\r\n $db_response_text .= ($response[0] == 2 && $response[2] == 4) ? ' NOTICE: Card should be picked up - possibly stolen ' : '';\r\n $db_response_text .= ($response[0] == 3 && $response[2] == 11) ? ' DUPLICATE TRANSACTION ATTEMPT ' : '';\r\n\r\n // Insert the data into the database\r\n $sql = \"insert into \" . TABLE_AUTHORIZENET . \" (id, customer_id, order_id, response_code, response_text, authorization_type, transaction_id, sent, received, time, session_id) values (NULL, :custID, :orderID, :respCode, :respText, :authType, :transID, :sentData, :recvData, :orderTime, :sessID )\";\r\n $sql = $db->bindVars($sql, ':custID', $_SESSION['customer_id'], 'integer');\r\n $sql = $db->bindVars($sql, ':orderID', preg_replace('/[^0-9]/', '', $response[7]), 'integer');\r\n $sql = $db->bindVars($sql, ':respCode', $response[0], 'integer');\r\n $sql = $db->bindVars($sql, ':respText', $db_response_text, 'string');\r\n $sql = $db->bindVars($sql, ':authType', $response[11], 'string');\r\n $sql = $db->bindVars($sql, ':transID', $this->transaction_id, 'string');\r\n $sql = $db->bindVars($sql, ':sentData', print_r($this->reportable_submit_data, true), 'string');\r\n $sql = $db->bindVars($sql, ':recvData', print_r($response, true), 'string');\r\n $sql = $db->bindVars($sql, ':orderTime', $order_time, 'string');\r\n $sql = $db->bindVars($sql, ':sessID', $sessID, 'string');\r\n $db->Execute($sql);\r\n }\r\n }", "function xt_admin_notice_installing() {\n ?>\n\n <div class=\"error fade\">\n <p><?php\n printf('<strong>需要到新淘客WordPress插件平台激活初始化您的网站</strong>. <br>\n\t <ul>\n\t <li>1.注册并登录<a href=\"%1s\" target=\"_blank\">新淘客WordPress插件平台</a>(已注册的会员可直接登录),添加网站</li>\n\t <li>2.验证并添加该网站(<a href=\"' . admin_url('admin.php?page=xt_menu_sys&xt-action=tool') . '\">填写验证代码</a>)</li>', XT_API_URL)\n ?></p>\n </div>\n\n <?php\n}", "function contactmod_cron () {\n return true;\n}", "function qruqsp_admin_actionLogs($q) {\n //\n // Get the args\n //\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'prepareArgs');\n $rc = qruqsp_core_prepareArgs($q, 'no', array(\n 'last_timestamp'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Last Timestamp'),\n 'session_key'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Session Key'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access restrictions to monitorActionLogs\n //\n qruqsp_core_loadMethod($q, 'qruqsp', 'admin', 'private', 'checkAccess');\n $rc = qruqsp_admin_checkAccess($q, 0, 'qruqsp.admin.actionLogs');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n \n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'datetimeFormat');\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbQuote');\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbRspQuery');\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbHashQuery');\n\n $strsql = \"SELECT UNIX_TIMESTAMP(UTC_TIMESTAMP()) as cur\";\n $ts = qruqsp_core_dbHashQuery($q, $strsql, 'qruqsp.core', 'timestamp');\n if( $ts['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'qruqsp.core.389', 'msg'=>'No timestamp available'));\n }\n\n //\n // Verify the field was passed, and is valid.\n //\n $last_timestamp = $ts['timestamp']['cur'] - 43200; // Get anything that is from the last 12 hours by default.\n $last_timestamp = $ts['timestamp']['cur'] - 86400; // Get anything that is from the last 24 hours by default.\n $req_last_timestamp = $last_timestamp;\n if( isset($args['last_timestamp']) && $args['last_timestamp'] != '' ) {\n $req_last_timestamp = $args['last_timestamp'];\n }\n // Force last_timestamp to be no older than 1 week\n if( $req_last_timestamp < ($ts['timestamp']['cur'] - 604800) ) {\n $req_last_timestamp = $ts['timestamp']['cur'] - 604800;\n }\n\n $date_format = qruqsp_core_datetimeFormat($q);\n\n // Sort the list ASC by date, so the oldest is at the bottom, and therefore will get insert at the top of the list in qruqsp manage\n $strsql = \"SELECT DATE_FORMAT(log_date, '\" . qruqsp_core_dbQuote($q, $date_format) . \"') as log_date, \"\n . \"CAST(UNIX_TIMESTAMP(UTC_TIMESTAMP())-UNIX_TIMESTAMP(log_date) as DECIMAL(12,0)) as age, \"\n . \"UNIX_TIMESTAMP(log_date) as TS, \"\n . \"qruqsp_core_api_logs.id, \"\n . \"qruqsp_core_api_logs.user_id, \"\n . \"qruqsp_core_users.display_name, \"\n . \"IFNULL(qruqsp_core_stations.name, 'System Admin') AS name, \"\n . \"qruqsp_core_api_logs.session_key, \"\n . \"qruqsp_core_api_logs.method, \"\n . \"qruqsp_core_api_logs.action \"\n . \"FROM qruqsp_core_api_logs \"\n . \"LEFT JOIN qruqsp_core_users ON (\"\n . \"qruqsp_core_api_logs.user_id = qruqsp_core_users.id\"\n . \") \"\n . \"LEFT JOIN qruqsp_core_stations ON (\"\n . \"qruqsp_core_api_logs.station_id = qruqsp_core_stations.id\"\n . \") \";\n if( isset($args['session_key']) && $args['session_key'] != '' ) {\n $strsql .= \"WHERE session_key = '\" . qruqsp_core_dbQuote($q, $args['session_key']) . \"' \";\n } else {\n $strsql .= \"WHERE UNIX_TIMESTAMP(qruqsp_core_api_logs.log_date) > '\" . qruqsp_core_dbQuote($q, $req_last_timestamp) . \"' \";\n }\n// . \"AND qruqsp_core_api_logs.user_id = qruqsp_users.id \"\n $strsql .= \"\"\n . \"ORDER BY TS DESC \"\n . \"LIMIT 100 \";\n qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = qruqsp_core_dbHashQueryArrayTree($q, $strsql, 'qruqsp.core', array(\n array('container'=>'logs', 'fname'=>'id', 'fields'=>array('id', 'log_date', 'age', 'TS', 'user_id', 'display_name', 'name', 'session_key', 'method', 'action')),\n ));\n $rsp = $rc;\n if( $rsp['stat'] == 'ok' ) {\n $rsp['timestamp'] = $ts['timestamp']['cur'];\n }\n\n return $rsp;\n}", "function __construct() \r\n{\r\n $this->name=\"scheduled_job\";\r\n $this->title=\"scheduled job module\";\r\n $this->module_category=\"<#LANG_SECTION_SYSTEM#>\";\r\n //$this->checkInstalled();\r\n}", "function getActions() {\n return array(\n 'updateUpdateHistoryTable' => 'Update upgrade history storage',\n 'updateModules' => 'Update module definitions',\n 'updateProjectObjectsParentType' => 'Update parent type values',\n 'updateConfigOptions' => 'Update configuration options storage',\n 'updateSystemModuleConfigOptions' => 'Update system configuration',\n 'updateRoles' => 'Update roles',\n 'updateLanguages' => 'Update localization data',\n 'updateSearch' => 'Update search',\n 'updateCompanies' => 'Update company information',\n 'updateUsers' => 'Update user accounts',\n 'updateUserSessions' => 'Add interface support to user sessions',\n 'updateApiSubscriptions' => 'Update API subscriptions',\n 'updateAssignmentFilters' => 'Update assignment filters',\n 'prepareActivityLogs' => 'Prepare activity logs for upgrade',\n 'prepareCategoriesTable' => 'Prepare categories for upgrade',\n 'prepareModificationLog' => 'Prepare modification log for upgrade',\n 'prepareAssignments' => 'Prepare assignments for upgrade',\n 'cleanUpOrphanedSubscriptions' => \"Clean up orphaned subscriptions\",\n 'prepareSubscriptions' => 'Prepare subscriptions for upgrade',\n 'prepareLabels' => 'Prepare labels for upgrade',\n 'prepareFavorites' => 'Prepare favorites storage',\n 'updateProjectGroups' => 'Convert project groups to project categories',\n 'updateProjectLabels' => 'Update project status labels',\n 'updateProjects' => 'Update projects',\n 'updateProjectObjects' => 'Update project objects storage',\n 'updateStateAndVisibility' => 'Update state and visibility values',\n 'updateAttachments' => 'Update attachments storage',\n 'updateSubtasks' => 'Update ticket, checklist and page subtasks',\n 'updateComments' => 'Update comments storage',\n 'updateMilestones' => 'Update project milestones',\n 'updateTicketChanges' => 'Move ticket changes to modification log',\n 'updateTickets' => 'Convert tickets to tasks',\n 'updateChecklists' => 'Convert checklists to to do lists (if used)',\n 'updatePageCategories' => 'Convert pages to notebooks',\n 'updatePages' => 'Update pages',\n 'updateFiles' => 'Update project files',\n 'updateDiscussions' => 'Update project discussions',\n 'updateTracking' => 'Update time tracking module',\n 'updateTimeRecords' => 'Move time records to the new storage',\n\n // We need complete project objects table and updated type field\n\n 'updateProjectPermissionNames' => 'Update project permission names',\n 'updateFavorites' => 'Update pinned projects and starred objects',\n 'updateReminders' => 'Update reminders',\n 'backupTags' => 'Back up tag data',\n 'setUpPayments' => 'Set up payment processing system',\n 'updateInvoicing' => 'Update invoicing module',\n 'updateInvoicingPayments' => 'Register existing payments with the new payment handling system',\n 'updateDocuments' => 'Update documents',\n 'updateDocumentHashes' => 'Update document hashes',\n 'updatePublicSubmit' => 'Upgrade public submit module',\n 'updateSourceModule' => 'Upgrade source module',\n 'finalizeModuleUpgrade' => 'Finalize module upgrade',\n 'rebuildLocalizationIndex' => 'Rebuild localization index',\n 'prepareBodyBackup' => 'Prepare content backup storage',\n 'upgradeProjectSummaries' => 'Update project summaries',\n 'updateDocumentsContent' => 'Update content of global documents',\n 'updateOpenTaskDescriptions' => 'Update open task descriptions',\n 'updateCompletedTaskDescriptions' => 'Update completed task descriptions',\n 'updateOpenTaskComments' => 'Update open task comments',\n 'updateCompletedTaskComments' => 'Update completed task comments',\n 'updateDiscussionDescriptions' => 'Update discussion descriptions',\n 'updateDiscussionComments' => 'Update discussion comments',\n 'updateNotebookPagesComments' => 'Update notebook pages comments',\n 'updateFileDescriptions' => 'Update file descriptions',\n 'updateFileComments' => 'Update file comments',\n 'updateFirstLevelPageContent' => 'Update first level pages',\n 'updateFirstLevelPageVersions' => 'Update first level page versions',\n 'updateFirstLevelPageComments' => 'Update first level page comments',\n 'updateSubpagesContent' => 'Update subpages',\n 'updateSubpageVersions' => 'Update subpage versions',\n 'updateSubpageComments' => 'Update subpage comments',\n );\n }", "function log()\n {\n }", "function upgrade_activity_modules($return) {\n\n global $CFG, $db;\n\n if (!$mods = get_list_of_plugins('mod') ) {\n error('No modules installed!');\n }\n\n $updated_modules = false;\n $strmodulesetup = get_string('modulesetup');\n\n foreach ($mods as $mod) {\n\n if ($mod == 'NEWMODULE') { // Someone has unzipped the template, ignore it\n continue;\n }\n\n $fullmod = $CFG->dirroot .'/mod/'. $mod;\n\n unset($module);\n\n if ( is_readable($fullmod .'/version.php')) {\n include_once($fullmod .'/version.php'); // defines $module with version etc\n } else {\n notify('Module '. $mod .': '. $fullmod .'/version.php was not readable');\n continue;\n }\n\n $oldupgrade = false;\n $newupgrade = false;\n if ( is_readable($fullmod .'/db/' . $CFG->dbtype . '.php')) {\n include_once($fullmod .'/db/' . $CFG->dbtype . '.php'); // defines old upgrading function\n $oldupgrade = true;\n }\n if ( is_readable($fullmod . '/db/upgrade.php')) {\n include_once($fullmod . '/db/upgrade.php'); // defines new upgrading function\n $newupgrade = true;\n }\n\n if (!isset($module)) {\n continue;\n }\n\n if (!empty($module->requires)) {\n if ($module->requires > $CFG->version) {\n $info = new object();\n $info->modulename = $mod;\n $info->moduleversion = $module->version;\n $info->currentmoodle = $CFG->version;\n $info->requiremoodle = $module->requires;\n if (!$updated_modules) {\n print_header($strmodulesetup, $strmodulesetup,\n build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',\n upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');\n }\n upgrade_log_start();\n notify(get_string('modulerequirementsnotmet', 'error', $info));\n $updated_modules = true;\n continue;\n }\n }\n\n $module->name = $mod; // The name MUST match the directory\n\n include_once($fullmod.'/lib.php'); // defines upgrading and/or installing functions\n\n if ($currmodule = get_record('modules', 'name', $module->name)) {\n if ($currmodule->version == $module->version) {\n // do nothing\n } else if ($currmodule->version < $module->version) {\n /// If versions say that we need to upgrade but no upgrade files are available, notify and continue\n if (!$oldupgrade && !$newupgrade) {\n notify('Upgrade files ' . $mod . ': ' . $fullmod . '/db/' . $CFG->dbtype . '.php or ' .\n $fullmod . '/db/upgrade.php were not readable');\n continue;\n }\n if (!$updated_modules) {\n print_header($strmodulesetup, $strmodulesetup,\n build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',\n upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');\n }\n upgrade_log_start();\n print_heading($module->name .' module needs upgrading');\n\n /// Run de old and new upgrade functions for the module\n $oldupgrade_function = $module->name . '_upgrade';\n $newupgrade_function = 'xmldb_' . $module->name . '_upgrade';\n\n /// First, the old function if exists\n $oldupgrade_status = true;\n if ($oldupgrade && function_exists($oldupgrade_function)) {\n $db->debug = true;\n $oldupgrade_status = $oldupgrade_function($currmodule->version, $module);\n if (!$oldupgrade_status) {\n notify ('Upgrade function ' . $oldupgrade_function .\n ' did not complete successfully.');\n }\n } else if ($oldupgrade) {\n notify ('Upgrade function ' . $oldupgrade_function . ' was not available in ' .\n $mod . ': ' . $fullmod . '/db/' . $CFG->dbtype . '.php');\n }\n\n /// Then, the new function if exists and the old one was ok\n $newupgrade_status = true;\n if ($newupgrade && function_exists($newupgrade_function) && $oldupgrade_status) {\n $db->debug = true;\n $newupgrade_status = $newupgrade_function($currmodule->version, $module);\n } else if ($newupgrade && $oldupgrade_status) {\n notify ('Upgrade function ' . $newupgrade_function . ' was not available in ' .\n $mod . ': ' . $fullmod . '/db/upgrade.php');\n }\n\n $db->debug=false;\n /// Now analyze upgrade results\n if ($oldupgrade_status && $newupgrade_status) { // No upgrading failed\n // OK so far, now update the modules record\n $module->id = $currmodule->id;\n if (! update_record('modules', $module)) {\n error('Could not update '. $module->name .' record in modules table!');\n }\n remove_dir($CFG->dataroot . '/cache', true); // flush cache\n notify(get_string('modulesuccess', '', $module->name), 'notifysuccess');\n echo '<hr />';\n } else {\n notify('Upgrading '. $module->name .' from '. $currmodule->version .' to '. $module->version .' FAILED!');\n }\n\n /// Update the capabilities table?\n if (!update_capabilities('mod/'.$module->name)) {\n error('Could not update '.$module->name.' capabilities!');\n }\n events_update_definition('mod/'.$module->name);\n\n $updated_modules = true;\n\n } else {\n upgrade_log_start();\n error('Version mismatch: '. $module->name .' can\\'t downgrade '. $currmodule->version .' -> '. $module->version .' !');\n }\n\n } else { // module not installed yet, so install it\n if (!$updated_modules) {\n print_header($strmodulesetup, $strmodulesetup,\n build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',\n upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');\n }\n upgrade_log_start();\n print_heading($module->name);\n $updated_modules = true;\n $db->debug = true;\n @set_time_limit(0); // To allow slow databases to complete the long SQL\n\n /// Both old .sql files and new install.xml are supported\n /// but we priorize install.xml (XMLDB) if present\n if (file_exists($fullmod . '/db/install.xml')) {\n $status = install_from_xmldb_file($fullmod . '/db/install.xml'); //New method\n } else {\n $status = modify_database($fullmod .'/db/'. $CFG->dbtype .'.sql'); //Old method\n }\n\n $db->debug = false;\n\n /// Continue with the installation, roles and other stuff\n if ($status) {\n if ($module->id = insert_record('modules', $module)) {\n\n /// Capabilities\n if (!update_capabilities('mod/'.$module->name)) {\n error('Could not set up the capabilities for '.$module->name.'!');\n }\n\n /// Events\n events_update_definition('mod/'.$module->name);\n\n /// Run local install function if there is one\n $installfunction = $module->name.'_install';\n if (function_exists($installfunction)) {\n if (! $installfunction() ) {\n notify('Encountered a problem running install function for '.$module->name.'!');\n }\n }\n\n notify(get_string('modulesuccess', '', $module->name), 'notifysuccess');\n echo '<hr />';\n } else {\n error($module->name .' module could not be added to the module list!');\n }\n } else {\n error($module->name .' tables could NOT be set up successfully!');\n }\n }\n\n /// Check submodules of this module if necessary\n\n $submoduleupgrade = $module->name.'_upgrade_submodules';\n if (function_exists($submoduleupgrade)) {\n $submoduleupgrade();\n }\n\n\n /// Run any defaults or final code that is necessary for this module\n\n if ( is_readable($fullmod .'/defaults.php')) {\n // Insert default values for any important configuration variables\n unset($defaults);\n include($fullmod .'/defaults.php'); // include here means execute, not library include\n if (!empty($defaults)) {\n foreach ($defaults as $name => $value) {\n if (!isset($CFG->$name)) {\n set_config($name, $value);\n }\n }\n }\n }\n }\n\n upgrade_log_finish(); // finish logging if started\n\n if ($updated_modules) {\n print_continue($return);\n print_footer('none');\n die;\n }\n}", "function init_woocommerce_cost_of_goods() {\nclass WC_COG extends SV_WC_Plugin {\n\n\n\t/** plugin version number */\n\tconst VERSION = '2.3.0';\n\n\t/** @var WC_COG single instance of this plugin */\n\tprotected static $instance;\n\n\t/** plugin id */\n\tconst PLUGIN_ID = 'cog';\n\n\t/** @var \\WC_COG_Admin instance plugin admin */\n\tprotected $admin;\n\n\t/** @var \\WC_COG_Admin_Reports instance, le reports */\n\tprotected $admin_reports;\n\n\t/** @var \\WC_COG_Import_Export_Handler instance, adds support for import/export functionality */\n\tprotected $import_export_handler;\n\n\t/** @var \\WC_COG_REST_API $api REST API integration class instance */\n\tprotected $rest_api;\n\n\n\t/**\n\t * Initialize the plugin\n\t *\n\t * @since 1.0\n\t */\n\tpublic function __construct() {\n\n\t\tparent::__construct(\n\t\t\tself::PLUGIN_ID,\n\t\t\tself::VERSION,\n\t\t\tarray(\n\t\t\t\t'text_domain' => 'woocommerce-cost-of-goods',\n\t\t\t)\n\t\t);\n\n\t\t// include required files\n\t\tadd_action( 'sv_wc_framework_plugins_loaded', array( $this, 'includes' ) );\n\n\t\t// set the order meta when an order is placed from standard checkout\n\t\tadd_action( 'woocommerce_checkout_update_order_meta', array( $this, 'set_order_cost_meta' ), 10, 1 );\n\n\t\t// set the order meta when an order is created from the API\n\t\tadd_action( 'woocommerce_api_create_order', array( $this, 'set_order_cost_meta' ), 10, 1 );\n\n\t\t// add support for orders programmatically added by the ebay WP-Lister plugin\n\t\tadd_action( 'wplister_after_create_order', array( $this, 'set_order_cost_meta' ), 10, 1 );\n\t}\n\n\n\t/**\n\t * Include required files\n\t *\n\t * @since 1.0\n\t */\n\tpublic function includes() {\n\n\t\t// COG product functions\n\t\trequire_once( $this->get_plugin_path() . '/includes/class-wc-cog-product.php' );\n\n\t\t// REST API integration class\n\t\t$this->rest_api = $this->load_class( '/includes/class-wc-cog-rest-api.php', 'WC_COG_REST_API' );\n\n\t\tif ( is_admin() ) {\n\t\t\t$this->admin_includes();\n\t\t}\n\t}\n\n\n\t/**\n\t * Include required admin files\n\t *\n\t * @since 1.0\n\t */\n\tprivate function admin_includes() {\n\n\t\t// admin\n\t\t$this->admin = $this->load_class( '/includes/admin/class-wc-cog-admin.php', 'WC_COG_Admin' );\n\n\t\t// reports\n\t\t$this->admin_reports = $this->load_class( '/includes/admin/class-wc-cog-admin-reports.php', 'WC_COG_Admin_Reports' );\n\n\t\t// import/export handler\n\t\t$this->import_export_handler = $this->load_class( '/includes/class-wc-cog-import-export-handler.php', 'WC_COG_Import_Export_Handler' );\n\t}\n\n\n\t/**\n\t * Return admin class instance\n\t *\n\t * @since 2.0.0\n\t * @return \\WC_COG_Admin\n\t */\n\tpublic function get_admin_instance() {\n\t\treturn $this->admin;\n\t}\n\n\n\t/**\n\t * Return the admin reports class instance\n\t *\n\t * @since 2.0.0\n\t */\n\tpublic function get_admin_reports_instance() {\n\t\treturn $this->admin_reports;\n\t}\n\n\n\t/**\n\t * Return the import/export handler class instance\n\t *\n\t * @since 2.0.0\n\t * @return \\WC_COG_Import_Export_Handler\n\t */\n\tpublic function get_import_export_handler_instance() {\n\t\treturn $this->import_export_handler;\n\t}\n\n\n\t/**\n\t * Return the REST API class instance\n\t *\n\t * @since 2.0.0\n\t * @return \\WC_COG_REST_API\n\t */\n\tpublic function get_rest_api_instance() {\n\t\treturn $this->rest_api;\n\t}\n\n\n\t/** Checkout processing methods *******************************************/\n\n\t/**\n\t * Set the cost of goods meta for a given order.\n\t *\n\t * @since 1.9.0\n\t * @param int $order_id The order ID.\n\t */\n\tpublic function set_order_cost_meta( $order_id ) {\n\n\t\t// get the order object.\n\t\t$order = wc_get_order( $order_id );\n\n\t\t$total_cost = 0;\n\n\t\t// loop through the order items and set their cost meta.\n\t\tforeach ( $order->get_items() as $item_id => $item ) {\n\n\t\t\t$product_id = ( ! empty( $item['variation_id'] ) ) ? $item['variation_id'] : $item['product_id'];\n\t\t\t$item_cost = (float) WC_COG_Product::get_cost( $product_id );\n\t\t\t$quantity = (float) $item['qty'];\n\n\t\t\t/**\n\t\t\t * Order Item Cost Filer.\n\t\t\t *\n\t\t\t * Allow actors to modify the item cost before the meta is updated.\n\t\t\t *\n\t\t\t * @since 1.9.0\n\t\t\t * @param float|string $item_cost order item cost to set\n\t\t\t * @param array $item order item\n\t\t\t * @param \\WC_Order $order order object\n\t\t\t */\n\t\t\t$item_cost = (float) apply_filters( 'wc_cost_of_goods_set_order_item_cost_meta_item_cost', $item_cost, $item, $order );\n\n\t\t\t$this->set_item_cost_meta( $item_id, $item_cost, $quantity );\n\n\t\t\t// add to the item cost to the total order cost.\n\t\t\t$total_cost += ( $item_cost * $quantity );\n\t\t}\n\n\t\t/**\n\t\t * Order Total Cost Filter.\n\t\t *\n\t\t * Allow actors to modify the order total cost before the meta is updated.\n\t\t *\n\t\t * @since 1.9.0\n\t\t * @param float|string $total_cost order total cost to set\n\t\t * @param \\WC_Order $order order object\n\t\t */\n\t\t$total_cost = apply_filters( 'wc_cost_of_goods_set_order_cost_meta', $total_cost, $order );\n\n\t\t$formatted_total_cost = wc_format_decimal( $total_cost, wc_get_price_decimals() );\n\n\t\t// save the order total cost meta.\n\t\tSV_WC_Order_Compatibility::update_meta_data( $order, '_wc_cog_order_total_cost', $formatted_total_cost );\n\t}\n\n\n\t/**\n\t * Set an item's cost meta.\n\t *\n\t * @since 1.9.0\n\t * @param int $item_id item ID\n\t * @param float|string $item_cost item cost\n\t * @param int $quantity number of items in the order\n\t */\n\tprotected function set_item_cost_meta( $item_id, $item_cost = '0', $quantity ) {\n\n\t\t// format the single item cost\n\t\t$formatted_cost = wc_format_decimal( $item_cost );\n\n\t\t// format the total item cost\n\t\t$formatted_total = wc_format_decimal( $item_cost * $quantity );\n\n\t\twc_update_order_item_meta( $item_id, '_wc_cog_item_cost', $formatted_cost );\n\t\twc_update_order_item_meta( $item_id, '_wc_cog_item_total_cost', $formatted_total );\n\t}\n\n\n\t/** Helper methods ******************************************************/\n\n\n\t/**\n\t * Main Cost of Goods Instance, ensures only one instance is/can be loaded\n\t *\n\t * @since 1.6.0\n\t * @see wc_cog()\n\t * @return WC_COG\n\t */\n\tpublic static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}\n\n\n\t/**\n\t * Returns the plugin name, localized\n\t *\n\t * @since 1.3\n\t * @see SV_WC_Plugin::get_plugin_name()\n\t * @return string the plugin name\n\t */\n\tpublic function get_plugin_name() {\n\t\treturn __( 'WooCommerce Cost of Goods', 'woocommerce-cost-of-goods' );\n\t}\n\n\n\t/**\n\t * Returns __FILE__\n\t *\n\t * @since 1.3\n\t * @see SV_WC_Plugin::get_file()\n\t * @return string the full path and filename of the plugin file\n\t */\n\tprotected function get_file() {\n\t\treturn __FILE__;\n\t}\n\n\n\t/**\n\t * Gets the URL to the settings page\n\t *\n\t * @since 1.3\n\t * @see SV_WC_Plugin::is_plugin_settings()\n\t * @param string $_ unused\n\t * @return string URL to the settings page\n\t */\n\tpublic function get_settings_url( $_ = null ) {\n\t\treturn admin_url( 'admin.php?page=wc-settings&tab=products&section=inventory' );\n\t}\n\n\n\t/**\n\t * Gets the plugin documentation url\n\t *\n\t * @since 1.8.0\n\t * @see SV_WC_Plugin::get_documentation_url()\n\t * @return string documentation URL\n\t */\n\tpublic function get_documentation_url() {\n\t\treturn 'https://docs.woocommerce.com/document/cost-of-goods-sold/';\n\t}\n\n\n\t/**\n\t * Returns true if on the plugin settings page\n\t *\n\t * @since 1.3\n\t * @see SV_WC_Plugin::is_plugin_settings()\n\t * @return boolean true if on the settings page\n\t */\n\tpublic function is_plugin_settings() {\n\t\treturn isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] &&\n\t\t isset( $_GET['tab'] ) && 'products' === $_GET['tab'] &&\n\t\t isset( $_GET['section'] ) && 'inventory' === $_GET['section'];\n\t}\n\n\n\t/**\n\t * Gets the plugin support URL\n\t *\n\t * @since 1.8.0\n\t * @see SV_WC_Plugin::get_support_url()\n\t * @return string\n\t */\n\tpublic function get_support_url() {\n\t\treturn 'https://woocommerce.com/my-account/tickets/';\n\t}\n\n\n\t/** Lifecycle methods ******************************************************/\n\n\n\t/**\n\t * Run every time. Used since the activation hook is not executed when updating a plugin\n\t *\n\t * @since 1.0\n\t */\n\tpublic function install() {\n\n\t\trequire_once( $this->get_plugin_path() . '/includes/admin/class-wc-cog-admin.php' );\n\n\t\t// install default settings\n\t\tforeach ( WC_COG_Admin::get_global_settings() as $setting ) {\n\n\t\t\tif ( isset( $setting['default'] ) ) {\n\t\t\t\tupdate_option( $setting['id'], $setting['default'] );\n\t\t\t}\n\t\t}\n\t}\n\n\n\t/**\n\t * Perform any version-related changes\n\t *\n\t * @since 1.0\n\t * @param int $installed_version the currently installed version of the plugin\n\t */\n\tpublic function upgrade( $installed_version ) {\n\n\t\t$this->installed_version = $installed_version;\n\n\t\tadd_action( 'woocommerce_after_register_taxonomy', array( $this, 'delayed_upgrade' ) );\n\t}\n\n\n\t/**\n\t * Performs a delayed upgrade, as the WC taxonomies need to load first\n\t *\n\t * @since 1.3\n\t */\n\tpublic function delayed_upgrade() {\n\n\t\t$installed_version = wc_cog()->installed_version;\n\n\t\t// upgrade code\n\n\t\t// in this version we add the cost/min/max costs for variable products\n\t\tif ( version_compare( $installed_version, '1.1', '<' ) ) {\n\n\t\t\t// page through the variable products in blocks to avoid out of memory errors\n\t\t\t$offset = (int) get_option( 'wc_cog_variable_product_offset', 0 );\n\t\t\t$posts_per_page = 500;\n\n\t\t\tdo {\n\t\t\t\t// grab a set of variable product ids\n\t\t\t\t$product_ids = get_posts( array(\n\t\t\t\t\t'post_type' => 'product',\n\t\t\t\t\t'fields' => 'ids',\n\t\t\t\t\t'offset' => $offset,\n\t\t\t\t\t'posts_per_page' => $posts_per_page,\n\t\t\t\t\t'tax_query' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'taxonomy' => 'product_type',\n\t\t\t\t\t\t\t'field' => 'slug',\n\t\t\t\t\t\t\t'terms' => array( 'variable' ),\n\t\t\t\t\t\t\t'operator' => 'IN',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t) );\n\n\t\t\t\t// some sort of bad database error: deactivate the plugin and display an error\n\t\t\t\tif ( is_wp_error( $product_ids ) ) {\n\t\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t\t\t\tdeactivate_plugins( 'woocommerce-cost-of-goods/woocommerce-cost-of-goods.php' );\n\n\t\t\t\t\t/* translators: Placeholders: %s - error messages */\n\t\t\t\t\twp_die( sprintf( __( 'Error upgrading <strong>WooCommerce Cost of Goods</strong>: %s', 'woocommerce-cost-of-goods' ), '<ul><li>' . implode( '</li><li>', $product_ids->get_error_messages() ) . '</li></ul>' ) .\n\t\t\t\t\t\t'<a href=\"' . admin_url( 'plugins.php' ) . '\">' . __( '&laquo; Go Back', 'woocommerce-cost-of-goods' ) . '</a>' );\n\t\t\t\t}\n\n\t\t\t\t// otherwise go through the results and set the min/max/cost\n\t\t\t\tif ( is_array( $product_ids ) ) {\n\n\t\t\t\t\tforeach ( $product_ids as $product_id ) {\n\n\t\t\t\t\t\t$cost = WC_COG_Product::get_cost( $product_id );\n\n\t\t\t\t\t\tif ( '' === $cost && ( $product = wc_get_product( $product_id ) ) ) {\n\n\t\t\t\t\t\t\t// get the minimum and maximum costs associated with the product\n\t\t\t\t\t\t\tlist( $min_variation_cost, $max_variation_cost ) = WC_COG_Product::get_variable_product_min_max_costs( $product_id );\n\n\t\t\t\t\t\t\tSV_WC_Product_Compatibility::update_meta_data( $product, '_wc_cog_cost', wc_format_decimal( $min_variation_cost ) );\n\t\t\t\t\t\t\tSV_WC_Product_Compatibility::update_meta_data( $product, '_wc_cog_min_variation_cost', wc_format_decimal( $min_variation_cost ) );\n\t\t\t\t\t\t\tSV_WC_Product_Compatibility::update_meta_data( $product, '_wc_cog_max_variation_cost', wc_format_decimal( $max_variation_cost ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// increment offset\n\t\t\t\t$offset += $posts_per_page;\n\n\t\t\t\t// and keep track of how far we made it in case we hit a script timeout\n\t\t\t\tupdate_option( 'wc_cog_variable_product_offset', $offset );\n\n\t\t\t} while ( count( $product_ids ) === $posts_per_page ); // while full set of results returned (meaning there may be more results still to retrieve)\n\n\t\t}\n\n\t\t// in this version we are setting any variable product default costs, at the variation level with an indicator\n\t\tif ( version_compare( $installed_version, '1.3.3', '<' ) ) {\n\n\t\t\t// page through the variable products in blocks to avoid out of memory errors\n\t\t\t$offset = (int) get_option( 'wc_cog_variable_product_offset2', 0 );\n\t\t\t$posts_per_page = 500;\n\n\t\t\tdo {\n\t\t\t\t// grab a set of variable product ids\n\t\t\t\t$product_ids = get_posts( array(\n\t\t\t\t\t'post_type' => 'product',\n\t\t\t\t\t'fields' => 'ids',\n\t\t\t\t\t'offset' => $offset,\n\t\t\t\t\t'posts_per_page' => $posts_per_page,\n\t\t\t\t\t'tax_query' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'taxonomy' => 'product_type',\n\t\t\t\t\t\t\t'field' => 'slug',\n\t\t\t\t\t\t\t'terms' => array( 'variable' ),\n\t\t\t\t\t\t\t'operator' => 'IN',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t) );\n\n\t\t\t\t// Some sort of bad database error: deactivate the plugin and display an error.\n\t\t\t\tif ( is_wp_error( $product_ids ) ) {\n\n\t\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\n\t\t\t\t\t// Hardcode the plugin path so that we can use symlinks in development.\n\t\t\t\t\tdeactivate_plugins( 'woocommerce-cost-of-goods/woocommerce-cost-of-goods.php' );\n\n\t\t\t\t\t/* translators: Placeholders: %s - error messages */\n\t\t\t\t\twp_die( sprintf( __( 'Error upgrading <strong>WooCommerce Cost of Goods</strong>: %s', 'woocommerce-cost-of-goods' ), '<ul><li>' . implode( '</li><li>', $product_ids->get_error_messages() ) . '</li></ul>' ) .\n\t\t\t\t\t\t'<a href=\"' . admin_url( 'plugins.php' ) . '\">' . __( '&laquo; Go Back', 'woocommerce-cost-of-goods' ) . '</a>' );\n\n\t\t\t\t// ...Otherwise go through the results and set the min/max/cost.\n\t\t\t\t} elseif ( is_array( $product_ids ) ) {\n\n\t\t\t\t\tforeach ( $product_ids as $product_id ) {\n\n\t\t\t\t\t\tif ( $product = wc_get_product( $product_id ) ) {\n\n\t\t\t\t\t\t\t$default_cost = SV_WC_Product_Compatibility::get_meta( $product, '_wc_cog_cost_variable', true );\n\n\t\t\t\t\t\t\t// get all child variations\n\t\t\t\t\t\t\t$children = get_posts( array(\n\t\t\t\t\t\t\t\t'post_parent' => $product_id,\n\t\t\t\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t\t\t\t\t'post_type' => 'product_variation',\n\t\t\t\t\t\t\t\t'fields' => 'ids',\n\t\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t) );\n\n\t\t\t\t\t\t\tif ( $children ) {\n\n\t\t\t\t\t\t\t\tforeach ( $children as $child_product_id ) {\n\n\t\t\t\t\t\t\t\t\t// cost set at the child level?\n\t\t\t\t\t\t\t\t\t$cost = SV_WC_Product_Compatibility::get_meta( $child_product_id, '_wc_cog_cost', true );\n\n\t\t\t\t\t\t\t\t\tif ( $child_product = wc_get_product( $child_product_id ) ) {\n\n\t\t\t\t\t\t\t\t\t\tif ( '' === $cost && '' !== $default_cost ) {\n\t\t\t\t\t\t\t\t\t\t\t// using the default parent cost\n\t\t\t\t\t\t\t\t\t\t\tSV_WC_Product_Compatibility::update_meta_data( $child_product, '_wc_cog_cost', wc_format_decimal( $default_cost ) );\n\t\t\t\t\t\t\t\t\t\t\tSV_WC_Product_Compatibility::update_meta_data( $child_product, '_wc_cog_default_cost', 'yes' );\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t// otherwise no default cost\n\t\t\t\t\t\t\t\t\t\t\tSV_WC_Product_Compatibility::update_meta_data( $child_product, '_wc_cog_default_cost', 'no' );\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}\n\n\t\t\t\t// increment offset\n\t\t\t\t$offset += $posts_per_page;\n\n\t\t\t\t// and keep track of how far we made it in case we hit a script timeout\n\t\t\t\tupdate_option( 'wc_cog_variable_product_offset2', $offset );\n\n\t\t\t} while ( count( $product_ids ) === $posts_per_page ); // while full set of results returned (meaning there may be more results still to retrieve)\n\t\t}\n\t}\n\n\n} // end \\WC_COG class\n\n\n/**\n * Returns the One True Instance of <plugin>\n *\n * @since 1.6.0\n * @return WC_COG\n */\nfunction wc_cog() {\n\treturn WC_COG::instance();\n}\n\n// fire it up!\nwc_cog();\n\n}", "function install() {\r\n global $db;\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Authorize.net (eCheck) Module', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_STATUS', 'True', 'Do you want to accept eCheck payments via Authorize.net?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Login ID', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_LOGIN', 'testing', 'The API Login ID used for the Authorize.net service', '6', '0', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function) values ('Transaction Key', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_TXNKEY', 'Test', 'Transaction Key used for encrypting TP data<br />(See your Authorizenet Account->Security Settings->API Login ID and Transaction Key for details.)', '6', '0', now(), 'zen_cfg_password_display')\"); \r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function) values ('MD5 Hash', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_MD5HASH', '*Set A Hash Value at AuthNet Admin*', 'Encryption key used for validating received transaction data (MAX 20 CHARACTERS)', '6', '0', now(), 'zen_cfg_password_display')\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_TESTMODE', 'Test', 'Transaction mode used for processing orders', '6', '0', 'zen_cfg_select_option(array(\\'Test\\', \\'Production\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Authorization Type', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_AUTHORIZATION_TYPE', 'Authorize', 'Do you want submitted credit card transactions to be authorized only, or authorized and captured?', '6', '0', 'zen_cfg_select_option(array(\\'Authorize\\', \\'Authorize+Capture\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Database Storage', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_STORE_DATA', 'True', 'Do you want to save the gateway communications data to the database?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Customer Notifications', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_CUSTOMER', 'False', 'Should Authorize.Net email a receipt to the customer?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Merchant Notifications', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_MERCHANT', 'False', 'Should Authorize.Net email a receipt to the merchant?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_ORDER_STATUS_ID', '1', 'Set the status of orders made with this payment module to this value', '6', '0', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Mode', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_DEBUGGING', 'Off', 'Would you like to enable debug mode? A complete detailed log of failed transactions may be emailed to the store owner.', '6', '0', 'zen_cfg_select_option(array(\\'Off\\', \\'Log File\\', \\'Log and Email\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Wells Fargo SecureSource Merchant', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_WFSS_ENABLED', 'False', 'Are you a Wells Fargo SecureSource merchant? eCheck transactions will collect additional information from customers. Set to True only if your account has been configured to use Wells Fargo SecureSource.', '6', '0', 'zen_cfg_select_option(array(\\'False\\', \\'True\\'), ', now())\");\r\n }", "function cp_admin_logs()\n{\n?>\n\n\t<div class=\"wrap\">\n\t\t<h2>CubePoints - <?php _e('Logs', 'cp'); ?></h2>\n\t\t<?php _e('View recent point transactions.', 'cp'); ?><br /><br />\n\t\t<?php cp_show_logs('all', apply_filters('cp_admin_logs_limit', 0 ) , true); ?>\n\t</div>\n\t\n\t<?php do_action('cp_admin_logs'); ?>\n\t\n\t<?php\n}", "function vtlib_handler($modulename, $event_type) {\n\t\tglobal $adb;\n\t\trequire_once('include/events/include.inc');\n\t\tinclude_once('vtlib/Vtiger/Module.php');\n\t\t$em = new VTEventsManager($adb);\n\t\tif($event_type == 'module.postinstall') {\n\t\t\t// TODO Handle post installation actions\n\t\t\t$this->setModuleSeqNumber('configure', $modulename, 'TIME-BILLING-', '000001');\n\t\t\t$em->registerHandler('corebos.filter.CalendarModule.save', 'modules/Timecontrol/TCCalendarHandler.php', 'TCCalendarHandler');\n\t\t\t$em->registerHandler('corebos.filter.listview.render', 'modules/Timecontrol/convertTZListView.php', 'convertTZListViewOnTimecontrol');\n\t\t\tself::addTSRelations();\n\t\t} else if($event_type == 'module.disabled') {\n\t\t\t// TODO Handle actions when this module is disabled.\n\t\t} else if($event_type == 'module.enabled') {\n\t\t\t// TODO Handle actions when this module is enabled.\n\t\t} else if($event_type == 'module.preuninstall') {\n\t\t\t// TODO Handle actions when this module is about to be deleted.\n\t\t} else if($event_type == 'module.preupdate') {\n\t\t\t// TODO Handle actions before this module is updated.\n\t\t} else if($event_type == 'module.postupdate') {\n\t\t\t// TODO Handle actions after this module is updated.\n\t\t\t$adb->query(\"update vtiger_field SET typeofdata='D~M', uitype=5 WHERE tablename='vtiger_timecontrol' and columnname='date_start'\");\n\t\t\t$adb->query(\"update vtiger_field SET typeofdata='D~O', uitype=5 WHERE tablename='vtiger_timecontrol' and columnname='date_end'\");\n\t\t\t$adb->query(\"update vtiger_field SET displaytype=1, uitype=14 WHERE tablename='vtiger_timecontrol' and columnname='time_start'\");\n\t\t\t$adb->query(\"update vtiger_field SET displaytype=1, uitype=14 WHERE tablename='vtiger_timecontrol' and columnname='time_end'\");\n\t\t\t$adb->query(\"update vtiger_field SET displaytype=1, typeofdata='V~O' WHERE tablename='vtiger_timecontrol' and columnname='totaltime'\");\n\t\t\t$adb->query(\"ALTER TABLE vtiger_timecontrol ADD relatednum VARCHAR(255) NULL, ADD relatedname VARCHAR(255) NULL\");\n\t\t\t$adb->query(\"ALTER TABLE vtiger_timecontrol CHANGE invoiced invoiced VARCHAR(3) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0'\");\n\t\t\t$adb->query(\"UPDATE vtiger_timecontrol SET `invoiced`=0 WHERE invoiced!=1 or invoiced is null\");\n\t\t\t$em->registerHandler('corebos.filter.CalendarModule.save', 'modules/Timecontrol/TCCalendarHandler.php', 'TCCalendarHandler');\n\t\t\t$em->registerHandler('corebos.filter.listview.render', 'modules/Timecontrol/convertTZListView.php', 'convertTZListViewOnTimecontrol');\n\t\t}\n\t}", "function info(){\n\n\tglobal $nombre;\n\tglobal $apellido;\n\t\t\n\t$rf = $_POST['ref'];\n\t$nombre = $_POST['Nombre'];\n\t$apellido = $_POST['Apellidos'];\n\t\t\n\t$ActionTime = date('H:i:s');\n\t\n\tglobal $logtext;\n\t$logtext = PHP_EOL.\"- USERS VER DETALLES \".$ActionTime.PHP_EOL.\"\\t Nombre: \".$nombre.\" \".$apellido.PHP_EOL;\n\n\trequire 'Inc_Log_Total.php';\n\n\t}", "function update_system_log($action, $description) {\n\t\tglobal $database;\n\t\t\n\t\t// write to system log\n\t\t$action = strtoupper($action);\n\t\t$ip = get_client_ip();\n\t\t$now = datetime_now();\n\t\t\n\t\t$action = str_sanitize($action);\n\t\t$description = str_sanitize($description);\n\t\t\n\t\t$ret = $database->query(\"INSERT INTO system_log(action,ipaddress,entrydate,description)\n\t\t VALUES('$action', '$ip','$now', '$description');\");\t\n}", "public function actionIndex()\n {\n\n // $event = json_decode(json_encode($event));\n\n // $event->sms = array(\n // 'type' => 'score_due',\n // 'mobile' => ['18957301032'],\n // 'params' => [\n // 'code' => '111',\n // ],\n // 'template_id' => 'SMS_215333695',\n // );\n // P($event);\n // $res = (new smsController($this->id, $this->module))->sendSms($event);\n // P($res);\n //exit();\n // return $this->plugins(\"task\", \"config.integral_return\");\n // return $this->plugins(\"task\", [\"scoreadd\", [-2, 94, 0, 'del', '后台手动扣减']]);\n\n // $order_sn = \"osn628884227247724\";\n\n // $M = '\\order\\models\\Order';\n // $model = $M::find()->where(['order_sn' => $order_sn])->one();\n // //判断插件已经安装,则执行\n // if ($this->plugins(\"task\", \"status\")) {\n // //判断是否积分订单\n // if ($model->total_score > 0) {\n // //执行下单操作减积分操作\n // $this->plugins(\"task\", [\"order\", [\n // $model->total_score,\n // $model->UID,\n // $order_sn,\n // \"order\",\n // ]]);\n // }\n // P(123);\n // //执行下单操作\n // $this->plugins(\"task\", [\"score\", [\n // \"goods\",\n // $model->total_amount,\n // $model->UID,\n\n // ]]);\n // P(345);\n // //执行下单操作\n // $this->plugins(\"task\", [\"score\", [\n // \"order\",\n // $model->total_amount,\n // $model->UID,\n // ]]);\n // P(456);\n // }\n // osn713704239689910\n\n //执行下单操作\n $this->plugins(\"task\", [\"score\", [\"goods\", 0.03, 4, 'osn713704239689910']]);\n P2(\"完成\");\n\n //执行下单操作\n // $this->plugins(\"task\", [\"score\", [\"signin\", 1, 4]]);\n // P2(\"完成\");\n\n // //执行下单操作\n // $this->plugins(\"task\", [\"score\", [\"perfect\", 4, 4]]);\n // P2(\"完成\");\n\n // //执行下单操作\n // $this->plugins(\"task\", [\"score\", [\"browse\", time(), 4]]);\n // P2(\"完成\");\n\n // //执行下单操作\n // $this->plugins(\"task\", [\"score\", [\"share\", 1, 4]]);\n // P2(\"完成\");\n // exit();\n //执行下单操作\n // $this->plugins(\"task\", [\"score\", [\"order\", 1, 45, \"SSSSSS\"]]);\n // P2(\"完成\");\n // exit();\n // $this->plugins(\"task\", [\"score\", [\"invite\", time(), 4]]);\n // P2(\"完成\");\n exit();\n }", "function log(array $args, array $assoc_args ) {\n //TODO: format output\n return $this->terminus_request(\"site\", $this->_siteInfo->site_uuid, 'code-log', 'GET');\n }", "public function onTP_Storelog($data)\n\t{\n\t\t$log_write = $this->params->get('log_write', '0');\n\n\t\tif ($log_write == 1)\n\t\t{\n\t\t\t$plgPaymentAuthorizenetHelper = new plgPaymentAuthorizenetHelper;\n\t\t\t$log = $plgPaymentAuthorizenetHelper->Storelog($this->_name, $data);\n\t\t}\n\t}", "function changelog()\n\t{\n\t\t?>\n\t\t<pre>\n\t\t\t<?php\n\t\t\treadfile( JPATH_SITE.'/CHANGELOG.php' );\n\t\t\t?>\n\t\t</pre>\n\t\t<?php\n\t}", "function frl_perform_update(){\n\n\t$task_for_out = frl_get_tasks();\n\t$log_for_out = frl_get_log();\n\t$log_queue = frl_get_log_queue();\n\n\t$step = count($log_for_out);\n\tif($step > $log_queue){\n\t\tfrl_perform_reset();\n\t\treturn;\n\t}\n\n\t//add action into log\n\t$new_line = $log_queue[$step]; \n\tarray_unshift($log_for_out, $new_line);\n\n\t$file = dirname(__FILE__).'/data/log-out.csv'; \n $csv_handler = fopen($file,'w');\n foreach ($log_for_out as $l) {\n \tfputcsv($csv_handler, $l, \",\");\n }\n fclose($csv_handler);\n\n //change status of task\n if($new_line[2] == 'Запрос уточнения'){\n \t//change status to Ждет уточнения\n \t$task_for_out = frl_change_task_status($task_for_out, $new_line[4], 'Ждет уточнения');\n }\n\n if($new_line[2] == 'Отклик на задачу'){\n \t//change status to Подтверждено\n \t$task_for_out = frl_change_task_status($task_for_out, $new_line[4], 'Подтверждено');\n }\n\n $file = dirname(__FILE__).'/data/tasks-out.csv';\n $csv_handler = fopen($file,'w');\n foreach ($task_for_out as $t) {\n \tfputcsv($csv_handler, $t, \",\");\n }\n fclose($csv_handler);\n\n}", "public function logger(Varien_Event_Observer $observer)\n {\n $controller = $observer->getEvent()->getControllerAction();\n $request = $controller->getRequest();\n\n //Watchdog if off => RETURN;\n //We don't log this extension actions => RETURN;\n if ((Mage::helper('foggyline_watchdog')->isModuleEnabled() == false)\n || ($request->getControllerModule() == 'Foggyline_Watchdog_Adminhtml')\n ) {\n return;\n }\n\n //We are in admin area, but admin logging is off => RETURN;\n if ((Mage::getDesign()->getArea() == 'adminhtml')\n && (Mage::helper('foggyline_watchdog')->isLogBackendActions() == false)\n ) {\n return;\n }\n\n //We are in frontend area, but frontend logging is off => RETURN;\n if ((Mage::getDesign()->getArea() == 'frontend')\n && (Mage::helper('foggyline_watchdog')->isLogFrontendActions() == false)\n ) {\n return;\n }\n\n //If user login detected\n $user = Mage::getSingleton('admin/session')->getUser();\n\n //If customer login detected\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n\n $log = Mage::getModel('foggyline_watchdog/action');\n\n $log->setWebsiteId(Mage::app()->getWebsite()->getId());\n $log->setStoreId(Mage::app()->getStore()->getId());\n\n $log->setTriggeredAt(Mage::getModel('core/date')->timestamp(time()));\n\n if ($user && $user->getId()) {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_USER);\n $log->setTriggeredById($user->getId());\n } elseif ($customer && $customer->getId()) {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_CUSTOMER);\n $log->setTriggeredById($customer->getId());\n } else {\n $log->setTriggeredByType(Foggyline_Watchdog_Model_Action::TRIGGERED_BY_TYPE_GUEST);\n $log->setTriggeredById(null);\n }\n\n $log->setControllerModule($request->getControllerModule());\n $log->setFullActionName($request->getControllerModule());\n $log->setClientIp($request->getClientIp());\n $log->setControllerName($request->getControllerName());\n $log->setActionName($request->getActionName());\n $log->setControllerModule($request->getControllerModule());\n $log->setRequestMethod($request->getMethod());\n\n //We are in 'adminhtml' area and \"lbparams\" is ON\n if (Mage::getDesign()->getArea() == 'adminhtml'\n && Mage::helper('foggyline_watchdog')->isLogBackendActions()\n && Mage::helper('foggyline_watchdog')->isLogBackendParams()\n ) {\n $log->setRequestParams(Mage::helper('core')->encrypt(serialize($request->getParams())));\n }\n\n //We are in 'frontend' area and \"lfparams\" is ON\n if (Mage::getDesign()->getArea() == 'frontend'\n && Mage::helper('foggyline_watchdog')->isLogFrontendActions()\n && Mage::helper('foggyline_watchdog')->isLogFrontendParams()\n ) {\n $log->setRequestParams(Mage::helper('core')->encrypt(serialize($request->getParams())));\n }\n\n //In case of other areas, we don't log request params\n\n try {\n $log->save();\n } catch (Exception $e) {\n //If you cant save, die silently, not a big deal\n Mage::logException($e);\n }\n }", "function setSyncItemsPriceAction()\n {\n }", "function acf_upgrade_550()\n{\n}", "function Homelog($user_name,$action,$class_name,$class_obj,$result){\n if(empty($user_name)||empty($action)||empty($class_name)||empty($class_obj)||empty($result)){\n return false;\n }\n $data=array(\n \"user_name\"=>$user_name,\n \"action\"=>$action,\n \"class_name\"=>$class_name,\n \"class_obj\"=>$class_obj,\n \"result\"=>$result,\n \"op_time\"=>time()\n );\n $res=M(\"Sys_log\")->add($data);\n return $res;\n}", "function upgrade_350()\n {\n }", "function ghbt_scanner() {\n $this->name=\"ghbt_scanner\";\n $this->title=\"GoogleHome BT Scanner\";\n $this->module_category=\"<#LANG_SECTION_DEVICES#>\";\n $this->checkInstalled();\n}", "function upgrade_250()\n {\n }", "function worldlogger_admin_warnings() {\n\tglobal $wpcom_api_key;\n\tif ( !get_option('worldlogger_hash') && !isset($_POST['submit']) ) {\n\t\tfunction worldlogger_warning() {\n\t\t\techo \"\n\t\t\t<div id='worldlogger-warning' class='updated fade'><p><strong>\".__('Worldlogger is almost ready.').\"</strong> \".sprintf('You must <a href=\"%1$s\">enter a Worldlogger API key</a> for it to work.', \"options-general.php?page=worldlogger-options\").\"</p></div>\n\t\t\t\";\n\t\t}\n\t\tadd_action('admin_notices', 'worldlogger_warning');\n\t\treturn;\n\t}\n}", "public function logUpdate(Varien_Event_Observer $observer)\r\n{\r\n// Retrieve the product being updated from the event observer\r\n$product = $observer->getEvent()->getProduct();\r\n// Write a new line to var/log/product-updates.log\r\n$name = $product->getName();\r\n$sku = $product->getSku();\r\nMage::log(\"{$name} {$sku} updated success\", null, 'product-update.log');\r\n}", "function acf_upgrade_500()\n{\n}", "public function onPostInstall() {\n $moduleName = 'siteevent';\n $db = $this->getDb();\n $select = new Zend_Db_Select($db);\n $select\n ->from('engine4_core_modules')\n ->where('name = ?', 'sitemobile')\n ->where('enabled = ?', 1);\n $is_sitemobile_object = $select->query()->fetchObject();\n if (!empty($is_sitemobile_object)) {\n $db->query(\"INSERT IGNORE INTO `engine4_sitemobile_modules` (`name`, `visibility`) VALUES\n('$moduleName','1')\");\n $select = new Zend_Db_Select($db);\n $select\n ->from('engine4_sitemobile_modules')\n ->where('name = ?', $moduleName)\n ->where('integrated = ?', 0);\n $is_sitemobile_object = $select->query()->fetchObject();\n if ($is_sitemobile_object) {\n $actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n $controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n if ($controllerName == 'manage' && $actionName == 'install') {\n $view = new Zend_View();\n $baseUrl = (!empty($_ENV[\"HTTPS\"]) && 'on' == strtolower($_ENV[\"HTTPS\"]) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace('install/', '', $view->url(array(), 'default', true));\n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n $redirector->gotoUrl($baseUrl . 'admin/sitemobile/module/enable-mobile/enable_mobile/1/name/' . $moduleName . '/integrated/0/redirect/install');\n }\n }\n }\n //END - SITEMOBILE CODE TO CALL MY.SQL ON POST INSTALL\n //WORK FOR THE WORD CHANGES IN THE ADVANCED EVENT PLUGIN .CSV FILE.\n $actionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\n $controllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();\n if ($controllerName == 'manage' && ($actionName == 'install' || $actionName == 'query')) {\n $view = new Zend_View();\n $baseUrl = (!empty($_ENV[\"HTTPS\"]) && 'on' == strtolower($_ENV[\"HTTPS\"]) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . str_replace('install/', '', $view->url(array(), 'default', true));\n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n if ($actionName == 'install') {\n $redirector->gotoUrl($baseUrl . 'admin/siteevent/settings/language/redirect/install');\n } else {\n $redirector->gotoUrl($baseUrl . 'admin/siteevent/settings/language/redirect/query');\n }\n }\n }", "protected static function _processModule()\n {\n //Pour la ligne de commandes\n global $argv;\n\t\t\n // Nom du module à installer\n $module_name = Tools::getValue('module_name');\n\n // Action à effectuer : Par défaut installation\n $action = Tools::getValue('action', 'install');\n\n // Flag pour permettre d'installer le module via github\n $github = Tools::getValue('github', false);\n\n //Gestion via la ligne de commande\n if ($argv) {\n $endOfLine = \"\\n\";\n $allowsKeys = array('module_name','action','github');\n\n foreach ($argv as $arg) {\n $arguments = explode('=', $arg);\n if (in_array($arguments[0], $allowsKeys)) {\n ${$arguments[0]} = $arguments[1];\n }\n }\n\t\t\t\n\t\t\tif ( self::$verbose )\n\t\t\t\techo 'Lancement via la ligne de commande '.self::$endOfLine;\n }\n\n // Si l'action demandéé n'est pas autorisée , on affiche un message d'erreur\n if (!in_array($action, self::$modulesActionsAllowed)) {\n exit('Erreur : action demandée non autorisée'.self::$endOfLine);\n }\n\n //Si le module est disponible sur github\n if ($github) {\n echo 'Tentative de récupération du module depuis github'.self::$endOfLine;\n echo 'Url du dépôt : '.$github.$endOfLine;\n //@ToDO : Récupérer les messages d'erreur + vérifier que shell_exec est autorisé\n shell_exec('git clone '.$github.' '._PS_MODULE_DIR_.$module_name);\n }\n\n if ($module = Module::getInstanceByName($module_name)) {\n\n // Pour les actions enable / disable : il faut s'assurer que le module est installé\n if (($action == 'enable' || $action == 'disable') && !Module::isInstalled($module->name)) {\n exit('Erreur : le module '.$module_name.' n\\'est pas installé. Il ne peut pas être activé / désactivé '.self::$endOfLine);\n }\n\t\t\t\n\t\t\t//Affichage du statut du module (Installé ou non )\n\t\t\tif ( $action =='status' ) {\n\t\t\t\tif ( Module::isInstalled($module->name) )\n\t\t\t\t{\n\t\t\t\t\tif ( self::$verbose )\n\t\t\t\t\t\techo 'Le module '.$module->name.' est bien installé'.self::$endOfLine;\n\t\t\t\t\telse\n\t\t\t\t\t\techo 1;\n\t\t\t\t} else {\n\t\t\t\t\tif ( self::$verbose )\n\t\t\t\t\t\techo 'Le module '.$module->name.' n\\'est pas installé'.self::$endOfLine;\n\t\t\t\t\telse\n\t\t\t\t\t\techo 0;\n\t\t\t\t}\n\t\t\t\texit();\t\n\t\t\t}\n\n // Exécution de l'action du module\n try {\n $module->$action();\n } catch (PrestashopException $e) {\n echo $e->getMessage();\n exit();\n }\n\t\t\t\n\t\t\tif ( self::$verbose )\n\t\t\t\techo 'Module '.$module_name.' action : '.$action.' effectuée avec succès'.self::$endOfLine;\n\t\t\t\t\n } else {\n echo 'Erreur le module '.$module_name.' n\\'existe pas'.self::$endOfLine;\n }\n }", "function wpec_authsim_plugin_updater() {\n\t\t$license = get_option( 'wpec_product_'. WPEC_AUTHSIM_PRODUCT_ID .'_license_active' );\n\t\t$key = ! $license ? '' : $license->license_key;\n\t\t// setup the updater\n\t\t$wpec_updater = new WPEC_Product_Licensing_Updater( 'https://wpecommerce.org', __FILE__, array(\n\t\t\t\t'version' \t=> WPEC_AUTHSIM_VERSION, \t\t\t\t// current version number\n\t\t\t\t'license' \t=> $key, \t\t// license key (used get_option above to retrieve from DB)\n\t\t\t\t'item_id' \t=> WPEC_AUTHSIM_PRODUCT_ID \t// id of this plugin\n\t\t\t)\n\t\t);\n\t}", "function execute()\n {\n // and handle inside this plugin the e-mailing corresponding to events.\n\n require_once 'library/CE/XmlFunctions.php';\n\n $arrEmails = explode(\"\\r\\n\", $this->settings->get('plugin_serverstatus_Admin E-mail'));\n\n $messages = array();\n\n // Get list of servers\n $sql = \"SELECT id, name, statsurl FROM server WHERE statsurl != ''\";\n $result = $this->db->query($sql);\n\n $str1minLoad = $this->settings->get('plugin_serverstatus_1 Min. Load Average');\n $str5minLoad = $this->settings->get('plugin_serverstatus_5 Min. Load Average');\n $strMemory = $this->settings->get('plugin_serverstatus_Used Physical Memory');\n $arrSpace = explode(';', $this->settings->get('plugin_serverstatus_Mount Space Available'));\n if ( ($str1minLoad == \"\") && ($str5minLoad == \"\") && ($arrSpace[0] == \"\") ) {\n return;\n }\n\n while (list($serverid, $servername, $statsurl) = $result->fetch())\n {\n if (is_a($xmldata = $this->_getXMLData($statsurl, $serverid, $servername, $arrEmails), 'CE_Error')) {\n $messages[] = $xmldata;\n continue;\n }\n\n //need to validate XML before we do anything so that we do not\n //get unexpected errors when using this xmlize function\n $xml = XmlFunctions::xmlize($xmldata,1);\n if (is_a($xml, 'CE_Error')) {\n throw new Exception('Invalid XML. Ensure your server stats URL is returning valid XML.');\n }\n if ( array_key_exists(\"tns:phpsysinfo\", $xml) ){\n $this->phpsysinfo_ver = \"3.x\";\n }else{\n $this->phpsysinfo_ver = \"old\";\n }\n\n // Work from here\n if($this->phpsysinfo_ver == \"3.x\") {\n $uptimeTimeStamp = $xml[\"tns:phpsysinfo\"][\"#\"][\"Vitals\"][0][\"@\"][\"Uptime\"];\n } else {\n $uptimeTimeStamp = $xml[\"phpsysinfo\"][\"#\"][\"Vitals\"][0][\"#\"][\"Uptime\"][0][\"#\"];\n }\n if ($this->settings->get('plugin_serverstatus_Server Restarted')\n && $uptimeStatus = $this->_updateUptimeStatus($uptimeTimeStamp, $serverid, $servername, $arrEmails))\n {\n $messages[] = $uptimeStatus;\n }\n\n //Check 1 Min. Load Threshold\n if ($str1minLoad != '' && ($load1minStatus = $this->_checkLoad($xml,$serverid, $servername, $arrEmails, '1'))) {\n $messages[] = $load1minStatus;\n }\n //Check 5 Min. Load Threshold\n if ($str5minLoad != '' && ($load5minStatus = $this->_checkLoad($xml,$serverid, $servername, $arrEmails, '5'))) {\n $messages[] = $load5minStatus;\n }\n //Check Used Physical Memory Threshold\n if ($strMemory != '' && ($memoryStatus = $this->_checkmemory($xml,$serverid, $servername, $arrEmails))) {\n $messages[] = $memoryStatus;\n }\n\n //Check Disk Mount Space\n if($arrSpace[0] != \"\"){\n $mountsStatus = $this->_checkdiskspace($xml, $serverid, $servername, $arrEmails);\n if (is_array($mountsStatus) && $mountsStatus) {\n foreach ($mountsStatus as $status) {\n if ($status) {\n $messages[] = $status;\n }\n }\n }\n }\n\n }\n\n if (!$messages) {\n return array('Server Status Is Ok');\n }\n\n return $messages;\n }", "function sitemgr_upgrade1_2()\n{\n\t$GLOBALS['egw_setup']->db->update('egw_sitemgr_modules',array('module_name' => 'news_admin'),array('module_name' => 'news'),__LINE__,__FILE__);\n\n\t$GLOBALS['setup_info']['sitemgr']['currentver'] = '1.3.001';\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'];\n}", "function TransLog($message){\t\n notify_webmaster($message);\t\n}", "function insert_web_request_log($customer_id,$product_code,$REQUEST_PURPOSE_ID,$response_msg,$request_msg=null){\n\t\t\t\n\t$micro_sec_diff=getDeltaTime();\n\t$table_name='gft_lic_request';\n\t$insert_arr=/*. (mixed[string]) .*/ array();\n\t$insert_arr['GLC_FROM_ONLINE']='Y';\n\t$insert_arr['GLC_ONLINE_CONTENT']=mysqli_real_escape_string_wrapper(json_encode($_REQUEST));\n\t$insert_arr['GLC_DECRYPTED_CONTENT']=mysqli_real_escape_string_wrapper(json_encode($_REQUEST));\n\tif($request_msg!=null){\n\t\t$insert_arr['GLC_ONLINE_CONTENT']=mysqli_real_escape_string_wrapper(json_encode($request_msg));\n\t\t$insert_arr['GLC_DECRYPTED_CONTENT']=mysqli_real_escape_string_wrapper(json_encode($request_msg));\n\t}\n\t$insert_arr['GLC_REQUEST_TIME']=date('Y-m-d H:i:s');\n\t$insert_arr['GLC_RETURN_DATA']=(isset($response_msg)?mysqli_real_escape_string_wrapper(json_encode($response_msg)):'');\n\t$insert_arr['GLC_ERROR_MESSAGE']=(isset($response_msg['error_message'])?mysqli_real_escape_string_wrapper((string)$response_msg['error_message']):'');\n\t$insert_arr['GLC_STATUS']=(isset($response_msg['error_message'])?'S':'F');\n\t$insert_arr['GLC_LEAD_CODE']=$customer_id;\n\t$insert_arr['GLC_IP_ADDRESS']=isset($_SERVER['REMOTE_ADDR'])?(string)$_SERVER['REMOTE_ADDR']:'';\n\t$insert_arr['GLC_REQUEST_PURPOSE_ID']=$REQUEST_PURPOSE_ID;\n\t$insert_arr['GLC_PROCESSING_TIME']=$micro_sec_diff;\n\t$insert_arr['GLC_PRODUCT_KEY']=$product_code;\n\tarray_update_tables_common($insert_arr,$table_name,null,null,SALES_DUMMY_ID,$remarks=null,null,$insert_arr);\n\t\n}", "static function errorHandler()\n {\n//die(\"Coupon::errorHandler(): Disabled\");\n// Coupon\n // Fix settings first\n ShopSettings::errorHandler();\n\n $table_name = DBPREFIX.'module_shop_discount_coupon';\n $table_structure = array(\n 'code' => array('type' => 'varchar(20)', 'default' => '', 'primary' => true),\n 'customer_id' => array('type' => 'INT(10)', 'unsigned' => true, 'default' => '0', 'primary' => true),\n 'payment_id' => array('type' => 'INT(10)', 'unsigned' => true, 'default' => '0'),\n 'product_id' => array('type' => 'INT(10)', 'unsigned' => true, 'default' => '0'),\n 'start_time' => array('type' => 'INT(10)', 'unsigned' => true, 'default' => '0'),\n 'end_time' => array('type' => 'INT(10)', 'unsigned' => true, 'default' => '0'),\n 'uses' => array('type' => 'INT(10)', 'unsigned' => true, 'default' => '0', 'renamefrom' => 'uses_available'),\n 'global' => array('type' => 'TINYINT(1)', 'unsigned' => true, 'default' => '0'),\n 'minimum_amount' => array('type' => 'decimal(9,2)', 'unsigned' => true, 'default' => '0.00'),\n 'discount_amount' => array('type' => 'decimal(9,2)', 'unsigned' => true, 'default' => '0.00'),\n 'discount_rate' => array('type' => 'decimal(3,0)', 'unsigned' => true, 'default' => '0'),\n );\n $table_index = array();\n \\Cx\\Lib\\UpdateUtil::table($table_name, $table_structure, $table_index);\n\n $table_name = DBPREFIX.'module_shop_rel_customer_coupon';\n $table_structure = array(\n 'code' => array('type' => 'varchar(20)', 'default' => '', 'primary' => true),\n 'customer_id' => array('type' => 'INT(10)', 'unsigned' => true, 'default' => '0', 'primary' => true),\n 'order_id' => array('type' => 'INT(10)', 'unsigned' => true, 'default' => '0', 'primary' => true),\n 'count' => array('type' => 'INT(10)', 'unsigned' => true, 'default' => '0'),\n 'amount' => array('type' => 'DECIMAL(9,2)', 'unsigned' => true, 'default' => '0.00'),\n );\n $table_index = array();\n \\Cx\\Lib\\UpdateUtil::table($table_name, $table_structure, $table_index);\n\n // Always\n return false;\n }", "function ef_contract_action_info() {\n // UPDATE COUNTRY GROUP AND CONTRACT\n $actions['ef_contract_update_country_group_and_contract'] = array(\n 'type' => 'node',\n 'label' => t('Update Country group and Contract'),\n 'configurable' => FALSE,\n 'triggers' => array('any'),\n 'behavior' => array('changes_property'),\n 'vbo_configurable' => FALSE,\n 'pass rows' => TRUE,\n );\n // UPDATE old contracts with real values (Authors and contracts)\n $actions['ef_contract_upload_contract'] = array(\n 'type' => 'node', // Here come's the name of your custom entity type\n 'label' => t('Upload contract'),\n 'configurable' => FALSE,\n 'triggers' => array('any'),\n 'behavior' => array('changes_property'),\n 'vbo_configurable' => FALSE,\n 'pass rows' => TRUE,\n );\n // UPDATE old contracts with N/A contract\n $actions['ef_contract_upload_NA_contract'] = array(\n 'type' => 'node', // Here come's the name of your custom entity type\n 'label' => t('Upload N/A contracts'),\n 'configurable' => FALSE,\n 'triggers' => array('any'),\n 'behavior' => array('changes_property'),\n 'vbo_configurable' => FALSE,\n 'pass rows' => TRUE,\n );\n // Change EF Article, CAR/REP,NC,IR Dictionary status\n // from Approved for Editing to On external Editing\n $actions['ef_editor_to_ee'] = array(\n 'type' => 'node', // Here come's the name of your custom entity type\n 'label' => t('Change status to On External Editing'),\n 'configurable' => FALSE,\n 'triggers' => array('any'),\n 'behavior' => array('changes_property'),\n 'vbo_configurable' => FALSE,\n 'pass rows' => TRUE,\n );\n // Update empty contracts for network quarterly reports\n $actions['empty_network'] = array(\n 'type' => 'node', // Here come's the name of your custom entity type\n 'label' => t('Update empty Network Quarterly Reports'),\n 'configurable' => FALSE,\n 'triggers' => array('any'),\n 'behavior' => array('changes_property'),\n 'vbo_configurable' => FALSE,\n 'pass rows' => TRUE,\n );\n\n return $actions;\n}", "public function vtlib_handler($modulename, $event_type) {\n\t\tif ($event_type == 'module.postinstall') {\n\t\t\t$db = PearDatabase::getInstance();\n\t\t\t$db->pquery(\n\t\t\t\t'INSERT INTO `berli_crmtogo_defaults` (`fetch_limit`, `crmtogo_lang`, `defaulttheme`, `crm_version`) VALUES (?, ?, ?, ?)',\n\t\t\t\tarray('99','en_us', 'b', '6.3')\n\t\t\t);\n\t\t\t$db->pquery(\n\t\t\t\t'INSERT INTO `berli_crmtogo_config` (`crmtogouser`, `navi_limit`, `theme_color`, `compact_cal`) VALUES (?, ?, ?, ?)',\n\t\t\t\tarray('1','25', 'b', '1')\n\t\t\t);\n\t\t\t$seq = 0;\n\t\t\t$supported_module = array(\n\t\t\t\t'Contacts','Accounts','Leads','cbCalendar','Potentials','HelpDesk','Vendors','Assets','Faq','Documents',\n\t\t\t\t'Quotes','SalesOrder','Invoice','Products','Project','ProjectMilestone','ProjectTask','Events'\n\t\t\t);\n\t\t\tforeach ($supported_module as $mdulename) {\n\t\t\t\t$db->pquery(\n\t\t\t\t\t'INSERT INTO `berli_crmtogo_modules` (`crmtogo_user`, `crmtogo_module`, `crmtogo_active`, `order_num`) VALUES (?, ?, ?, ?)',\n\t\t\t\t\tarray('1',$mdulename, '1', $seq)\n\t\t\t\t);\n\t\t\t\t$seq = $seq + 1;\n\t\t\t}\n\t\t} elseif ($event_type == 'module.disabled') {\n\t\t\t// Handle actions when this module is disabled.\n\t\t} elseif ($event_type == 'module.enabled') {\n\t\t\t// Handle actions when this module is enabled.\n\t\t} elseif ($event_type == 'module.preuninstall') {\n\t\t\t// Handle actions when this module is about to be deleted.\n\t\t} elseif ($event_type == 'module.preupdate') {\n\t\t\t$db = PearDatabase::getInstance();\n\t\t\t$db->pquery(\"CREATE TABLE IF NOT EXISTS `berli_crmtogo_defaults` (\n\t\t\t\t `fetch_limit` int(3) NOT NULL,\n\t\t\t\t `crmtogo_lang` varchar(5) NOT NULL,\n\t\t\t\t `defaulttheme` varchar(1) NOT NULL,\n\t\t\t\t `crm_version` varchar(5) NOT NULL\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8\", array());\n\t\t\t$db->pquery(\"CREATE TABLE IF NOT EXISTS `berli_crmtogo_config` (\n\t\t\t\t `crmtogouser` int(19) NOT NULL,\n\t\t\t\t `navi_limit` int(3) NOT NULL,\n\t\t\t\t `theme_color` varchar(1) NOT NULL,\n\t\t\t\t `compact_cal` int(1) NOT NULL,\n\t\t\t\t PRIMARY KEY (`crmtogouser`),\n\t\t\t\t CONSTRAINT `fk_1_berli_crmtogo_config` FOREIGN KEY (`crmtogouser`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8\", array());\n\t\t\t$db->pquery(\"CREATE TABLE IF NOT EXISTS `berli_crmtogo_modules` (\n\t\t\t\t `crmtogo_user` int(19) NOT NULL,\n\t\t\t\t `crmtogo_module` varchar(50) NOT NULL,\n\t\t\t\t `crmtogo_active` int(1) NOT NULL DEFAULT '1',\n\t\t\t\t `order_num` int(3) NOT NULL,\n\t\t\t\t CONSTRAINT `fk_1_berli_crmtogo_modules` FOREIGN KEY (`crmtogo_user`) REFERENCES `vtiger_users` (`id`) ON DELETE CASCADE\n\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8\", array());\n\t\t} elseif ($event_type == 'module.postupdate') {\n\t\t\t$db = PearDatabase::getInstance();\n\t\t\t$res = $db->pquery(\"SELECT * FROM berli_crmtogo_config WHERE crmtogouser =?\", array('1'));\n\t\t\tif ($db->num_rows($res) ==0) {\n\t\t\t\t$db->pquery(\n\t\t\t\t\t'INSERT INTO `berli_crmtogo_defaults` (`fetch_limit`, `crmtogo_lang`, `defaulttheme`, `crm_version`) VALUES (?, ?, ?, ?)',\n\t\t\t\t\tarray('99','en_us', 'b', '6.3')\n\t\t\t\t);\n\t\t\t\t$db->pquery(\n\t\t\t\t\t'INSERT INTO `berli_crmtogo_config` (`crmtogouser`, `navi_limit`, `theme_color`, `compact_cal`) VALUES (?, ?, ?, ?)',\n\t\t\t\t\tarray('1','25', 'b', '1')\n\t\t\t\t);\n\t\t\t\t$seq = 0;\n\t\t\t\t$supported_module = array(\n\t\t\t\t\t'Contacts','Accounts','Leads','cbCalendar','Potentials','HelpDesk','Vendors','Assets','Faq','Documents',\n\t\t\t\t\t'Quotes','SalesOrder','Invoice','Products','Project','ProjectMilestone','ProjectTask'\n\t\t\t\t);\n\t\t\t\tforeach ($supported_module as $mdulename) {\n\t\t\t\t\t$db->pquery(\n\t\t\t\t\t\t'INSERT INTO `berli_crmtogo_modules` (`crmtogo_user`, `crmtogo_module`, `crmtogo_active`, `order_num`) VALUES (?, ?, ?, ?)',\n\t\t\t\t\t\tarray('1', $mdulename, '1', $seq)\n\t\t\t\t\t);\n\t\t\t\t\t$seq = $seq + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function sendDiagnosticEvent()\n\t{\n\t\tYii::import( 'webroot.backend.protected.modules.triggmine.models.PluginDiagnosticEvent' );\n\t\t\n\t\t$pluginDiagnostic = new PluginDiagnosticEvent;\n\t\t$pluginDiagnostic->dateCreated = date(\"Y-m-d H:i:s\");\n \t$pluginDiagnostic->diagnosticType = \"InstallPlugin\";\n \t$pluginDiagnostic->description = \"Argilla CMS (kostis.ru) Yii1 TriggMine plugin for Yii (customized) v3.0.23\";\n \t$pluginDiagnostic->status = $this->installed;\n \t\n \t$response = $this->client->sendEvent( $pluginDiagnostic );\n \tif ( $this->debugMode )\n \t\t{\n \t\t Yii::log( json_encode( $pluginDiagnostic ), CLogger::LEVEL_INFO, 'triggmine' );\n \t\t Yii::log( CVarDumper::dumpAsString( $response ), CLogger::LEVEL_INFO, 'triggmine' );\n \t\t}\n\t}", "function upgrade_130()\n {\n }", "public function actionExp()\n {\n try {\n // 根据手机号归属地 修改 客户的位置\n CRMStockClient::phone_to_location();\n } catch (\\Exception $e) {\n\n }\n\n try {\n // 更新统计数据 /stock/trend\n TrendStockService::init(TrendStockService::CAT_TREND)->chartTrend(date('Y-m-d'), 1);\n } catch (\\Exception $e) {\n\n }\n\n }", "public function _log($text)\n {\n if (!Mage::getStoreConfigFlag('simple_relevance/general/debug')) {\n return; // if the debug flag is false in the config, do nothing\n }\n\n Mage::log($text, null, 'SimpleRelevance_Integration.log');\n }", "public function logManagerAction() {\r\n $key = $this->object ? $this->object->get($this->primaryKeyField) :\r\n $this->getProperty('elementType') . ' ' . $this->getProperty('elementId') . ' Default';\r\n $this->modx->logManagerAction($this->objectType.'_update_from_element', $this->classKey, $key);\r\n }", "private function add_to_log($action) {\n if ($action) {\n $event = \\mod_simplecertificate\\event\\course_module_viewed::create(\n array(\n 'objectid' => $this->get_course_module()->instance,\n 'context' => $this->get_context(),\n 'other' => array('certificatecode' => $this->get_issue()->code)));\n $event->add_record_snapshot('course', $this->get_course());\n }\n\n if (!empty($event)) {\n $event->trigger();\n }\n }", "function upgrade_230()\n {\n }", "function usp_ews_get_monitorable_modules() {\n global $DB;\n\n return array(\n 'assign' => array(\n 'defaultTime' => 'duedate',\n 'actions' => array(\n 'submitted' => \"SELECT id\n FROM {assign_submission}\n WHERE assignment = :eventid\n AND userid = :userid\n AND status = 'submitted'\",\n 'marked' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'assign'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND g.finalgrade IS NOT NULL\",\n 'passed' => \"SELECT g.finalgrade, i.gradepass\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'assign'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\"\n ),\n 'defaultAction' => 'submitted'\n ),\n 'assignment' => array(\n 'defaultTime' => 'timedue',\n 'actions' => array(\n 'submitted' => \"SELECT id\n FROM {assignment_submissions}\n WHERE assignment = :eventid\n AND userid = :userid\n AND (\n numfiles >= 1\n OR {$DB->sql_compare_text('data2')} <> ''\n )\",\n 'marked' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'assignment'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND g.finalgrade IS NOT NULL\",\n 'passed' => \"SELECT g.finalgrade, i.gradepass\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'assignment'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\"\n ),\n 'defaultAction' => 'submitted'\n ),\n 'bigbluebuttonbn' => array(\n 'defaultTime' => 'timedue',\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'bigbluebuttonbn'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'recordingsbn' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'recordingsbn'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'book' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'book'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'certificate' => array(\n 'actions' => array(\n 'awarded' => \"SELECT id\n FROM {certificate_issues}\n WHERE certificateid = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'awarded'\n ),\n 'chat' => array(\n 'actions' => array(\n 'posted_to' => \"SELECT id\n FROM {chat_messages}\n WHERE chatid = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'posted_to'\n ),\n 'choice' => array(\n 'defaultTime' => 'timeclose',\n 'actions' => array(\n 'answered' => \"SELECT id\n FROM {choice_answers}\n WHERE choiceid = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'answered'\n ),\n 'data' => array(\n 'defaultTime' => 'timeviewto',\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'data'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'feedback' => array(\n 'defaultTime' => 'timeclose',\n 'actions' => array(\n 'responded_to' => \"SELECT id\n FROM {feedback_completed}\n WHERE feedback = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'responded_to'\n ),\n 'resource' => array( // AKA file.\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'resource'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'flashcardtrainer' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'flashcardtrainer'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'folder' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'folder'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'forum' => array(\n 'defaultTime' => 'assesstimefinish',\n 'actions' => array(\n\t\t\t\t'viewed' => \"SELECT id\n\t\t\t\t\t\t\t\t\t FROM {log}\n\t\t\t\t\t\t\t\t\tWHERE course = :courseid\n\t\t\t\t\t\t\t\t\t AND module = 'forum'\n\t\t\t\t\t\t\t\t\t AND action = 'view forum' \n\t\t\t\t\t\t\t\t\t AND cmid = :cmid\n\t\t\t\t\t\t\t\t\t AND userid = :userid\",\n 'posted_to' => \"SELECT id\n FROM {forum_posts}\n WHERE userid = :userid AND discussion IN (\n SELECT id\n FROM {forum_discussions}\n WHERE forum = :eventid\n )\"\n ),\n 'defaultAction' => 'posted_to'\n ),\n 'glossary' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'glossary'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'hotpot' => array(\n 'defaultTime' => 'timeclose',\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {hotpot_attempts}\n WHERE hotpotid = :eventid\n AND userid = :userid\",\n 'finished' => \"SELECT id\n FROM {hotpot_attempts}\n WHERE hotpotid = :eventid\n AND userid = :userid\n AND timefinish <> 0\",\n ),\n 'defaultAction' => 'finished'\n ),\n 'imscp' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'imscp'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'journal' => array(\n 'actions' => array(\n 'posted_to' => \"SELECT id\n FROM {journal_entries}\n WHERE journal = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'posted_to'\n ),\n 'lesson' => array(\n 'defaultTime' => 'deadline',\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {lesson_attempts}\n WHERE lessonid = :eventid\n AND userid = :userid\n UNION ALL\n SELECT id\n FROM {lesson_branch}\n WHERE lessonid = :eventid1\n AND userid = :userid1\",\n 'graded' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'lesson'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND g.finalgrade IS NOT NULL\"\n ),\n 'defaultAction' => 'attempted'\n ),\n 'page' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'page'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'questionnaire' => array(\n 'defaultTime' => 'closedate',\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {questionnaire_attempts}\n WHERE qid = :eventid\n AND userid = :userid\",\n 'finished' => \"SELECT id\n FROM {questionnaire_response}\n WHERE complete = 'y'\n AND username = :userid\n AND survey_id = :eventid\",\n ),\n 'defaultAction' => 'finished'\n ),\n 'quiz' => array(\n 'defaultTime' => 'timeclose',\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {quiz_attempts}\n WHERE quiz = :eventid\n AND userid = :userid\",\n 'finished' => \"SELECT id\n FROM {quiz_attempts}\n WHERE quiz = :eventid\n AND userid = :userid\n AND timefinish <> 0\",\n 'graded' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'quiz'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND g.finalgrade IS NOT NULL\",\n 'passed' => \"SELECT g.finalgrade, i.gradepass\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'quiz'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\"\n ),\n 'defaultAction' => 'finished'\n ),\n 'scorm' => array(\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {scorm_scoes_track}\n WHERE scormid = :eventid\n AND userid = :userid\",\n 'completed' => \"SELECT id\n FROM {scorm_scoes_track}\n WHERE scormid = :eventid\n AND userid = :userid\n AND element = 'cmi.core.lesson_status'\n AND {$DB->sql_compare_text('value')} = 'completed'\",\n 'passedscorm' => \"SELECT id\n FROM {scorm_scoes_track}\n WHERE scormid = :eventid\n AND userid = :userid\n AND element = 'cmi.core.lesson_status'\n AND {$DB->sql_compare_text('value')} = 'passed'\"\n ),\n 'defaultAction' => 'attempted'\n ),\n 'turnitintool' => array(\n 'defaultTime' => 'defaultdtdue',\n 'actions' => array(\n 'submitted' => \"SELECT id\n FROM {turnitintool_submissions}\n WHERE turnitintoolid = :eventid\n AND userid = :userid\n AND submission_score IS NOT NULL\"\n ),\n 'defaultAction' => 'submitted'\n ),\n 'url' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'url'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'wiki' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'wiki'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'workshop' => array(\n 'defaultTime' => 'assessmentend',\n 'actions' => array(\n 'submitted' => \"SELECT id\n FROM {workshop_submissions}\n WHERE workshopid = :eventid\n AND authorid = :userid\",\n 'assessed' => \"SELECT s.id\n FROM {workshop_assessments} a, {workshop_submissions} s\n WHERE s.workshopid = :eventid\n AND s.id = a.submissionid\n AND a.reviewerid = :userid\n AND a.grade IS NOT NULL\",\n 'graded' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'workshop'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND g.finalgrade IS NOT NULL\"\n ),\n 'defaultAction' => 'submitted'\n ),\n );\n}", "private function _log($msg)\n\t{\n\t\t$this->EE->TMPL->log_item(\"Low Events: {$msg}\");\n\t}", "function debugMP($type,$hdr,$msg='') {\n\t\tglobal $slplus_plugin;\n\t\tif (!is_object($slplus_plugin)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (($type === 'msg') && ($msg!=='')) {\n\t\t\t$msg = esc_html($msg);\n\t\t}\n\t\tif (($hdr!=='')) {\n\t\t\t$hdr = 'GFM: ' . $hdr;\n\t\t}\n\t\t$slplus_plugin->AddOns->instances[SLP_GFL_FREE_SLUG]->debugMP($type,$hdr,$msg,NULL,NULL,true);\n\t}", "function setup() {\r\n // \"Buy more than 100 items, get 50 (% or $, as per admin) off\" \r\n // $this->add_extra_level_discount(100, 50);\r\n }", "public static function display_changelog(){\r\n if($_REQUEST[\"plugin\"] != self::$slug)\r\n return;\r\n\r\n //loading upgrade lib\r\n if(!class_exists(\"RGConstantContactUpgrade\"))\r\n require_once(self::get_base_path().\"plugin-upgrade.php\");\r\n\r\n RGConstantContactUpgrade::display_changelog(self::$slug, self::get_key(), self::$version);\r\n }", "public function get_change_log()\n\t{\n\t\treturn '';\n\t}", "function install() {\n\n global $db, $messageStack;\n\n\t if(defined(MODULE_PAYMENT_CCBILL_STATUS)){\n $messsageStack->add_session('CCBill payment module already installed.', 'error');\n zen_redirect(zen_href_link(FILENAME_MODULES, 'set=payment&module=ccbill', 'NONSSL'));\n return 'failed';\n\t }// end if\n\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable CCBill Module', 'MODULE_PAYMENT_CCBILL_STATUS', 'True', 'Do you want to accept CCBill payments ?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Client Account Number', 'MODULE_PAYMENT_CCBILL_ClientAccountNo', '', 'Your six-digit CCBill Client Account Number', '6', '1', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Client SubAccount Number', 'MODULE_PAYMENT_CCBILL_ClientSubAccountNo', '', 'Your four-digit CCBill Client SubAccount Number', '6', '2', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Form Name', 'MODULE_PAYMENT_CCBILL_FormName', '', 'The name of your CCBill payment form', '6', '3', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Is Flex Form', 'MODULE_PAYMENT_CCBILL_IsFlexForm', 'False','Select Yes if the form name provided is a CCBill FlexForm', '6', '4', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Currency', 'MODULE_PAYMENT_CCBILL_Currency', 'USD', 'The currency that will be used by CCBill.', '6', '5', 'zen_cfg_select_option(array(\\'USD\\', \\'EUR\\', \\'AUD\\', \\'CAD\\', \\'GBP\\', \\'JPY\\'), ', now())\");\n //$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Currency Code', 'MODULE_PAYMENT_CCBILL_CurrencyCode', '840', 'The three-digit currency code that CCBill will utilize for billing (USD => 840, EUR => 978, AUD => 036, CAD => 124, GBP => 826, JPY => 392)', '6', '4', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Salt', 'MODULE_PAYMENT_CCBILL_Salt', '', 'The salt value is used by CCBill to verify the hash and can be obtained in one of two ways: (1) Contact client support and receive the salt value, OR (2) Create your own salt value (up to 32 alphanumeric characters) and provide it to client support.', '6', '6', now())\");\n\n\t\t\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_CCBILL_ORDER_STATUS_ID', '1', 'Set the status of orders made with this payment module to this value', '6', '7', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\n\n\n $tcSql = 'CREATE TABLE ccbill '\n . '('\n . 'ccbill_id int(10) UNSIGNED NOT NULL AUTO_INCREMENT, '\n . 'ccbill_tx_id bigint(20)unsigned, '\n . 'first_name varchar(255), '\n . 'last_name varchar(255), '\n . 'email varchar(255), '\n . 'amount decimal(7,2), '\n . 'currency_code int(3), '\n . 'digest varchar(32), '\n . 'success bit DEFAULT 0, '\n . 'order_created bit DEFAULT 0, '\n . 'created TIMESTAMP DEFAULT CURRENT_TIMESTAMP, '\n . 'PRIMARY KEY(ccbill_id)'\n . ')';\n\n $db->Execute($tcSql);\n\n $tcSql = 'ALTER TABLE orders ADD ccbill_id int(10) UNSIGNED';\n\n $db->Execute($tcSql);\n\n $this->notify('NOTIFY_PAYMENT_CCBILL_INSTALLED');\n\n //$messsageStack->add_session('CCBill payment module successfully installed.', 'error');\n //zen_redirect(zen_href_link(FILENAME_MODULES, 'set=payment&module=ccbill', 'NONSSL'));\n\n }", "function maintenance_nag()\n {\n }", "function upgrade_431()\n {\n }", "function wpsc_submit_checkout_handler($args) {\n wp_affiliate_log_debug(\"WPSC Integration - wpsc_submit_checkout_handler(). Saving purchase log ID.\", true);\n global $wpdb;\n $aff_relations_tbl = WP_AFF_RELATIONS_TBL_NAME;\n $purchase_log_id = $args['purchase_log_id'];\n $referrer = wp_affiliate_get_referrer();\n $clientdate = (date(\"Y-m-d\"));\n $clienttime = (date(\"H:i:s\"));\n $clientip = wp_aff_get_user_ip();\n $updatedb = \"INSERT INTO $aff_relations_tbl (unique_ref,refid,reference,date,time,ipaddress,additional_info) VALUES ('$purchase_log_id','$referrer','wp_ecommerce','$clientdate','$clienttime','$clientip','')\";\n $results = $wpdb->query($updatedb);\n}", "function updates()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['updates'] == 1 ) ? 'Database Update' : 'Database Updates';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'reverted' : 'executed';\n\t\t\n\t\tforeach ( $this->xml_array['updates_group']['update'] as $k => $v )\n\t\t{\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->do_update( \"{$v['table']['VALUE']}\", array( \"{$v['key']['VALUE']}\" => \"{$v['new_value']['VALUE']}\" ), \"{$v['where']['VALUE']}\" );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( $v['old_value'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->DB->do_update( \"{$v['table']['VALUE']}\", array( \"{$v['key']['VALUE']}\" => \"{$v['old_value']['VALUE']}\" ), \"{$v['where']['VALUE']}\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['updates']} {$object} {$operation}....\" );\n\t}", "function vtlib_handler($modulename, $event_type) {\n\t\tif($event_type == 'module.postinstall') {\n\t\t\t// TODO Handle post installation actions\n\t\t\t$this->setModuleSeqNumber('configure', $modulename, $modulename.'-', '0000001');\n\t\t} else if($event_type == 'module.disabled') {\n\t\t\t// TODO Handle actions when this module is disabled.\n\t\t} else if($event_type == 'module.enabled') {\n\t\t\t// TODO Handle actions when this module is enabled.\n\t\t} else if($event_type == 'module.preuninstall') {\n\t\t\t// TODO Handle actions when this module is about to be deleted.\n\t\t} else if($event_type == 'module.preupdate') {\n\t\t\t// TODO Handle actions before this module is updated.\n\t\t} else if($event_type == 'module.postupdate') {\n\t\t\t// TODO Handle actions after this module is updated.\n\t\t}\n\t}", "function list_core_update($update)\n {\n }", "static function log($query) {\n\t\tif(!class_exists('Administration')) return;\n\t\t//if(!Symphony::Engine() instanceOf Administration) return;\n\t\t\n\t\tif(Symphony::Configuration()->get('enabled', 'db_sync') == 'no') return;\n\t\t\n\t\t$tbl_prefix = Symphony::Configuration()->get('tbl_prefix', 'database');\n\n\t\t/* FILTERS */\n\t\t// only structural changes, no SELECT statements\n\t\tif (!preg_match('/^(insert|update|delete|create|drop|alter|rename)/i', $query)) return;\n\t\t// un-tracked tables (sessions, cache, authors)\n\t\tif (preg_match(\"/{$tbl_prefix}(authors|cache|forgotpass|sessions)/i\", $query)) return;\n\t\t// content updates in tbl_entries (includes tbl_entries_fields_*)\n\t\tif (preg_match('/^(insert|delete|update)/i', $query) && preg_match(\"/({$config->tbl_prefix}entries)/i\", $query)) return;\n\t\t\n\t\t$line = '';\n\t\t\n\t\tif(self::$meta_written == FALSE) {\n\t\t\t\n\t\t\t$line .= \"\\n\" . '-- ' . date('Y-m-d H:i:s', time());\n\t\t\t\n\t\t\t$author = Administration::instance()->Author;\n\t\t\tif (isset($author)) $line .= ', ' . $author->getFullName();\n\t\t\t\n\t\t\t$url = Administration::instance()->getCurrentPageURL();\n\t\t\tif (!is_null($url)) $line .= ', ' . $url;\n\t\t\t\n\t\t\t$line .= \"\\n\";\n\t\t\t\n\t\t\tself::$meta_written = TRUE;\n\t\t\t\n\t\t}\n\t\t\n\t\t$query = trim($query);\n\t\t\n\t\t// append query delimeter if it doesn't exist\n\t\tif (!preg_match('/;$/', $query)) $query .= \";\";\n\t\t\n\t\t$line .= $query . \"\\n\";\n\t\t\n\t\trequire_once(EXTENSIONS . '/db_sync/extension.driver.php');\n\t\textension_db_sync::addToLogFile($line);\n\t\t\n\t}", "public function welcomInformations() {\n echo \"\\t\\t####################################\\t\\t\\n\";\n echo \"\\t\\t#\\n\";\n echo \"\\t\\t# \" . Utils::red(\"This is a Enterprise Backup Tool!\") . \"\\n\";\n echo \"\\t\\t#\\n\";\n echo \"\\t\\t####################################\\t\\t\\n\\n\";\n }", "function EdenShop03($eden_shop_action){\n\t\n\tglobal $db_shop_setup,$db_admin,$db_shop_basket,$db_admin_contact,$db_admin_contact_shop,$db_shop_carriage,$db_shop_product,$db_shop_product_clothes,$db_shop_clothes_style,$db_shop_clothes_style_parents,$db_shop_clothes_colors;\n\tglobal $db_shop_tax_rates,$db_category,$db_shop_payment_methods,$db_shop_sellers,$db_shop_discount_category;\n\tglobal $url_shop_payments;\n\tglobal $project;\n\tglobal $eden_cfg;\n\t\n\t$_SESSION['loginid'] = AGet($_SESSION,'loginid');\n\t\n\t$res_setup = mysql_query(\"\n\tSELECT shop_setup_show_vat_subtotal, shop_setup_carriage_id, shop_setup_delivery_free_amount_active, shop_setup_delivery_free_amount, shop_setup_delivery_free_num_active, shop_setup_delivery_free_num \n\tFROM $db_shop_setup \n\tWHERE shop_setup_lang='\".mysql_real_escape_string($_GET['lang']).\"'\"\n\t) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$ar_setup = mysql_fetch_array($res_setup);\n\t\n\t$res = mysql_query(\"SELECT COUNT(*) FROM $db_shop_basket WHERE shop_basket_admin_id=\".(integer)$_SESSION['loginid']) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$num = mysql_fetch_array($res);\n\tif ($num[0] > 0){\n\t\t/* Kdyz je zakaznik user/admin */\n\t\tif ($_SESSION['u_status'] != \"seller\"){\n\t\t\t$res = mysql_query(\"SELECT a.admin_firstname,\n\t\t\ta.admin_name,\n\t\t\ta.admin_email,\n\t\t\ta.admin_title,\n\t\t\tac.admin_contact_address_1,\n\t\t\tac.admin_contact_address_2,\n\t\t\tac.admin_contact_city,\n\t\t\tac.admin_contact_postcode,\n\t\t\tac.admin_contact_country,\n\t\t\tac.admin_contact_companyname,\n\t\t\tac.admin_contact_telefon,\n\t\t\tac.admin_contact_mobil,\n\t\t\tacs.admin_contact_shop_use,\n\t\t\tacs.admin_contact_shop_firstname,\n\t\t\tacs.admin_contact_shop_name,\n\t\t\tacs.admin_contact_shop_companyname,\n\t\t\tacs.admin_contact_shop_title,\n\t\t\tacs.admin_contact_shop_address_1,\n\t\t\tacs.admin_contact_shop_address_2,\n\t\t\tacs.admin_contact_shop_city,\n\t\t\tacs.admin_contact_shop_country,\n\t\t\tacs.admin_contact_shop_postcode\n\t\t\tFROM $db_admin AS a, $db_admin_contact AS ac, $db_admin_contact_shop AS acs \n\t\t\tWHERE a.admin_id=\".(integer)$_SESSION['loginid'].\" AND ac.aid=\".(integer)$_SESSION['loginid'].\" AND acs.aid=\".(integer)$_SESSION['loginid']\n\t\t\t) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$ar = mysql_fetch_array($res);\n\t\t\t$company_name = \"none\"; // Zabrani zobrazeni vyzvy k doplneni nazvu firmy - zobrazeni firmy je dulezite jen pro prodejce\n\t\t\t$contact_firstname = $ar['admin_firstname'];\n\t\t\t$contact_surname = $ar['admin_name'];\n\t\t\t$contact_address_1 = $ar['admin_contact_address_1'];\n\t\t\t$contact_address_2 = $ar['admin_contact_address_2'];\n\t\t\t$contact_city = $ar['admin_contact_city'];\n\t\t\t$contact_postcode = $ar['admin_contact_postcode'];\n\t\t\t$contact_country = $ar['admin_contact_country'];\n\t\t\t$contact_email = $ar['admin_email'];\n\t\t\t$contact_telefon = $ar['admin_contact_telefon'];\n\t\t\t$contact_mobil = $ar['admin_contact_mobil'];\n\t\t\t$company_shop_name = \"none\";\n\t\t\t$contact_shop_title = $ar['admin_contact_shop_title'];\n\t\t\t$contact_shop_firstname = $ar['admin_contact_shop_firstname'];\n\t\t\t$contact_shop_name = $ar['admin_contact_shop_name'];\n\t\t\t$contact_shop_address_1 = $ar['admin_contact_shop_address_1'];\n\t\t\t$contact_shop_address_2 = $ar['admin_contact_shop_address_2'];\n\t\t\t$contact_shop_city = $ar['admin_contact_shop_city'];\n\t\t\t$contact_shop_postcode = $ar['admin_contact_shop_postcode'];\n\t\t\t$contact_shop_country = $ar['admin_contact_shop_country'];\n\t\t} else {\n\t\t/* Kdyz je zakaznik prodejce */\n\t\t\t$res = mysql_query(\"SELECT a.admin_firstname,\n\t\t\ta.admin_name,\n\t\t\ta.admin_email,\n\t\t\ta.admin_title,\n\t\t\tss.shop_seller_phone_1,\n\t\t\tss.shop_seller_mobile,\n\t\t\tss.shop_seller_delivery_country_id,\n\t\t\tss.shop_seller_delivery_city,\n\t\t\tss.shop_seller_delivery_address_1,\n\t\t\tss.shop_seller_delivery_address_2,\n\t\t\tss.shop_seller_delivery_postcode,\n\t\t\tss.shop_seller_invoice_country_id,\n\t\t\tss.shop_seller_invoice_city,\n\t\t\tss.shop_seller_invoice_address_1,\n\t\t\tss.shop_seller_invoice_address_2,\n\t\t\tss.shop_seller_invoice_postcode \n\t\t\tFROM $db_admin AS a, $db_shop_sellers AS ss \n\t\t\tWHERE a.admin_id=\".(integer)$_SESSION['loginid'].\" AND ss.shop_seller_admin_id=\".(integer)$_SESSION['loginid']\n\t\t\t) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$ar = mysql_fetch_array($res);\n\t\t\t$company_name = $ar['shop_seller_company_name'];\n\t\t\t$contact_firstname = $ar['admin_firstname'];\n\t\t\t$contact_surname = $ar['admin_name'];\n\t\t\t$contact_address_1 = $ar['shop_seller_invoice_address_1'];\n\t\t\t$contact_address_2 = $ar['shop_seller_invoice_address_2'];\n\t\t\t$contact_city = $ar['shop_seller_invoice_city'];\n\t\t\t$contact_postcode = $ar['shop_seller_invoice_postcode'];\n\t\t\t$contact_country = $ar['shop_seller_invoice_country_id'];\n\t\t\t$contact_email = $ar['admin_email'];\n\t\t\t$contact_telefon = $ar['shop_seller_phone_1'];\n\t\t\t$contact_mobil = $ar['shop_seller_mobile'];\n\t\t\t$company_shop_name = $ar['shop_seller_company_name'];\n\t\t\t$contact_shop_title = $ar['admin_title'];\n\t\t\t$contact_shop_firstname = $ar['admin_firstname'];\n\t\t\t$contact_shop_name = $ar['admin_name'];\n\t\t\t$contact_shop_address_1 = $ar['shop_seller_delivery_address_1'];\n\t\t\t$contact_shop_address_2 = $ar['shop_seller_delivery_address_2'];\n\t\t\t$contact_shop_city = $ar['shop_seller_delivery_city'];\n\t\t\t$contact_shop_postcode = $ar['shop_seller_delivery_postcode'];\n\t\t\t$contact_shop_country = $ar['shop_seller_delivery_country_id'];\n\t\t}\n\t\techo \"\t<div align=\\\"center\\\">\\n\";\n\t\techo \"\t\t<div id=\\\"edenshop_progress_border_top\\\"></div>\\n\";\n\t\techo \"\t\t<div id=\\\"edenshop_progress_border_mid\\\">\\n\";\n\t\techo \"\t\t\t<img src=\\\"images/edenshop_pbar_03_delivery_en.gif\\\" width=\\\"500\\\" height=\\\"100\\\" alt=\\\"\\\">\\n\";\n\t\techo \"\t\t</div>\\n\";\n\t\techo \"\t\t<div id=\\\"edenshop_progress_border_bottom\\\"></div>\\n\";\n\t\techo \"\t</div>\\n\";\n\t\techo \"\t<div align=\\\"center\\\">\\n\";\n\t\techo \"\t\t<div id=\\\"edenshop_progress_border_top\\\"></div>\\n\";\n\t\techo \"\t\t<div id=\\\"edenshop_progress_border_mid\\\">\\n\";\n\t\techo \"\t\t\t<div id=\\\"edenshop_progress_title\\\">\"._SHOP_03_CUSTOMER_AND_DELIVERY.\"</div><br><br>\\n\";\n\t\techo \"\t\t\t<table id=\\\"edenshop_progress_03\\\">\";\n\t\t// Pokud se edituje uzivatel, nezobrazi se cela tato cast\n\t\tif ($_GET['action_shop'] != \"shop_check_del_address\"){\n\t\t\t// Pokud chybi nejaka polozka z adresy uzivatele zobrazi se vyzva\n\t\t\tif ($company_name = \"\" || $contact_firstname == \"\" || $contact_surname == \"\" || $contact_address_1 == \"\" || $contact_city == \"\" || $contact_postcode == \"\" || $contact_email == \"\"){\n\t\t\t\techo \"\t<tr>\\n\";\n\t\t\t\techo \"\t\t<td colspan=\\\"3\\\">\\n\";\n\t\t\t\techo \"\t\t\t<table id=\\\"edenshop_progress_address_error\\\">\\n\";\n\t\t\t\techo \"\t\t\t\t<tr id=\\\"edenshop_progress_address_error\\\">\\n\";\n\t\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_error\\\">\"._SHOP_CUSTOMER_FILL_FIELD.\"</td>\\n\";\n\t\t\t\techo \"\t\t\t\t</tr>\\n\";\n\t\t\t\techo \"\t\t\t</table>\\n\";\n\t\t\t\techo \"\t\t</td>\\n\";\n\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t}\n\t\t\techo \"\t<tr>\\n\";\n\t\t\techo \"\t\t<td id=\\\"edenshop_progress_03_customer\\\" valign=\\\"top\\\">\\n\";\n\t\t\techo \"\t\t\t<table id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\techo \"\t\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_main_title\\\" colspan=\\\"2\\\"><strong>\"._SHOP_03_CUSTOMER_ADDRESS.\"</strong> <a href=\\\"index.php?action=03&amp;action_shop=shop_check_del_address&amp;mode=edit_user&amp;lang=\".$_GET['lang'].\"&amp;filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\"><< \"._SHOP_PROGRESS_CHANGE.\"</a></td>\\n\";\n\t\t\techo \"\t\t\t\t</tr>\\n\";\n\t\t\t\t\t\t\t\tif ($_SESSION['u_status'] == \"seller\"){\n\t\t\t\t\t\t\t\t\techo \" \t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\t\t\t\t\t\t\techo \" \t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_COMPANY_NAME.\"</td>\\n\";\n\t\t\t\t\t\t\t\t\techo \" \t\t<td id=\\\"edenshop_progress_address_address\\\">\".$company_name.\"</td>\\n\";\n\t\t\t\t\t\t\t\t\techo \" \t</tr>\\n\";\n\t\t\t\t\t\t\t\t}\n\t\t\techo \"\t\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_CUSTOMER_NAME.\"</td>\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_address\\\">\"; if($contact_firstname == \"\" || $contact_surname == \"\"){echo \"<span class=\\\"edenshop_error\\\">*</span>\"; } else { if ($ar['admin_title'] != \"\"){echo $ar['admin_title'].\" \";} echo $contact_firstname.\" \".$contact_surname;} echo \"</td>\\n\";\n\t\t\techo \"\t\t\t\t</tr>\\n\";\n\t\t\techo \"\t\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_CUSTOMER_ADDRESS.\"</td>\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_address\\\">\"; \n\t\t\t\t\t\t\t\t\t\tif ($contact_address_1 == \"\"){\n\t\t\t\t\t\t\t\t\t\t\techo \"<span class=\\\"edenshop_error\\\">*</span>\"; \n\t\t\t\t\t\t\t\t\t\t} else { \n\t\t\t\t\t\t\t\t\t\t\techo $contact_address_1.\"<br>\\n\";\n\t\t\t\t\t\t\t\t\t \t\tif ($contact_address_2 != \"\"){\n\t\t\t\t\t\t\t\t\t \t\t\techo $contact_address_2.\"<br>\";\n\t\t\t\t\t\t\t\t\t \t\t}\n\t\t\t\t\t\t\t\t\t \t}\n\t\t\techo \"\t\t\t\t\t</td>\\n\";\n\t\t\techo \"\t\t\t\t</tr>\\n\";\n\t\t\techo \"\t\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_CUSTOMER_CITY.\"</td>\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_address\\\">\"; if($contact_city == \"\"){echo \"<span class=\\\"edenshop_error\\\">*</span>\"; } else { echo $contact_city;} echo \"</td>\\n\";\n\t\t\techo \"\t\t\t\t</tr>\\n\";\n\t\t\techo \"\t\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_CUSTOMER_POSTCODE.\"</td>\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_address\\\">\"; if ($contact_postcode == \"\"){echo \"<span class=\\\"edenshop_error\\\">*</span>\"; } else { echo $contact_postcode;} echo \"</td>\\n\";\n\t\t\techo \"\t\t\t\t</tr>\\n\";\n\t\t\techo \"\t\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_CUSTOMER_COUNTRY.\"</td>\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_address\\\">\"; if ($contact_country == \"\"){echo \"<span class=\\\"edenshop_error\\\">*</span>\"; } else { echo ShowCountryName($contact_country);} echo \"</td>\\n\";\n\t\t\techo \"\t\t\t\t</tr>\\n\";\n\t\t\techo \"\t\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_CUSTOMER_EMAIL.\"</td>\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_address\\\">\"; if ($contact_email == \"\"){echo \"<span class=\\\"edenshop_error\\\">*</span>\"; } else { echo $contact_email;} echo \"</td>\\n\";\n\t\t\techo \"\t\t\t\t</tr>\\n\";\n\t\t\techo \"\t\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_CUSTOMER_TELEPHONE.\"</td>\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_address\\\">\".$contact_telefon.\"</td>\\n\";\n\t\t\techo \"\t\t\t\t</tr>\\n\";\n\t\t\techo \"\t\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_CUSTOMER_MOBILE.\"</td>\\n\";\n\t\t\techo \"\t\t\t\t\t<td id=\\\"edenshop_progress_address_address\\\">\".$contact_mobil.\"</td>\\n\";\n\t\t\techo \"\t\t\t\t</tr>\\n\";\n\t\t\techo \"\t\t\t</table>\\n\";\n\t\t\techo \"\t\t</td>\\n\";\n\t\t\techo \"\t\t<td id=\\\"edenshop_progress_03_delivery\\\" valign=\\\"top\\\">\";\n\t\t\tif ($ar['admin_contact_shop_use'] == 0){\n\t\t\t\techo \"<a href=\\\"index.php?action=03&amp;action_shop=shop_check_del_address&amp;mode=edit_user&amp;lang=\".$_GET['lang'].\"&amp;filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\">\"._SHOP_PROGRESS_ADD_DELIVERY.\"</a>\";\n\t\t\t} elseif ($ar['admin_contact_shop_firstname'] == \"\" && $ar['admin_contact_shop_name'] == \"\"){\n\t\t\t\techo \"<a href=\\\"index.php?action=03&amp;action_shop=shop_check_del_address&amp;mode=edit_user&amp;lang=\".$_GET['lang'].\"&amp;filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\">\"._SHOP_PROGRESS_ADD_DELIVERY.\"</a><br>\";\n\t\t\t\techo _ADMIN_INFO_CONTACT_SHOP_HELP;\n\t\t\t} else {\n\t\t\t\techo \"\t\t<table id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\t\techo \"\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\t\techo \"\t\t\t\t<td id=\\\"edenshop_progress_address_title\\\" colspan=\\\"2\\\"><strong>\"._SHOP_03_DELIVERY_ADDRESS.\"</strong> <a href=\\\"index.php?action=03&amp;action_shop=shop_check_del_address&amp;mode=edit_user&amp;lang=\".$_GET['lang'].\"&amp;filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\"><< \"._SHOP_PROGRESS_CHANGE.\"</a></td>\\n\";\n\t\t\t\techo \"\t\t\t</tr>\\n\";\n\t\t\t\t\t\t\t\tif ($_SESSION['u_status'] == \"seller\"){\n\t\t\t\t\t\t\t\t\techo \"\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\t\t\t\t\t\t\techo \"\t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_COMPANY_NAME.\"</td>\\n\";\n\t\t\t\t\t\t\t\t\techo \"\t\t<td id=\\\"edenshop_progress_address_address\\\">\".$company_shop_name.\"</td>\\n\";\n\t\t\t\t\t\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\techo \"\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\t\techo \"\t\t\t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_CUSTOMER_NAME.\"</td>\\n\";\n\t\t\t\techo \"\t\t\t\t<td id=\\\"edenshop_progress_address_address\\\">\"; if ($ar['admin_title'] != \"\"){echo $ar['admin_title'].\" \";} echo $contact_firstname.\" \".$contact_surname.\"</td>\\n\";\n\t\t\t\techo \"\t\t\t</tr>\\n\";\n\t\t\t\techo \"\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\t\techo \"\t\t\t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_CUSTOMER_ADDRESS.\"</td>\\n\";\n\t\t\t\techo \"\t\t\t\t<td id=\\\"edenshop_progress_address_address\\\">\".$contact_shop_address_1.\"<br>\\n\";\n\t\t\t\t\t\t\t\t\t\tif ($contact_shop_address_2 != \"\"){echo $contact_shop_address_2.\"<br>\"; }\n\t\t\t\techo \"\t\t\t\t</td>\\n\";\n\t\t\t\techo \"\t\t\t</tr>\\n\";\n\t\t\t\techo \"\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\t\techo \"\t\t\t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_CUSTOMER_CITY.\"</td>\\n\";\n\t\t\t\techo \"\t\t\t\t<td id=\\\"edenshop_progress_address_address\\\">\".$contact_shop_city.\"</td>\\n\";\n\t\t\t\techo \"\t\t\t</tr>\\n\";\n\t\t\t\techo \"\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\t\techo \"\t\t\t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_CUSTOMER_POSTCODE.\"</td>\\n\";\n\t\t\t\techo \"\t\t\t\t<td id=\\\"edenshop_progress_address_address\\\">\".$contact_shop_postcode.\"</td>\\n\";\n\t\t\t\techo \"\t\t\t</tr>\\n\";\n\t\t\t\techo \"\t\t\t<tr id=\\\"edenshop_progress_address\\\">\\n\";\n\t\t\t\techo \"\t\t\t\t<td id=\\\"edenshop_progress_address_sub_title\\\">\"._SHOP_CUSTOMER_COUNTRY.\"</td>\\n\";\n\t\t\t\techo \"\t\t\t\t<td id=\\\"edenshop_progress_address_address\\\">\".ShowCountryName($contact_shop_country).\"</td>\\n\";\n\t\t\t\techo \"\t\t\t</tr>\\n\";\n\t\t\t\techo \"\t\t</table>\\n\";\n\t\t\t}\n\t\t\techo \"\t\t</td>\\n\";\n\t\t\techo \"\t</tr>\";\n\t\t}\n\t\tif ($_GET['action_shop'] == \"shop_check_del_address\"){\n\t\t\techo \"<tr>\";\n\t\t\techo \"\t<td>\";\n\t\t\techo \"\t\t<a href=\\\"index.php?action=03&amp;lang=\".$_GET['lang'].\"&amp;filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\"><< \"._SHOP_PROGRESS_BACK.\"</a><br>\";\n \t\t\techo UserEdit(\"shop_check_del_address\").\"<br>\";\n\t\t\techo \"\t</td>\";\n\t\t\techo \"\t</tr>\";\n\t\t}\n\t\techo \"\t\t\t</table>\\n\";\n\t\techo \"\t\t</div>\\n\";\n\t\techo \"\t\t<div id=\\\"edenshop_progress_border_bottom\\\"></div>\\n\";\n\t\techo \"\t</div>\";\n\t// Pokud se edituje uzivatel, nezobrazi se cela tato cast\n\tif ($_GET['action_shop'] != \"shop_check_del_address\"){\n\t\techo \"\t<div align=\\\"center\\\">\\n\";\n\t\techo \"\t\t<div id=\\\"edenshop_progress_border_top\\\"></div>\\n\";\n\t\techo \"\t\t<div id=\\\"edenshop_progress_border_mid\\\">\\n\";\n\t\techo \"\t\t<div id=\\\"edenshop_progress_title\\\">\"._SHOP_03_BASKET_CONTENTS.\"</div><br><br>\";\n \t\t$res_basket = mysql_query(\"\n\t\tSELECT shop_basket_products_id, shop_basket_quantity \n\t\tFROM $db_shop_basket \n\t\tWHERE shop_basket_admin_id=\".(integer)$_SESSION['loginid'].\" \n\t\tORDER BY shop_basket_date_added ASC\"\n\t\t) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t$num_basket = mysql_num_rows($res_basket);\n\t\techo \"\t<table id=\\\"edenshop_progress_basket_headline\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" border=\\\"1\\\">\\n\";\n\t\techo \"\t<tr id=\\\"edenshop_progress_basket_name\\\">\\n\";\n\t\techo \"\t\t<td id=\\\"edenshop_progress_basket_name_qty\\\">\"._SHOP_QTY.\"</td>\\n\";\n\t\techo \"\t\t<td id=\\\"edenshop_progress_basket_name_code\\\">\"._SHOP_CODE.\"</td>\\n\";\n\t\techo \"\t\t<td id=\\\"edenshop_progress_basket_name_title\\\">\"._SHOP_TITLE.\"</td>\\n\";\n\t\t\t\t\tif ($ar_setup['shop_setup_show_vat_subtotal'] == 1){ echo \"<td id=\\\"edenshop_progress_basket_name_ex_vat\\\">\"._SHOP_PRICE_EX_VAT_S.\"</td>\"; }\n\t\techo \"\t\t<td id=\\\"edenshop_progress_basket_name_inc_vat\\\">\"._SHOP_PRICE_INC_VAT_S.\"</td>\\n\";\n\t\techo \"\t</tr>\";\n\t\tif ($_SESSION['u_status'] == \"seller\"){\n\t\t\t/* Nacteme vsechny slevove kategorie pro prodejce */\n\t\t\t$res_discount = mysql_query(\"\n\t\t\tSELECT shop_discount_category_id, shop_discount_category_name \n\t\t\tFROM $db_shop_discount_category \n\t\t\tWHERE shop_discount_category_parent_id=0 AND shop_discount_category_type < 30\"\n\t\t\t) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$i=0;\n\t\t\t/* Ty pak ulozime do vicerozmerneho pole spolu s mnozstvim - na zacatku je mnozstvi 0 */\n\t\t\twhile ($ar_discount = mysql_fetch_array($res_discount)){\n\t\t\t\t/* array (discount kategorie, mnozstvi vyrobku) */\n\t\t\t\t$discount[$i] = array($ar_discount['shop_discount_category_id'],0);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t/* Spocitame mnozstvi slevovych kategorii v poli - nize pouzijeme pro iteraci */\n\t\t\t$pocet_disc = count($discount);\n\t\t\t/* Projdeme vsechny polozky v kosiku */\n\t\t\twhile($ar_basket = mysql_fetch_array($res_basket)){\n\t\t\t\t$res_product = mysql_query(\"\n\t\t\t\tSELECT shop_product_discount_cat_seller_id \n\t\t\t\tFROM $db_shop_product \n\t\t\t\tWHERE shop_product_id=\".(integer)$ar_basket['shop_basket_products_id'].\" \n\t\t\t\tGROUP BY shop_product_discount_cat_seller_id\"\n\t\t\t\t) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t/* Projdeme vsehchny produkty v kosiku a patrame po tom jestli maji ulozen zaznam o slevove kategorii */\n\t\t\t\twhile ($ar_product = mysql_fetch_array($res_product)){\n\t\t\t\t\t$y = 0;\n\t\t\t\t\t/* Projdeme vsechny slevove kategorie pro obchodniky */\n\t\t\t\t\twhile ($y < $pocet_disc){\n\t\t\t\t\t\t/* A kdyz nalezneme zaznam pripocteme mnozstvi kusu daneho produktu do vicerozmerneho pole se slevovymi kategoriemi */\n\t\t\t\t\t\tif ($discount[$y][0] == $ar_product['shop_product_discount_cat_seller_id']){$discount[$y][1] = $discount[$y][1] + (integer)$ar_basket['shop_basket_quantity'];}\n\t\t\t\t\t\t$y++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* Do vicerozmerneho pole vlozime ID discount kategorie, mnozstvi vyrobku a cenu za jeden vyrobek*/\n\t\t\t$y = 0;\n\t\t\twhile ($y < $pocet_disc){\n\t\t\t\t//echo \"Discount Cat ID = \".$discount[$y][0].\" - Qty = \".$discount[$y][1].\"<br>\";\n\t\t\t\t$res_dc_price = mysql_query(\"\n\t\t\t\tSELECT shop_discount_category_discount_price \n\t\t\t\tFROM $db_shop_discount_category \n\t\t\t\tWHERE shop_discount_category_parent_id=\".$discount[$y][0].\" AND \".$discount[$y][1].\" BETWEEN shop_discount_category_discounted_from_amount AND shop_discount_category_discounted_to_amount\"\n\t\t\t\t) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t$ar_dc_price = mysql_fetch_array($res_dc_price);\n\t\t\t\t/* $discount_cat[ID discount kategorie][0 = mnozstvi vyrobku/1 = cena] */\n\t\t\t\t$discount_cat[$discount[$y][0]] = array($discount[$y][1],$ar_dc_price['shop_discount_category_discount_price']);\n\t\t\t\t$y++;\n\t\t\t}\n\t\t}\n\t\t$i_basket = 0;\n\t\tmysql_data_seek($res_basket, 0);\n\t\twhile($ar_basket = mysql_fetch_array($res_basket)){\n\t\t\t$res_product = mysql_query(\"\n\t\t\tSELECT p.shop_product_selling_price, p.shop_product_id, p.shop_product_product_code, p.shop_product_name, p.shop_product_vat_class_id, p.shop_product_discount_cat_seller_id, \n\t\t\tp.shop_product_discount_cat_cust_id, c.category_name, cstp.shop_clothes_style_parents_title, cc.shop_clothes_colors_title, pc.shop_product_clothes_size \n\t\t\tFROM $db_shop_product AS p \n\t\t\tJOIN $db_shop_product_clothes AS pc ON shop_product_clothes_product_id=\".(integer)$ar_basket['shop_basket_products_id'].\" \n\t\t\tJOIN $db_shop_clothes_style AS cst ON cst.shop_clothes_style_parent_id=pc.shop_product_clothes_style_id \n\t\t\tJOIN $db_shop_clothes_style_parents AS cstp ON cstp.shop_clothes_style_parents_id=cst.shop_clothes_style_parent_id \n\t\t\tJOIN $db_shop_clothes_colors AS cc ON cc.shop_clothes_colors_id=pc.shop_product_clothes_color_id \n\t\t\tJOIN $db_category AS c ON c.category_id=p.shop_product_master_category \n\t\t\tWHERE shop_product_id=\".(integer)$ar_basket['shop_basket_products_id']\n\t\t\t) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\n\t\t\t$ar_product = mysql_fetch_array($res_product);\n\t\t\t$res_product_tax_rate = mysql_query(\"\n\t\t\tSELECT shop_tax_rates_rate \n\t\t\tFROM $db_shop_tax_rates \n\t\t\tWHERE shop_tax_rates_class_id=\".(integer)$ar_product['shop_product_vat_class_id'].\" \n\t\t\tORDER BY shop_tax_rates_priority DESC\"\n\t\t\t) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$ar_product_tax_rate = mysql_fetch_array($res_product_tax_rate);\n\t\t\tif ($_SESSION['u_status'] == \"seller\"){\n\t\t\t \t/* Cena za jednotku vynasobena mnozstvim */\n\t\t\t\t$price_inc_vat = $discount_cat[$ar_product['shop_product_discount_cat_seller_id']][1] * $ar_basket['shop_basket_quantity'];\n\t\t\t} else {\n\t\t\t\t/* Cena za jednotku vynasobena mnozstvim */\n\t\t\t\t$price_inc_vat = $ar_product['shop_product_selling_price'] * $ar_basket['shop_basket_quantity'];\n\t\t\t}\n\t\t\t$price_ex_vat = $price_inc_vat / ($ar_product_tax_rate['shop_tax_rates_rate']/100+1);\n\t\t\t$price_vat = ($price_inc_vat - $price_ex_vat);\n\t\t\techo \"<tr id=\\\"edenshop_progress_basket\\\">\\n\";\n\t\t\techo \"\t<td id=\\\"edenshop_progress_basket_qty\\\">\".$ar_basket['shop_basket_quantity'].\"</td>\\n\";\n\t\t\techo \"\t<td id=\\\"edenshop_progress_basket_code\\\"><a href=\\\"index.php?action=\".strtolower($ar_product['category_name']).\"&amp;lang=\".$_GET['lang'].\"&amp;filter=\".$_GET['filter'].\"&amp;prod_id=\".$ar_product['shop_product_id'].\"&amp;spec=1\\\">\".$ar_product['shop_product_product_code'].\"</a></td>\\n\";\n\t\t\techo \"\t<td id=\\\"edenshop_progress_basket_title\\\"><strong>\".$ar_product['shop_product_name'].\"</strong><br>\".$ar_product['shop_clothes_style_parents_title'].\", \".$ar_product['shop_clothes_colors_title'].\", \".$ar_product['shop_product_clothes_size'].\"</td>\\n\";\n\t\t\t\t\t if ($ar_setup['shop_setup_show_vat_subtotal'] == 1){ echo \"<td id=\\\"edenshop_progress_basket_ex_vat\\\">\".PriceFormat($price_ex_vat).\"</td>\";}\n\t\t\techo \"\t<td id=\\\"edenshop_progress_basket_inc_vat\\\">\".PriceFormat($price_inc_vat).\"</td>\\n\";\n\t\t\techo \"</tr>\";\n\t\t\t$quantity = $quantity + $ar_basket['shop_basket_quantity'];\n\t\t\t$total_nett_price = $price_ex_vat + $total_nett_price;\n\t\t\t$total_vat = $price_vat + $total_vat;\n\t\t\t$subtotal = $price_inc_vat + $subtotal;\n\t\t\t$i_basket++;\n\t\t}\n\t\t\n\t\tif ($_SESSION['u_status'] == \"seller\"){\n\t\t\t$res_carr = mysql_query(\"SELECT shop_carriage_price FROM $db_shop_carriage WHERE shop_carriage_wholesale=1\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$ar_carr = mysql_fetch_array($res_carr);\n\t\t\t$carriage_price = $ar_carr['shop_carriage_price'];\n\t\t} else {\n\t\t\t$res_carr = mysql_query(\"SELECT shop_carriage_price FROM $db_shop_carriage WHERE shop_carriage_id=\".(integer)$ar_setup['shop_setup_carriage_id']) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t$ar_carr = mysql_fetch_array($res_carr);\n\t\t\t/* Kdyz je pocet nebo castka vetsi nez aktivni zadane veliciny tak je doprava FREE */\n\t\t\tif ($ar_setup['shop_setup_delivery_free_amount_active'] == 1 && $total_nett_price > $ar_setup['shop_setup_delivery_free_amount']){\n\t\t\t\t$carriage_price = 0;\n\t\t\t} elseif ($ar_setup['shop_setup_delivery_free_num_active'] == 1 && $quantity > $ar_setup['shop_setup_delivery_free_num']){\n\t\t\t\t$carriage_price = 0;\n\t\t\t} else {\n\t\t\t\t$carriage_price = $ar_carr['shop_carriage_price'];\n\t\t\t}\n\t\t}\n\t\t$total_total = $total_nett_price + $total_vat + $carriage_price;\n\t\t\techo \"\t\t\t\t</table>\\n\";\n\t\t\techo \"\t\t\t\t<table id=\\\"edenshop_progress_basket_headline\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\" border=\\\"0\\\">\\n\";\n\t\t\techo \"\t\t\t\t\t<tr>\\n\";\n\t\t\techo \"\t\t\t\t\t\t<td id=\\\"edenshop_progress_basket_recalculate\\\"><br></td>\\n\";\n\t\t\techo \"\t\t\t\t\t\t<td id=\\\"edenshop_progress_basket_total\\\">\\n\";\n\t\t\techo \"\t\t\t\t\t\t\t<table width=\\\"100%\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\" border=\\\"0\\\">\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\tif ($ar_setup['shop_setup_show_vat_subtotal'] == 1 || $_SESSION['u_status'] == \"seller\"){\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \" \t<tr>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \" \t\t<td id=\\\"edenshop_progress_basket_total\\\">\"._SHOP_NETT_TOTAL.\"</td>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t\t<td id=\\\"edenshop_progress_basket_total_price\\\">\".PriceFormat(TepRound($total_nett_price,2)).\"</td>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t<tr>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t\t<td colspan=\\\"2\\\" id=\\\"edenshop_basket_dotted\\\"></td>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t<tr>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t\t<td id=\\\"edenshop_progress_basket_total\\\">\"._SHOP_TOTAL_VAT.\"</td>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t\t<td id=\\\"edenshop_progress_basket_total_price\\\">\".PriceFormat(TepRound($total_vat,2)).\"</td>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t<tr>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t\t<td colspan=\\\"2\\\" id=\\\"edenshop_basket_dotted\\\"></td>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t<tr>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t\t<td id=\\\"edenshop_progress_basket_total\\\">\"._SHOP_SUBTOTAL.\"</td>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t\t<td id=\\\"edenshop_progress_basket_total_price\\\">\".PriceFormat(TepRound($subtotal,2)).\"</td>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t<tr>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t\t<td colspan=\\\"2\\\" id=\\\"edenshop_basket_dotted\\\"></td>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\techo \"\t\t\t\t\t\t\t\t<tr>\\n\";\n\t\t\techo \"\t\t\t\t\t\t\t\t\t<td id=\\\"edenshop_progress_basket_total\\\">\"._SHOP_CARRIAGE.\"</td>\\n\";\n\t\t\techo \"\t\t\t\t\t\t\t\t\t<td id=\\\"edenshop_progress_basket_total_price\\\">\\n\";\n\t\t \t\t\t\t\t\t\t\t\t\t\tif ($carriage_price == 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo \"FREE\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo PriceFormat(TepRound($carriage_price,2));\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\techo \"\t\t\t\t\t\t\t\t\t</td>\\n\";\n\t\t\techo \"\t\t\t\t\t\t\t\t</tr>\\n\";\n\t\t\techo \"\t\t\t\t\t\t\t\t<tr>\\n\";\n\t\t\techo \"\t\t\t\t\t\t\t\t\t<td colspan=\\\"2\\\" id=\\\"edenshop_progress_basket_dotted\\\"></td>\\n\";\n\t\t\techo \"\t\t\t\t\t\t\t\t</tr>\\n\";\n\t\t\techo \"\t\t\t\t\t\t\t\t<tr>\\n\";\n\t\t\techo \"\t\t\t\t\t\t\t\t\t<td id=\\\"edenshop_progress_basket_total\\\">\"._SHOP_TOTAL.\"</td>\\n\";\n\t\t\techo \"\t\t\t\t\t\t\t\t\t<td id=\\\"edenshop_progress_basket_total_total\\\">\".PriceFormat(TepRound($total_total)).\"</td>\\n\";\n\t\t\techo \"\t\t\t\t\t\t\t\t</tr>\\n\";\n\t\t\techo \"\t\t\t\t\t\t\t</table>\\n\";\n\t\t\techo \"\t\t\t\t\t\t</td>\\n\";\n\t\t\techo \"\t\t\t\t\t</tr>\\n\";\n\t\t\techo \"\t\t\t\t</table>\\n\";\n\t\t\techo \"\t\t</div>\\n\";\n\t\t\techo \"\t\t<div id=\\\"edenshop_progress_border_bottom\\\"></div>\\n\";\n\t\t\techo \"\t</div>\\n\";\n\t\t\techo \"\t<div align=\\\"center\\\">\\n\";\n\t\t\techo \"\t\t<div id=\\\"edenshop_progress_border_top\\\"></div>\\n\";\n\t\t\techo \"\t\t<div id=\\\"edenshop_progress_border_mid\\\">\\n\";\n\t\t\techo \"\t\t<div id=\\\"edenshop_progress_title\\\">\"._SHOP_03_DELIVERY_OPTIONS.\"</div><br><br>\\n\";\n\t\t\techo \"\t\t\t<table width=\\\"100%\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\" border=\\\"0\\\">\\n\";\n\t\t\t\t\t\t\t// Zabezpeceni aby nebyl zobrazen formular pokud chybi nektery z kontaktnich udaju\n\t\t\t\t\t\t \tif ($contact_firstname != \"\" && $contact_surname != \"\" && $contact_address_1 != \"\" && $contact_city != \"\" && $contact_postcode != \"\" && $contact_email != \"\"){\n\t\t\t\t\t\t\t\techo \"<form action=\\\"\".$eden_cfg['url_edencms'].\"eden_shop_save.php?lang=\".$_GET['lang'].\"&amp;filter=\".$_GET['filter'].\"\\\" method=\\\"post\\\">\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($carriage_price == 0){\n\t\t\t\t\t\t\t\tif ($_SESSION['u_status'] == \"seller\"){\n\t\t\t\t\t\t\t\t\t$where = \"shop_carriage_wholesale=1\";\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$where = \"shop_carriage_price=0\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$res_carr = mysql_query(\"SELECT shop_carriage_id, shop_carriage_title, shop_carriage_description FROM $db_shop_carriage WHERE $where\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t\t\t\t\t$ar_carr = mysql_fetch_array($res_carr);\n\t\t\t\t\t\t\t\techo \"\t<tr>\\n\";\n\t\t\t\t\t\t\t\techo \"\t\t<td id=\\\"edenshop_progress_delivery_radio\\\"><input type=\\\"hidden\\\" name=\\\"shop_carriage_id\\\" id=\\\"edenshop_progress_carriage\\\" value=\\\"\".$ar_carr['shop_carriage_id'].\"\\\"></td>\\n\";\n\t\t\t\t\t\t\t\techo \"\t\t<td id=\\\"edenshop_progress_delivery_title\\\">\".$ar_carr['shop_carriage_description'].\" - <strong>FREE</strong></td>\\n\";\n\t\t\t\t\t\t\t\techo \"\t\t<td id=\\\"edenshop_progress_delivery_price\\\">\"._SHOP_PROGRESS_TOTAL_PRICE; $price = $total_nett_price + $total_vat; echo \"<strong>\".PriceFormat($price).\"</strong>&nbsp;</td>\\n\";\n\t\t\t\t\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// V pripade ze Delivery adresa neni vyplnena pouzije se jako delivery adresa adresa normalni\n\t\t\t\t\t\t\t\tif ($ar['admin_contact_shop_country'] == \"\"){$delivery_zone = RoyalMailWorldZone($ar['admin_contact_country']);} else {$delivery_zone = RoyalMailWorldZone($ar['admin_contact_shop_country']);}\n\t\t\t\t\t\t\t\t$res_carr = mysql_query(\"\n\t\t\t\t\t\t\t\tSELECT shop_carriage_id, shop_carriage_title, shop_carriage_price \n\t\t\t\t\t\t\t\tFROM $db_shop_carriage \n\t\t\t\t\t\t\t\tWHERE shop_carriage_category='\".$delivery_zone.\"' \n\t\t\t\t\t\t\t\tORDER BY shop_carriage_price ASC, shop_carriage_category ASC\"\n\t\t\t\t\t\t\t\t) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t\t\t\t\t$i = 1;\n\t\t\t\t\t\t\t\twhile($ar_carr = mysql_fetch_array($res_carr)){\n\t\t\t\t\t\t\t\t\techo \"\t<tr>\\n\";\n\t\t\t\t\t\t\t\t\techo \"\t\t<td id=\\\"edenshop_progress_delivery_radio\\\"><input type=\\\"radio\\\" name=\\\"shop_carriage_id\\\" id=\\\"edenshop_progress_carriage\\\" value=\\\"\".$ar_carr['shop_carriage_id'].\"\\\" \"; if ($ar_carr['shop_carriage_id'] == $ar_setup['shop_setup_carriage_id']){ echo 'checked=\\\"checked\\\"';} echo \"></td>\\n\";\n\t\t\t\t\t\t\t\t\techo \"\t\t<td id=\\\"edenshop_progress_delivery_title\\\">\".$ar_carr['shop_carriage_title'].\" - <strong>\".PriceFormat($ar_carr['shop_carriage_price']).\"</strong></td>\\n\";\n\t\t\t\t\t\t\t\t\techo \"\t\t<td id=\\\"edenshop_progress_delivery_price\\\">\"._SHOP_PROGRESS_TOTAL_PRICE; $price = $total_nett_price + $total_vat + $ar_carr['shop_carriage_price']; echo \"<strong>\".PriceFormat($price).\"</strong>&nbsp;</td>\\n\";\n\t\t\t\t\t\t\t\t\techo \"\t</tr>\\n\";\n\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\techo \"\t\t\t</table>\\n\";\n\t\t\techo \"\t\t</div>\\n\";\n\t\t\techo \"\t\t<div id=\\\"edenshop_progress_border_bottom\\\"></div>\\n\";\n\t\t\techo \"\t</div>\\n\";\n\t\t\techo \"\t<div align=\\\"center\\\">\\n\";\n\t\t\techo \"\t\t<div id=\\\"edenshop_progress_border_top\\\"></div>\\n\";\n\t\t\techo \"\t\t<div id=\\\"edenshop_progress_border_mid\\\">\\n\";\n\t\t\techo \"\t\t\t<div id=\\\"edenshop_progress_title\\\">\"._SHOP_03_PAYMENT_METHOD.\"</div><br><br>\\n\";\n\t\t\techo \"\t\t\t<table width=\\\"100%\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\" border=\\\"0\\\">\\n\";\n\t\t\t\t\t\t\t$res_pay = mysql_query(\"\n\t\t\t\t\t\t\tSELECT shop_payment_methods_id, shop_payment_methods_publish, shop_payment_methods_title, shop_payment_methods_descriptions, shop_payment_methods_picture \n\t\t\t\t\t\t\tFROM $db_shop_payment_methods \n\t\t\t\t\t\t\tWHERE shop_payment_methods_publish=1 \n\t\t\t\t\t\t\tORDER BY shop_payment_methods_id ASC\"\n\t\t\t\t\t\t\t) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t\t\t\t\t\t\t$num_pay = mysql_num_rows($res_pay);\n\t\t\t\t\t\t\twhile($ar_pay = mysql_fetch_array($res_pay)){\n\t\t\t\t\t\t\t\techo \" \t<tr>\\n\";\n\t\t\t\t\t\t\t\techo \" \t\t<td align=\\\"left\\\" valign=\\\"top\\\" width=\\\"20\\\">\"; if ($num_pay < 2){ echo \"<input type=\\\"hidden\\\" name=\\\"shop_payment_methods_id\\\" value=\\\"\".$ar_pay['shop_payment_methods_id'].\"\\\">\"; } else { echo \"<input type=\\\"radio\\\" name=\\\"shop_payment_methods_id\\\" id=\\\"edenshop_progress_carriage\\\" value=\\\"\".$ar_pay['shop_payment_methods_id'].\"\\\" \"; if ($ar_pay['shop_payment_methods_publish'] == 0){echo \" disabled=\\\"disabled\\\" \";} echo \">\"; } echo \"</td>\\n\";\n\t\t\t\t\t\t\t\techo \" \t\t<td align=\\\"left\\\" valign=\\\"top\\\" width=\\\"700\\\" class=\\\"edenshop_progress_03_payment\\\">\\n\";\n\t\t\t\t\t\t\t\tif ($ar_pay['shop_payment_methods_publish'] == 0){ echo \"<strong class=\\\"edenshop_disabled\\\">\".$ar_pay['shop_payment_methods_title'].\"</strong>\"; } else { echo \"<strong>\".$ar_pay['shop_payment_methods_title'].\"</strong>\"; } echo \"<br>\\n\";\n\t\t\t\t\t\t\t\techo \"\t \t\".$ar_pay['shop_payment_methods_descriptions'].\"<br>\\n\";\n\t\t\t\t\t\t\t\techo \"\t \t<img src=\\\"\".$url_shop_payments.$ar_pay['shop_payment_methods_picture'].\"\\\" alt=\\\"\".$ar_pay['shop_payment_methods_title'].\"\\\"><br><br>\\n\";\n\t\t\t\t\t\t\t\techo \"\t \t</td>\\n\";\n\t\t\t\t\t\t\t\techo \"\t </tr>\\n\";\n\t\t\t\t\t\t\t}\n\t\t\techo \"\t\t\t</table>\\n\";\n\t\t\techo \"\t\t</div>\\n\";\n\t\t\techo \"\t\t<div id=\\\"edenshop_progress_border_bottom\\\"></div>\\n\";\n\t\t\techo \"\t</div><br>\\n\";\n\t\t\techo \"\t<div id=\\\"edenshop_but_pos\\\">\\n\";\n\t\t\t// Zabezpeceni aby nebyl zobrazen formular pokud chybi nektery z kontaktnich udaju\n\t\t\t\tif ($contact_firstname != \"\" && $contact_surname != \"\" && $contact_address_1 != \"\" && $contact_city != \"\" && $contact_postcode != \"\" && $contact_email != \"\"){\n\t\t\t\t\techo \"\t\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"add_order\\\">\\n\";\n\t\t\t\t\techo \"\t\t<input type=\\\"hidden\\\" name=\\\"oaid\\\" value=\\\"\".$_SESSION['loginid'].\"\\\">\\n\";\n\t\t\t\t\techo \"\t\t<input type=\\\"hidden\\\" name=\\\"orders_shop_ip\\\" value=\\\"\".$eden_cfg['ip'].\"\\\">\\n\";\n\t\t\t\t\techo \"\t\t<input type=\\\"hidden\\\" name=\\\"project\\\" value=\\\"\".$project.\"\\\">\\n\";\n\t\t\t\t\techo \"\t\t<input type=\\\"Submit\\\" id=\\\"edenshop_progress_proceed\\\" value=\\\"\\\">\\n\";\n\t\t\t\t\techo \"\t</form>\\n\";\n\t\t\t\t}\n\t\t\t\techo \"\t</div>\\n\";\n\t \t}\n\t} else {\n\t\techo \"\t<div align=\\\"center\\\">\\n\";\n\t\techo _SHOP_BASKET_EMPTY.\"<br>\\n\";\n\t\techo _SHOP_BASKET_EMPTY_PLEASE.\"<br>\\n\";\n\t\techo \"\t\t<a href=\\\"index.php?action=&amp;lang=\".$_GET['lang'].\"&amp;filter=\".$_GET['filter'].\"\\\" target=\\\"_self\\\"><img src=\\\"images/edenshop_butt_cont_shop_en.gif\\\" width=\\\"159\\\" height=\\\"25\\\" alt=\\\"\\\"></a>\\n\";\n\t\techo \"\t</div>\";\n\t}\n}" ]
[ "0.6074926", "0.59945244", "0.57460475", "0.5733867", "0.57280225", "0.55935407", "0.5541372", "0.55338275", "0.54648745", "0.5446975", "0.54381377", "0.5393287", "0.53683424", "0.53604907", "0.5351857", "0.5310708", "0.53056484", "0.5279834", "0.5261923", "0.52479446", "0.524417", "0.5207641", "0.5205537", "0.51995397", "0.5179384", "0.51738334", "0.5134863", "0.5117154", "0.51137686", "0.5106172", "0.5099798", "0.50955504", "0.5094487", "0.5090909", "0.5072311", "0.5054538", "0.50526947", "0.50523543", "0.5047294", "0.50472254", "0.504532", "0.5043835", "0.5038193", "0.5033347", "0.50313354", "0.5029002", "0.50203276", "0.50200343", "0.501957", "0.50191885", "0.50096875", "0.500772", "0.50015384", "0.49966866", "0.4994167", "0.49927762", "0.4991915", "0.49908286", "0.49840826", "0.49774015", "0.49741393", "0.4972729", "0.4970458", "0.49671906", "0.49592787", "0.49531177", "0.49467632", "0.49418274", "0.4940715", "0.4940585", "0.49375835", "0.49340582", "0.49334762", "0.49289", "0.49280927", "0.49245575", "0.4923907", "0.49235904", "0.49226508", "0.492093", "0.49161685", "0.49032137", "0.4902385", "0.49019524", "0.48965213", "0.48956105", "0.48903385", "0.48868266", "0.488566", "0.4884934", "0.4878871", "0.48758727", "0.48716184", "0.48715082", "0.4870998", "0.48705703", "0.4869616", "0.48679706", "0.48674253", "0.48647624" ]
0.57243013
5
Listar usuarios no banco de dados static > cramos getList com Static para quando precisarmos chama lo fora do escopo
public static function getList(){ $sql = new sql(); return $sql->select("SELECT * FROM usuarios ORDER BY email;"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getlist(){\n $sql = new Sql();\n \n return $sql->select(\"SELECT * FROM tb_usuarios ORDER BY deslogin\");\n }", "public function ListarUsuarios()\n{\n\tself::SetNames();\n\t$sql = \" select * from usuarios \";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}", "public function listarUsua(){\n\t\t$sql=\"SELECT USUARI_ID, USUARI_NOMBRES, USUARI_USUARIO\n\t\t FROM usuario ORDER BY USUARI_NOMBRES\";\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function Listar()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$result = array();\n\n\t\t\t$stm = $this->pdo->prepare(\"SELECT usuario.`correo`, `usuario`.`clave`, `rol`.`nomRol`, `datospersonales`.`Documento`\nFROM `usuario`\nLEFT JOIN `rol` ON `rol`.`nomRol` = `usuario`.`nomRol` \nLEFT JOIN `datospersonales` ON `datospersonales`.`Documento` = `usuario`.`Documento`\n WHERE correo is not null \");\n\t\t\t$stm->execute();\n\n\t\t\tforeach($stm->fetchAll(PDO::FETCH_OBJ) as $r)\n\t\t\t{\n\t\t\t\t$usu = new Usuario();\n\n\t\t\t\t$usu->__SET('correo', $r->correo);\n\t\t\t\t$usu->__SET('clave', $r->clave);\n\t\t\t\t$usu->__SET('nomRol', $r->nomRol);\n\t\t\t\t$usu->__SET('Documento', $r->Documento);\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t$result[] = $usu;\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tdie($e->getMessage());\n\t\t}\n\t}", "public function get_usuarios()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$sql = \"SELECT * FROM usuarios\";\n\n\t\t\t$resultado = $this->db->prepare($sql);\n\n\t\t\tif(!$resultado->execute())\n\t\t\t{\n\t\t\t\techo \"<h1 class='text-danger bg-danger'>Falla en la consulta</h1>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\twhile($reg = $resultado->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->usuarios[] = $reg;\n\t\t\t\t}\n\n\t\t\t\treturn $this->usuarios;\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tdie(\"Error: {$e->getMessage()}\");\n\t\t}\n\t}", "public static function getList(){\n\t\t\t$sql = new sql();\n\n\t\t\treturn $sql->select(\"SELECT * FROM tb_usuarios ORDER BY deslogim\");\n\t\t}", "function getUsuarios(){\n\t\n\t\treturn conectar()->query( \"SELECT * FROM usuarios\");\n\t}", "function listar_usuarios() {\n\t\t$query = \"SELECT colaboradores.*, colaboradores_permisos.*\n\t\tFROM colaboradores, colaboradores_permisos\n\t\tWHERE colaboradores.id_colaborador=colaboradores_permisos.id_colaborador\n\t\tAND colaboradores.estado=1\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "static public function ctrListarUsuario( ){\n\n\t\treturn ModeloUsuarios::mdlListarUsuario( );\n\n\t}", "public function getUsers(){\n $query = \"SELECT * FROM usuario \";\n return self::getInstance()->consulta($query);\n }", "public function listarUsuarios()\r\n\t{\r\n\t\t$administradores=array();\r\n\t\ttry{\r\n\t\t\t//realizamos la consulta de todos los items\r\n\t\t\t$consulta = $this->db->prepare(\"select * from administrador\");\r\n\t\t\t$consulta->execute();\r\n\t\t\tfor($i=0; $row = $consulta->fetch(); $i++)\r\n\t\t\t{\r\n\t\t $fila['admin_cedula']=$row['ADMIN_CEDULA'];\r\n\t\t\t$fila['admin_login']=$row['ADMIN_LOGIN'];\r\n\t\t\t$fila['admin_nombre']=$row['ADMIN_NOMBRE'];\r\n\t\t\t$fila['admin_apellido']=$row['ADMIN_APELLIDO'];\r\n\t\t\t$fila['admin_status']=$row['ADMIN_STATUS'];\r\n\t\t\t$administradores[]=$fila;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tcatch(PDOException $e)\r\n\t\t{\r\n\t\t\techo $e;\r\n\t\t}\r\n\t\treturn $administradores;\t\t\r\n\t}", "function ListaUsuario() {\n\t\n\t\t\t$sql = \"SELECT usu.*, CONCAT_WS(' ', per.primer_nombre, per.primer_apellido) as nombre_completo, usu.nombre_usuario, rol.descripcion FROM usuario usu\n\t\t\t\t\tINNER JOIN rol rol ON rol.id = usu.rol_id\n\t\t\t\t\tINNER JOIN persona per ON per.id = usu.persona_id\";\n\t\t\t$db = new conexion();\n\t\t\t$result = $db->consulta($sql);\n\t\t\t$num = $db->encontradas($result);\n\t\t\t$respuesta->datos = [];\n\t\t\t$respuesta->mensaje = \"\";\n\t\t\t$respuesta->codigo = \"\";\n\t\t\tif ($num != 0) {\n\t\t\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t\t\t}\n\t\t\t\t$respuesta->mensaje = \"Ok\";\n\t\t\t\t$respuesta->codigo = 1;\n\t\t\t} else {\n\t\t\t\t$respuesta->mensaje = \"No existen registros de roles.\";\n\t\t\t\t$respuesta->codigo = 0;\n\t\t\t}\n\t\t\treturn json_encode($respuesta);\n\t\t}", "public static function get_usuarios(){\n\t\t\n\t\t$query = \"SELECT * FROM usuarios\";\n\n\t\t/**\n\t\t * Call getConexion()\n\t\t */\n\t\tself::getConexion();\n\n\n\n\t\t$resultado = self::$cn->prepare($query);\n\t\t$resultado->execute();\n\n\t\t$filas=$resultado->fetchAll();\n\n\t\t\n\t\treturn $filas;\n\n\t}", "function ListaUsuarios() {\n\t//obtiene el id del usuario\n $sql = \"SELECT usuario.id, usuario.nombre_usuario, persona.primer_nombre, persona.primer_apellido, usuario.estado, rol.descripcion FROM usuario INNER JOIN persona ON usuario.persona_id = persona.id INNER JOIN rol ON usuario.rol_id = rol.id WHERE usuario.estado = 'ACTIVO'\";\n\n\t$db = new conexion();\n\t$result = $db->consulta($sql);\n\t$num = $db->encontradas($result);\n\n\t$respuesta->datos = [];\n\t$respuesta->mensaje = \"\";\n\t$respuesta->codigo = \"\";\n\n\tif ($num != 0) {\n\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t}\n\t\t$respuesta->mensaje = \"Usuarios listados\";\n\t\t$respuesta->codigo = 1;\n\t} else {\n\t\t$respuesta->mensaje = \"No existen registros de usuarios !\";\n\t\t$respuesta->codigo = 0;\n\t}\n\treturn json_encode($respuesta);\n}", "public static function ListarUsuarios(){\n return (new Usuario)->FindBy([],[\"nombre asc\"]);\n }", "public function buscarUsuarios(){\n\t\t}", "public function listarUser() {\n if(IDUSER) {\n $eval = \"SELECT id,nombre,apellidos,email FROM users\";\n $peticion = $this->db->prepare($eval);\n $peticion->execute();\n $resultado = $peticion->fetchAll(PDO::FETCH_OBJ);\n exit(json_encode($resultado));\n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Fallo de autorizacion\"])); \n }\n }", "public function getUsuarios(){\n\t\t$filasPagina = 7;//registros mostrados por página\n\n\t\tif(isset($_GET['pagina'])){//si le pasamos el valor \"pagina\" de la url (si el usuario da click en la paginación)\n\t\t\t\tif($_GET['pagina']==1){\n\t\t\t\t$pagina=1; \n\t\t\t\theader(\"Location: principal.php?c=controlador&a=muestraUsuarios\");\n\t\t\t\t}else{\n\t\t\t\t\t$pagina=$_GET['pagina'];//índice que indica página actual\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$pagina=1;//índice que indica página actual\n\t\t\t}\n\n\t\t\t$empezarDesde = ($pagina-1) * $filasPagina;\n\n\t\t\t$sql = \" SELECT * FROM usuarios \";\n\n\t\t\t$resultado = $this->db->query($sql);\n\n\t\t\t$resultado->execute(array());\n\n\t\t\t$numFilas = $resultado->rowCount();//número de registos totales de la consulta\n\n\t\t\t//ceil — Redondear fracciones hacia arriba\n\t\t\t$totalPaginas = ceil($numFilas / $filasPagina);//calcula cuántas páginas serán en total para mostrar todos los registros\n\n\t\t\t$resultado->closeCursor();\n\n\t\t//------------------------- Consulta para mostrar los resultados ---------------------------\n\n\t\t\t$sql_limite = \" SELECT * FROM usuarios LIMIT $empezarDesde , $filasPagina \";\n\n\t\t\t$resultado = $this->db->query($sql_limite);//ejecutando la consulta con la conexión establecida\n\n\t\t\twhile($row = $resultado->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$this->objeto[] = $row;//llenando array con valores de la consulta\n\t\t\t}\n\n\t\treturn $this->objeto;\n\t}", "function listarCuentaBancariaUsuario(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_sel';\n\t\t$this->transaccion='TES_USRCTABAN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('permiso','permiso','varchar');\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cuenta_bancaria','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('fecha_baja','date');\n\t\t$this->captura('nro_cuenta','varchar');\n\t\t$this->captura('fecha_alta','date');\n\t\t$this->captura('id_institucion','int4');\n\t\t$this->captura('nombre_institucion','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('id_moneda','integer');\n\t\t$this->captura('codigo_moneda','varchar');\n\t\t$this->captura('denominacion','varchar');\n\t\t$this->captura('centro','varchar');\n\t\t$this->captura('id_finalidads','varchar');\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function listarUsuarios(){\n \n $conex=Conexion::getInstance();\n $stmt = $conex->dbh->prepare(\"SELECT * FROM usuarios\"); \n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n $stmt->execute();\n $listaUsuarios=[];\n while ($row = $stmt->fetch()){\n $listaUsuarios[]=array('id'=>$row['id'],'usuario'=>$row['usuario'],'nombre'=>$row['nombre'],'admin'=>$row['admin'],'password'=>$row['password']) ; \n }\n return $listaUsuarios;\n}", "public function getUsersList()\n {\n }", "function all_usuarios(){\n\t\t$Query = 'SELECT * FROM tb_usuarios';\n\t\t$respuesta = ObtenerRegistros($Query);\t\n\t\treturn ConvertirUTF8($respuesta);\n\t}", "public function utilisateurListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Utilisateur\");//type array\n\t}", "public function getList(){\n\t\t$model=new Model();\n\t\treturn $model->select(\"SELECT * FROM tb_usuarios ORDER BY idusuario\");\n\t}", "private function usuarios(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"GET\") {\n\t\t\t# no se envian los usuarios, se envia un error\n\t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n\t\t}//es una petición GET\n\t\t//se realiza la consulta a la bd\n\t\t$query = $this->_conn->query(\n\t\t\t\"SELECT id, nombre, email \n\t\t\t FROM usuario\");\n\t\t//cantidad de usuarios\n\t\t$filas = $query->fetchAll(PDO::FETCH_ASSOC); \n \t$num = count($filas);\n \t//si devolvio un resultado, se envia al cliente\n \tif ($num > 0) { \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['usuarios'] = $filas; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } //se envia un error \n\t $this->mostrarRespuesta($this->devolverError(2), 204);\n\t}", "public static function getUsuarios()\n {\n $query = \"SELECT id,nombre,email,usuario,privilegio,fecha_registro FROM users\";\n\n self::getConexion();\n\n $resultado = self::$cnx->prepare($query);\n\n $resultado->execute();\n\n $filas = $resultado->fetchAll();\n\n return $filas;\n }", "function getList() {\n $this->db->getCursorParameters(self::TABLA);\n $respuesta = array();\n while ($fila = $this->db->getRow()) {\n $objeto = new Usuario();\n $objeto->set($fila);\n $respuesta[] = $objeto;\n }\n return $respuesta;\n }", "function listUsers()\n{\n require_once($_SERVER[\"DOCUMENT_ROOT\"].\"/config/config.php\");\n require_once($_SERVER[\"DOCUMENT_ROOT\"].\"/class/autoload.php\");\n require_once($_SERVER[\"DOCUMENT_ROOT\"].\"/vendor/autoload.php\");\n $db = new cMariaDb($Cfg);\n\n // Generateur de templates\n $tpl = new Smarty();\n $tpl->template_dir = $_SERVER[\"DOCUMENT_ROOT\"].\"/tools/templates\";\n $tpl->compile_dir = $_SERVER[\"DOCUMENT_ROOT\"].\"/templates_c\";\n\n $sSQL = \"SELECT id, sNom, sPrenom, sEmail, sTelMobile, sLogin FROM sys_user WHERE bActive=1 ORDER BY sNom, sPrenom;\";\n\n // Récupérer les éléments \n $tpl->assign(\"Users\",$db->getAllFetch($sSQL));\n $sHtml = $tpl->fetch(\"editUsers.smarty\");\n return [\"Errno\" => 0, \"html\" => $sHtml ];\n}", "function getUsersAdmin() {\n $usuarios = [];\n\n $con = crearConexion();\n\n $query = \"SELECT `username` FROM `usuario` WHERE `tipo`='0'\";\n\n $result = mysqli_query($con, $query);\n\n while ($row = mysqli_fetch_array($result)) {\n $usuarios[] = $row['username'];\n }\n\n cerrarConexion($con);\n return $usuarios;\n}", "public function lista() { // Aqui define o ação: /users/lista\n $usuarios = new Users(); // Aqui carrega o model: Users\n $dados['usuarios'] = $usuarios->getUsuarios();\t\n if(isset($_GET['id']) && !empty($_GET['id'])) {\t\n $this->loadTemplate('user_contact', $dados);\n }else { $this->loadTemplate('users_list', $dados);\n }\n }", "public function getUserList() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n\n $role_name = $this->request->input(\"role_name\");\n if ($role_name) {\n $where[] = [\"roles.role_name\", \"=\", $role_name];\n }\n\n $user_id = $this->request->input(\"user_id\");\n if ($user_id) {\n $where[] = [\"users.user_id\", \"=\", $user_id];\n }\n $orderBy = \"users.user_id\";\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getUsers($orderBy);\n\n return $users;\n }", "public function listarUsuariosAction(){\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$usuario = $em->getRepository('TheClickCmsAdminBundle:Usuarios')->findAll();\n\t\treturn $this->render('TheClickCmsAdminBundle:Default:listarUsuarios.html.twig', array('usuario' => $usuario));\n\t}", "public function listarUsuarios()\n {\n $usuarios = Usuarios::all();\n\n return $usuarios;\n }", "public function list_user()\n\t{\n\t\tcheck_access_level_superuser();\n\t\t$data = [\n\t\t\t'list_user' => $this->user_m->get_cabang(),\n\t\t\t'list_cabang' => $this->data_m->get('tb_cabang')\n\t\t];\n\t\t$this->template->load('template2', 'user/list_user', $data);\n\t}", "public function listar(){\n\n $sql = \"SELECT * FROM buro_credito\";\n\n return $this->mysql->getRows($sql);\n\n }", "public function getList(){\n\t\t$resultsUsers = [];\n\t\t$q = $this->pdo->query('SELECT * FROM utilisateur');\n\t\twhile ($donnee = $q->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t$resultsUsers[] = new Utilisateur($donnee);\n\t\t}\n\t\treturn $resultsUsers;\n\t}", "public function infoUsuariosPorProyectoList(){\n\n $usuarios = UsersModel::infoUsuariosPorProyecto(\"usuario\", $_SESSION[\"id_project\"]);\n \n foreach ($usuarios as $row => $item) {\n echo '<option value=\"'.$item[\"Email\"].'\">'.$item[\"Email\"].'</option>'; \n }\n\n }", "function listaUtentiScuola($passordIsNull = FALSE, $userNotVisible = FALSE) {\n if ($this->connectToMySql()) {\n $query = \"SELECT id_utente , cognome , nome , email , password ,\n user_is_admin FROM scuola.utenti_scuola \";\n if ($passordIsNull && !$userNotVisible) {//$passordIsNull TRUE\n $query .= \" WHERE NOT isnull(password) \";\n } elseif (!$passordIsNull && $userNotVisible) {//$userNotVisible TRUE\n $query .= \"WHERE id_utente != \" . $_COOKIE['id_utente'];\n } elseif ($passordIsNull && $userNotVisible) {\n $query .= \" WHERE NOT isnull(password) AND id_utente != \" . $_COOKIE['id_utente'];\n }\n $query .= \" ORDER BY cognome , nome\";\n // Perform Query\n $result = mysql_query($query);\n //$array = mysql_fetch_assoc($result);\n }\n $this->closeConnection();\n return $result;\n }", "function getAllUsuarios(){\n\t\t\tDB_DataObject::debugLevel(0);\n\t\t\t$obj = DB_DataObject::Factory('VenUsuario');\n\t\t\t$obj->find();\n\t\t\t$i = 0;\n\t\t\t$data='';\n\t\t\twhile($obj->fetch()){\n\t\t\t\t$data[$i]['idUsuario']=$obj->idUsuario;\n\t\t\t\t$data[$i]['idCargo']=$obj->idCargo;\n\t\t\t\t$nombreCargo=$this->getCargoById($obj->idCargo);\n\t\t\t\t$nombreCargo=utf8_encode($nombreCargo['nombre']);\n\t\t\t\t$data[$i]['cargo']= $nombreCargo;\n\t\t\t\t$data[$i]['nombre']=utf8_encode($obj->nombre);\n\t\t\t\t$data[$i]['apellido']=utf8_encode($obj->apellido);\n\t\t\t\t$data[$i]['email']=$obj->email;\n\t\t\t\t$data[$i]['usuario']=utf8_encode($obj->usuario);\n\t\t\t\t$data[$i]['contrasena']=utf8_encode($obj->contrasena);\n\t\t\t\t$data[$i]['puntos']=$obj->puntos;\n\t\t\t\t$data[$i]['estado']=$obj->estado;\n\t\t\t\t$data[$i]['fechaMod']=$obj->fechaMod;\n\t\t\t\t$data[$i]['fecha']=$obj->fecha;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$obj->free();\n\t\t\t//printVar($data,'getAllUsuarios');\n\t\t\treturn $data;\n\t\t}", "function listar()\n {\n $query = $this->db->get(\"usuarios\");\n return $query->result_array();\n }", "public function getUsuarios()\n {\n\n $sql = \"SELECT * FROM usuario\";\n\n foreach ($this->bd->query($sql) as $res) {\n $this->usuarios[] = $res;\n }\n return $this->usuarios;\n\n }", "public function listarUsuarios(){\r\n $sql = \"SELECT U.IdUsuario, U.NombreCompleto, U.Usuario, U.Correo, U.Estado, U.IdRol, R.Rol\r\n FROM usuarios AS U\r\n INNER JOIN roles AS R ON U.IdRol = R.IdRol;\";\r\n $tabla = $this->conexion->getTable($sql);\r\n return $tabla;\r\n}", "function showUsuarios()\r\n\t{\r\n\t\t$valuesUsuarios = $this->User->find('all', array('conditions' => array('User.active' => 1),'order' => 'User.first_lastname ASC'));\r\n\t\t\r\n\t\tforeach ($valuesUsuarios as $value)\r\n\t\t{\r\n\t\t\t$resultadosUsuarios[$value['User']['id']]= $value['User']['first_lastname'].' '.$value['User']['second_lastname'].', '.$value['User']['name'];\r\n\t\t}\r\n\t\t\r\n\t\treturn $resultadosUsuarios;\r\n\t}", "function listuser(){\n\t\t\tif(!empty($_GET['paginado'])){\n\t\t\t\t$pag = $_GET['paginado'];\n\t\t\t\t$list = $this -> model -> selectuser($pag);\n\t\t\t}else{\n\t\t\t\t$list = $this -> model -> selectuser();\n\t\t\t}\n\t\t\t$this -> ajax_set($list);\n\t\t}", "function liste_utilisateur(){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->prepare(\"SELECT id_utilisateur, pseudo FROM utilisateur WHERE status_utilisateur = ? AND fqdn_blog NOT LIKE 'supprimer'\");\n\t\t$req->execute(array(0));\n\t\t$result = $req->fetchAll();\n\t\t\n\t\t$req->closeCursor();\n\t\treturn $result;\n\t}", "function getUsuarios()\n{\n\t$con = getDBConnection();\n\t$sql = \"SELECT * FROM usuarios\";\n\t$stmt = $con->prepare($sql);\n\t$stmt->execute();\n\t$usuarios = null;\n\twhile ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t$usuario = new Usuario();\n\t\t$usuario->setID($row['id']);\n\t\t$usuario->set($row['nombre'],$row['apellidos'],$row['user_name'],$row['password'],$row['email']);\n\t\t$usuarios[] = $usuario;\n\t}\n\treturn $usuarios;\n}", "private function getUserList()\n {\n $users = User::getUsers();\n $users = ArrayHelper::map($users, 'id', 'username');\n \n return $users;\n }", "public function listausuarios(){\n $user = Usuario::with('rol')->paginate(15);\n $lista_usuarios = compact('user'); \n\n return $this->sendResponse($lista_usuarios, 'Listado de usuarios devueltos con éxito');\n\n }", "function modele_get_liste_user() {\n\n\t\t$req = 'SELECT * FROM p_user ';\n\n\t\t$reqPrep = self::$connexion->prepare($req);\n\n\t\t$reqPrep->execute();\n\n\t\t$enregistrement = $reqPrep->fetchall(PDO::FETCH_ASSOC);\n\n\t\treturn $enregistrement;\n\t}", "protected function getUserList() {\n\t$controller = new ChatMySQLDAO();\n\tif(!isset($_SESSION['username'])) {\n\t return;\n\t}\n\t$users = $controller->getUserList($_SESSION['username']);\n\t$data = array();\n\t$i = 0;\n\tforeach ($users as $user) {\n\t $data[$i++] = $user['user_name'];\n\t}\n\treturn $data;\n }", "public function lista2() { // Aqui define o ação: /users/lista\n $usuarios = new Users(); // Aqui carrega o model: Users\n $dados['usuarios'] = $usuarios->getUsuarios();\t\n if(isset($_GET['id']) && !empty($_GET['id'])) {\t\n $this->loadTemplate('usuario', $dados);\n }\n }", "public function getUsuaris()\n {\n $usuarios = $this->_db->query(\"select * from usuarios\");\n return $usuarios->fetchall();\n }", "public function readUsuarios()\n\t{\n\t\t$sql = 'SELECT IdRol, Nombre, Apellido, Telefono, Email, u.IdEstado, IdUsuario \n FROM usuarios u ORDER BY Apellido';\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}", "public function get_all() {\n\t\t\n\t\treturn $this->db->get('usuarios');\n\t}", "public function listUsersAdmin(){\n $sql=\"SELECT id_people,dni,first_name,last_name,adress,email,is_active FROM people WHERE is_user=1\";\n $rs=$this->con->prepare($sql);\n $rs->execute();\n return $rs->fetchAll(PDO::FETCH_OBJ);\n }", "public function listAll(){\n $sql = \"SELECT id,name,email FROM users\";\n $stmt = $this->cnx->prepare($sql);\n $result = $stmt->execute();\n \n $resultados = array();\n\n while($rs = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $resultados[] = $rs;\n }\n \n if(empty($resultados)){\n throw new Exception(\"Nenhum usuario encontrado!\");\n }\n \n return $resultados;\n }", "public static function obtenerUsuarios()\n {\n $consulta = \"SELECT * FROM usuarios, usuarios_roles WHERE (usuarios.rol=usuarios_roles.id_rol) ORDER BY usuarios.nombres ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "function listar_usuarios(){\n //Se filtran solo id los diferentes \n $this->db->distinct();\n\n //Se seleccionan las columnas\n $this->db->select('Fk_Id_Usuario');\n $this->db->select('Nombres');\n $this->db->select('Apellidos');\n $this->db->order_by('Nombres', 'asc');\n \n $this->db->from('contratos');\n $this->db->join('tbl_usuarios', 'contratos.Fk_Id_Usuario = tbl_usuarios.Pk_Id_Usuario');\n return $this->db->get()->result();\n }", "private function getListaUsuarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'pfranco',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }", "public static function getUserComboList() { \n return Doctrine_Query::create()->select('u.id, SUBSTRING(u.username, 1, 25) as username')->from('sfGuardUser u')->orderBy('u.username');\n }", "public function consultarUsuario(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT c.*, a.permissao FROM tbusuarios c, tbpermissao a where c.idpermissao = a.idpermissao and permissao <> 'SUPER-ADMIN'order by c.nome\";\n $sql = $this->conexao->query($sql);\n\n $dados = array();\n\n while ($row = $sql->fetch_assoc()) {\n $idusuario = $row[\"idusuario\"];\n $nome = $row[\"nome\"];\n $email = $row[\"email\"];\n $dtnascimento = $row[\"dt_nascimento\"];\n $telefone = $row[\"telefone\"];\n $dtnascimento = $row[\"dt_nascimento\"];\n $habilitado = $row[\"habilitado\"];\n $permissao = $row[\"permissao\"]; \n $idpermissao = $row[\"idpermissao\"]; \n\n $dado = array();\n $dado['idusuario'] = $idusuario;\n $dado['nome'] = $nome;\n $dado['email'] = $email;\n $dado['senha'] = $row['senha'];\n $dado['senha_confirma'] = $row['senha_confirma'];\n $dado['idpermissao'] = $idpermissao;\n $dado['permissao'] = $permissao;\n $dado['telefone'] = $telefone;\n $dado['dtnascimento'] = $dtnascimento;\n $dado['habilitado'] = $habilitado; \n $dados[] = $dado;\n }\n\n return $dados;\n\n }", "public static function getAllUsuario(){\n $v = array();\n\t\t$conexion = new Database();\n $sql = sprintf('SELECT * FROM agenda_usuarios' );\n $rows = $conexion->query( $sql );\n\n foreach( $rows as $row ){\n\t\t\t$u = new Usuario();\n\t\t\t$u->usuario = $row['USUARIO'];\n $u->password = $row['PASSWORD'];\n $u->codigo = $row['USUARIO_ID'];\n\t\t\t$v[] = $u;\n\t\t}\n return $v;\n }", "public function listAction(){\n $r=$this->getRequest();\n $query=Doctrine_Query::create()\n ->select(\"uo.orgid, u.ID, u.nome,u.cognome,u.user,u.active,u.data_iscrizione,r.role\")\n ->from(\"Users u\")\n ->leftJoin(\"u.Role r\")\n ->leftJoin(\"u.UsersOrganizations uo\")\n ->where(\"uo.orgid=\".$r->getParam('orgid'))\n ->addWhere(\"uo.active=\".Constants::UTENTE_ATTIVO);\n list($users,$total)=DBUtils::pageQuery($query,array(),$this->getLimit(),$this->getOffset());\n $this->emitTableResult($users,$total);\n }", "public function getList() {\n //Retourne la liste de tous les users\n $users = [];\n $requsers = $this->db->query('SELECT * FROM user');\n\n while ($data = $requsers->fetch(PDO::FETCH_ASSOC)) {\n $users[] = new user($data);\n }\n\n return $users;\n }", "private function consultar_usuario_todos() {\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u;\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "function listerUtilisateur()\n\t{\n\t\t$req=\"select idUti, nomUti, prenomUti, photoUti, telPorUti, mailUti, statutUti from utilisateur\";\n\t\t$exereq = mysql_query($req) or die(mysql_error());\n\t\n\t\twhile($ligne=mysql_fetch_array($exereq))\n\t\t{\n\t\t\t$tab[]=$ligne;\n\t\t}\n\n\t\treturn $tab;\n\t}", "public function retrieve_all_users()\n {\n $table_pengajar = $this->db->dbprefix('pengajar');\n $table_siswa = $this->db->dbprefix('siswa');\n $table_login = $this->db->dbprefix('login');\n\n $sql = \"SELECT {$table_login}.username, {$table_pengajar}.nama FROM {$table_pengajar} INNER JOIN {$table_login} ON {$table_pengajar}.id = {$table_login}.pengajar_id\n UNION\n SELECT {$table_login}.username, {$table_siswa}.nama FROM {$table_siswa} INNER JOIN {$table_login} ON {$table_siswa}.id = {$table_login}.siswa_id\";\n\n $result = $this->db->query($sql);\n\n $data = array();\n foreach ($result->result_array() as $r) {\n # selain yang login\n if (is_login() && $r['username'] == get_sess_data('login', 'username')) {\n continue;\n }\n $data[] = addslashes($r['nama']) . ' [' . $r['username'] . ']';\n }\n\n return $data;\n }", "public static function allUser() {\n $listado = DB::table('users')->join('role_user', 'role_user.user_id', '=', 'users.id')\n ->join('roles', 'roles.id', '=', 'role_user.role_id')\n ->select('users.*', 'roles.description')\n ->get();\n\n return $listado;\n }", "public function index()\n {\n $usuarios = dev_Usuario::get();\n return $usuarios;\n }", "public function mostrar_usuaris(){\n $sql = \"SELECT usuaris.id AS id, usuaris.nom AS nom, usuaris.cognoms AS cognoms, usuaris.email AS email,\n usuaris.idrol AS idrol, rols.descrip AS descrip FROM usuaris INNER JOIN rols ON usuaris.idrol = rols.id\";\n \n $query=$this->db->prepare($sql);\n $query->execute();\n $res=$query->fetchAll();\n return $res;\n }", "function GetAllUser(){\n\t\t/*$hasil=$this->db->query(\"SELECT * FROM buku ORDER BY judul_buku\");\n\t\tif($hasil->num_rows()>0){\n\t\t\tforeach($hasil->result() as $row){\n\t\t\t\t$data[]=$row;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\t\t*/\n\t\t$query=$this->db->get('user');\n\t\tforeach($query->result() as $row){\n\t\t\t$data[]=$row;\n\t\t}\n\t\treturn $data;\n\t}", "public function citas_usuariosCitas(){\n \t\n\t\t\t$resultado = array();\n\t\t\n\t\t\t$query = \" SELECT idUsuario, identificacion, nombre, apellido\n\t\t\t\t\t\tFROM tb_usuarios\";\n\t\t\t\t\t\t\n\t\t\t$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado[] = $filas;\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado;\n\t\t\t\n }", "public function generate_users_list()\n {\n $this->get('/usuarios')->assertStatus(200)->assertSee('Pedro');\n }", "public function listarContratoUser(){\n \n $model = new ContratoModel();\n \n if($model->getContratoUserModel($_POST[\"id\"])){\n \n \techo json_encode($model->getContratoUserModel($_POST[\"id\"]));\n \t\n \t}else{\n \t\n \t$retorno = array(\"retorno\" =>\"NO\");\n \t\n \t\techo json_encode($retorno);\n \t}\n \t\n \n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "function abmUsuarios()\n {\n $this->checkCredentials();\n $users = $this->modelUser->getAllUsers();\n $this->view->showAbmUsuarios($users);\n }", "public static function getUsers($request){\r\n //CONTEUDO DA PAGINA DE USUARIOS\r\n $content= View::render('admin/modules/users/index',[\r\n 'itens' => self::getUserItems($request,$obPagination),\r\n 'pagination' => parent::getPagination($request,$obPagination),\r\n\t\t\t'status' => self::getStatus($request)\r\n ]);\r\n\r\n //RETORNA A PAGINA COMPLETA \r\n return parent::getPanel('Usuarios - AliDEV',$content,'users');\r\n\r\n\r\n }", "function modeloUserGetAll (){\n // Genero lo datos para la vista que no muestra la contraseña ni los códigos de estado o plan\n // sino su traducción a texto\n $db = AccesoDatos::getModelo();\n $tusuarios = $db->getUsuarios();\n foreach ($tusuarios as $clave=>$user){\n \n $tabla[$user->id]= ['nombre'=>$user->nombre,\n 'correo'=>$user->correo,\n 'plan'=>PLANES[$user->plan],\n 'estado'=>ESTADOS[$user->estado],\n ];\n }\n return $tabla;\n}", "function usersList($da){\r\n\t\t\treturn $this->trouverTout();\r\n\t\t}", "function get_user_list(){\n\t\treturn array();\n\t}", "public function listarPorId(){\n $query = \"select * from usuario where idusuario=?\";\n\n //preparando a consulta para a execução\n $stmt=$this->conn->prepare($query);\n\n //vamos fazer um blind(ligação) do id pesquisado\n //com o paramêtro da consulta, neste caso é o \n //ponto de interrogação\n $stmt ->bindParam(1,$this->idusuario);\n\n //executar efetivamente a consulta \n $stmt ->execute();\n\n //Organizar os dados retornados da consulta para \n // a exibição em formato de json\n // Vamos usar uma variavel e um array para associar \n // os campos da tabela\n $linha = $stmt->fetch(PDO::FETCH_ASSOC);\n\n //organizar no objeto usuario(aqrquivo usuario.php)\n //os dados retornados\n //da tabela usuario que está no banco de dados\n \n $this->email = $linha['email'];\n $this->senha = $linha['senha'];\n $this->nome = $linha['nome'];\n $this->cpf = $linha['cpf'];\n $this->telefone = $linha['telefone'];\n $this->foto = $linha['foto'];\n\n }", "function findAll() \n {\n $usuarios = array();\n $n=0;\n $sql=\"select u.id,u.nombre,u.paterno,u.materno,u.username,u.fechaAlta,\".\n \" u.estatus,u.idTipoUsuario,tu.descripcion from Usuarios u\".\n \" inner join TipoUsuarios tu on tu.id=u.idTipoUsuario\".\n \" order by u.id\";\n \n $usuariosRs = mysqli_query($this->_connDb, $sql); \n while ($row = mysqli_fetch_array($usuariosRs)) {\n $oUsuario = new Usuario(0);\n $oUsuario->setId($row['id']);\n $oUsuario->setNombre($row['nombre']);\n $oUsuario->setPaterno($row['paterno']);\n $oUsuario->setMaterno($row['materno']);\n $oUsuario->setUsername($row['username']);\n $oUsuario->setFechaAlta($row['fechaAlta']);\n $oUsuario->setEstatus($row['estatus']);\n\n // Creamos el objeto de tipo TipoUsuario\n $oTipoUsuario = new TipoUsuario($row['idTipoUsuario']);\n $oTipoUsuario->setDescripcion($row['descripcion']);\n\n // Inyectamos la dependencia de TipoUsuario\n $oUsuario->setTipoUsuario($oTipoUsuario);\n $usuarios[$n]=$oUsuario;\n $n++; \n }\n return $usuarios;\n }", "public static function modeloUserGetAll ():array {\n // Genero lo datos para la vista que no muestra la contraseña ni los códigos de estado o plan\n // sino su traducción a texto\n $stmt=self::$db->query(\"select * from Usuarios\");\n $usuarios=[];\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n while ($cod=$stmt->fetch()) {\n $datosuser= [\n $cod[\"nombre\"],\n $cod[\"email\"],\n PLANES[$cod[\"plan\"]],\n ESTADOS[$cod[\"estados\"]]\n ];\n $usuarios[$cod[\"user\"]]=$datosuser;\n }\n return $usuarios;\n}", "public function userList() {\n /** @var User[] $users */\n $users = $this->entityManager->getRepository(\"Entity\\\\User\")->findAll(); // Retrieve all User objects registered in database\n echo $this->twig->render('admin/lists/users.html.twig', ['users' => $users]);\n }", "public function getAllUsers() {\n $sql = 'SELECT id, firstname, mail, role, isAdmin FROM user';\n $sth = $this->db->prepare($sql);\n $sth-> execute(array());\n if ($row = $sth->fetchAll()) {\n return $row;\n }\n }", "public function getAll()\n {\n $usuario = new Usuario();\n return $usuario->getAll();\n }", "public function userlistAction()\n\t{\n\t\t$users = $this->userService->getUserList(array(), false);\n\n\t\t$this->view->roles = za()->getUser()->getAvailableRoles();\n\t\t$this->view->users = $users;\n\t\t$this->renderView('admin/user-list.php');\n\t}", "public function obtenerUsuariosOnline(){\n return $this->obtenerUsuarios(\" uid_usuario IN ( SELECT uid_usuario FROM \". TABLE_USUARIO .\" u WHERE u.uid_usuario = uid_usuario AND conexion = 1 ) \");\n }", "public static function getAll()\n {\n $consulta = \"SELECT * FROM usuarios\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "public function getAllUsers(){\n\t\n\t\t$db = new Database();\n\t\t$conn= $db->getConn();\n\t\t$rs = $conn->query(\"select * from login\");\n\t\t$num_of_row = $rs->num_rows;\n\t\tif($num_of_row >0){\n\t\t\twhile($row = $rs->fetch_assoc()){\n\t\t\t\t$users[]=array('username'=>$row['username'],'password'=>sha1($row['password']),'email'=>$row['email'],'user_type'=>$row['user_type']);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $users;\n\t}", "function getUsers(){\n }", "function getUsers(){\n }", "function obtenerUsuarios(){\n //Variable que almacena la consulta sql\n $sql = \"select login,Alias\n \t\t\tfrom ENTREGA\";\n\t\t//se ejecuta la query\n $resultado = $this->mysqli->query( $sql );\n if ( $resultado->num_rows == 0 ) { return null; }//miramos si el número de filas es 0.\n //Caragamos las tuplas resultado de la consulta en un array\n while($datos = mysqli_fetch_row ($resultado)){\n //Variable que almacena el array de las tuplas resultado de la query\n $miarray[] = $datos;\n }\n return $miarray;\n }", "public function ls_user_get()\n {\n $this->db->select('id, idrol,rol, nombre, correo, activo');\n $this->db->from('vusuarios');\n $query = $this->db->get();\n if ($query && $query->num_rows() >= 1) {\n $usuarios = $query->result();\n\n foreach ($usuarios as $row) {\n $row->id = (int) $row->id;\n $row->idrol = (int) $row->idrol;\n $row->rol = (int) $row->rol;\n $row->nombre = $row->nombre;\n $row->correo = (int) $row->correo;\n $row->activo = $row->activo;\n }\n $respuesta = array(\n 'usuarios' => $usuarios,\n );\n $status = 200;\n } else {\n $respuesta = array(\n 'message' => 'Valide sus datos de acceso',\n );\n $status = 401;\n }\n $this->response($respuesta, $status);\n }", "function listadoClientes(){\n\t\t\t\n\t\t\t//SQL\n\t\t\t$query = \"SELECT * FROM users ORDER BY rol,id DESC;\";\n\t\t\t$rst = $this->db->enviarQuery($query,'R');\n\t\t\t\n\t\t\tif(@$rst[0]['id'] != \"\"){\n\t\t\t\treturn $rst;\n\t\t\t}else{\n\t\t\t\treturn array(\"ErrorStatus\"=>true);\n\t\t\t}\n\t\t}", "public function listarAdmin()\n {\n $sql = \"SELECT US.nombre,CO.problema,CO.tipo_problema,CO.solucion, CO.modo_contacto, CO.tipo_estado \n FROM usuarios US JOIN consulta CO\n ON US.idusuarios = CO.idusuario\n WHERE CO.tipo_estado = 'Ejecutado'\";\n return ejecutarConsulta($sql);\n\n }", "public function index()\n {\n // get all\n $users = Utilisateur::all();\n return $users;\n }", "function getAllInfo(){\n //Creamos la consulta\n $sql = \"SELECT * FROM usuarios;\";\n //obtenemos el array con toda la información\n return $this->getArraySQL($sql);\n }" ]
[ "0.78709203", "0.7809892", "0.7750791", "0.77340674", "0.7728917", "0.7721335", "0.77068317", "0.77026314", "0.7698417", "0.7671685", "0.7664428", "0.76522464", "0.7580625", "0.7558152", "0.75075686", "0.75049686", "0.7485061", "0.7478444", "0.7450958", "0.7441594", "0.7415724", "0.7354461", "0.7346593", "0.7338224", "0.7325713", "0.7319396", "0.731811", "0.73133534", "0.7298996", "0.7289473", "0.7272131", "0.7263367", "0.72615343", "0.7258045", "0.72388273", "0.7226073", "0.7211377", "0.7195628", "0.7192538", "0.7183642", "0.7171299", "0.7169803", "0.71466273", "0.7134556", "0.7118036", "0.7112357", "0.71060586", "0.7103842", "0.7101682", "0.7090768", "0.70732105", "0.70661527", "0.7061786", "0.70562446", "0.70537066", "0.7043436", "0.70376605", "0.70358944", "0.7030037", "0.70125985", "0.70084465", "0.7005173", "0.70032763", "0.6988742", "0.69827056", "0.69647324", "0.6958597", "0.69555503", "0.69419956", "0.6930701", "0.69198567", "0.69146377", "0.68971735", "0.68950856", "0.6893969", "0.6893969", "0.6893969", "0.6893881", "0.6887436", "0.6867374", "0.68662214", "0.68635935", "0.6861349", "0.68608457", "0.68553287", "0.6849957", "0.68373483", "0.6829872", "0.68235993", "0.6805379", "0.6805265", "0.68020153", "0.6799547", "0.6799547", "0.6798332", "0.67945963", "0.6793089", "0.6791178", "0.6784832", "0.6779686" ]
0.7913158
0
Obter dados do usuario autenticado
function login($email, $senha){// primeiro precisamos aceder os dados dos usuarios $sql = new sql(); $results = $sql->select("SELECT * FROM usuarios WHERE email = :email AND senha = :senha", array( ":email"=>$email, ":senha"=>$senha )); if(count($results) > 0){ $this->setDados($results[0]); }else{ throw new Exception("login e/ou email invalidade!"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function autenticar(){\n\n $query = \"select id, nome, email from pessoa where email = :email and senha = :senha\";\n $stmt = $this->db->prepare($query);\n $stmt->bindValue(':email',$this->__get('email'));\n $stmt->bindValue(':senha',$this->__get('senha'));\n $stmt->execute();\n\n $usuario = $stmt->fetch(\\PDO::FETCH_ASSOC);\n \n if($usuario['id'] != '' && $usuario['nome'] != ''){\n $this->__set('id', $usuario['id']);\n $this->__set('nome', $usuario['nome']);\n }\n return $this;\n }", "public function agregarUsuario(){\n \n }", "function post_conectar()\n\t{\n\t\t//En este metodo antiguamente se incluia codigo para asegurarse que el esquema de auditoria\n\t\t//guardara el usuario conectado.\n\t}", "public function telaCadastroUsuario():void {\n $session =(Session::get('USER_AUTH'));\n if (!isset($session)) {\n $this->view('Home/login_viewer.php');\n }\n elseif ((int) Session::get('USER_ID')!==1) {\n Url::redirect(SELF::PAINEL_USUARIO);\n }\n else {\n $this->cabecalhoSistema();\n $this->view('Administrador/usuario/formulario_cadastro_usuario_viewer.php');\n $this->rodapeSistema();\n }\n }", "public function autualizar_dados_login()\n {\n \ttry {\n \t\t \n \t\t$con = FabricaDeConexao::conexao();\n \t\t \n \t\t$sqlquery = 'update usuario set usuario = :usuario,senha=md5(:senha),email = :email where id = :id; ';\n \t\t$stmt->$con-> prepare($sqlquery);\n \t\t$stmt->bindValue(':usuario',$dados->usuario);\n \t\t$stmt->bindValue(':senha',$dados->senha);\n \t\t$stmt->bindValue(':email',$dados->email);\n \t\t$stmt->bindValue(':id',$dados->id);\n \t\t\n \t\t$stmt->execute();\n \t\t$rowaf = $stmt->rowCount();\n \t\treturn $rowaf;\n \t}\n \tcatch (PDOException $ex)\n \t{\n \t\techo \"Erro: \".$ex->getMessage();\n \t}\n }", "private function usuarios(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"GET\") {\n\t\t\t# no se envian los usuarios, se envia un error\n\t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n\t\t}//es una petición GET\n\t\t//se realiza la consulta a la bd\n\t\t$query = $this->_conn->query(\n\t\t\t\"SELECT id, nombre, email \n\t\t\t FROM usuario\");\n\t\t//cantidad de usuarios\n\t\t$filas = $query->fetchAll(PDO::FETCH_ASSOC); \n \t$num = count($filas);\n \t//si devolvio un resultado, se envia al cliente\n \tif ($num > 0) { \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['usuarios'] = $filas; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } //se envia un error \n\t $this->mostrarRespuesta($this->devolverError(2), 204);\n\t}", "public function autentificacion($username,$password){\n $userService = new UsuariosServiceImp();\n //objeto de tipo usuario\n $usuario = new Usuarios();\n //llamdo al metodo definido en la capa de servicio\n $usuario = $userService->buscarPorUsernamePassword($username,$password);\n if ( is_object($usuario)){\n /*\n variable de sesion mediante variables locales\n \n $_SESSION['nombre'] = $usuario->getNombre();\n $_SESSION['correo'] = $usuario->getEmail();\n $_SESSION['id'] = $usuario->getId();\n */\n /* variable de sesion mediante un arreglo asociado\n */\n $_SESSION['miSesion'] = array();\n $_SESSION['miSesion']['nombre'] = $usuario->getNombre();\n $_SESSION['miSesion']['correo'] = $usuario->getEmail();\n $_SESSION['miSesion']['id'] = $usuario->getId();\n \n //echo \"<br>El usuario es valido\";\n header(\"location:../view/productos.class.php\");\n }else{\n //echo \"<br>Este usuario no esta registrado en la base de datos\";\n header(\"location:../view/formLogin.html\");\n }\n }", "public function saveUsuario(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_usuario SET usuario = \"%s\" password = \"%s\" WHERE usuario_id = %d',\n $this->usuario,\n $this->password,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_usuario ( usuario, password) VALUES (\"%s\", \"%s\")',\n $this->usuario,\n $this->password );\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }", "public function hacerLogin() {\n $user = json_decode(file_get_contents(\"php://input\"));\n\n if(!isset($user->email) || !isset($user->password)) {\n http_response_code(400);\n exit(json_encode([\"error\" => \"No se han enviado todos los parametros\"]));\n }\n \n //Primero busca si existe el usuario, si existe que obtener el id y la password.\n $peticion = $this->db->prepare(\"SELECT id,idRol,password FROM users WHERE email = ?\");\n $peticion->execute([$user->email]);\n $resultado = $peticion->fetchObject();\n \n if($resultado) {\n \n //Si existe un usuario con ese email comprobamos que la contraseña sea correcta.\n if(password_verify($user->password, $resultado->password)) {\n \n //Preparamos el token.\n $iat = time();\n $exp = $iat + 3600*24*2;\n $token = array(\n \"id\" => $resultado->id,\n \"iat\" => $iat,\n \"exp\" => $exp\n );\n \n //Calculamos el token JWT y lo devolvemos.\n $jwt = JWT::encode($token, CJWT);\n http_response_code(200);\n exit(json_encode($jwt . \"?\" . $resultado->idRol));\n \n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Password incorrecta\"]));\n }\n \n } else {\n http_response_code(404);\n exit(json_encode([\"error\" => \"No existe el usuario\"])); \n }\n }", "public function autenticar($usr,$pwd) {\n $pwd=\"'\".$pwd.\"'\";\n $sql= 'SELECT * FROM empleados WHERE (\"idEmpleado\" = '.$usr.') AND (dni = '.$pwd.');';\n $empleado=\"\";\n $result = pg_query($sql);\n\n if ($result){\n $registro = pg_fetch_object($result);\n $empleado = $registro->nombres . \" \" . $registro->apellido;\n session_start(); //una vez que se que la persona que se quiere loguear es alguien autorizado inicio la sesion\n //cargo en la variable de sesion los datos de la persona que se loguea\n $_SESSION[\"idEmpleado\"]=$registro->idEmpleado;\n $_SESSION[\"dni\"]=$registro->dni;\n $_SESSION[\"fechaInicio\"]=$registro->fechaInicio;\n $_SESSION[\"nombres\"]=$registro->nombres;\n $_SESSION[\"apellido\"]=$registro->apellido;\n $_SESSION[\"i_lav\"]=$registro->i_lav;\n $_SESSION[\"f_lav\"]=$registro->f_lav;\n $_SESSION[\"i_s\"]=$registro->i_s;\n $_SESSION[\"f_s\"]=$registro->f_s;\n $_SESSION[\"i_d\"]=$registro->i_d;\n $_SESSION[\"f_d\"]=$registro->f_d;\n //$_SESSION[\"iex_lav\"]=$registro->iex_lav;\n //$_SESSION[\"fex_lav\"]=$registro->fex_lav;\n }\n return $empleado;\n }", "public function Autenticar(){\n try {\n $r = $this->auth->autenticar(\n $this->model->Acceder(\n $_POST['usuario'],\n $_POST['password']\n )\n );\n \n // Valida modelo de autenticacion definido\n if(__AUTH__ === 'token'){\n header(\"Location: ?c=Historia&token=$r\"); // Si fuera token, redirecciona al controlador por defecto anexando el N° de token generado\n } \n else{\n header('Location: ?c=Historia'); // En caso contrario, redireccion al controlador por defecto \n }\n } \n catch(Exception $e){\n header('Location: index.php'); // En caso de error remite a pagina inicial por defecto para validar credenciales de acceso\n }\n }", "public function listarUser() {\n if(IDUSER) {\n $eval = \"SELECT id,nombre,apellidos,email FROM users\";\n $peticion = $this->db->prepare($eval);\n $peticion->execute();\n $resultado = $peticion->fetchAll(PDO::FETCH_OBJ);\n exit(json_encode($resultado));\n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Fallo de autorizacion\"])); \n }\n }", "public function solicitaUsuario()\n {\n // Lo emitimos por evento\n $this->emit('cambioUsuario', $this->usuario);\n }", "public function ctrIngresoUsuario(){\n\t\tif(isset($_POST[\"ingUsuario\"])){\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingUsuario\"]) && \n\t\t\t\tpreg_match('/^[a-zA-Z0-9]+$/',$_POST[\"ingPassword\"])){\n\n\t\t\t\t$tabla=\"usuarios\";\n\t\t\t$item=\"usuario\";\n\t\t\t$valor=$_POST[\"ingUsuario\"];\n\t\t\t$respuesta=ModeloUsuarios::MdlMostrarUsuarios($tabla,$item,$valor);\t\n\t\t\t //var_dump($respuesta[\"usuario\"]);\n\t\t\tif($respuesta[\"usuario\"]==$_POST[\"ingUsuario\"] && $respuesta[\"password\"]==$_POST[\"ingPassword\"]){\n\t\t\t\t$_SESSION[\"iniciarSesion\"]=\"ok\";\n\t\t\t\techo '<script>\n\t\t\t\twindow.location=\"inicio\";\n\t\t\t\t</script>';\n\t\t\t}else{\n\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelva a intentarlo</div>';\n\t\t\t}\n\t\t}\n\t}\n }", "private function login(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"POST\") {\n\t\t\t# no se envian los usuarios, se envia un error\n\t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n\t\t} //es una peticion POST\n\t\tif(isset($this->datosPeticion['email'], $this->datosPeticion['pwd'])){\n\t\t\t#el constructor padre se encarga de procesar los datos de entrada\n\t\t\t$email = $this->datosPeticion['email']; \n \t\t$pwd = $this->datosPeticion['pwd'];\n \t\t//si los datos de la solicitud no es tan vacios se procesa\n \t\tif (!empty($email) and !empty($pwd)){\n \t\t\t//se valida el email\n \t\t\tif (filter_var($email, FILTER_VALIDATE_EMAIL)) { \n \t\t\t//consulta preparada mysqli_real_escape()\n \t\t\t\t$query = $this->_conn->prepare(\n \t\t\t\t\t\"SELECT id, nombre, email, fRegistro \n \t\t\t\t\t FROM usuario \n \t\t\t\t\t WHERE email=:email AND password=:pwd \");\n \t\t\t\t//se le prestan los valores a la query\n \t\t\t\t$query->bindValue(\":email\", $email); \n \t\t\t$query->bindValue(\":pwd\", sha1($pwd)); \n \t\t\t$query->execute(); //se ejecuta la consulta\n \t\t\t//Se devuelve un respuesta a partir del resultado\n \t\t\tif ($fila = $query->fetch(PDO::FETCH_ASSOC)){ \n\t\t\t $respuesta['estado'] = 'correcto'; \n\t\t\t $respuesta['msg'] = 'Los datos pertenecen a un usuario registrado';\n\t\t\t //Datos del usuario \n\t\t\t $respuesta['usuario']['id'] = $fila['id']; \n\t\t\t $respuesta['usuario']['nombre'] = $fila['nombre']; \n\t\t\t $respuesta['usuario']['email'] = $fila['email']; \n\t\t\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t\t\t } \n \t\t\t}\n \t\t} \n\t\t} // se envia un mensaje de error\n\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(3)), 400);\n\t}", "public function autenticar(Autenticar $autenticar){\n\n $sql = \"select * from tbl_funcionario where matricula = '\".$autenticar->getLogin().\"' and senha = '\".$autenticar->getSenha().\"'\";\n\n echo $sql;\n \n $pdoConn = $this->conn->startConnection();\n\n $select = $pdoConn->query($sql);\n\n if($rsContatos=$select->fetch(PDO::FETCH_ASSOC)){\n // echo \"AQQUI\";\n // var_dump($rsContatos);\n \n // require_once('model/usuarioCmsClass.php');\n $user = new UsuarioCms();\n\n $user->setId($rsContatos['id']);\n $user->setNome($rsContatos['nome']);\n $user->setLogin($rsContatos['matricula']);\n $user->setSenha($rsContatos['senha']);\n $user->setIdPermissao($rsContatos['id_permissao']);\n\n return $user;\n }else{\n return \"FALHA\";\n }\n\n $this->conn->closeConnection();\n\n }", "static public function ctrIngresoUsuario(){\n\n\t\tif(isset($_POST[\"ingUsuario\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUsuario\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])){\n\n\t\t\t\t$tabla = \"usuarios\";\n\n\t\t\t\t// $encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$usesomesillystringforsalt$');\n\n\t\t\t\t$item = \"usu_descri\";\n\t\t\t\t$valor = $_POST[\"ingUsuario\"];\n\t\t\t\t$pass = $_POST[\"ingPassword\"];\n\n\t\t\t\t$respuesta = ModeloUsuarios::MdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t// var_dump($respuesta);\n\t\t\t\t// die();\n\n\t\t\t\tif($respuesta[\"usu_descri\"] == $_POST[\"ingUsuario\"] && $respuesta[\"clave\"] == $_POST[\"ingPassword\"])\n\t\t\t\t{\n\n\t\t\t\t\tif($respuesta['estado'] == 'A')\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$_SESSION[\"iniciarSesion\"] = \"ok\";\n\t\t\t\t\t\t$_SESSION[\"id\"] = $respuesta[\"id\"];\n\t\t\t\t\t\t// $_SESSION[\"nombre\"] = $respuesta[\"nombre\"];\n\t\t\t\t\t\t$_SESSION[\"usuario\"] = $respuesta[\"usu_descri\"];\n\t\t\t\t\t\t// $_SESSION[\"foto\"] = $respuesta[\"foto\"];\n\t\t\t\t\t\t// $_SESSION[\"perfil\"] = $respuesta[\"perfil\"];\n\n\t\t\t\t\t\techo '<script>\n\t\n\t\t\t\t\t\twindow.location = \"inicio\";\n\t\n\t\t\t\t\t\t</script>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<br><div class=\"alert alert-danger\">El usuario no esta activo, porfavor, comuniquese con el administrador</div>';\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\n\t\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelve a intentarlo</div>';\n\n\t\t\t\t}\n\n\t\t\t}\t\n\n\t\t}\n\n\t}", "public function authenticate()\n\t{\n\t\t\n\t\t$username=strtolower($this->username);\n\t\t// aca deber�a agregar la condici�n de activo\n\t\t $user=Usuario::model()->find('LOWER(nombre)=? and estado=1',array($username));\n\t\t if($user===null)\n\t\t\t$this->errorCode=self::ERROR_USERNAME_INVALID;\n\t\t else if(!$user->validatePassword($this->password))\n\t\t\t$this->errorCode=self::ERROR_PASSWORD_INVALID;\n\t\t else\n\t\t {\n\t\t\t$this->_id=$user->id;\n\t\t\t$this->username=$user->nombre; \n //si el estado es 0 le muestro un cartel avisando que debe completar sus datos sino se bloqueará\n /* if($user->estado==0 && !isset($_GET['act']))\n Yii::app()->user->setFlash(\"warning\",\"Debe completar sus datos personales sino su cuenta será deshabilitada.<br>\n \".CHtml::link('Completar',array('site/completarRegistro','act'=>$user->hash_activacion)));*/\n\t\t\t$this->errorCode=self::ERROR_NONE;\n\t\t }\n\treturn $this->errorCode==self::ERROR_NONE;\n\t}", "public function getUsuario() {\n }", "public function setLogin(){\n \n\t\t\t$obUser = Model::getUserByEmail($this->table, $this->camp,$this->email);\n\t\t\tif (!$obUser instanceof Model) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\tif (!password_verify($this->password, $obUser->senha)) {\n\t\t\t\t$this->message = 'Usuario ou Senha incorretos';\n return false;\n\t\t\t}\n\t\t\t\n\t\t\t$this->session($obUser);\n\n\t\t\theader('location: '.$this->location);\n\t\t\texit;\n\n\t\t}", "static public function ctrIngresoUsuario()\n{ \n if(isset($_POST[\"ingUsuario\"]))\n {\n\n if(preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUsuario\"]) && preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])) {\n\n\n //$encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\t\t\t//print_r($_POST);\n $tabla = \"usuarios\";\n $item= \"codusuario\";\n $valor= $_POST[\"ingUsuario\"];\t\t\t\t\n\n $respuesta = ModeloUsuarios::mdlMostrarUsuarios($tabla, $item, $valor );\n\n if($respuesta[\"codusuario\"] == $_POST[\"ingUsuario\"] && $respuesta[\"clave\"] == $_POST[\"ingPassword\"] ){\n\n if($respuesta[\"bloqueado\"] == 0 ) {\n $_SESSION[\"iniciarSesion\"] = \"ok\";\n $_SESSION[\"id\"] = $respuesta[\"codusuario\"];\n $_SESSION[\"nombre\"] = $respuesta[\"nomusuario\"];\n $_SESSION[\"usuario\"] = $respuesta[\"codusuario\"];\n $_SESSION[\"perfil\"] = $respuesta[\"codperfil\"];\n $_SESSION[\"foto\"] = \"\";\n $_SESSION[\"id_local\"] = 1;\n\n date_default_timezone_set('America/Bogota');\n $fecha = date('Y-m-d');\n $hora = date('H:i:s');\n $fechaActual = $fecha.' '.$hora;\n\n $tabla = 'usuarios';\n $item1 = 'fecingreso';\n $valor1 = $fechaActual ;\n $item2 = 'codusuario';\n $valor2= $respuesta[\"codusuario\"] ;\n $respuestaUltimoLogin = ModeloUsuarios::mdlActualizarUsuario($tabla,$item1, $valor1, $item2, $valor2 );\n\n if($respuestaUltimoLogin == \"ok\")\n {\n echo '<script> window.location = \"inicio\"</script>';\n\n }\n\n } \n else \n echo '<br><div class=\"alert alert-danger\">El usuario no se encuentra activado.</div>';\n\n }else {\n\n echo '<br><div class=\"alert alert-danger\">Error al ingresar vuelve a intentarlo.</div>';\n }\t\t\t\t\n\n }//\n\n }\n\n}", "function compruebaLoginUsuario($bd){\n //Hago un filtrado previo por si hay valores indeseables en el array\n $arrayFiltrado=array();\n foreach ($_POST as $k => $v)\n $arrayFiltrado[$k] = filtrado($v);\n\n //Utilizo los objetos DAO para añadir el usuario a la BD\n $daoUsuario = new Usuarios($bd);\n $usuario = new Usuario();\n $usuario->setPassword($arrayFiltrado[\"password\"]);\n $usuario->setUsuario($arrayFiltrado[\"usuario\"]);\n $resultado = $daoUsuario->compruebaCredenciales($usuario);\n //Compruebo si tengo usuario\n if($resultado!=false) {\n $usuario->setPassword(null);\n $usuario->setId($resultado[\"id\"]);\n $usuario->setImagen($resultado[\"imagen\"]);\n return $usuario;\n }\n else\n return false;\n}", "public function usuario_post() {\n $respuesta = $this->Account_model->selectUsuario($this->post('usuario'), $this->post('contraseña'));\n if(!$respuesta) {\n $this->response('', 204);\n } else {\n $this->response($respuesta, 200);\n }\n }", "private function consultar_usuario_todos() {\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u;\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "public function auth_user()\n {\n //echo $this->id;\n //echo $this->username. ' is authenticated';\n }", "private function ifoCadUser()\n {\n $infoCadUser = new AdmsRead();\n $infoCadUser->fullRead(\"SELECT env_email_conf, adms_niveis_acesso_id, adms_sits_usuario_id FROM adms_cads_usuarios WHERE id =:id LIMIT :limit\", \"id=1&limit=1\");\n $this->IfoCadUser = $infoCadUser->getResultado();\n\n }", "public function authenticate() {\n /* Valido que el usuario exista */\n\n $valido_usuario = Users::model()->find(array(\n 'select' => 'count(*) as id',\n 'condition' => 'username = :username',\n 'params' => array(':username' => $this->username)\n ));\n if ($valido_usuario->id == 1) {\n /* Si existe el usuario consulto el usuario con su password */\n\n $valido_clave = Users::model()->find(array(\n 'select' => 'count(*) as id',\n 'condition' => 'username = :username AND password = :password',\n 'params' => array(':username' => $this->username, ':password' => $this->password)\n ));\n\n if ($valido_clave->id == 1) {\n\n $sql = new CDbCriteria();\n\n $sql->params = array(':username' => $this->username, ':password' => $this->password);\n $sql->condition = 'username = :username AND password = :password';\n\n $model = Users::model()->find($sql);\n\n $sql->with = array('rol', 'statusUser');\n\n\n $consulto_usuario = Users::model()->find($sql);\n\n if ($consulto_usuario->status_user_id == 1) {\n\n $this->setState('id', $consulto_usuario->id);\n $this->setState('rol', $consulto_usuario->rol_id);\n $this->errorCode = self::ERROR_NONE;\n\n /* Usuario Activo Procedo a crear la Session */\n } elseif ($consulto_usuario->status_user_id == 2) {\n /* Usuario Inactivo */\n Yii::app()->user->setFlash('alert-danger', \"Usuario \" . @$consulto_usuario->statusUser->name);\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n } elseif ($consulto_usuario->status_user_id == 3) {\n /* Usuario Bloqueado */\n Yii::app()->user->setFlash('alert-danger', \"Usuario \" . @$consulto_usuario->statusUser->name);\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n } elseif ($consulto_usuario->status_user_id == 4) {\n /* Usuario Suspendido */\n Yii::app()->user->setFlash('alert-danger', \"Usuario \" . @$consulto_usuario->statusUser->name);\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n } elseif ($consulto_usuario->status_user_id == 5) {\n /* Usuario debe validar Email */\n Yii::app()->user->setFlash('alert-danger', \"Su usuario debe activarlo confirmando en su correo electronico \");\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n }\n } else {\n /* CONTRASEÑA ERRADA */\n Yii::app()->user->setFlash('alert-danger', \"Contraseña Errada\");\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n }\n } else {\n /* NO EXISTE USUARIO' */\n Yii::app()->user->setFlash('alert-danger', \"Usuario no existe\");\n $this->errorCode = self::ERROR_PASSWORD_INVALID;\n }\n\n return !$this->errorCode;\n }", "public function recibirdatos() {\n\t\t$passSha1 = sha1($this->input->post('password'));\n\t\t$datos = array(\n\t\t\t'usuario' => $this->input->post('usuario'),\n\t\t\t'password' => $passSha1\n\t\t\t);\n\t\t//Llamamos al modelo, Si la autentificacion es correcta damos paso a la aplicacion y sino devolvemos al login\n\t\tif($this->login_model->obtenerPass($datos) == true){\n\t\t\t//Cargamos la pagina principal\n\t\t\t$this->session->set_userdata('usuario', $datos['usuario']);\n\t\t\t//Llamamos a la clase que realiza los test de caja blanca\n\t\t\t$this->testCajaBlanca($datos);\n\t\t\t$this->mostrarDatosUser();\n\t\t\t$this->session->set_userdata('Token', true);\n\t\t}else{\n\t\t\t$this->load->view('login');\n\t\t}\n\t}", "public function authCliente(Request $data){\n //dd(\"jano\");\n try{\n \n $verificar = User::where('email', $data->correo)->first();\n\n\n if(count($verificar)>0 && $verificar->id_rol == 4){ /**\"eres vendedor institucional\"**/\n \n if (\\Auth::attempt(['email' => $data->correo, 'password' => $data->pass])) {\n \n return redirect('/inicio_cliente'); \n }\n return redirect()->back()->withErrors(['datos incorrectos, intente nuevamente']);\n }\n return redirect()->back();\n }catch (\\Illuminate\\Database\\QueryException $e) {\n return redirect()->back()->withErrors(['Algo no anda bien, posiblemente datos mal ingresados o no hay conexión']);\n } \n\n }", "function conectar(){\n global $Usuario;\n global $Clave;\n global $_SESSION;\n $this->dataOrdenTrabajo->SetUserName($Usuario);\n $this->dataOrdenTrabajo->SetUserPassword($Clave);\n $this->dataOrdenTrabajo->SetDatabaseName($_SESSION['database']);\n $this->dataOrdenTrabajo->setConnected(true);\n }", "public function ctrIngresoUsuario(){\n\n\t\tif(isset($_POST[\"user01\"])){\n\n\t\t//\t if(preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"ingresoEmail\"]) && preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingresoPassword\"])){\n\n\t\t\t \t//$encriptar = crypt($_POST[\"ingresoPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\t\t\t\t$encriptar = crypt($_POST[\"passwords01\"], '$2a$07$asxx54ahjppf17sd87a5a4dDDGsystemdevmybebe$');\n\n\t\t\t \t$tabla = \"genusuario\";\n\t\t\t \t$item = \"usunombre\";\n\t\t\t \t$valor = $_POST[\"user01\"];\n\n\t\t\t \t$respuesta = UserModel::mdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t//echo \"<pre>\".print_r($respuesta).\"</pre>\";\n\n\t\t\t \tif($respuesta[\"usunombre\"] == $_POST[\"user01\"] && $respuesta[\"usuclave\"] == $encriptar){\n\n\t\t\t \t\tif($respuesta[\"usuverific\"] == 0){\n\n\t\t\t \t\t\techo'<script>\n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t\t \ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t\t \ttext: \"¡El correo electrónico aún no ha sido verificado, por favor revise la bandeja de entrada o la carpeta SPAM de su correo electrónico para verificar la cuenta, o contáctese con nuestro soporte a [email protected]!\",\n\t\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t\t\t\treturn;\n\n\t\t\t \t\t}else{\n\n\t\t\t \t\t\t$_SESSION[\"validarSesion\"] = \"ok\";\n\t\t\t \t\t\t$_SESSION[\"id\"] = $respuesta[\"oid\"];\n\n\t\t\t \t\t\t$ruta = RouteController::ctrRoute();\n\n\t\t\t \t\t\techo '<script>\n\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"'.$ruta.'backoffice\";\t\t\t\t\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t \t\t}\n\n\t\t\t \t}else{\n\n\t\t\t \t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\t \ttitle: \"¡ERROR!\",\n\t\t\t\t\t\t\t \ttext: \"¡El email o contraseña no coinciden!\",\n\t\t\t\t\t\t\t \tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\t\t\tif(result.value){ \n\t\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t});\n\n\t\t\t\t\t</script>';\n\n\t\t\t \t}\n\n\n\t\t/*\t }else{\n\n\t\t\t \techo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\ttitle: \"¡CORREGIR!\",\n\t\t\t\t\t\ttext: \"¡No se permiten caracteres especiales en ninguno de los campos!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\thistory.back();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\t\n\n\t\t\t\t</script>';\n\n\t\t\t }*/\n\n\t\t}\n\n\t}", "public function autenticando_usuario_e_verificando_permissao_de_criar_empresa()\n {\n //Cria e loga o usuario\n $this->actingAs(factory('App\\User')->create());\n\n //And a task object\n $empresa = factory('App\\Empresa')->create();\n //When user submits post request to create task endpoint\n $this->post('empresa/create',$empresa->toArray());\n //It gets stored in the database\n $this->assertEquals(1, Empresa::all()->count());\n }", "public function dadosLogin(){\n\t\t$sql=\"select id_empresa from empresa where email=:email and senha=:senha\";\n\t\t//prepara o comando a ser executado no banco de dados\n\t\t$query=$this->con->prepare($sql);\n\t\t//set as variáveis no comando sql e executa no banco de dados\n\t\t$query->execute(array(\"email\"=>$this->email,\"senha\"=>$this->senha));\n\t\t//retorna resultado com um array assoc\n\t\t$resultado = $query->fetch(PDO::FETCH_ASSOC);\n\t\t//retorna os dados do usuário se estiver tudo ok, senão retorna falso\n\t\tif($resultado){\n\t\t\treturn $resultado;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function Login($dados){\n // //$conexao = $c->conexao();\n\n $email = $dados[0];\n $senha = md5($dados[1]);\n\n $sql = \"SELECT a.*, c.permissao FROM tbusuarios a, tbpermissao c WHERE email = '$email' and senha = '$senha' and a.idpermissao = c.idpermissao limit 1 \";\n $row = $this->ExecutaConsulta($this->conexao, $sql);\n\n // print_r($sql);\n\n // $sql=ExecutaConsulta($this->conecta,$sql);\n // $sql = $this->conexao->query($sql);\n // $sql = $this->conexao->query($sql);\n // $row = $sql->fetch_assoc();\n // print_r($row); \n\n if ($row) {\n $_SESSION['chave_acesso'] = md5('@wew67434$%#@@947@@#$@@!#54798#11a23@@dsa@!');\n $_SESSION['email'] = $email;\n $_SESSION['nome'] = $row['nome'];\n $_SESSION['permissao'] = $row['permissao'];\n $_SESSION['idpermissao'] = $row['idpermissao'];\n $_SESSION['last_time'] = time();\n $_SESSION['usuid'] = $row['idusuario'];\n $_SESSION['ip'] = $_SERVER[\"REMOTE_ADDR\"];\n $mensagem = \"O Usuário $email efetuou login no sistema!\";\n $this->salvaLog($mensagem);\n return 1;\n }else{\n return 0;\n }\n\n }", "static public function ctrIngresoUsuario()\n {\n\n if (isset($_POST['ingEmail'])) {\n if (\n preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"ingEmail\"]) &&\n preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"])\n ) {\n\n\n $encriptar = crypt($_POST[\"ingPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n $tabla = \"usuarios\";\n $item = \"email\";\n $valor = $_POST[\"ingEmail\"];\n\n $respuesta = ModeloUsuarios::mdlMostrarUsuario($tabla, $item, $valor);\n\n /*Validacion junto con la BD*/\n if ($respuesta[\"email\"] == $_POST[\"ingEmail\"] && $respuesta[\"password\"] == $encriptar) {\n //validacion con la BD si ya esta verficado el email\n if ($respuesta['verificacion'] == 1) {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡NO HA VERIFICADO SU CORREO ELECTRONICO!\",\n\t\t\t\t\t\t\t\t text: \"¡Por favor revise la bandeja de entrada o la carpeta de SPAM, para verifcar la direccion de correo electronico ' . $_POST[\"ingEmail\"] . '\" ,\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t }\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\t</script>';\n } else {\n\n /*Variables de sesion*/\n\n @session_start();\n $_SESSION['validarSesion'] = 'ok';\n $_SESSION['id'] = $respuesta['id'];\n $_SESSION['nombre'] = $respuesta['nombre'];\n $_SESSION['foto'] = $respuesta['foto'];\n $_SESSION['email'] = $respuesta['email'];\n $_SESSION['password'] = $respuesta['password'];\n $_SESSION['modo'] = $respuesta['modo'];\n\n //Utilizando del local storgae, alcenamos la ruta, para cuando inicie sesion, sea redireccionado hacia la ruta\n echo '\n <script> \n window.location = localStorage.getItem(\"rutaActual\");\n </script>\n ';\n\n\n }\n } else {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡ERROR AL INGRESAR!\",\n\t\t\t\t\t\t\t\t text: \"¡Por favor revise el correo electronico, o la contraseña\" ,\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t window.location = localStorage.getItem(\"rutaActual\");\n\t\t\t\t\t\t\t }\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\t</script>';\n }\n\n\n } else {\n echo '<script> \n\n\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t title: \"¡ERROR!\",\n\t\t\t\t\t\t\t\t text: \"¡Error al ingresar al sistema, no se permiten caracteres especiales\",\n\t\t\t\t\t\t\t\t type:\"error\",\n\t\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction (isConfirm){\n\t\t\t\t\t\t\t if(isConfirm){\n\t\t\t\t\t\t\t history.back();\n\t\t\t\t\t\t\t }\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\t</script>';\n }\n }\n\n\n }", "function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }", "public function authUser()\n {\n //я не знаю почему, что эти функции возвращают пустые строки...\n //$login = mysql_real_escape_string($_POST['login']);\n //$password = mysql_real_escape_string($_POST['password']);\n $login = $_POST['login'];\n $password = $_POST['password'];\n if(DBunit::checkLoginPassword($login, $password)){\n DBunit::createUserSession(DBunit::getUser($login, $password));\n return true;\n }\n else {\n return false;\n }\n }", "static public function ctrIngresoUsuario(){\n\t\t\n\t\tif (isset($_POST['user']) && isset($_POST['pass'])) {\n\t\t\tif (preg_match('/^[a-zA-Z-0-9 ]+$/', $_POST['user'])) {\n\t\t\t\tswitch ($_POST['rol']) {\n\t\t\t\t\tcase 'Encargado':\n\t\t\t\t\t\t$answer = adminph\\Attendant::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Propietario':\n\t\t\t\t\t\t$answer = adminph\\Propietary::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Arrendatario':\n\t\t\t\t\t\t$answer = adminph\\Lessee::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$answer = adminph\\User::where('username',$_POST['user'])->first();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$password = $_POST[\"pass\"];\n\t\t\t\tif (is_object($answer)) {\n\t\t\t\t\tif (password_verify($password,$answer->password) ) {\n\t\t\t\t\t\tif ($answer->state == 1) {\n\t\t\t\t\t\t\tif ($_POST['rol'] == 'Otro') {\n\t\t\t\t\t\t\t\tsession(['rank' => $answer->type]);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tsession(['rank' => $_POST['rol']]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsession(['user' => $answer->username]);\n\t\t\t\t\t\t\tsession(['name' => $answer->name]);\n\t\t\t\t\t\t\tsession(['id' => $answer->id]);\n\t\t\t\t\t\t\tsession(['photo' => $answer->photo]);\n\t\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\t= REGISTRAR LOGIN =\n\t\t\t\t\t\t\t=============================================*/\n\t\t\t\t\t\t\tdate_default_timezone_set('America/Bogota');\n\t\t\t\t\t\t\tsession(['log' => date(\"Y-m-d h:i:s\")]);\n\t\t\t\t\t\t\t$answer->last_log = session('log');\n\t\t\t\t\t\t\tif ($answer->save()) {\n\t\t\t\t\t\t\t\techo ' <script>\n\t\t\t\t\t\t\twindow.location = \"inicio\"; </script> ';\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\techo '<br><div class=\"alert alert-warning\" style=\"text-align: center;\" >Este usuario se encuentra desactivado, por favor contacte al administrador.</div>';\t\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}\n\t\t\t\telse{\n\t\t\t\t\techo '<head><style type=\"text/css\" media=\"screen\">body{background:#4a6886;color:#fff;}</style></head><body><div class=\"alert alert-warning\" style=\"text-align: center; font-size: 30px;margin-top:15%\" >Las credenciales ingresadas no son correctas.</div><br><br><div style=\"text-align: center; margin-left: 35%;margin-top:5%; width:30%;background:#E75300; padding: 10px;\"><a href=\"/\"> <span style=\" font-size: 18px; color: #fff\"><b>Volver al inicio</b></span> </a></div></body>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "static public function ctrLoginUser(){ \n\t\t\tif(isset($_POST[\"ingUser\"])){\n\t\t\t\t//Intento de Logeo\n\t\t\t\tif((preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingUser\"]))\n\t\t\t\t && (preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingPassword\"]))){\n\t\t\t\t\t\t$tabla = \"usuarios\";\t//Nombre de la Tabla\n\n\t\t\t\t\t\t$item = \"usuario\";\t\t//Columna a Verficar\n\t\t\t\t\t\t$valor = $_POST[\"ingUser\"];\n\n\t\t\t\t\t\t//Encriptar contraseña\n\t\t\t\t\t\t$crPassword = crypt($_POST[\"ingPassword\"], '$2a$08$abb55asfrga85df8g42g8fDDAS58olf973adfacmY28n05$');\n\n\t\t\t\t\t\t$respuesta = ModelUsers::mdlMostrarUsuarios($tabla, $item, $valor);\n\n\t\t\t\t\t\tif($respuesta[\"usuario\"] == $_POST[\"ingUser\"]\n\t\t\t\t\t\t\t&& $respuesta[\"password\"] == $crPassword){\n\t\t\t\t\t\t\t\tif($respuesta[\"estado\"] == '1'){\n\t\t\t\t\t\t\t\t\t//Coincide \n\t\t\t\t\t\t\t\t\t$_SESSION[\"login\"] = true;\n\t\t\t\t\t\t\t\t\t//Creamos variables de Sesion\n\t\t\t\t\t\t\t\t\t$_SESSION[\"user\"] = $respuesta;\n\t\t\t\t\t\t\t\t\t//Capturar Fecha y Hora de Login\n\t\t\t\t\t\t\t\t\tdate_default_timezone_set('America/Mexico_City');\n\t\t\t\t\t\t\t\t\t$fechaActual = date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t\t\t$item1 = \"ultimo_login\";\n\t\t\t\t\t\t\t\t\t$valor1 = $fechaActual;\n\t\t\t\t\t\t\t\t\t$item2 = \"id_usuario\";\n\t\t\t\t\t\t\t\t\t$valor2 = $respuesta[\"id_usuario\"];\n\n\t\t\t\t\t\t\t\t\t$ultimoLogin = ModelUsers::mdlActualizarUsuario($tabla, $item1, $valor1, $item2, $valor2);\n\n\t\t\t\t\t\t\t\t\tif($ultimoLogin)\t//Redireccionando\n\t\t\t\t\t\t\t\t\t\techo '<script>location.reload(true);</script>';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\techo '<br><div class=\"alert alert-danger\">El usuario no esta activado</div>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<br><div class=\"alert alert-danger\">Error al ingresar, vuelve a intentarlo</div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}", "public function getUsuariosLogin($datos)\n {\n $stmt = Conexion::conectar()->prepare('SELECT *from usuarios WHERE correo=:correo && password=:contrasena');\n $stmt->bindParam(\":correo\", $datos[\"correo\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":contrasena\", $datos[\"contrasena\"] , PDO::PARAM_STR);\n if($stmt->execute())\n {\n \n //Variables para iniciar una sesion \n \n $respuesta = $stmt->rowCount();\n $resultado =$stmt->fetch();\n session_start();\n $_SESSION[\"idUsuario\"]=$resultado[\"idUsuario\"];\n $_SESSION[\"nombre\"]=$resultado[\"nombre\"];\n $_SESSION[\"apellido\"]=$resultado[\"apellido\"];\n $_SESSION[\"nombre_usuario\"]=$resultado[\"nombre_usuario\"];\n $_SESSION[\"contrasena\"]=$resultado[\"password\"];\n $_SESSION[\"apellido\"]=$resultado[\"apellido\"];\n $_SESSION[\"correo\"]=$resultado[\"correo\"];\n $_SESSION[\"fecha_registro\"]=$resultado[\"fecha_registro\"];\n $_SESSION[\"ruta_img\"]=$resultado[\"ruta_img\"];\n $_SESSION[\"tipoUsuario\"]=$resultado[\"tipoUsuario\"];\n\n return $respuesta;\n }else\n {\n return \"error\";\n }\n }", "public function datos_usuario(){\n\t\t$data = json_decode(json_encode($_SESSION['USER']),true);\n\n\t\t$result = $this->_db->query(\"\n\t\tSELECT a.roleid FROM \".DB_PRE.\"role_assignments a, \".DB_PRE.\"context b \n\t\tWHERE a.userid = '$data[id]' AND a.contextid = b.id AND b.instanceid =\".ID_CURSO\n\t\t);\n\n\t\t$rol = 0;\n\t\tif (!$result) {\n\t\t\tprintf(\"Errormessage datos_usuario: %s\\n\", $this->_db->error);\n\t\t}else{\n\t $rol_user = $result->fetch_all(MYSQLI_ASSOC);\n\t if(count($rol_user) > 0){\n\t \t$rol = $rol_user['0']['roleid'];\n\t }\n \t}\n\n\t\t$usuario = array(\n\t\t\t\"id\" => $data['id'],\n\t\t\t\"nombre\" => $data['firstname'],\n\t\t\t\"apellido\" => $data['lastname'],\n\t\t\t\"codigo_estudiante\" => $data['idnumber'],\n\t\t\t\"rol\" => $rol\n\t\t);\n\n\t\t$datos_add = $this->_db->query(\"\n\t\t\tSELECT e.per_aca, b.id_facultad, a.id_programa, e.idnumber as codigo_curso, a.id_genero, a.idnumber\n\t\t\tFROM am_usuario a, am_programa b, \".DB_PRE.\"course e\n\t\t\tWHERE a.id_programa = b.id_programa\n\t\t\tAND e.id = \".ID_CURSO.\"\n\t\t\tAND id_moodle = \".$data['id']\n\t\t\t);\n\n\t\tif (!$datos_add) {\n\t\t\tprintf(\"Errormessage datos_add: %s\\n\", $this->_db->error);\n\t\t}else{\n\t\t\t$row = $datos_add->fetch_all(MYSQLI_ASSOC);\n\t\t\tforeach ($row as $key) {\n\t\t\t\tforeach ($key as $data => $value) {\n\t\t\t\t\t$usuario[$data] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $usuario;\n\t}", "public function authenticate() {\r\n /*tomamos los 2 datos del from con el pass ya modificado*/\r\n $user = $this->input->post('email');\r\n $passever= md5($this->input->post('password'));\r\n /*cargamos el modelo y enviamos la consulta a la DB*/\r\n $this->load->model('User_model');\r\n $query = $this->User_model->authenticate($user, $passever); \r\n $row = $query->row_array();\r\n if (isset($row))\r\n {\r\n $user = array(\r\n 'id' => $row['id'],\r\n 'email' => $row['email'],\r\n 'password' => $row['password'],\r\n 'name' => $row['name'],\r\n 'tipo_usuario' => $row['tipo_usuario']\r\n ); \r\n $this->session->set_userdata('user', $user); \r\n if ($row['tipo_usuario']==1) {\r\n \r\n $this->load->view('Logueado/index');\r\n }else {\r\n $this->load->view('Logueado/indexuser');\r\n \r\n \r\n }\r\n } else \r\n { \r\n $data['error'] = \"Usuario o contraseña incorrecta, por favor vuelva a intentar\";\r\n $this->load->view('/Inicio/login',$data);\r\n }\r\n }", "public function login($datos)\n {\n $stmt = Conexion::conectar()->prepare('SELECT *from usuarios WHERE nombre_usuario=:correo && password=:contrasena');\n $stmt->bindParam(\":correo\", $datos[\"correo\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":contrasena\", $datos[\"contrasena\"] , PDO::PARAM_STR);\n if($stmt->execute())\n {\n $respuesta = $stmt->rowCount();\n $resultado =$stmt->fetch();\n //Si el resultado returna mayor que uno es que si existe el usuario asi que inicia la sesion\n if($resultado[\"count(*)\"]>0)\n {\n return \"Datos no validos\";\n }else\n {\n session_start();\n $_SESSION[\"correo\"]=$resultado[\"correo\"];\n $_SESSION[\"nombre\"]=$resultado[\"nombre\"];\n return \"Correcto\";\n }\n\n \n }else\n {\n return \"error\";\n }\n }", "public function login(){\n\n if(isset($_POST)){\n \n /* identificar al usuario */\n /* consulta a la base de datos */\n $usuario = new Usuario();\n \n $usuario->setEmail($_POST[\"email\"]);\n $usuario->setPassword($_POST[\"password\"]);\n \n $identity = $usuario->login();\n \n\n if($identity && is_object($identity)){\n \n $_SESSION[\"identity\"]= $identity;\n\n if($identity->rol == \"admin\"){\n var_dump($identity->rol);\n\n $_SESSION[\"admin\"] = true;\n }\n }else{\n $_SESSION[\"error_login\"] = \"identificacion fallida\";\n }\n\n\n /* crear una sesion */\n \n }\n /* redireccion */\n header(\"Location:\".base_url);\n\n }", "public function auth(){ return $this->authForUser( User::$cUser ); }", "public function login($user, $clave)\n {\n parent::conectar();\n\n \n\n // El metodo salvar sirve para escapar cualquier comillas doble o simple y otros caracteres que pueden vulnerar nuestra consulta SQL\n $user = parent::salvar($user);\n $clave = parent::salvar($clave);\n\n // Si necesitas filtrar las mayusculas y los acentos habilita las lineas 36 y 37 recuerda que en la base de datos debe estar filtrado tambien para una \n \n\t$consulta = 'select id, nombre, cargo from usuarios where email=\"'.$user.'\" and clave= MD5(\"'.$clave.'\")\n\t UNION SELECT codpaci, nombrep, cargo from customers where email =\"'.$user.'\" and clave= MD5(\"'.$clave.'\")';\n\t \n\t \n /*\n Verificamos si el usuario existe, la funcion verificarRegistros\n retorna el número de filas afectadas, en otras palabras si el\n usuario existe retornara 1 de lo contrario retornara 0\n */\n\n $verificar_usuario = parent::verificarRegistros($consulta);\n\n // si la consulta es mayor a 0 el usuario existe\n if($verificar_usuario > 0){\n\n \n\n /*\n Realizamos la misma consulta de la linea 55 pero esta ves transformaremos el resultado en un arreglo,\n ten mucho cuidado con usar el metodo consultaArreglo ya que devuelve un arreglo de la primera fila encontrada\n es decir, como nosotros solo validamos a un usuario no hay problema pero esta funcion no funciona si\n vas a listar a los usuarios, espero que me entiendan xd\n */\n\n $user = parent::consultaArreglo($consulta);\n\n /*\n Bien espero ser un poco claro en esta parte, la variable user\n en la linea 69 pasa a ser un arreglo con los campos consultados en la linea\n 48, entonces para acceder a los datos utilizamos $user[nombre_del_campo] Ok?\n bueno hagamos el ejercicio.\n */\n\n /*\n Inicializamos la sessión | Recuerda con las variables de sesión\n podemos acceder a la informacion desde cualquiera pagina siempre y cuando\n exista una sesión y ademas utilicemos el codigo de la linea 84\n */\n\n session_start();\n\n /*\n Las variables de sesion son muy faciles de usar, es como\n declarar una variable, lo unico diferente es que obligatoria mente\n debes usar $_SESSION[] y .... el nombre de la variable ya no sera asi\n $miVariable sino entre comillas dentro del arreglo de sesion, haber me\n dejo explicar, $_SESSION['miVariable'], recuerda que como declares la variable\n en este archivo asi mismo lo llamaras en los demas.\n */\n\n $_SESSION['id'] = $user['id'];\n $_SESSION['nombre'] = $user['nombre'];\n $_SESSION['cargo'] = $user['cargo'];\n\n /*\n Que porqué almacenamos cargo? es encillo en nuestros proyectos\n pueden existir archivos que solo puede ver un usuario con el cargo de\n administrador y no un usuario estandar, asi que la variable global de\n sesion nos ayudara a verificar el cargo del usuario que ha iniciado sesion\n Ok?\n */\n\n /*\n Recuerda:\n cargo con valor: 1 es: Administrador\n cargo con valor: 2 es: usuario estandar\n puedes agregar cuantos cargos desees, en este ejemplo solo uso 2\n */\n\n // Verificamos que cargo tiene l usuario y asi mismo dar la respuesta a ajax para que redireccione\n if($_SESSION['cargo'] == 1){\n echo 'view/admin/admin.php';\n }else if($_SESSION['cargo'] == 2){\n echo 'view/user/user.php';\n }\n\n\n // u.u finalizamos aqui :v\n\n }else{\n // El usuario y la clave son incorrectos\n echo 'error_3';\n }\n\n\n # Cerramos la conexion\n parent::cerrar();\n }", "public function obtener($antigua,$nueva){\n \n \n session_start();\n //busca en la tabla usuarios los campos donde el nombre sea igual a admin si no encuentra nada devuelve null\n \n $usuario = R::findOne('usuarios', 'alias=?', [\n $_SESSION['nombre']\n ]);\n \n \n //comprueba si la variable password es distinta al campo contraseña almacenado en la base de datos si es asi b octiene el valor=\"no\"\n if ( password_verify($antigua, $usuario->contrasena)) {\n \n \n $actualizar=R::load('usuarios',$usuario->id);\n $actualizar->contrasena = password_hash($nueva, PASSWORD_DEFAULT);\n $actualizar->confirmar_contrasena=password_hash($nueva, PASSWORD_DEFAULT);\n \n \n R::store($actualizar);\n redirect(base_url().\"usuario/Usuarios/accesoget\");\n \n }\n }", "function validatedLogin($email,$contra){\n $query = \"SELECT\n id_usuario,\n nombre,\n apellidoP,\n apellidoM,\n email,\n fechaNac,\n nombreRol,\n valuePermission\n FROM\n usuario\n LEFT JOIN(rol) ON usuario.rol_id = rol.id_rol\n WHERE\n usuario.email = \".$this->db->escape($email).\" AND\n pass = \".$this->db->escape($contra).\"\n \";\n return $this->db->query($query);\n }", "private function consultar_usuario_por_correo() {\n $sentencia = \"select id,nombrecompleto ,correo,token \"\n . \"from usuario u where u.correo ='{$this->referencia_a_buscar}'; \";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "public function buscarUsuarios(){\n\t\t}", "public function login (){\n\n $dao = DAOFactory::getUsuarioDAO(); \n $GoogleID = $_POST['GoogleID']; \n $GoogleName = $_POST['GoogleName']; \n $GoogleImageURL = $_POST['GoogleImageURL']; \n $GoogleEmail = $_POST['GoogleEmail'];\n $usuario = $dao->queryByGoogle($GoogleID); \n if ($usuario == null){\n $usuario = new Usuario();\n $usuario->google = $GoogleID;\n $usuario->nombre = $GoogleName;\n $usuario->avatar = $GoogleImageURL;\n $usuario->correo = $GoogleEmail;\n print $dao->insert($usuario);\n $_SESSION[USUARIO] = serialize($usuario);\n //$usuario = unserialize($_SESSION[USUARIO]);\n } else {\n $_SESSION[USUARIO] = serialize($usuario);\n }\n }", "public function login($datos)\n {\n \n $ok = true;\n $sql = \"SELECT id, nombre , mail \n FROM \" . $this->tabla . \"\n WHERE mail='\" . $datos['mail'] . \"' AND clave='\" . md5($datos['clave']) . \"';\";\n\n $bd = new Bd($this->tabla);\n\n $res = $bd->consultaSimple($sql);\n \n if (!$res) {\n $ok = false;\n } else {\n\n session_start();\n $_SESSION['id'] = $res['id'];\n $_SESSION['nombre'] = $res['nombre'];\n $ok = true;\n }\n return $ok;\n }", "public function loginTraitement(){\n\n $identifiant = $this->verifierSaisie(\"identifiant\");\n $password = $this->verifierSaisie(\"password\");\n\n //securite\n if (($identifiant != \"\") && ($password != \"\")){\n\n //on crée un objet de la classe \\W\\Security\\AuthentificationModel\n //ce qui nous permet d'utiliser la methode isValidLoginInfo\n $objetAuthentificationModel = new \\W\\Security\\AuthentificationModel;\n\n $idUser = $objetAuthentificationModel->isValidLoginInfo($identifiant, $password);\n\n if($idUser > 0){\n\n // recuperer les infos de l'utilisateur\n //requete base de donnée pour les recuperer\n //je crée un objet de la classe \\W\\Model\\UsersModel\n $objetUsersModel = new \\W\\Model\\UsersModel;\n // je retrouve les infos de la ligne grace à la colonne ID\n // La classe UsersModel herite de la classe Model je peu donc faire un find pour recupeerr les infos\n $tabUser = $objetUsersModel->find($idUser);\n\n // Je vais ajouter des infos dans la session\n $objetAuthentificationModel->logUserIn($tabUser);\n\n // recuperer l'username\n $username = $tabUser[\"username\"];\n\n\n $GLOBALS[\"loginRetour\"] = \"Bienvenue $username\";\n\n $this->redirectToRoute(\"admin_accueil\");\n }\n else{\n $GLOBALS[\"loginRetour\"] = \"Identifiant incorrects \";\n }\n }else{\n\n $GLOBALS[\"loginRetour\"] = \"Identifiant incorrects \";\n }\n }", "function autenticado() {\t\n\tif(!isset( $_SESSION['autenticado'])) {\n\t\treturn false;\n\t} else {\n\t\treturn $_SESSION['autenticado'];\n\t}\n\t\n}", "private function _userAutehntication()\r\n {\r\n /* Check if the USERNAME and PASSWORD HTTP headers is set*/\r\n if(!(isset($_SERVER['HTTP_X_'.self::POSTAPI_KEY.'_USERNAME']) and isset($_SERVER['HTTP_X_'.self::POSTAPI_KEY.'_PASSWORD']))) {\r\n /* Error: Unauthorized User */\r\n $this->_sendResponse(401);\r\n }\r\n $username = $_SERVER['HTTP_X_'.self::POSTAPI_KEY.'_USERNAME'];\r\n $password = $_SERVER['HTTP_X_'.self::POSTAPI_KEY.'_PASSWORD']; \r\n \r\n /* Find the user */\r\n $user=User::model()->find('LOWER(username)=?',array(strtolower($username)));\r\n if($user===null) {\r\n /* Error: Unauthorized User, username doesn't exist */\r\n $this->_sendResponse(401, 'Error: Not a valid User');\r\n } else if(!$user->validatePassword($password)) {\r\n /* Error: Unauthorized User, Wrong Password */\r\n $this->_sendResponse(401, 'Error: Password is Wrong');\r\n }\r\n }", "public function auth(){\n return response()->json($this->usuario->api_Auth());\n }", "function autenticado(){\n\tif(isset($_SESSION['DNI'])){//Si existe, existe\n\t\treturn true;\n\t}else{//Si no existe, no existe\n\t\treturn false;\n\t}\n}", "public function authentification(){\n $mail = $_POST['email'];\n $password = $_POST['password'];\n\n $checkPass = $this->checkPassword($mail, $password);\n\n //check if email and password are corrects\n if ($checkPass){\n require_once 'ressources/modele/ModelLogin.php';\n $modelLogin = new ModelLogin();\n $user_check = $modelLogin->getUserByEmail($mail);\n\n\n while($row = $user_check->fetch()) {\n // redirect to layout with her Identifiant and Level and check if an user's birthday\n //Create SESSION\n\n $_SESSION['User_ID'] = $row['Id'];\n\n $_SESSION['Level'] = $row['Level'];\n\n $_SESSION['Last_name'] = $row['Last_name'];\n\n $_SESSION['First_name'] = $row['First_name'];\n\n }\n\n header('Location: /');\n exit();\n\n } else {\n header('Location: /login');\n exit();\n }\n }", "function abmUsuarios()\n {\n $this->checkCredentials();\n $users = $this->modelUser->getAllUsers();\n $this->view->showAbmUsuarios($users);\n }", "public function authUser(){\n if(!isset($this->sessionBool) || empty($this->sessionBool)){\n die($this->alerts->ACCESS_DENIED);\n }else{\n if(!$this->sessionBool){\n die($this->alerts->ACCESS_DENIED);\n }\n } \n }", "public function login() {\n parent::conectarBD();\n\n $queri = parent::query(sprintf(\"select usu_id as codigo, usu_password as senha, \"\n . \"usu_token_sessao as token_sessao, usu_login as login from \"\n . table_prefix . \"usuario where usu_login = '%s' and \"\n . \"usu_password = '%s'\", $this->usu_login, $this->usu_password));\n\n if ($queri) {\n $dados = $queri->fetch_assoc();\n if ($dados) {\n $new_session_id = hash('sha256', $dados['senha'] . time());\n $queri2 = parent::query(\"update \" . table_prefix . \"usuario set usu_token_sessao = '$new_session_id' where usu_id = \" . $dados['codigo']);\n\n if ($queri2) {\n $dados['token_sessao'] = $new_session_id;\n parent::commit();\n parent::desconectarBD();\n return $dados;\n } else {\n parent::rollback();\n parent::desconectarBD();\n return false;\n }\n } else {\n parent::desconectarBD();\n return false;\n }\n } else {\n parent::desconectarBD();\n return false;\n }\n }", "public function signin(){\r\n if(isset($_SESSION['user'])){\r\n if(isset($_POST['mail']) && isset($_POST['password'])){\r\n $mail = $_POST['mail']; \r\n $password = $_POST['password'];\r\n \r\n if($this->user->setMail($mail) && $this->user->setPassword($password)){\r\n $this->user->db_set_Users($this->user);\r\n die(\"REGISTRO EXITOSO\");\r\n }else{\r\n die(\"ERROR AL REALIZAR EL REGISTRO\");\r\n }\r\n }\r\n }else{\r\n die(\"ERROR AL REQUEST ERRONEO\");\r\n }\r\n }", "function ingresar($user,$password){\n\t\t$activo = true;\n\t\t$query = \"SELECT * FROM usuarios WHERE user='$user' and pass=$password and activo=1\";\n\t\t$link = conectar(); //llama a la funcion conectar de conex.php\n\t\t$result = $link->query($query); //envia el query a la BD\n\t\tif ($resultdb = mysqli_fetch_array($result) and $result->num_rows == 1) {\n\t\t\t$usuario = array('id'=>$resultdb['idUsuario'], \"nombre\"=>$resultdb['nombre'], \"user\"=>$resultdb['user'], \n\t\t\t\t'rol'=>$resultdb['rol'], \"token\"=>\"fake\");\n\t\t}\n\t\t$link->close();\t\t\n\t\techo json_encode($usuario);\t\n\t}", "public function loginUser($user,$pwd){\n \n $pwdCr = mkpwd($pwd);\n \n \n \n $sql = new Sql();\n $userData = $sql->select('SELECT * FROM usuarios \n WHERE email_usuario = :email_usuario\n AND pwd_usuario = :pwd_usuario',array(':email_usuario'=>$user,':pwd_usuario'=>$pwdCr));\n \n if(!isSet($userData) || count($userData)==0){//CASO NADA RETORNADO\n return false;\n }elseif(count($userData)>0){//CASO DADOS RETORNADOS CONFERE O STATUS\n \n if($userData[0]['status_usuario']==0){\n \n return 0;//caso INATIVO entao retorna ZERO indicando cadastro NAO ATIVO\n \n }elseif($userData[0]['status_usuario']==1){//CASO USUARIO ATIVO GERA SESSION DO LOGIN\n \n \n //permissao do cliente\n $_SESSION['_uL'] = encode($userData[0]['permissao_usuario']);\n $_SESSION['logado'] = 'sim';\n \n //dados do usuario\n $_SESSION['_iU'] = encode($userData[0]['id_usuario']);\n $_SESSION['_iE'] = encode($userData[0]['id_empresa']);\n $_SESSION['_nU'] = encode($userData[0]['nome_usuario'] . ' ' . $userData[0]['sobrenome_usuario']);\n $_SESSION['_eU'] = encode($userData[0]['email_usuario']);\n \n return 1;\n }\n \n }\n \n \n }", "public function auth_user() {\n\t\t$key = $this->getParams('key');\n\t\t\n\t\t$this->UserAuth = ClassRegistry::init('UserAuth');\n\t\t$options = array('conditions' => array('UserAuth.key' => $key), 'order' => array('id' => 'DESC'));\n\t\t$data = $this->UserAuth->find('first', $options);\n\t\t$data = isset($data['UserAuth']['params']) ? unserialize($data['UserAuth']['params']) : array();\n\t\t\t\n\t\t$response = array(\n\t\t\t\t'status' => 'success',\n\t\t\t\t'operation' => 'auth_user',\n\t\t\t\t'data' => $data,\n\t\t\t\t);\n\t\t$this->set(array(\n 'response' => parseParams($response),\n '_serialize' => array('response'),\n ));\n\t}", "public function getUsuario(){\n return $this->usuario;\n }", "function cadastrarUser(){\n //$this->session->set_tempdata('erro-acesso', 'login e senha n&atilde;o correspondem!', 5);\n\t \n\t\t/*$verificarUser = $this->login->get_verificar_user('sytesraul', '513482am');\n\t\tif($verificarUser != null) :\n\t\t\techo \"USUARIO JA CADASTRADO \".$verificarUser->name_login;\n\t\tendif;*/\n\t //redirect('login/acessoAceito', 'refresh');\n\t \n\t\t$dados['titulo'] = 'Cadastrar Usuário';\n\t\t$dados['h2'] = 'Tela de Cadastro';\n\t\t$this->load->view('login/cadastrar_user_view', $dados);\n\t\t\n\t\t\n\t}", "public function loggedIn()\n {\n $user = new User([\n 'first_name' => 'Janez',\n 'last_name' => 'Novak',\n 'birth_date' => Carbon::create(2000, 1, 1, 0, 0, 0),\n 'gender' => Code::MALE()->id,\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n 'phone_number' => '123456789',\n 'post' => Postcode::wherePostcode(1000)->first()->id,\n 'address' => 'Dunajska',\n 'zz_card_number' => str_random(30),\n ]);\n $user->confirmEmail();\n $user->save();\n\n Auth::attempt([\n 'email' => $user->email,\n 'password' => 'password',\n ]);\n }", "function loguear($usuario) {\n $_SESSION[\"idUser\"] = $usuario[\"id\"];\n }", "public function authenticate($usuario, $senha) {\r\n \r\n\t\t// Captura a sessao\r\n $sessao = new Zend_Session_Namespace('portoweb_soap');\r\n\t\t\r\n // Inicializa a classe de autenticacao\r\n\t\t$this->_autenticacao = Marca_Auth::getInstance();\r\n \r\n // Passa o login e a senha para logar no banco\r\n $resultado = $this->_autenticacao->authenticate(new Marca_Auth_Adapter_Autentica($usuario, $senha));\r\n \r\n $aut = false;\r\n \r\n // Retorna o codigo de validacao\r\n switch($resultado->getCode()) {\r\n\r\n case Marca_Auth_Result::FAILURE_CREDENTIAL_INVALID:\r\n case Marca_Auth_Result::FAILURE_ACCOUNT_USER_LOCKED:\r\n case Marca_Auth_Result::FAILURE_UNCATEGORIZED:\r\n \r\n // Remove o usuario da sessao\r\n $this->_autenticacao->clearIdentity();\r\n\t\t\t\t\t\t\t\t\r\n break;\t\t\t\t\t\t\r\n\r\n default: \r\n \r\n // Instancia o usuario\r\n $usuario = new UsuarioModel();\r\n $usuarioLinha = $usuario->find(strtoupper($this->_autenticacao->getIdentity()));\r\n $usuarioLogado = $usuarioLinha->current();\r\n \r\n // Captura o adaptador padrao\r\n $db = Zend_Registry::get('db');\r\n\r\n // Altera algumas sessoes do ORACLE\r\n $db->query(\"ALTER SESSION SET NLS_COMP = 'LINGUISTIC'\");\r\n $db->query(\"ALTER SESSION SET NLS_SORT = 'BINARY_AI'\");\r\n $db->query(\"ALTER SESSION SET NLS_DATE_FORMAT = 'DD/MM/YYYY HH24:MI:SS'\");\r\n \r\n $aut = true;\r\n \r\n break;\r\n }\r\n \r\n return $aut;\r\n }", "public function getUsuario() {\n return $this->iUsuario;\n }", "public function authenticate()\n {\n $cedula = Input::get('cedula');\n\n $profile = DB::table('users')->where('cedula',$cedula)->first();\n\n if (empty($profile))\n {\n return redirect()->back()->with('mensaje', 'Número de cédula inválido, inténtalo nuevamente');\n }\n else\n {\n $user = $profile->id;\n Auth::loginUsingId($user);\n\n //si es primera vez que entra este usuario\n if(0 == $profile->estado)\n {\n $user1= User::find($user);\n $user1->estado=1;\n $user1->save();\n\n return redirect()->intended('instrucciones');\n }\n //si no es la primera vez\n else\n {\n return redirect()->intended('mapa');\n }\n\n }\n }", "public function ConnectUsers(){\r\n $this->emailPost();\r\n $this->passwordPost();\r\n \r\n $_SESSION['email'] = $this->_emailPostSecure;\r\n $_SESSION['password'] = $this->_passwordPostSecure;\r\n header('location: Accueil');\r\n }", "protected function LoginAuthentification()\n {\n \n $tokenHeader = apache_request_headers();\n\n //isset Determina si una variable esta definida y no es NULL\n\n if(isset($tokenHeader['token']))\n { \n $token = $tokenHeader['token'];\n $datosUsers = JWT::decode($token, $this->key, $this->algorithm); \n //var_dump($datosUsers);\n if(isset($datosUsers->nombre) and isset($datosUsers->password))\n { \n $user = Model_users::find('all', array\n (\n 'where' => array\n (\n array('nombre'=>$datosUsers->nombre),\n array('password'=>$datosUsers->password)\n )\n ));\n if(!empty($user))\n {\n foreach ($user as $key => $value)\n {\n $id = $user[$key]->id;\n $username = $user[$key]->nombre;\n $password = $user[$key]->password;\n }\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n\n if($username == $datosUsers->nombre and $password == $datosUsers->password)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n } \n \n }", "public function updatedUsuario()\n {\n // Notificamos al otro componente el cambio\n $this->emit('cambioUsuario', $this->usuario);\n }", "private function crearUsuario(){\n \t\t#valida que la solicitud sea mediante un post \n\t if ($_SERVER['REQUEST_METHOD'] != \"POST\") {\n\t \t//envia un error \n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405); \n\t }\n\t //valida que los datos a incorporar no sean vacios \n\t if (isset($this->datosPeticion['nombre'], $this->datosPeticion['email'], $this->datosPeticion['pwd'])){\n\t $nombre = $this->datosPeticion['nombre']; \n\t $pwd = $this->datosPeticion['pwd']; \n\t $email = $this->datosPeticion['email'];\n\n\t //valida la existemcia del usuario mediante el email \n\t if (!$this->existeUsuario($email)){ \n\t $query = $this->_conn->prepare(\n\t \t\"INSERT into usuario (nombre,email,password,fRegistro) \n\t \t VALUES (:nombre, :email, :pwd, NOW())\");\n\t //se le asignan los valores a las variables de la consulta \n\t $query->bindValue(\":nombre\", $nombre); \n\t $query->bindValue(\":email\", $email); \n\t $query->bindValue(\":pwd\", sha1($pwd)); \n\t $query->execute(); \n\t if ($query->rowCount() == 1){ // se inserto bien \n\t $id = $this->_conn->lastInsertId(); \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['msg'] = 'usuario creado correctamente'; \n\t $respuesta['usuario']['id'] = $id; \n\t $respuesta['usuario']['nombre'] = $nombre; \n\t $respuesta['usuario']['email'] = $email; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } else //se envia un error de insercion en la bd\n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(7)), 400); \n\t } else //se envia un error del usuario no existe\n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(8)), 400); \n\t } else { \n\t $this->mostrarRespuesta($this->convertirJson($this->devolverError(7)), 400); \n\t } \n\t}", "function login($usuario) {\n // Una vez se cumpla la validacion del login contra la base de datos\n // seteamos como identificador de la misma, el email del usuario:\n $_SESSION[\"email\"] = $usuario[\"email\"];\n // dd($_SESSION);\n // Luego seteo la cookie. La mejor explicacion del uso de \n // setcookie() la tienen como siempre, en el manual de PHP\n // http://php.net/manual/es/function.setcookie.php\n setcookie(\"email\", $usuario[\"email\"], time()+3600);\n // A TENER EN CUENTA las observaciones de MDN sobre la seguridad\n // a la hora de manejar cookies, y de paso para comentarles por que\n // me hacia tanto ruido tener que manejar la session asi:\n // https://developer.mozilla.org/es/docs/Web/HTTP/Cookies#Security\n }", "function agregar($nombre,$correo,$usuario,$rol,$zonah,$estado,$psw)\n {\n $Valores = \"'\".$usuario.\"','\".$psw.\"','\".$nombre.\"','\".$correo.\"',\".$estado.\",\".$zonah.\",\".$rol;\n $this->Insertar(\"usuarios\",\"usuario,password,nombre,correo,activo,zonashorarias_id,roles_id\",$Valores);\n }", "public function login($usuario, $senha) {\n global $conexao;\n\n // Verifica se o email e senha são iguais aos que serão recebidos\n $sql = \"Select * FROM suafesta.cadastros WHERE usuario = :usuario AND senha = :senha\";\n\n // $sql é nada mais nada menos que a tabela usuario\n\n $sql = $conexao->prepare($sql);\n\n // Passa o valor recebido do parametro na variavel\n $sql->bindValue(\"usuario\", $usuario);\n $sql->bindValue(\"senha\", $senha);\n\n $sql->execute();\n\n // Se quantidade de registros > 0\n if($sql->rowCount() > 0) {\n // Fetch - cria um array e retorna apenas uma linha dele\n $dado = $sql->fetch();\n\n echo $sql->rowCount();\n\n // Mostre a linha que está na posição do codigo que bate o email e a senha\n //echo $dado['codigo'];\n\n // Salvar o codigo do usuario no navegador\n $_SESSION[\"codUser\"] = $dado['codigo'];\n \n return true;\n } else {\n return false;\n }\n\n }", "public function login(Request $request)\n\t {\n \t$this->validate($request, [\n \t\t'usuario' =>'required',\n \t\t'password' => 'required',\n \t]);\n\n\n if (Auth::attempt($request->only(['usuario','password']))){\n \n \t\t\tif (Auth::user()->status == \"inactivo\") {\n\n \t\t\t\tAuth::logout();\n \t\t\t\treturn redirect()->route('login')->with([\n\t\t\t 'flash_message' => 'Usuario Inactivo, contacte con el administrador!',\n\t\t\t 'flash_class' => 'alert-warning'\n\t\t\t ]);\n\n \t\t\t}else{\n\n $bu = new BitacoraUser;\n $bu->fecha = date(\"d/m/Y\");\n $bu->hora = date(\"H:i:s\");\n $bu->movimiento = \"Inicio de sesion en sistema\";\n $bu->user_id = \\Auth::user()->id;\n $bu->save();\n \t\t\t return redirect()->intended('dashboard');\n\n \t\t\t}\n \n }else{\n \t\treturn redirect()->route('login')->withErrors('¡Error!, Usuario o clave incorrecta');\n \n }\n\t\n }", "public function ctrIngresoUsuario(){\n\n\t\t\tif(isset($_POST[\"ingresoUsuario\"])){\n\n\n\t\t\t\tif(preg_match('/^[a-zA-Z0-9 ]+$/', $_POST[\"ingresoUsuario\"]) && \n\t\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"ingresoPassword\"])){\n\n\t\t\t\t\t$tabla= \"administrador\";\n\t\t\t\t\t$item =\"usuario\";\n\n\t\t\t\t\t$valor = $_POST[\"ingresoUsuario\"];\n\t\t\t\t\t$respuesta = AdministradorModelo::mdlMostrarUsuario($tabla,$item,$valor);\n\n\t\t\t\t\tif($respuesta != null){\n\n\t\t\t\t\t\t if($respuesta[\"usuario\"]==$_POST[\"ingresoUsuario\"] && $respuesta[\"password\"]==$_POST[\"ingresoPassword\"]){\n\n\t\t\t\t\t\t\tif($respuesta[\"estado\"]==1){\n\n\t\t\t\t\t\t\t\t$_SESSION[\"verificarUsuarioB\"]=\"ok\";\n\t\t\t\t\t\t\t\t$_SESSION[\"idUsuarioB\"]=$respuesta[\"id_admin\"];\n\n\t\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\twindow.location = \"'.$_SERVER[\"REQUEST_URI\"].'\";\n\t\t\t\t\t\t\t </script>';\n\n\n\t\t\t\t\t\t\t}else {\n\n\t\t\t\t\t\t\techo '<div class=\"alert alert-danger\">\n\t\t\t\t\t\t\t\t\t<span>¡ERROR AL INGRESAR!</span> El usuario está desactivado.\n\t\t\t\t\t\t\t\t </div>';\n\n\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t} else {\n\n\n\t\t\t\t\t\t\techo '<div class=\"alert alert-danger\">\n\t\t\t\t\t\t\t<span>¡ERROR AL INGRESAR!</span> Su contraseña y/o usario no es correcta, Intentelo de nuevo.\n\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t}\n\t\t\t\t\n\n\n\t\t\t\t}else {\n\n\t\t\t\t\techo '<div class=\"alert alert-danger\">\n\t\t\t\t\t<span>¡ERROR!</span> no se permite caracteres especiales.\n\t\t\t\t\t</div>';\n\n\t\t\t\t}\n\n\n\n\n\t\t\t}\n\n\t}", "private function login(){\n \n }", "public function authenticate()\n\t{\n \n $record=Usuario::model()->findByAttributes(array('login'=>$this->username));\n if($record===null)\n $this->errorCode=self::ERROR_USERNAME_INVALID;\n\n else\n if (($record->status == 'SUSPENDIDO') || (($record->status == 'EXPULSADO')))\n {\n $this->errorCode=self::ERROR_USERNAME_INVALID;\n }\n else\n if($record->password!==md5($this->password))\n $this->errorCode=self::ERROR_PASSWORD_INVALID;\n else\n {\n $this->_id=$record->id;\n switch ($record->cod_rol) {\n case 1: $role = 'Usuarios'; break;\n case 2: $role = 'Moderadores'; break;\n case 3: $role = 'Coordinadores'; break;\n case 4: $role = 'Supervisores'; break;\n case 5: $role = 'Administradores'; break;\n case 7: $role = 'Root'; break;\n default:\n $role = '';\n }\n $this->setState('rol', $role);\n $this->errorCode=self::ERROR_NONE;\n }\n return !$this->errorCode;\n\t}", "public function loginUsuario($login = '', $clave = '') {\n $password = md5($clave);\n $this->consulta = \"SELECT * \n FROM usuario \n WHERE login = '$login' \n AND password = '$password' \n AND estado = 'Activo' \n LIMIT 1\";\n\n if ($this->consultarBD() > 0) {\n $_SESSION['LOGIN_USUARIO'] = $this->registros[0]['login'];\n $_SESSION['ID_USUARIO'] = $this->registros[0]['idUsuario'];\n $_SESSION['PRIVILEGIO_USUARIO'] = $this->registros[0]['privilegio'];\n $_SESSION['ACTIVACION_D'] = 0;\n// $_SESSION['ACCESOMODULOS'] = $this->registros[0]['accesoModulos'];\n\n $tipoUsuario = $this->registros[0]['tipoUsuario'];\n\n switch ($tipoUsuario) {\n case 'Empleado':\n $idEmpleado = $this->registros[0]['idEmpleado'];\n $this->consulta = \"SELECT primerNombre, segundoNombre, primerApellido, segundoApellido, cargo, cedula, tipoContrato \n FROM empleado \n WHERE idEmpleado = $idEmpleado \n LIMIT 1\";\n $this->consultarBD();\n// $apellidos = explode(' ', $this->registros[0]['apellidos']);\n $_SESSION['ID_EMPLEADO'] = $idEmpleado;\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['primerNombre'] . ' ' . $this->registros[0]['primerApellido'];\n $_SESSION['CARGO_USUARIO'] = $this->registros[0]['cargo'];\n $_SESSION['TIPO_CONTRATO'] = $this->registros[0]['tipoContrato'];\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['primerNombre'] . ' ' . $this->registros[0]['segundoNombre'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['primerApellido'] . ' ' . $this->registros[0]['segundoApellido'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['cedula'];\n break;\n case 'Cliente Residencial':\n $idResidencial = $this->registros[0]['idResidencial'];\n $this->consulta = \"SELECT nombres, apellidos, cedula \n FROM residencial \n WHERE idResidencial = $idResidencial \n LIMIT 1\";\n $this->consultarBD();\n $apellidos = explode(' ', $this->registros[0]['apellidos']);\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['nombres'] . ' ' . $apellidos[0];\n $_SESSION['CARGO_USUARIO'] = 'Cliente Residencial';\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['nombres'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['apellidos'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['cedula'];\n break;\n case 'Cliente Corporativo':\n $idCorporativo = $this->registros[0]['idCorporativo'];\n $this->consulta = \"SELECT razonSocial, nit \n FROM corporativo \n WHERE idCorporativo = $idCorporativo \n LIMIT 1\";\n\n $this->consultarBD();\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['CARGO_USUARIO'] = 'Cliente Corporativo';\n\n $_SESSION['NOMBRES_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['APELLIDOS_USUARIO'] = $this->registros[0]['razonSocial'];\n $_SESSION['CEDULA_USUARIO'] = $this->registros[0]['nit'];\n break;\n case 'Administrador':\n $_SESSION['NOMBRES_APELLIDO_USUARIO'] = 'Administrador';\n $_SESSION['CARGO_USUARIO'] = 'Administrador';\n $_SESSION['TIPO_CONTRATO'] = 'Laboral Administrativo';\n\n $_SESSION['NOMBRES_USUARIO'] = 'Administrador';\n $_SESSION['APELLIDOS_USUARIO'] = 'Administrador';\n $_SESSION['CEDULA_USUARIO'] = '10297849';\n $_SESSION['ID_EMPLEADO'] = '12';\n $_SESSION['ID_CAJA_MAYOR_FNZAS'] = 2;\n $idEmpleado = 12;\n break;\n default:\n break;\n }\n\n //******************************************************************\n // VARIABLES DE SESSION PARA EL ACCESO AL MODULO RECAUDOS Y FACTURACION DE swDobleclick\n\n $_SESSION['user_name'] = $_SESSION['NOMBRES_APELLIDO_USUARIO'];\n $_SESSION['user_charge'] = $_SESSION['CARGO_USUARIO'];\n\n $_SESSION['user_id'] = 0; //$this->getIdUsuarioOLD($idEmpleado);\n $_SESSION['user_privilege'] = 0; //$this->getPrivilegioUsuarioOLD($idEmpleado);\n\n //******************************************************************\n\n $fechaHora = date('Y-m-d H:i:s');\n $idUsuario = $_SESSION['ID_USUARIO'];\n $consultas = array();\n $consultas[] = \"UPDATE usuario \n SET fechaHoraUltIN = '$fechaHora' \n WHERE idUsuario = $idUsuario\";\n $this->ejecutarTransaccion($consultas);\n return true;\n } else {\n return false;\n }\n }", "function login_user($user,$pass,$activo=false,$h=false){\n $c = ($h)?$pass:md5($pass);\n $sql = sprintf(\"SELECT * FROM `login` WHERE `email` = %s AND `contrasena` = %s AND `cloud` = %s LIMIT 1\",\n varSQL($user),\n varSQL($c),\n varSQL(__sistema));\n $datos = consulta($sql,true);\n if($datos != false){\n $_SESSION['usuario'] = $datos['resultado'][0]['id'];\n $_SESSION['session_key']= md5($pass);\n //obtener los datos adicionales del usuario en cuestion de acuerdo al perfil de usuario que pertenesca\n $sql = sprintf(\"SELECT * FROM `%s` WHERE `id_login` = %s\",(obtener_campo(sprintf(\"SELECT `tabla` FROM `usuarios_perfiles_link` WHERE `id_perfil` = %s\",varSQL($datos['resultado'][0]['perfil'])))),varSQL($datos['resultado'][0]['id']));\n $datos1 = consulta($sql,true);\n if($datos1!=false){\n unset($datos1['resultado'][0]['id']);\n $d = array_merge($datos['resultado'][0],$datos1['resultado'][0]);\n $_SESSION['data_login'] = $d;\n }else{\n $_SESSION['data_login'] = $datos['resultado'][0];\n }\n //obteniendo los detalles de los modulos disponibles para cada usuario\n $con = sprintf(\"SELECT * FROM `componentes_instalados` WHERE `id` IN(SELECT `id_componente` FROM `usuarios_perfiles_permisos` WHERE `id_perfil` = %s)\",varSQL($datos['resultado'][0]['perfil']));\n $r = consulta($con,true);\n //detalles del perfil\n $p = consulta(sprintf(\"SELECT `nombre`,`p` FROM `usuarios_perfiles` WHERE `id` = %s\",varSQL($datos['resultado'][0]['perfil'])),true);\n $_SESSION['usuario_perfil'] = $p['resultado'][0];\n $_SESSION['usuario_componentes'] = $r['resultado'];\n $detalles = array(\"estado\"=>\"ok\",\"detalles\"=>\"\");\n }else{\n $_SESSION['usuario']='';\n $_SESSION['session_key']='';\n $detalles = array(\"estado\"=>\"error\",\"detalles\"=>\"no_log_data\",\"mensaje\"=>\"Nombre de usuario o contrase&ntilde;a incorrecta\");\n }\n return $detalles;\n}", "public function testCreate_usuario_autenticado()\n {\n $user = factory(User::class)->create();\n $this->actingAs($user);\n\n // When => Cuando hace un post request a status\n $response = $this->postJson(route('statuses.store'), ['body' => 'Mi primer status']);\n\n $response->assertJson([\n 'body' =>'Mi primer status'\n ]);\n\n // Then => entonces veo un nuevo estado en la base de datos\n $this->assertDatabaseHas('statuses', [\n 'user_id' => $user-> ID,\n 'body' => 'Mi primer status'\n ]);\n }", "public function login()\n\t{\n\t \tif(User::all()->count() == 0){\n\t \t\t$users = [\n\t\t\t [\n\t\t\t \t\"SEG_Usuarios_Nombre\" => \"Administrador\",\n\t\t\t \"SEG_Usuarios_Username\" => \"admin\",\n\t\t\t \"SEG_Usuarios_Contrasena\" => Hash::make(\"hola123\"),\n\t\t\t \"SEG_Usuarios_Email\" => \"[email protected]\",\n\t\t\t \"SEG_Usuarios_Activo\" => true,\n\t\t\t \"SEG_Roles_SEG_Roles_ID\" => 1,\n\t\t\t ]\n\t\t ];\n\t\t \n\t\t foreach ($users as $user) {\n\t\t User::create($user);\n\t\t }\n\t \t}\n\n\t \t//Autentica\n\t if ($this->isPostRequest()) {\n\t \t$validator = $this->getLoginValidator();\t \n\t \tif ($validator->passes()) {\n\t\t $credentials = $this->getLoginCredentials();\n\t\t $credentials[\"SEG_Usuarios_Activo\"] = 1; // Agrega al array el elemento para verificar si usuario esta activo\n\t\t if (Auth::attempt($credentials)) {\n\n\t\t \tif (Auth::user()->SEG_Usuarios_FechaDeExpiracion == null) {\n\t\t\t\t\t\treturn Redirect::to('Auth/Cambio');\n\t\t\t\t\t}\n\n\t\t \t$datetimeUser = new DateTime(Auth::user()->SEG_Usuarios_FechaDeExpiracion);\n\t\t\t\t\t$datetimeHoy = new DateTime(date('Y-m-d h:i:s'));\n\t\t\t\t\t$diff = date_diff($datetimeUser, $datetimeHoy);\n\n\t\t \tif ($diff->format(\"%d\") <= 5 && $diff->format(\"%d\") > 0) {\n\t\t\t\t\t\treturn View::make(\"Usuarios.mensaje\");\n\t\t \t} \n\n\t\t \tif ($diff->format(\"%d\") <= 0) {\n\t\t \t\tAuth::logout();\n\t\t \t\treturn Redirect::back()->withErrors([\n\t\t \t\t\t\"errors\" => [\"Su contraseña ha expirado, contacte a su administrador.\"]\n\t\t \t\t]);\n\t\t \t}\n\t\t \t \t\n\t\t \tif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n\t\t\t\t\t $ip = $_SERVER['HTTP_CLIENT_IP'];\n\t\t\t\t\t} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t\t\t $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t\t\t} else {\n\t\t\t\t\t $ip = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$UserAct = User::find(Auth::user()->SEG_Usuarios_ID);\n\t\t\t\t\t$UserAct->SEG_Usuarios_IP3 = $UserAct->SEG_Usuarios_IP2;\n\t\t\t\t\t$UserAct->SEG_Usuarios_IP2 = $UserAct->SEG_Usuarios_IP1;\n\t\t\t\t\t$UserAct->SEG_Usuarios_IP1 = $ip;\n\t\t\t\t\t$UserAct->SEG_Usuarios_UltimaSesion = date(\"Y-m-d h:i:s\");\n\t\t\t\t\t$UserAct->save();\n\t\t\t\t\t\n\t\t\t\t\treturn View::make(\"hello\");\n\t\t }\n\t\t return Redirect::back()->withErrors([\n\t\t \t\"errors\" => [\"Sus credenciales no concuerdan.\"]\n\t\t ]);\n\t \t} else {\n\t \treturn Redirect::back()\n\t\t ->withInput()\n\t\t ->withErrors($validator);\n\t \t}\n\t }\n\n\t //Recoge la IP del cliente y la guarda en la base de datos\n\t return View::make(\"Usuarios.login\");\n \t}", "public function loginValidated()\n\t\t{\n\t\t\t$campos = array('*');\n\t\t\t\n\t\t\t$pw = $this->_objCrypt->encrypt($this->_password);\n\n\t\t\t# Campos que se incluyen en la validacion WHERE DE LA SQL\n\t\t\t$field['userName'] = $this->_userName;\n\t\t\t$register = Usuario::findCustom($campos, $field);\n\n\t\t\t# Validación nombre usuario en BD\n\t\t\tif (empty($register)) {\n\t\t\t\t$json_error = array('success' => 'error', 'error' => 'error1');\n\t\t\t\t$success = json_encode($json_error);\n\t\t\t\tsetcookie(\"success\", $success, time() + 60, \"/\"); \n\t\t\t\theader('location:../views/users/login.php');\n\t\t\t}else{\n\t\t\t\t# pw que se obtiene de BD\n\t\t\t\t$pw_DB = $register[0]->getPassword();\n\n\t\t\t\t# Validacion coincidencia de contraseñas\n\t\t\t\tif ($pw !== $pw_DB) {\n\t\t\t\t\t$json_error = array('success' => 'error', 'error' => 'error2');\n\t\t\t\t\t$success = json_encode($json_error);\n\t\t\t\t\tsetcookie(\"success\", $success, time() + 60, \"/\"); \n\t\t\t\t\theader('location:../views/users/login.php');\n\t\t\t\t}else{\n\t\t\t\t\t$data_session['id_user'] \t= $register[0]->getId();\t\t\t\t\t\n\t\t\t\t\t$data_session['nombre'] \t= $register[0]->getNombre();\t\t\t\n\t\t\t\t\t$data_session['apellido'] \t\t= $register[0]->getApellido();\t\t\t\n\t\t\t\t\t$data_session['tipoUsuario']\t= $register[0]->getTipoUsuario();\t\t\t\n\t\t\t\t\t$data_session['userName'] \t\t= $register[0]->getUserName();\t\t\t\n\t\t\t\t\t$data_session['email'] \t\t = $register[0]->getEmail();\t\t\t\n\t\t\t\t\t$data_session['telFijo'] \t\t= $register[0]->getTelFijo();\t\t\t\n\t\t\t\t\t$data_session['telMovil'] \t\t= $register[0]->getTelMovil();\t\t\t\n\t\t\t\t\t$data_session['estado'] \t\t= $register[0]->getEstado();\n\t\t\t\t\t$data_session['lan']\t\t\t= $_COOKIE['lan'];\n\t\t\t\t\t\n\t\t\t\t\t$obj_Session = new Simple_sessions();\n\t\t\t\t\t$obj_Session->add_sess($data_session);\n\n\t\t\t\t\theader('location:../views/users/crearUsuario.php');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function cadastrar()\n\t{\n\t\t//conexao com o banco\n\t\t$connect = new Connect('user_login');\n\n\t\t$this->id = $connect->insert([\n\t\t\t\t'login'=> $this->login,\n\t\t\t\t'password'=> $this->password\n\t\t]);\n\n\t}", "function verificaLogin($errores,$db) {\r\n $email=$_POST['email'];\r\n $password=$_POST['password'];\r\n $encontreUsuario=false;\r\n $encontrePassword=false;\r\n $stmt=$db->prepare(\"SELECT * FROM jugadores where email=:email\");\r\n $stmt->bindValue(':email',$email);\r\n $stmt->execute();\r\n $consulta=$stmt->fetch(PDO::FETCH_ASSOC);\r\n if($consulta>0){\r\n $encontreUsuario=true;\r\n $contraseniaValida=password_verify($password,$consulta['password']);\r\n if($contraseniaValida){\r\n $_SESSION['usuario']=$consulta['usuario'];\r\n $_SESSION['nombre']=$consulta['name'];\r\n $_SESSION['previoLogueo']=false;\r\n $encontrePassword=true;\r\n header('Location: bienvenida.php');\r\n if(empty($errores)){\r\n if (!empty($_POST[\"guardar_clave\"])){\r\n setcookie(\"email\", $_POST['email'], time() + 365 * 24 * 60 * 60);\r\n echo $_COOKIE['email'];\r\n setcookie(\"password\", $_POST['password'], time() + 365 * 24 * 60 * 60);\r\n }\r\n else {\r\n if(isset($_COOKIE['email'])){\r\n setcookie('email',\"\");\r\n }\r\n if(isset($_COOKIE['password'])){\r\n setcookie('password',\"\");\r\n }\r\n }\r\n }\r\n }\r\n else{\r\n $errores[]=\"Verifique los datos\";\r\n return $errores;\r\n }\r\n }\r\n else {\r\n $errores[]=\"No existe el usuario\";\r\n return $errores;\r\n }\r\n /*foreach ($usuarioJSON as $usuario)\r\n {\r\n if ($usuario[\"email\"] == $_POST['email']){\r\n $encontreUsuario=true;\r\n //\r\n if(password_verify($_POST[\"password\"], $usuario[\"password\"])){\r\n $_SESSION['usuario']=$usuario['usuario'];\r\n $_SESSION['nombre']=$usuario['name'];\r\n $_SESSION['previoLogueo']=false;\r\n $encontrePassword=true;\r\n header('Location: bienvenida.php');\r\n if(empty($errores)){\r\n if (!empty($_POST[\"guardar_clave\"])){\r\n setcookie(\"email\", $_POST['email'], time() + 365 * 24 * 60 * 60);\r\n echo $_COOKIE['email'];\r\n setcookie(\"password\", $_POST['password'], time() + 365 * 24 * 60 * 60);\r\n }\r\n else {\r\n if(isset($_COOKIE['email'])){\r\n setcookie('email',\"\");\r\n }\r\n if(isset($_COOKIE['password'])){\r\n setcookie('password',\"\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if($encontreUsuario!=true){\r\n array_push($errores,'Por Favor verifique el nombre de usuario');\r\n }\r\n if ($encontrePassword!=true) {\r\n array_push($errores,'Contraseña incorrecta');\r\n }\r\n return $errores;*/\r\n}", "public function logar()\n {\n if ($this->checkPost()) { \n $usuario = new \\App\\Model\\Usuario;\n $usuario->setLogin($this->post['usuario']);\n $usuario->setSenha($this->post['senha']);\n $usuario->authDb();\n redirect(DEFAULTCONTROLLER.'\\logado');\n } else {\n redirect(DEFAULTCONTROLLER);\n }\n }", "public function guardarUsuario()\r\n {\r\n $user = new \\App\\Models\\User;\r\n \r\n $user->Seq_Usuario = $_REQUEST['Seq_Usuario'];\r\n $user->Usuario = $_REQUEST['username'];\r\n $user->Password = $_REQUEST['password'];\r\n $user->sys_rol_id = $_REQUEST['rolID'];\r\n\r\n\r\n $userController = new App\\Controllers\\UserController;\r\n\r\n if($user->Seq_Usuario > 0) {\r\n $result = $userController->updateUser($user);\r\n } else {\r\n $result = $userController->createUser($user);\r\n }\r\n \r\n /**\r\n * Variable de sesión usada para mostrar la notificación del\r\n * resultado de la solicitud.\r\n */\r\n $_SESSION['result'] = $result;\r\n \r\n header('Location: ?c=Registro&a=usuarios');\r\n }", "public function loginUser()\r\n {\r\n $req = $this->login->authenticate($this->user);\r\n $req_result = get_object_vars($req);\r\n print(json_encode($req_result));\r\n }", "private function accesoUsuario()\n {\n if ($this->adminSession) {\n $usuario = $this->session->userdata('admin');\n if ($usuario['id'] > 0) {\n redirect('admin/dashboard');\n } else {\n $this->adminSession = false;\n $this->session->sess_destroy();\n redirect('admin/index'); \n }\n }\n }", "private function preAddUser(){\n $LMS = new LMS();\n $api = $LMS->getDataXUserPass($this->_user, $this->_pass, 'https://www.sistemauno.com/source/ws/uno_wsj_login.php');\n $this->_person = \"\";\n if ($this->isObjectAPI($api)) {\n //validar Permisos\n $FilterAPI = new FilterAPI($api);\n $this->_datPerson = $FilterAPI->runFilter($this->_user, $this->_pass);\n if (is_array($this->_datPerson)) {\n //si el usuario cuenta con un perfil apropiado se le pide que valide sus coreo\n $this->validateEmailUser();\n if($this->validUniqueMail()){\n $this->sendMail();\n $this->_response = \"1|\" . $this->_datPerson[email] . \"|\" . $this->_datPerson[personId] . \"|\" . $this->_code . \"|\" . $this->_datPerson['name'];\n }else{\n $this->_response = \"2|\" . $this->_datPerson[email] . \"|\" . $this->_datPerson[personId] . \"|\" . $this->_code . \"|\" . $this->_datPerson['name'];\n }\n } else {\n $this->_response = $this->_datPerson;\n }\n } else {\n $this->_response = $api;\n }\n }", "public function asignar(Request $request){\n if(!$request->ajax() || Auth::user()->rol_id == 11)return redirect('/');\n $rol = $request->rol_id;\n $user = new User();\n $user->id = $request->id_persona;\n $user->usuario = $request->usuario;\n $user->password = bcrypt( $request->password);\n $user->condicion = '1';\n $user->rol_id = $request->rol_id;\n\n if($user->rol_id == 2){\n $vendedor = new Vendedor();\n $vendedor->id = $request->id_persona;\n $vendedor->save();\n }\n\n switch($rol){// se le abilitan los modulos deacuerdo a su tipo de rol\n case 1: // Administrador\n {\n $user->administracion=1;\n $user->desarrollo=1;\n $user->precios=1;\n $user->obra=1;\n $user->ventas=1;\n $user->acceso=1;\n $user->reportes=1;\n //Administracion\n $user->departamentos=1;\n $user->personas=1;\n $user->empresas=1;\n $user->medios_public=1;\n $user->lugares_contacto=1;\n $user->servicios=1;\n $user->inst_financiamiento=1;\n $user->tipos_credito=1;\n $user->asig_servicios=1;\n $user->mis_asesores=0;\n //Desarrollo\n $user->fraccionamiento=1;\n $user->etapas=1;\n $user->modelos=1;\n $user->lotes=1;\n $user->asign_modelos=1;\n $user->licencias=1;\n $user->acta_terminacion=1;\n $user->p_etapa=0;\n\n //Precios\n $user->agregar_sobreprecios=1;\n $user->precios_etapas=1;\n $user->sobreprecios=1;\n $user->paquetes=1;\n $user->promociones=1;\n //Obra\n $user->contratistas=1;\n $user->ini_obra=1;\n $user->aviso_obra=1;\n $user->partidas=1;\n $user->avance=1;\n //Ventas\n $user->lotes_disp=1;\n $user->mis_prospectos=0;\n $user->simulacion_credito=1;\n $user->hist_simulaciones=1;\n $user->hist_creditos=1;\n $user->contratos=1;\n $user->docs=1;\n //Acceso\n $user->usuarios=1;\n $user->roles=1;\n //Reportes\n $user->mejora=1;\n break;\n }\n case 2: //Asesor de ventas\n {\n $user->administracion=1;\n $user->ventas=1;\n //Administracion\n $user->empresas=1;\n //Ventas\n $user->lotes_disp=1;\n $user->mis_prospectos=0;\n $user->simulacion_credito=1;\n break;\n }\n case 3: //Gerente de proyectos\n {\n $user->desarrollo=1;\n //Desarrollo\n $user->fraccionamiento=1;\n $user->modelos=1;\n $user->lotes=1;\n $user->licencias=1;\n $user->acta_terminacion=1;\n break;\n }\n case 4: //Gerente de ventas\n {\n $user->administracion=1;\n $user->ventas=1;\n $user->reportes=1;\n //Administracion\n $user->empresas=1;\n $user->inst_financiamiento=1;\n $user->tipos_credito=1;\n $user->mis_asesores=0;\n //Ventas\n $user->lotes_disp=1;\n $user->simulacion_credito=1;\n $user->hist_simulaciones=1;\n $user->contratos=1;\n $user->docs=1;\n //Reportes\n $user->mejora=1;\n break;\n }\n case 5: // Gerente de obra\n {\n $user->obra=1;\n\n //Obra\n $user->contratistas=1;\n $user->aviso_obra=1;\n $user->partidas=1;\n $user->avance=1;\n break;\n }\n case 6: // Admin ventas\n {\n $user->administracion=1;\n $user->desarrollo=1;\n $user->precios=1;\n $user->obra=1;\n $user->ventas=1;\n $user->acceso=1;\n $user->reportes=1;\n //Administracion\n $user->empresas=1;\n $user->personas=1;\n $user->inst_financiamiento=1;\n $user->tipos_credito=1;\n //Desarrollo\n $user->fraccionamiento=1;\n $user->etapas=1;\n $user->modelos=1;\n $user->asign_modelos=1;\n //Precios\n $user->agregar_sobreprecios=1;\n $user->precios_etapas=1;\n $user->sobreprecios=1;\n $user->paquetes=1;\n $user->promociones=1;\n //Obra\n $user->ini_obra=1;\n //Ventas\n $user->lotes_disp=1;\n $user->simulacion_credito=1;\n $user->hist_simulaciones=1;\n $user->hist_creditos=1;\n $user->contratos=1;\n $user->docs=1;\n //Acceso\n $user->usuarios=1;\n $user->roles=1;\n //Reportes\n $user->mejora=1;\n break;\n }\n case 7: // Publicidad\n {\n $user->administracion=1;\n $user->desarrollo=1;\n $user->reportes=1;\n //Administracion\n $user->medios_public=1;\n $user->lugares_contacto=1;\n $user->servicios=1;\n $user->asig_servicios=1;\n //Desarrollo\n $user->modelos=1;\n $user->p_etapa=0;\n\n //Reportes\n $user->mejora=1;\n break;\n }\n case 8: // Gestor ventas\n {\n $user->administracion=1;\n $user->ventas=1;\n //Administracion\n $user->empresas=1;\n $user->inst_financiamiento=1;\n $user->tipos_credito=1;\n //Ventas\n $user->lotes_disp=1;\n $user->simulacion_credito=1;\n $user->hist_simulaciones=1;\n $user->hist_creditos=1;\n $user->contratos=1;\n $user->docs=1;\n break;\n }\n case 9: // Contabilidad\n {\n $user->administracion=1;\n $user->saldo=1;\n //Administracion\n $user->cuenta=1;\n //Saldos\n $user->edo_cuenta=1;\n $user->depositos=1;\n $user->gastos_admn=1;\n break;\n }\n\n }\n\n $user->save();\n }", "function actualizarUsuarios($id,$nombre,$apellido,$user,$pass,$rol){\n\t\t$activo = true;\n\t\t$query = \"UPDATE usuarios set nombre = '$nombre', apellido = '$apellido', user = '$user', pass='$pass', rol='$rol' where idUsuario=$id AND activo = $activo\";\n\t\t$link = conectar(); //llama a la funcion conectar de conex.php\n\t\t$result = $link->query($query); //envia el query a la BD\t\t\n\t\t$link->close();\n\t\techo json_encode($result);\n\t}", "public function login($usuario) {\n $_SESSION['usuario'] = $usuario;\n }", "function setUsuario($usuario, $contraseña, $nombre, $apellidos, $telefono, $movil){\n\t\t\n\t\t$resultado = conectar()->query( \"SELECT * FROM usuarios WHERE usuario LIKE '$usuario'\");\n\t\tif($resultado->num_rows == 0){\n\t\t\tconectar()->query(\"INSERT INTO usuarios (usuario, contrasenia, nombre, apellidos, telefono, movil) VALUES ('\" . $usuario . \"','\" . $contraseña . \"','\" . $nombre . \"','\" . $apellidos .\"','\" . $telefono . \"','\" . $movil .\"')\");\n\t\t\techo \"<script>alert('Te has registrado correctamente!');document.location.reload();\";\t\n\t\t}else{\n\t\t\techo \"<script>alert('Ya existe ese nombre de usuario!');</script>\";\n\t\t}\n\t}", "function consult_login($dato){\n\t\t// se crean las variables que tentran la data correspondiente en la posicion que esta cada uno de estos datos\n\t\t$cedula=strip_tags($dato[0]);\n\t\t$contrasena=strip_tags($dato[1]);\n\t\t//se crea una variable que instancia la clase que coneccion a la base de datos\n\t\t$mysqli = new conect_database();\n\t\t// se rea una variable que sea igual a la variable que instancio la clase anterior y se realiza una respectiva consulta y se le mandan los respectivos datos\n\t\t$query = $mysqli->prepare(\"select id_usuarios,nombre_usuario,tipo_usuario from t_usuarios where usuario='\".$cedula.\"' and contrasena='\".$contrasena.\"'\");\n\t\t// se ejecuta lo que esta dentro de la variable anterior \n\t\t$query->execute();\t\n // se llama la una de las variables privadas que se crearon al principio y esta va a ser igual a la variable que contiene los datos de la consulta uy se obtienen los datos con get_result();\n\t\t$this->consult=$query->get_result();\n // se creaun bucle que es igual a data que sea igual al metodo inbocado en este caso la variable que contiela los datos de la consulta y se obtiene una colunma o un array (los datos)\n\t\twhile ($data=$this->consult->fetch_row()) {\n // llamamos a la otra variable privada que sera un array y contendra los datos\n\t\t\t$this->dataAll[]=$data;\n\n\t\t}\n // retornamos los datos \n\t\treturn $this->dataAll;\n\t}" ]
[ "0.7215789", "0.69144654", "0.683271", "0.68306917", "0.6830393", "0.68278795", "0.6798237", "0.67803365", "0.6729149", "0.6726594", "0.6704519", "0.6703103", "0.66902727", "0.66596544", "0.66516584", "0.66235393", "0.662221", "0.6577906", "0.6511042", "0.6509866", "0.64993984", "0.64985764", "0.6490726", "0.6483406", "0.64794785", "0.64636606", "0.64326257", "0.64167225", "0.6411224", "0.6405057", "0.64044183", "0.6398256", "0.63954145", "0.63912296", "0.6387671", "0.6386184", "0.6381199", "0.6371804", "0.63690424", "0.636215", "0.63588995", "0.6354658", "0.63287455", "0.6322656", "0.63191587", "0.63003075", "0.6292332", "0.6291558", "0.62911993", "0.6271669", "0.6271514", "0.62696934", "0.6263358", "0.62620914", "0.6256433", "0.625543", "0.6248483", "0.6247659", "0.62442094", "0.6236016", "0.6234486", "0.6233094", "0.6221631", "0.6220059", "0.62054604", "0.6191368", "0.6177531", "0.61759007", "0.61734", "0.6167182", "0.61470354", "0.6142207", "0.61415946", "0.61322725", "0.61266166", "0.61246973", "0.61239684", "0.6120079", "0.61194307", "0.6118783", "0.61166763", "0.6116469", "0.61124104", "0.61117333", "0.610941", "0.6108183", "0.6083956", "0.6082151", "0.6075418", "0.6075001", "0.6074899", "0.6074134", "0.6073246", "0.60709673", "0.6065575", "0.6065082", "0.60629445", "0.60616595", "0.6058491", "0.60532904" ]
0.6074543
91
Get Key pieces for caching block content
public function getCacheKeyInfo() { return array( 'VES_PRODUCTCAROUSEL4_BLOCK_WIDGET_TAB', $this->getNameInLayout(), Mage::app()->getStore()->getId(), Mage::getDesign()->getPackageName(), Mage::getDesign()->getTheme('template'), Mage::getSingleton('customer/session')->getCustomerGroupId(), 'template' => $this->getTemplate(), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCacheKeyInfo()\n {\n // Get Magento's standard product list block cache key info\n $info = parent::getCacheKeyInfo();\n\n // Dispatch event so others can modfify cache key info of this block without modifying module\n Mage::dispatchEvent('st_productlistblockcache_cache_info_add_before', array('cache_key_info' => $info));\n\n /** @var Mage_Catalog_Model_Category|null $currentCategory Current category model or null */\n $currentCategory = Mage::registry('current_category');\n\n /** @var string $categoryId Current category id. Empty string if we don't know. */\n $categoryId = '';\n\n // If we know current category, then add category id to cache key info\n if ($currentCategory instanceof Mage_Catalog_Model_Category) {\n $categoryId = $currentCategory->getId();\n }\n\n // Add category_id to cache key info\n $info['category_id'] = $categoryId;\n\n /** @var int $customerGroupId Get logged in user's customer group id */\n $customerGroupId = (int) Mage::getSingleton('customer/session')->getCustomerGroupId();\n\n // Add customer_group to cache key info\n $info['customer_group'] = $customerGroupId;\n\n /** @var int $currentWebsiteId Current website ID */\n $currentWebsiteId = (int) Mage::app()->getWebsite()->getId();\n\n // Add website_id to cache key info\n $info['website_id'] = $currentWebsiteId;\n\n /** @var string $layerStateKey */\n $layerStateKey = $this->getLayer()->getStateKey();\n $info['layer_state_key'] = $layerStateKey;\n \n /** @var string $formKey */\n $formKey = Mage::getSingleton('core/session')->getFormKey();\n $info['form_key'] = $formKey;\n\n /** @var string $originalRequestUri */\n $originalRequestUri = Mage::app()->getRequest()->getOriginalRequest()->getRequestUri();\n $info['request_uri'] = $originalRequestUri;\n\n // Current currency code\n $info['currency'] = Mage::app()->getStore()->getCurrentCurrencyCode();\n\n // Current locale code\n $info['locale'] = Mage::app()->getLocale()->getLocaleCode();\n\n // Dispatch event so others can modfify cache key info of this block without modifying module\n Mage::dispatchEvent('st_productlistblockcache_cache_info_add_after', array('cache_key_info' => $info));\n\n return $info;\n }", "public function getCacheKeyInfo()\n {\n\t\t$httpContext = ObjectManager::getInstance()->get(\\Magento\\Framework\\App\\Http\\Context::class);\n\t\t$priceCurrency = ObjectManager::getInstance()->get(\\Magento\\Framework\\Pricing\\PriceCurrencyInterface::class);\n return [\n\t\t\t'MAGEZONBUILDERS_ELEMENT',\n\t\t\t$priceCurrency->getCurrencySymbol(),\n\t\t\t$this->_storeManager->getStore()->getId(),\n\t\t\t$this->_design->getDesignTheme()->getId(),\n\t\t\t$httpContext->getValue(\\Magento\\Customer\\Model\\Context::CONTEXT_GROUP),\n\t\t\t$this->getElementType(),\n\t\t\t$this->getElementId(),\n\t\t\t$this->getTemplate()\n ];\n }", "public function getCacheKeyInfo()\n {\n $cacheKeyInfo = parent::getCacheKeyInfo();\n $cacheKeyInfo['item_renders'] = $this->_serializeRenders();\n return $cacheKeyInfo;\n }", "public function getCacheKeyInfo()\n {\n return array(\n 'PAGE_FOOTER',\n Mage::app()->getStore()->getId(),\n (int)Mage::app()->getStore()->isCurrentlySecure(),\n Mage::getDesign()->getPackageName(),\n Mage::getDesign()->getTheme('template')\n );\n }", "public function getCacheKeyInfo();", "public function getCacheKeyInfo()\n\t{\n\t\t$conditions = $this->getData('conditions')\n\t\t\t? $this->getData('conditions')\n\t\t\t: $this->getData('conditions_encoded');\n\n\t\treturn [\n\t\t\t'CATALOG_PRODUCTS_LIST_WIDGET',\n\t\t\t$this->_storeManager->getStore()->getId(),\n\t\t\t$this->_design->getDesignTheme()->getId(),\n\t\t\t$this->httpContext->getValue(\\Magento\\Customer\\Model\\Context::CONTEXT_GROUP),\n\t\t\tintval($this->getRequest()->getParam(self::PAGE_VAR_NAME, 1)),\n\t\t\t$this->getProductsPerPage(),\n\t\t\t$conditions\n\t\t];\n\t}", "public function getCacheKeyInfo()\n {\n return [\n 'REWARDS_NOTIFICATION_RULE_LIST_WIDGET',\n $this->_storeManager->getStore()->getId(),\n $this->_design->getDesignTheme()->getId(),\n $this->httpContext->getValue(\\Magento\\Customer\\Model\\Context::CONTEXT_GROUP),\n serialize($this->getRequest()->getParams())\n ];\n }", "public function getCacheKeyInfo()\r\n {\r\n return array(\r\n 'ZOPIM_CHAT',\r\n $this->getNameInLayout(),\r\n Mage::app()->getStore()->getId(),\r\n Mage::helper('customer')->getCurrentCustomer()->getId()\r\n );\r\n }", "function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('Group_block',$k,$v); }", "public function load_blocks_list() {\n $tmp_blocks = apply_filters('wpucacheblocks_blocks', array());\n $blocks = array();\n foreach ($tmp_blocks as $id => $block) {\n /* Path ex : /tpl/header/block.php */\n if (!isset($block['fullpath']) && !isset($block['path'])) {\n /* A path should always be defined */\n continue;\n }\n /* Full path to the file */\n if (!isset($block['fullpath'])) {\n $block['fullpath'] = get_stylesheet_directory() . $block['path'];\n }\n\n /* Reload hooks */\n if (!isset($block['reload_hooks']) || !is_array($block['reload_hooks'])) {\n $block['reload_hooks'] = array();\n } else {\n /* Keep a list of all hooks used */\n foreach ($block['reload_hooks'] as $hook) {\n $this->reload_hooks[$hook] = $hook;\n }\n }\n\n if (!isset($block['minify'])) {\n $block['minify'] = true;\n }\n\n /* Expiration time */\n if (!isset($block['expires'])) {\n $block['expires'] = 3600;\n } else {\n /* Allow infinite lifespan for a cached block ( no front reload ) */\n if ($block['expires'] == 0) {\n $block['expires'] = false;\n }\n }\n $blocks[$id] = $block;\n }\n return $blocks;\n }", "public function getCachedHTML($key);", "public function getBbCodeCache()\n\t{\n\t\treturn array(\n\t\t\t'mediaSites' => $this->getBbCodeMediaSitesForCache()\n\t\t);\n\t}", "public function getCacheContexts() {\n\t\t//you must set context of this block with 'route' context tag.\n\t\t//Every new route this block will rebuild\n\t\treturn Cache::mergeContexts( parent::getCacheContexts(), array( 'route' ) );\n\t}", "protected function calculateCacheKey()\n {\n if ($this->_cacheKey === null) {\n $key = [__CLASS__, Yii::$app->requestedRoute];\n if (is_array($this->variations)) {\n foreach ($this->variations as $value) {\n $key[] = $value;\n }\n }\n $this->_cacheKey = $key;\n }\n \n return $this->_cacheKey;\n }", "public function getCachedBlocks()\n {\n return $this->cachedBlocks;\n }", "public function createUniqueKeysForBlocks() {\n $blocks = $this->getActions();\n $keys = [];\n foreach ($blocks as $block) {\n $keys[] = ($block['view_mode']) ? $block['machine_name'] . '+' . $block['view_mode'] : $block['machine_name'];\n }\n\n return $keys;\n }", "public function ElementCacheKey()\n {\n $fragments = [\n 'elemental_block',\n $this->owner->ID,\n $this->owner->LastEdited\n ];\n return implode('-_-', $fragments);\n }", "public function getCacheKey() {\n return $this->_cacheKey;\n }", "private function getAllCacheKeys(){\n $keys = array();\n foreach ($this->storages as $name => $storage){\n $keys[] = $this->getCacheKey($name);\n }\n return $keys;\n }", "public function getCacheContexts() {\n //you must set context of this block with 'route' context tag.\n //Every new route this block will rebuild\n return Cache::mergeContexts(parent::getCacheContexts(), array('route'));\n }", "public function getCacheKeyInfo()\n {\n $baseCacheKeyInfo = parent::getCacheKeyInfo();\n\n array_push($baseCacheKeyInfo, self::WIDGET_TYPE, $this->_getWidgetParams(true));\n\n return $baseCacheKeyInfo;\n }", "public function getCache();", "protected static function getRebuildBlockMarkContent()\n {\n return static::getKey() ?: '_';\n }", "function &pkeyGet($kv)\n {\n return Memcached_DataObject::pkeyGet('Group_block', $kv);\n }", "public function getCacheKey()\n {\n return $this->cacheKey;\n }", "protected function _getBlockArray()\n {\n return array(\n \n /*\n * Minicart section\n */\n array(\n 'version' => '0.0.1',\n 'identifier' => 'header_contact_information',\n 'stores' => [0],\n 'title' => 'Header Contact Information',\n 'content' => <<<HTML\n<div id=\"phone-hrs\">\n <a href=\"https://goo.gl/maps/seJQCD3gzao\" target=\"_blank\">Visit Us</a> or Call Us: <a id=\"phone-number\" href=\"tel:+18009387925\">(800) 938-7925</a> &nbsp;&nbsp; Today's Hours: 7:00am - 6:00pm\n</div>\nHTML\n ),\n array(\n 'version' => '0.0.3',\n 'identifier' => 'home_sidebar',\n 'stores' => [0],\n 'title' => 'Home Sidebar',\n 'content' => <<<HTML\n<div class=\"sidebar\">\n <div class=\"home-side-menu\">\n <h2 class=\"side-menu-title\">CATEGORIES</h2>\n {{block class=\"Smartwave\\Megamenu\\Block\\Topmenu\" name=\"sw.sidenav\" template=\"Smartwave_Megamenu::sidemenu.phtml\" ttl=\"3600\"}} </div>\n <!-- start -->\n <div id=\"ads-slider-demo-9\">\n <div class=\"item\">\n <h2><a href=\"#\">Blog Articles</a></h2>\n <ul class=\"recent-blog\" style=\"list-style:none; padding-inline-start:12px; padding-right:12px;\">\n <li><a title=\"Bosch Laser Level - GLL3-330CG\" href=\"https://www.masterwholesale.com/blog/bosch-green-line-laser-level-review/\" target=\"_blank\">Review: Bosch Green Line Laser Level</a></li>\n <li><a title=\"Makita LXT Lithium Ion Cordless Brushless Angle Grinder\" href=\"https://www.masterwholesale.com/blog/makita-18v-lxt-lithium-ion-cordless-brushless-angle-grinder-review/\" target=\"_blank\">Review: Makita&nbsp;<span>LXT Cordless Brushless Angle Grinder&nbsp;</span></a></li>\n <li><a title=\"Mixing Laticrete PermaColor Grout\" href=\"https://www.masterwholesale.com/blog/how-to-mix-small-batch-laticrete-permacolor-select-grout/\" target=\"_blank\">How to Mix a Small Batch of Laticrete PermaColor Grout</a></li>\n <li><a title=\"Polishing Tile Edges with Diamond Hand Polishing Pads\" href=\"https://www.masterwholesale.com/blog/polish-stone-porcelain-tile-diamond-hand-polishing-pads/\" target=\"_blank\">How to Polish Tile Edges w/ Diamond Hand Polishing Pads</a></li>\n <li><a title=\"Stoning Porcelain and Stone Tile\" href=\"https://www.masterwholesale.com/blog/stone-edge-porcelain-tile-stone/\" target=\"_blank\">How to Stone or Edge Porcelain and Stone Tiles</a></li>\n <li><a title=\"Bridge Saw vs Sliding Table Saw\" href=\"https://www.masterwholesale.com/blog/366-2/\" target=\"_blank\">Bridge Saw vs Sliding Table Saw</a></li>\n <li><a title=\"How to Core with a Diamond Core Drill Bit\" href=\"https://www.masterwholesale.com/blog/dry-core-drill-tile-stone/\" target=\"_blank\">How to Dry Core Drill on Stone or Tile</a></li>\n <li><a title=\"How to Reopen a diamond Core Bit \" href=\"https://www.masterwholesale.com/blog/master-wholesale-reopen-diamond-core-bit/\" target=\"_blank\">How to Sharpen or Reopen a Diamond Core Bit</a></li>\n <li><a title=\"Resin Glass Blade Shootout\" href=\"https://www.masterwholesale.com/blog/resin-glass-blade-shootout/\" target=\"_blank\">Resin Glass Blade Shootout with Blake Adsero</a></li>\n <li><a title=\"Makita Polishing Kit\" href=\"https://www.masterwholesale.com/blog/makita-pw5001c-wet-polishing-kit-master-wholesale/\" target=\"_blank\">How to Polish an Exposed Edge on Stone Tile</a></li>\n <li><a title=\"Deluxe Dry Polishing Kit\" href=\"https://www.masterwholesale.com/blog/?p=254\" target=\"_self\">MWI Deluxe Dry Polishing Kit Demo</a></li>\n <li><a title=\"Laser Level Shootout\" href=\"https://www.masterwholesale.com/blog/laser-level-shootout/\" target=\"_self\">Laser Level Shootout</a></li>\n <li><a title=\"Ishii Tile Cutters\" href=\"https://www.masterwholesale.com/blog/how-to-assemble-and-use-the-ishii-blue-tile-cutters/\" target=\"_self\">How to Assemble and Use Ishii BlueTile Cutters</a></li>\n <li><a title=\"Diamond Blade Shootout\" href=\"https://www.masterwholesale.com/blog/tile-saw-diamond-blade-shootout/\" target=\"_self\">Tile Saw Diamond Blade Shootout</a></li>\n </ul>\n </div>\n </div>\n <!-- end --> \n <!-- start -->\n <div id=\"ads-slider-demo-9\" class=\"owl-carousel\">\n <div class=\"item\" style=\"text-align:center;\"> <img src=\"\" alt=\"\" style=\"display:inline-block;\"/> </div>\n </div>\n <!-- end --> \n <!-- start -->\n <div id=\"ads-slider-demo-9\">\n <div class=\"item\" style=\"text-align:center;\"> {{block class=\"Magento\\Framework\\View\\Element\\Template\" name=\"single_special\" template=\"Magento_Catalog::product/view/single_special.phtml\" ttl=\"3600\"}} </div>\n </div>\n <!-- end --> \n </div>\nHTML\n ),\n );\n }", "public function cache() {\r\n\t\t$key = $this->cacher.'.' . $this->hash();\r\n\t\tif (($content = pzk_store($key)) === NULL) {\r\n\t\t\t$content = $this->getContent();\r\n\t\t\tpzk_store($key, $content);\r\n\t\t}\r\n\t\techo $content;\r\n\t}", "protected function getContentFromCacheFile() {}", "private function getCacheKey(): string\n {\n return $this->webserviceId.$this->cacheKey;\n }", "function tammuz_block_info() {\r\n\t$blocks = array();\r\n\t\r\n\r\n\t$blocks['add_journey'] = array(\r\n\t\t// The name that will appear in the block list.\r\n\t\t'info' => t('Add a journey to the customer'),\r\n\t\t// Default setting.\r\n\t\t'cache' => DRUPAL_CACHE_PER_ROLE,\r\n\t);\r\n\treturn $blocks;\r\n}", "public static function get_block_data()\n {\n }", "public function getCleanupCacheKeyData()\n {\n // 124 sign long string\n $s124 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmnopqrstuvwxyz--ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789abcdefghijklmnopqrstuvwxyz';\n\n return [\n [\n 'initialKey' => 'myaction._caching.',\n 'cleanedKey' => 'myaction_caching_',\n 'config' => [],\n ],\n [\n 'initialKey' => 'abcABC!\"§$%&/()=?+#*\\'-.,_:;',\n 'cleanedKey' => 'abcABC_%&_-_',\n 'config' => [],\n ],\n [\n 'initialKey' => $s124,\n 'cleanedKey' => substr($s124, 0, 50 - 33).'-'.md5($s124),\n 'config' => ['keylength' => 50],\n ],\n ];\n }", "abstract public function getCacheContent( $cacheID = '', $unserialize = true );", "protected function cacheKey() : string\n {\n return $this->cacheKey ?? $this->cacheKeyHash();\n }", "public function getAllKey();", "public function getAllChunksAsKey()\n {\n return array_fill_keys(array_keys($this->entries), true);\n }", "private function getCacheData()\n {\n /**@var $cache Zend_Cache_Core */\n $cache = Shopware()->Cache();\n $data = array(\n 'metaData' => array(),\n 'options' => array(\n 'percentage' => $cache->getFillingPercentage()\n ),\n );\n $options = array(\n 'write_control',\n 'caching',\n 'cache_id_prefix',\n 'automatic_serialization',\n 'automatic_cleaning_factor',\n 'lifetime',\n 'logging',\n 'logger',\n 'ignore_user_abort'\n );\n foreach ($options as $option) {\n $data['options'][$option] = $cache->getOption($option);\n }\n\n foreach ($cache->getIds() as $id) {\n $metaData = $cache->getMetadatas($id);\n $createdAt = date('Y-m-d H:i:s', $metaData['mtime']);\n $validTo = date('Y-m-d H:i:s', $metaData['expire']);\n\n $from = new \\DateTime($createdAt);\n $diff = $from->diff(new \\DateTime($validTo));\n $minutes = $diff->days * 24 * 60;\n $minutes += $diff->h * 60;\n $minutes += $diff->i;\n\n $data['metaData'][$id] = array(\n 'Tags' => $metaData['tags'],\n 'Created at' => $createdAt,\n 'Valid to' => $validTo,\n 'Lifetime' => $minutes . ' minutes'\n );\n }\n\n return $data;\n }", "abstract protected function cacheData();", "public function tempPageCacheContent() {}", "function get_global_content_blocks()\n {\n #global $db_settings, $pdo;\n $gcb_result = Database::$content->query(\"SELECT id, identifier, content FROM \".Database::$db_settings['gcb_table'].\" ORDER BY id ASC\");\n while($row = $gcb_result->fetch())\n {\n $gcb[$row['identifier']] = $row['content'];\n #if($row['content_formatting']==1) $gcb[$row['id']] = auto_html($gcb[$row['id']]);\n }\n if(isset($gcb))\n {\n return $gcb;\n }\n return false;\n }", "public function realPageCacheContent() {}", "function GetBlocks($thing) {\n\t\n\t\n\t\t//query here to find the most liked \n\t\t$thingID = $thing->ID;\n\t\t\n\t\t$innerQuery = \"\tSELECT `image`, MAX(likes) AS HighestBlock \n\t\t\t\tFROM `blocks`\n\t\t\t\tWHERE `thing_id` = $thingID \n\t\t\t\t\";\n\t\t\t\t\n\t\tglobal $db;\n\t\t\t\t\n\t\t$blocks = $db->select($innerQuery);\n\t\t\n\t\tif(count($blocks)!=0){\n\t\t\t$topBlockImage = $blocks[0]->image;\n\t\t}\n\t\n\t\t$keyValuePairs = array(\n\t\t\n\t\t\t\"id\" \t\t\t=> \t$thingID,\n\t\t\t\"title\"\t\t\t=> \t$thing->title,\n\t\t\t\"post_time\"\t\t=>\t$thing->post_time,\n\t\t\t\"image\"\t\t\t=>\t$topBlockImage\n\t\t);\n\t\t\n\t\treturn $keyValuePairs;\n\t}", "function wp_cache_get_multiple($keys, $group = '', $force = \\false)\n {\n }", "public function caching_environment()\n {\n $info = array();\n $info['cache_on'] = array('block_youtube_channel__cache_on');\n $info['ttl'] = intval(get_option('youtube_channel_block_update_time'));\n return $info;\n }", "protected function cacheKey()\n {\n return md5($this->gridField->Link());\n }", "public static function getCacheControl() {}", "public function cacheKey(): string {\n return self::CACHE_PREFIX . $this->id\n . ($this->revisionId ? '_r' . $this->revisionId : '');\n }", "function expose_blocks($content) {\n $raw_blocks = parse_blocks($content);\n $blocks = array();\n\n foreach ($raw_blocks as $block) {\n if ($block['blockName']) { \n $block['content'] = render_block($block);\n $blocks[] = $block;\n }\n }\n\n return $blocks;\n}", "function cacheing_environment()\n\t{\n\t\t$info=array();\n\t\t$info['cache_on']=array('block_youtube_channel__cache_on');\n\t\t$info['ttl']=intval(get_option('channel_update_time'));\n\t\treturn $info;\n\t}", "public function makeCacheHash() {}", "private function get_cache( $key ) {\n\t\treturn get_site_transient( $key );\n\t}", "public function getCacheAttributes()\n {\n return array(\n 'type' => 'topic',\n 'id' => $this->attribute('id')\n );\n }", "public static function getCache() {}", "public function list_cache()\n {\n $result = $this->_db->find('all');\n\n $return_list = array();\n $ttl_expiry = time() - $this->_cacheTTL;\n\n foreach ($result as $i => $cache_item) {\n $expired = false;\n $ttl = $cache_item[$this->_db->name]['created'];\n\n if ($ttl < $ttl_expiry) {\n $expired = true;\n }\n\n $return_list[] = array(\n 'item_name' => $cache_item[$this->_db->name]['request_hash'],\n 'contents' => $cache_item[$this->_db->name]['request_response'],\n 'location' => $cache_item[$this->_db->name]['request_hash'],\n 'ttl' => $ttl,\n 'expired' => $expired\n );\n }\n\n return $return_list;\n }", "private function cacheKey()\n {\n return sprintf('contact-permissons-%s', $this->client->patientContactId);\n }", "protected static function getCacheIdentifier() {}", "protected function cacheKey()\n {\n return json_encode($this);\n }", "public function getFromCache() {}", "public function get_block()\n {\n\n\t\tglobal $charset;\n\n \t$column = 2;\n \t$data = array();\n\n\t\t$content = $this->get_content_html();\n\n\t\t$content_html = '\n\t\t\t <div class=\"panel panel-default\" id=\"intro\">\n\t\t\t <div class=\"panel-heading\">\n\t\t\t '.get_lang('SessionsInformation').'\n\t\t\t <div class=\"pull-right\"><a class=\"btn btn-danger btn-xs\" onclick=\"javascript:if(!confirm(\\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\\')) return false;\" href=\"index.php?action=disable_block&path='.$this->path.'\">\n\t\t\t <em class=\"fa fa-times\"></em>\n\t\t\t </a></div>\n\t\t\t </div>\n\t\t\t <div class=\"panel-body\">\n\t\t\t\t\t\t\t'.$content.'\n\t\t\t </div>\n\t\t\t </div>\n\t\t\t\t';\n\n \t$data['column'] = $column;\n \t$data['content_html'] = $content_html;\n\n \treturn $data;\n }", "public function readCache()\n {\n return $this->readFile()->unpackData();\n }", "protected function getCache()\n {\n return $this->cacheManager->getCache('cache_beautyofcode');\n }", "public function page_content__main() {\n\n echo '<h3>' . __('Blocks', 'wpucacheblocks') . '</h3>';\n foreach ($this->blocks as $id => $block) {\n echo '<p>';\n echo '<strong>' . $id . ' - ' . $block['path'] . '</strong><br />';\n $_expiration = (is_bool($block['expires']) ? __('never', 'wpucacheblocks') : $block['expires'] . 's');\n echo sprintf(__('Expiration: %s', 'wpucacheblocks'), $_expiration);\n\n $prefixes = $this->get_block_prefixes($id);\n\n foreach ($prefixes as $prefix) {\n echo $this->display_block_cache_status($id, $prefix);\n }\n\n echo '<br />';\n if (!apply_filters('wpucacheblocks_bypass_cache', false, $id)) {\n if (isset($block['callback_prefix'])) {\n submit_button(__('Clear', 'wpucacheblocks'), 'secondary', 'clear__' . $id, false);\n } else {\n submit_button(__('Reload', 'wpucacheblocks'), 'secondary', 'reload__' . $id, false);\n }\n } else {\n echo __('A bypass exists for this block. Regeneration is only available in front mode.', 'wpucacheblocks');\n }\n echo '</p>';\n echo '<hr />';\n }\n }", "public function cache_info() : array\n\t{\n\t\t$info = [];\n\n\t\tforeach ($this->cache as $key=>$value) {\n\t\t\t$info[$key] = [\n\t\t\t\t'value'=>$value,\n\t\t\t\t'size'=>strlen($value),\n\t\t\t\t'ttl'=>0,\n\t\t\t];\n\t\t}\n\n\t\treturn $info;\n\t}", "function wpucacheblocks_block($block_id = '', $lang = false) {\n global $WPUCacheBlocks;\n return $WPUCacheBlocks->get_block_content($block_id, $lang);\n}", "function wp_get_post_content_block_attributes()\n {\n }", "protected function fetchBlocks()\n {\n if (null === $this->blocks)\n {\n $this->blocks = array();\n\n $allBlocks = ContentBlockQuery::create()\n ->find()\n ;\n\n foreach ($allBlocks as $block)\n {\n /* @var $block ContentBlock */\n $this->blocks[$block->getName()][$block->getLocale()] = $block;\n }\n }\n }", "public function get(){\n $cache = $this->getCache();\n $hash = md5($this->hashes);\n \n //return parsed template\n $output = str_replace('{cache}', $cache, $this->appcacheTemplate);\n $output = str_replace('{hash}', $hash, $output);\n return $output;\n }", "public function getBlockHash();", "public function getCacheKey()\n {\n return $this->CacheKey;\n }", "function markup_from_cache();", "public function keys()\n {\n $keyPath = $this->getKeyPath();\n\n // find all the cached filenames among partitioned dirs within this group key\n // (e.g. '[GROUP PARTITION]/[GROUP]/[PARTITION]/[KEY]/cache')\n $iterator = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($keyPath));\n\n $regIterator = new \\RegexIterator($iterator, '/\\/[\\d]+\\/[\\w\\d]+\\/' . self::FILENAME_CACHE .'$/i');\n $keys = array();\n\n foreach ($regIterator as $path) {\n // extract key from file path\n preg_match('/\\/(?<key>[\\w\\d]+)\\/' . self::FILENAME_CACHE . '/', $path->__toString(), $match);\n if (!array_key_exists('key', $match) || empty($match['key'])) {\n continue;\n }\n // decode the key\n $entry = base64_decode($match['key']);\n $keys[] = $entry;\n }\n asort($keys);\n\n return $keys;\n }", "protected function getCacheModule() {}", "public function getFromMap($cacheKey);", "public function getBlockInfo();", "function flashcard_dbcleaner_add_keys() {\n global $DB;\n\n $flashcardmoduleid = $DB->get_field('modules', 'id', array('name' => 'flashcard'));\n\n $keys = array(\n array('flashcard', 'course', 'course', 'id', ''),\n array('flashcard', 'id', 'course_modules', 'instance', ' module = '.$flashcardmoduleid.' '),\n array('flashcard_card', 'flashcardid', 'flashcard', 'id', ''),\n array('flashcard_card', 'userid', 'user', 'id', ''),\n array('flashcard_deckdata', 'flashcardid', 'flashcard', 'id', ''),\n array('flashcard_userdeck_state', 'flashcardid', 'flashcard', 'id', ''),\n array('flashcard_userdeck_state', 'userid', 'user', 'id', ''),\n );\n\n return $keys;\n}", "function gutenberg_prepare_blocks_for_js() {\n\t$block_registry = WP_Block_Type_Registry::get_instance();\n\t$blocks = array();\n\t$keys_to_pick = array( 'title', 'description', 'icon', 'category', 'keywords', 'supports', 'attributes' );\n\n\tforeach ( $block_registry->get_all_registered() as $block_name => $block_type ) {\n\t\tforeach ( $keys_to_pick as $key ) {\n\t\t\tif ( ! isset( $block_type->{ $key } ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! isset( $blocks[ $block_name ] ) ) {\n\t\t\t\t$blocks[ $block_name ] = array();\n\t\t\t}\n\n\t\t\t$blocks[ $block_name ][ $key ] = $block_type->{ $key };\n\t\t}\n\t}\n\n\treturn $blocks;\n}", "protected function getPreloadKeys() {\n\t\t$keys = array(\n\t\t\t'echo-notification-timestamp',\n\t\t\t'echo-notification-timestamp-' . EchoAttributeManager::MESSAGE,\n\t\t\t'echo-notification-timestamp-' . EchoAttributeManager::ALERT,\n\t\t\t'echo-notification-count',\n\t\t\t'echo-notification-count-' . EchoAttributeManager::MESSAGE,\n\t\t\t'echo-notification-count-' . EchoAttributeManager::ALERT,\n\t\t);\n\n\t\treturn array_filter( array_merge(\n\t\t\tarray_map( array( $this, 'getMemcKey' ), $keys ),\n\t\t\tarray_map( array( $this, 'getGlobalMemcKey' ), $keys )\n\t\t) );\n\t}", "public function getContentCache()\n {\n return $this->contentCache;\n }", "protected function LoadKeysCache()\n\t{\n\t\t$sFileContent = @file_get_contents($this->m_sCacheFileName);\n\t\tif (!empty($sFileContent))\n\t\t{\n\t\t\t$aCache = unserialize($sFileContent);\n\t\t\t$this->m_aKeys = $aCache['keys'];\n\t\t\t$this->m_aObjectsCache = $aCache['objects']; \n\t\t\t$this->m_oChange = $aCache['change'];\n\t\t\t$this->m_aErrors = $aCache['errors'];\n\t\t\t$this->m_aWarnings = $aCache['warnings'];\n\t\t}\n\t}", "public function cacheGet() {\n }", "protected function GetCacheKey()\n\t{\n\t\treturn (isset($this->params['hashbase']) ? $this->params['hashbase'] : '') . '|' . (isset($this->params['hash']) ? $this->params['hash'] : '') . '|' . (isset($this->params['file']) ? sha1($this->params['file']) : '');\n\t}", "public function getHtmlCache()\n {\n return $this->data['fields']['html_cache'];\n }", "function pnRender_block_nocache($param, $content, &$smarty) {\n return $content;\n}", "public function getCacheAdapter();", "public function getCacheKey()\n {\n return md5($this->formId . ':' . implode(',', $this->fieldIds));\n }", "static function cached_all(){\n return static::get_cache();\n }", "function get ($key) {\n return $this->memcached->get($key);\n }", "private function getEncryptionKeys(){\n\t\treturn $this->cryptokeys;\n\t\t/*\n\t\treturn array('REGISTRATION'=> array(\n\t\t\t\t\t\t\t\t\t\t'h'=>array(\n\t\t\t\t\t\t\t\t\t\t\t'hash_size'=> \t64,\n\t\t\t\t\t\t\t\t\t\t\t'hash_key'=>\t'mysecretkey' ),\n\t\t\t\t\t\t\t\t\t\t'c'=>array(\t\n\t\t\t\t\t\t\t\t\t\t\t'nonce'=>\t\t'f5de5a2935a8927268be7a358dbfe73334a7dc38d57f23df',\n\t\t\t\t\t\t\t\t\t\t\t'secretkey'=>\t'8b49a72bb1addff71e630692e2a0c6a0f0cfa3657ff527642700b247364c19e8',\n\t\t\t\t\t\t\t\t\t\t\t'blocksize'=>\t16 )\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t 'EMAIL'=> \tarray(\n\t\t\t\t\t\t\t\t\t\t'h'=>array(\n\t\t\t\t\t\t\t\t\t\t\t'hash_size'=> \t32,\n\t\t\t\t\t\t\t\t\t\t\t'hash_key'=>\t'mysecretkey' ),\n\t\t\t\t\t\t\t\t\t\t'c'=>array(\t\n\t\t\t\t\t\t\t\t\t\t\t'nonce'=>\t\t'f5de5a2935a8927268be7a358dbfe73334a7dc38d57f23df',\n\t\t\t\t\t\t\t\t\t\t\t'secretkey'=>\t'8b49a72bb1addff71e630692e2a0c6a0f0cfa3657ff527642700b247364c19e8',\n\t\t\t\t\t\t\t\t\t\t\t'blocksize'=>\t16 )\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t 'PROFILE'=> array(\n\t\t\t\t\t\t\t\t\t\t'h'=>array(\n\t\t\t\t\t\t\t\t\t\t\t'hash_size'=> \t64,\n\t\t\t\t\t\t\t\t\t\t\t'hash_key'=>\t'mysecretkey' ),\n\t\t\t\t\t\t\t\t\t\t'c'=>array(\t\n\t\t\t\t\t\t\t\t\t\t\t'nonce'=>\t\t'f5de5a2935a8927268be7a358dbfe73334a7dc38d57f23df',\n\t\t\t\t\t\t\t\t\t\t\t'secretkey'=>\t'8b49a72bb1addff71e630692e2a0c6a0f0cfa3657ff527642700b247364c19e8',\n\t\t\t\t\t\t\t\t\t\t\t'blocksize'=>\t16 )\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t*/\n\t\t\n\t\t\t\t\t \t\t\t\n\t}", "function gallery2_sidebarblock_modify($blockinfo)\n{\n // get current content\n if (!is_array($blockinfo['content'])) {\n $vars = @unserialize($blockinfo['content']);\n } else {\n $vars = $blockinfo['content'];\n }\n\n $vars['blockid'] = $blockinfo['bid'];\n return $vars;\n}", "public function getObjFromCache($key);", "function acf_cache_key($key = '')\n{\n}", "protected function GetCacheKey()\n\t{\n\t\treturn $this->params['page'];\n\t}", "function getAllKeys() {\n return $this->memcached->getAllKeys();\n }", "function wp_get_attachment_id3_keys($attachment, $context = 'display')\n {\n }", "protected function getCacheKey()\r\n {\r\n if (null == $this->cacheKey) {\r\n $this->cacheKey = get_class($this)\r\n . $this->getParent()->getEnvironment()\r\n . $this->getHttpHost();\r\n }\r\n return $this->cacheKey;\r\n }", "public function getCacheTags() {\n\t\tif ( $node = \\Drupal::routeMatch()->getParameter( 'node' ) ) {\n\t\t\t//if there is node add its cachetag\n\t\t\treturn Cache::mergeTags( parent::getCacheTags(), array( 'node:' . $node->id() ) );\n\t\t} else {\n\t\t\t//Return default tags instead.\n\t\t\treturn parent::getCacheTags();\n\t\t}\n\t}", "private function _cacheName() {\n $file = APPLICATION_PATH . '/application/settings/restapi_caching_url.php';\n if (file_exists($file)) {\n $enableCacheUrl = include $file;\n } else {\n return '';\n }\n $viewer = Engine_Api::_()->user()->getViewer();\n $front = Zend_Controller_Front::getInstance();\n $request = $front->getRequest();\n $params = array();\n $params['module'] = $request->getModuleName();\n $params['controller'] = $request->getControllerName();\n $params['action'] = $request->getActionName();\n $parameters = $request->getParams();\n $language = $parameters['language'];\n $cacheName = implode(\"_\", $params);\n $key_val = '';\n $cacheName = str_replace('-', '_', $cacheName);\n if (!isset($enableCacheUrl[$cacheName]) || empty($enableCacheUrl[$cacheName]))\n return;\n $getRequestUri = htmlspecialchars($_SERVER['REQUEST_URI']);\n $urlarray = explode(\"?\", $getRequestUri);\n $trimData = trim($urlarray[0], \"/\");\n $cachName = str_replace(\"/\", \"_\", $trimData);\n $viewerId = 0;\n $keys = array_keys($parameters);\n $matched = preg_grep('/_id|_type$/', $keys);\n $matched = array_flip($matched);\n $matched = array_intersect_key($parameters, $matched);\n $key_val = implode('_', $matched);\n\n if ($enableCacheUrl[$cacheName] == 'member_level') {\n $viewerId = $viewer && $viewer->getIdentity() ? $viewer->level_id : 0;\n } elseif ($enableCacheUrl[$cacheName] == 'user_level') {\n $viewerId = $viewer && $viewer->getIdentity() ? $viewer->getIdentity() : 0;\n }\n\n $cachName = $cachName . '_' . $language . '_' . $key_val . '_' . $viewerId;\n $cachName = str_replace('-', '_', $cachName);\n $cachName = str_replace('.', '_', $cachName);\n return $cachName;\n }", "function keys() {\n\t\treturn array_keys($this->_cache);\n\t}", "abstract public function getCache( $cacheID = '', $unserialize = true );", "public function cacheKey() {\n $params = $this->getParameters();\n $ret = '';\n $this->make_cache_key($params, $ret);\n\n return md5($ret);\n }" ]
[ "0.70591486", "0.650009", "0.63922805", "0.6376948", "0.63757694", "0.60802513", "0.6075127", "0.6044646", "0.5977924", "0.59288204", "0.59132046", "0.58700424", "0.5869957", "0.58669734", "0.58633035", "0.5823115", "0.5804039", "0.5778641", "0.5770323", "0.5768616", "0.57583576", "0.57563525", "0.57515407", "0.5702734", "0.5687358", "0.56765306", "0.56699514", "0.565606", "0.5648947", "0.56436944", "0.5628542", "0.55998725", "0.55892825", "0.5562557", "0.5527652", "0.5509249", "0.5484439", "0.5475408", "0.54680514", "0.54481757", "0.54472667", "0.5434526", "0.54330844", "0.54292583", "0.5429083", "0.5421853", "0.54134995", "0.5409205", "0.540801", "0.54014987", "0.540069", "0.5398736", "0.53773636", "0.53728986", "0.53713644", "0.5368193", "0.5352447", "0.5351935", "0.5350224", "0.53451556", "0.53242", "0.5322832", "0.53166336", "0.53066105", "0.5301963", "0.5297942", "0.529528", "0.52884895", "0.5281935", "0.5280304", "0.5277439", "0.5274543", "0.5266886", "0.5243866", "0.52437735", "0.5240631", "0.52327347", "0.5225352", "0.5223095", "0.5222926", "0.52134436", "0.52082926", "0.52038014", "0.5201238", "0.51972604", "0.5185138", "0.5185063", "0.51839274", "0.5178335", "0.517553", "0.5168783", "0.5164095", "0.51627576", "0.5152378", "0.51457965", "0.51437706", "0.51375943", "0.51350236", "0.51321423", "0.5128236" ]
0.65895355
1
logMessage("INFO", "This is an info message."); logMessage("ERROR", "This is an info message.");
function logInfo($level, $message) { logMessage("INFO", "This is an info message.") . PHP_EOL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logInfo($message) {\n\tlogMessage(\" INFO\", $message);\n}", "abstract public function log( $message );", "private static function log($message)\n\t{\n\t}", "public function log($message) {\n }", "public function log($message) {\n }", "public function log($message) {\n }", "function mlog($message) {\n\tprint $message;\n}", "public function log($text)\n {\n }", "function log_info( $msg ){\n self::system_log( $msg, 'INFO' );\n }", "public function log($msg)\n {\n }", "function message($name, $city) {\n\techo \"My name is $name\";\n\techo \"\\nI live in $city\";\n}", "private function log($message) {\n //echo $message . \"\\n\";\n }", "function lDebug(string $msg):void\n{\n $args = func_get_args();\n\n \\Log::debug(' ######## Start DEBUG ####### ');\n $trace = debug_backtrace();\n \\Log::debug(' FILE : '.$trace[0]['file'].'');\n \\Log::debug(' LINE : '.$trace[0]['line'].'');\n \\Log::debug(' FUNCTION : '.$trace[1]['function'].'');\n \\Log::debug(' CLASS : '.$trace[1]['class'].'');\n if (is_array($args)) {\n foreach ($args as $string) {\n \\Log::debug(' >>>> Start Message <<<< ');\n \\Log::debug($string);\n \\Log::debug(' >>>> END Message <<<< ');\n }\n }\n \\Log::debug('######## End DEBUG #######');\n}", "function WriteLog($s) {\r\n}", "function writeLog($string){\n}", "function logMessage($message) {\n\techo date('Y-m-d H:i:s').\": $message\\n\";\n}", "function logMessage(string $message): void {\n // \\Drupal::logger(__FILE__)->notice($message);\n echo $message . PHP_EOL;\n}", "function info($message);", "function ttp_lms_log( $tag = \"\", $msg = \"\") {\n\tlog( $tag, $msg );\n}", "private function log($message) {\n\t\techo $message.\"\\n\";\n\t}", "function error_log($msg)\n{\n echo \"ERR: $msg\";\n}", "abstract public function log($msg, $style = '');", "abstract public function log($msg, $style = '');", "function logError($message) {\n\tlogMessage(\" ERROR\", $message);\n}", "abstract protected function log(LogMessage $message);", "function wfDebugLog($section, $message)\n{\n}", "function _logMessage($msg) {\n\t\tif ($msg[strlen($msg) - 1] != \"\\n\") {\n\t\t\t$msg .= \"\\n\";\n\t\t}\n\n\t\tif ($this->debug) debug($msg);\n\n\t\t$this->resultsSummary .= $msg;\n\n\t\tif ($this->useLog) {\n\t\t\t$logfile = $this->writeDir . \"cron.log\";\n\t\t\t$file = fopen($logfile, \"a\");\n\t\t\tfputs($file, date(\"r\", time()) . \" \" . $msg);\n\t\t\tfclose($file);\n\t\t}\n\t}", "function error_log($msg, $code)\n{\n // this will be called from abc\\Logger::error\n // instead of the native error_log() function\n echo \"ERR: $msg\";\n}", "function TransLog($message){\t\n notify_webmaster($message);\t\n}", "public function message($message);", "function trace_log()\n {\n $messages = func_get_args();\n\n foreach ($messages as $message) {\n $level = 'info';\n\n if ($message instanceof Exception) {\n $level = 'error';\n }\n elseif (is_array($message) || is_object($message)) {\n $message = print_r($message, true);\n }\n\n Log::$level($message);\n }\n }", "public function log($message)\r\n {\r\n echo \"Executing \" . __METHOD__. \"($message) with prefix '\" . $this->prefix . \"'\\n\";\r\n }", "function log()\n {\n }", "function logger($message)\n{\n $debug_arr = debug_backtrace();\n $prepend = 'line ' . $debug_arr[0]['line'] . ' ('. basename($debug_arr[0]['file']) .') ' . print_r($message, true) . PHP_EOL;\n append_message($prepend);\n}", "function writeMessage() {\n echo \"You are really a nice person, Have a nice time!\"; \n}", "public function msg($msg);", "function _log($text,$level=10) {\n if($this->logger) call_user_func($this->logger, $text, $level);\n }", "public function appendLog($message);", "function logString (string $msg): void {\n\t$fh = fopen(getConfig(\"LOG_FILE\"), 'a');\n\ttry {\n\t\tfwrite($fh, $msg.PHP_EOL);\n\t} finally {\n\t\t@fclose($fh);\n\t}\n}", "function log_it($msg) {\n//OUT: No return, although log file is updated\n//PURPOSE: Log messages to email and text files.\n\n $msg = date('m/d/y H:i:s : ', time()) . $msg . PHP_EOL;\n\n error_log(msg, 1, ERROR_E_MAIL);\n \terror_log(msg, 3, ERROR_LOG_FILE);\n}", "public function tlog($text);", "private function Log($msg) {\n// error_log( '[LOG] '.$msg);\n\t}", "function message(Message $message);", "function log_debug($msg, $condition=true, $mode='DEBUG')\r\n{\r\n log_msg($msg, $condition, $mode);\r\n}", "public function log(string $str)\n {\n }", "public function info($message) {}", "function log_message($level, $msg)\n{\n $level = strtolower($level);\n $file_name = __DIR__ . '/logs/' . date(\"Y_m_d\") . \"_{$level}.php\";\n if (!file_exists($file_name)) {\n file_put_contents($file_name, 'create log file ' . PHP_EOL);\n }\n file_put_contents($file_name, $level . ' - ' . date(\"Y-m-d H:i:s\") . ' --- ' . $msg . PHP_EOL, FILE_APPEND);\n}", "public function message($m){}", "function log_message($message)\n{\n $total_message = date('[H:m:s] ') . $message . '<br />';\n echo $total_message;\n}", "public static function log($message = '') {\n self::_log($message);\n }", "function addMessage($txt = \"\"){\t$this->mMessages\t.= $txt;\t}", "function logge($message, $type=INFO, $dateiName=\"\", $methodName=\"\") {\n\n $str = date(\"Y.m.d H:i:s\") . \" \" . $type;\n\n if ($dateiName !=\"\" || $methodName != \"\") {\n $str .= \"(\";\n if ($dateiName != \"\") {\n $str .= \"File: \" . $dateiName . \" \";\n }\n if ($methodName != \"\") {\n $str .= \"Methode: \" . $methodName;\n }\n $str .= \")\";\n }\n $str .= \": \" . $message . \"\\n\\r\";\n\n if (isset($_ENV[\"LOGFILE\"]) && $_ENV[\"LOGFILE\"] != '') {\n $fd = fopen($_ENV[\"LOGFILE\"], \"a\");\n\n fwrite($fd, $str);\n fclose($fd);\n } else {\n echo \"LOGFILE ist nicht bekannt, um Meldungen in die Log-Datei zu schreiben.<br>\\n\";\n echo $str;\n }\n\n}", "function debugMsg($msg)\n {\n echo \"DEBUG MESSAGE: {$msg}<br>\\n\";\n }", "function log_error( $msg ){\n self::system_log( $msg, 'ERROR' );\n }", "function ConsoleLog($message)\n{\n echo '<script type=\"text/javascript\">' .\n 'console.log(\\'' . $message . '\\');</script>';\n}", "public function message ();", "function consoleLog( $msg ) {\n\techo \"[\\033[1;34m\" . wfTimestamp( TS_RFC2822 ) . \"\\033[0m] $msg\\n\";\n}", "function _log($message)\n{\n\tfwrite($GLOBALS['logfile'], date(\"Y-m-d H:i:s :: \", time()) . $message . \"\\n\");\n}", "function printSomething($msg='Print something....'){\n echo '<br>'.$msg;\n}", "function add_success(&$log, $message){\n if(!is_array($log)) return;\n\n $log[] = array(\n \"type\" => \"success\",\n \"message\" => $message\n );\n}", "function SDKNotifications($message){\r\n echo \"<h4>$message</h4>\";\r\n}", "function loggerInformation($msgInfo) {\n\t$logger = new Logger('./log');\n $logger->log('Information', 'infos', $msgInfo, Logger::GRAN_MONTH);\n}", "public function log($msg = \"\", $replaces = array(), $type = null) {\n\n $toreps = preg_match_all(\"/%/\", $msg);\n \n // replaces have to be an array \n if(!Validator::isa($replaces,\"array\")) { \n\n $this->write(get_class($this).\" line \".__LINE__.\n \": Message replacements are not provided as an array.\",\n \"WARNING\");\n throw(new ParamNotArrayException());\n\n // number of replacement elements should not differ \n // in msg string and replacement array\n } else if($toreps != count($replaces)) {\n\n $this->write(get_class($this).\" line \".__LINE__.\n \": Number of message replacements do not fit.\", \n \"WARNING\");\n throw(new ParamNumberException());\n\n } else if($toreps == count($replaces)) {\n\n // replace % with flattened replacements\n foreach($replaces as $r) {\n if($type === \"DEBUG\") \n $msg = preg_replace(\"/%/\", $this->flatten($r,true), $msg, 1);\n else \n $msg = preg_replace(\"/%/\", $this->flatten($r), $msg, 1);\n } \n } \n \n // prefix message with file, object, function and line information \n if(!$this->cresolved) $cinfo = $this->get_caller_info(debug_backtrace());\n else $cinfo = \"\";\n $this->write($cinfo.$msg, ($type===null ? $this->level : $type));\n $this->cresolved = false;\n\n }", "function logMessage($msg)\r\n{\r\n $time = date(\"F jS Y, H:i\", time() + 25200);\r\n $file = 'errors.txt';\r\n $open = fopen($file, 'ab');\r\n fwrite($open, $time . ' : ' . json_encode($msg) . \"\\r\\n\");\r\n fclose($open);\r\n}", "function log_err($msg, $condition=true, $mode='ERROR')\r\n{\r\n log_msg($msg, $condition, $mode);\r\n}", "function log1($msg)\n{\n if(WRITE_LOG == false)\n return;\n date_default_timezone_set('Europe/Vienna');\n $now = date(\"Y-m-d H:i:s\");\n $line = sprintf(\"%s => %s\\r\\n\", $now, $msg);\n file_put_contents(LOG_FILE, $line, FILE_APPEND);\n}", "function log($message) {\n\t\tif (isset($this->logger)) {\n\t\t\tcall_user_func(array($this->logger, 'log'), $message);\n\t\t}\n\t}", "function warn($message, $query = \"\") {\n global $logger;\n\t $logger->error(\"$message \" . \"[ $query ]\" . \"\\n\");\n }", "function elog()\n{\n $params = func_get_args();\n\n $elevel = array_shift($params); /* 1st argument */\n $format = array_shift($params); /* 2nd argument */\n\n $message = vsprintf($format, $params);\n\n /* Output a message */\n switch ($elevel) {\n case LOG:\n fprintf(STDOUT, $message);\n break;\n case WARNING:\n fprintf(STDERR, \"[WARNING] \" . $message . \"\\n\");\n break;\n case ERROR:\n fprintf(STDERR, \"[ERROR] \" . $message . \"\\n\");\n exit(1);\n }\n}", "protected function log($msg, $level = 'Info'){\n// if ($msg != false) {\n// $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n// \n// if (isset($logfunction) && $logfunction != '' && function_exists($logfunction)){\n// switch ($level){\n// case('Info'): $loglevel = LOG_INFO; break; \n// case('Throttle'): $loglevel = LOG_INFO; break; \n// case('Warning'): $loglevel = LOG_NOTICE; break; \n// case('Urgent'): $loglevel = LOG_ERR; break; \n// default: $loglevel = LOG_INFO;\n// }\n// call_user_func($logfunction,$msg,$loglevel);\n// }\n// \n// \n// if(isset($userName) && $userName != ''){ \n// $name = $userName;\n// }else{\n// $name = 'guest';\n// }\n// \n// if(isset($backtrace) && isset($backtrace[1]) && isset($backtrace[1]['file']) && isset($backtrace[1]['line']) && isset($backtrace[1]['function'])){\n// $fileName = basename($backtrace[1]['file']);\n// $file = $backtrace[1]['file'];\n// $line = $backtrace[1]['line'];\n// $function = $backtrace[1]['function'];\n// }else{\n// $fileName = basename($backtrace[0]['file']);\n// $file = $backtrace[0]['file'];\n// $line = $backtrace[0]['line'];\n// $function = $backtrace[0]['function'];\n// }\n// if(isset($_SERVER['REMOTE_ADDR'])){\n// $ip = $_SERVER['REMOTE_ADDR'];\n// if($ip == '127.0.0.1')$ip = 'local';//save some char\n// }else{\n// $ip = 'cli';\n// }\n// if (!file_exists($this->logpath)) {\n// //attempt to create the file if it does not exist\n// file_put_contents($this->logpath, \"This is the Amazon log, for Amazon classes to use.\\n\");\n// }\n// if (file_exists($this->logpath) && is_writable($this->logpath)){\n// $str = \"[$level][\" . date(\"Y/m/d H:i:s\") . \" $name@$ip $fileName:$line $function] \" . $msg;\n// $fd = fopen($this->logpath, \"a+\");\n// fwrite($fd,$str . \"\\r\\n\");\n// fclose($fd);\n// } else {\n// throw new Exception('Error! Cannot write to log! ('.$this->logpath.')');\n// }\n// } else {\n// return false;\n// }\n }", "function _log($message) {\n file_put_contents(\n LOG_FILE, \n $message,\n FILE_APPEND\n );\n}", "private static function addLog($msg) {\n\t\tself::$log[] = '\"'.formatTimestamp(time()).' - '.$msg.'\"';\n\t}", "public function message($type, $message) {}", "function userclass2_adminlog($msg_num='00', $woffle='')\n{\n\te107::getAdminLog()->log_event('UCLASS_'.$msg_num,$woffle,E_LOG_INFORMATIVE,'');\n}", "function console_log($message){\n $script = \"<script>console.log('\".$message.\"');</script>\";\n return $script;\n }", "public function log(string $text, ?string $priority, ?string $class);", "function write($message);", "public function log (string $msg) : void {\n\t\t$this->logs [] = $msg;\n\t}", "function logInfo (string $msg): void {\n\tlogString('('.$_SERVER['REMOTE_ADDR'].') ('.date('Y-m-d H:i:s').') [Info] '.$msg);\n}", "function logMessage($level, $message) {\t\n// time and date functions assigned to variables\n\t$time = date(\"H:i:s\");\n\t$date = date(\"Y-m-d\");\n// filename created with current date. A new file will be created every day\n\t$filename = \"log-\" . $date . \".log\";\n\n// handle opens the file and appends new information to the end\n\t$handle = fopen($filename, 'a');\n\n// writes the date, time, and message to the file, then closes it\n\tfwrite($handle,PHP_EOL . $date . $time . $level . $message);\n\tfclose($handle);\n\n}", "function messageTask($fullName, $id, $language, $validEmail){\n echo \"Hello World, this is $fullName with HNGi7 ID $id and email $validEmail using $language for stage 2 task\" ;\n\n //echoing the text\n\n //Hello World, this is Elisha Simeon Ukpong Udoh with HNGi7 ID HNG-01827 and email [email protected] using python for stage 2 task\n\n }", "function LOGGING($message = \"\", $loglevel = 7, $raw = 0)\n{\n\tglobal $pcfg, $L, $config, $lbplogdir, $logfile, $plugindata;\n\t\n\tif ($plugindata['PLUGINDB_LOGLEVEL'] >= intval($loglevel) || $loglevel == 8) {\n\t\t($raw == 1)?$message=\"<br>\".$message:$message=htmlentities($message);\n\t\tswitch ($loglevel) \t{\n\t\t case 0:\n\t\t #LOGEMERGE(\"$message\");\n\t\t break;\n\t\t case 1:\n\t\t LOGALERT(\"$message\");\n\t\t break;\n\t\t case 2:\n\t\t LOGCRIT(\"$message\");\n\t\t break;\n\t\t\tcase 3:\n\t\t LOGERR(\"$message\");\n\t\t break;\n\t\t\tcase 4:\n\t\t\t\tLOGWARN(\"$message\");\n\t\t break;\n\t\t\tcase 5:\n\t\t\t\tLOGOK(\"$message\");\n\t\t break;\n\t\t\tcase 6:\n\t\t\t\tLOGINF(\"$message\");\n\t\t break;\n\t\t\tcase 7:\n\t\t\t\tLOGDEB(\"$message\");\n\t\t\tdefault:\n\t\t break;\n\t\t}\n\t\tif ($loglevel < 4) {\n\t\t\tif (isset($message) && $message != \"\" ) notify (LBPPLUGINDIR, $L['BASIS.MAIN_TITLE'], $message);\n\t\t}\n\t}\n\treturn;\n}", "function L($sString)\n\t{\n\t\t//error_log(date(\"H:i:s\").\";\".$sString.\"[END_LOG]\",3,\"c:\\\\xampp\\\\htdocs\\\\EnterSolutions\\\\logs_\".date(\"Ymd\").\".log\");\n\t}", "function debug($message);", "function wlog($msg,$typ='INF',$level=1)\n{\n global $log;\n\n if ($level==0)\n {\n return; //no logging\n }\n else {\n $log->log($msg,$typ );\n }\n\n}", "function line( $msg = '' ) {\n\tStreams::_call( 'line', func_get_args() );\n}", "function write($a_msg, $a_log_level = NULL) {\n\t}", "function printHelloMessage(){\n echo 'Hello! Welcome again!';\n}", "function _error_log($message)\n{\n error_log(\"VM: \" . $message);\n}", "function sNSLog($format) {\n\t\t$args = func_get_args();\t\t\n\t\tif ( count($args) >= 1 ) {\n\t\t\treturn _log_line($format, array_slice($args,2));\n\t\t}\n\t}", "public function log()\n {\n $this->appendLog('log', \\func_get_args());\n }", "public function log( $message )\r\n {\r\n printf( \"%s\\n\", $message );\r\n }", "static function message($message)\n {\n global $template_vars;\n $template_vars['messages'][] = $message;\n }", "function NSLogf() {\n\t\tglobal $db;\n\t\t$args = func_get_args();\n\t\t$db->Execute(sprintf(\"INSERT INTO `nslog_messages` (`message`, `timestamp`) VALUES('%s', NOW())\", $db->prepare_input(array_pop(sNSLog($args)))));\n\t}", "public function log($message, $level);", "function fbComments_log($msg) {\n\tif (FBCOMMENTS_ERRORS) {\n\t\terror_log('fbComments: ' . $msg);\n\t}\n}", "public function writeln($messages = '');", "abstract protected function doLog($level, $message, $params = null);", "public function log( $text )\n\t{\n\t\t$this->buffer .= sprintf('console.log(\"%s\");', $text);\n\t}", "protected abstract function _message();" ]
[ "0.7300014", "0.69796664", "0.69163626", "0.67127705", "0.67127705", "0.67127705", "0.67086464", "0.66128373", "0.65810376", "0.6557299", "0.65423876", "0.65381086", "0.6509108", "0.64677715", "0.64386314", "0.6423879", "0.64109194", "0.63407415", "0.6285348", "0.6281318", "0.6279951", "0.6275845", "0.6275845", "0.62484777", "0.6233959", "0.62299246", "0.61935836", "0.6190563", "0.6161559", "0.6118582", "0.6107656", "0.6088337", "0.6067854", "0.6045423", "0.603813", "0.6037397", "0.60275894", "0.599611", "0.59750426", "0.59672105", "0.5963454", "0.5959224", "0.59590465", "0.59428656", "0.59145343", "0.5883466", "0.5868182", "0.58680964", "0.58663094", "0.58535284", "0.58519727", "0.58478826", "0.584119", "0.5810763", "0.58064413", "0.5803492", "0.5782958", "0.5779241", "0.577346", "0.5768698", "0.5760353", "0.5758067", "0.5757104", "0.57510984", "0.57499397", "0.57486", "0.57413363", "0.57376856", "0.5734212", "0.57305175", "0.57303715", "0.5730212", "0.572811", "0.5726407", "0.5724349", "0.5716139", "0.5705944", "0.5703316", "0.5701896", "0.5695362", "0.56918025", "0.5690467", "0.5683724", "0.56802183", "0.5663699", "0.5663479", "0.56623626", "0.5662313", "0.56603754", "0.56504923", "0.56454945", "0.5644045", "0.5638735", "0.56315684", "0.5630443", "0.56273866", "0.5625359", "0.56240416", "0.56234884", "0.56186545" ]
0.66175246
7
Create a new User signup.
function __construct($user_signup_id = null, $email = null, $name = null, $school = null, $city = null, $exam = null) { parent::__construct(); $this->user_signup_id = $user_signup_id; $this->email = $email; $this->name = $name; $this->school = $school; $this->city = $city; $this->exam = $exam; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createAction()\r\n {\r\n $user = new User($_POST);\r\n\r\n if ($user->save()) {\r\n\t\t\t\r\n\t\t\tsession_regenerate_id(true);\r\n\r\n\t\t\t$_SESSION['user_id'] = User::getIdSavedUser($_POST['email']);\r\n\t\t\t\r\n\t\t\tIncome::saveDefaultIncomes($_SESSION['user_id']);\r\n\t\t\tExpense::saveDefaultExpenses($_SESSION['user_id']);\r\n\t\t\tPaymentMethod::saveDefaultPaymentMethods($_SESSION['user_id']);\r\n\t\t\t\r\n\t\t\t$user->sendActivationEmail();\r\n\r\n $this->redirect('/signup/success');\r\n\r\n } else {\r\n\r\n View::renderTemplate('Signup/new.html', [\r\n 'user' => $user\r\n ]);\r\n\r\n }\r\n }", "public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }", "public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }", "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "public function signup()\n {\n if ($this->validate()) {\n $user = new User();\n $user->username = $this->username;\n $user->first_name = $this->firstName;\n $user->last_name = $this->lastName;\n $user->email = $this->email;\n $user->setPassword($this->password);\n $user->generateAuthKey();\n $user->ip = Yii::$app->request->getUserIP();\n $user->ua = Yii::$app->request->getUserAgent();\n if ($user->save()) {\n $this->user = $user;\n $this->sendMail();\n return $user;\n }\n }\n\n return false;\n }", "public function signUp() {\n if ($this->request->is('post')) {\n\n $this->User->create();\n\n if ($this->User->save($this->request->data['signUp'])) {\n $this->Flash->set(__(\"Your user has been created\"),array(\n 'element' => 'success'\n ));\n return $this->redirect(array('action' => 'index'));\n }\n $this->Flash->set(\n __('The user could not be saved. Please, try again.',\n array(\n 'element' => 'error.ctp'\n ))\n );\n }\n\n $this->autoRender = false;\n }", "protected function _createUser()\n {\n $data = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $user = $this->Users->newEntity($data);\n\n $user->set('active', true);\n $user->set('role_id', 1);\n\n $this->Users->save($user);\n }", "public function action_signup()\r\n\t{\r\n\t\t$this->title = 'Sign Up';\r\n\t\t$user = ORM::factory('user');\r\n\t\t$errors = array();\r\n\t\tif ($_POST)\r\n\t\t{\r\n\t\t\t$user->values($_POST);\r\n\t\t\t$user->level_id = Model_User::DEFAULT_LEVEL;\r\n\t\t\tif ($user->check())\r\n\t\t\t{\r\n\t\t\t\t$user->save(); // must save before adding relations\r\n\t\t\t\t$user->add('roles', ORM::factory('role', array('name'=>'login')));\r\n\t\t\t\t$this->session->set($this->success_session_key, \"Your account is set up.\");\r\n\t\t\t\t$user->login($_POST);\r\n\t\t\t\t$user->create_sample_form();\r\n\t\t\t\t$this->request->redirect('account');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$errors = $user->validate()->errors('validate');\r\n\t\t\t}\r\n\t\t}\r\n\t\t$view = 'account/signup';\r\n\t\t$vars = array(\r\n\t\t\t'user' => $user,\r\n\t\t\t'errors' => $errors,\r\n\t\t);\r\n\t\t$this->template->content = View::factory($view)->set($vars);\r\n\t}", "public function signup (SignupRequest $request): Response\n {\n $response = User::create($request->all()); \n\n return response()->json([]); \n }", "public function create()\n {\n // TODO: Algún parámetro para no permitir el registro.\n \n // Es ya un usuario?\n if (Core::isUser())\n {\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('') . '\\';');\n return;\n }\n \n // Tenemos datos?\n if ($this->request->is('email'))\n {\n // Validamos los datos\n $form = Core::getLib('form.validator');\n $form->setRules(Core::getService('account.signup')->getValidation());\n \n // Si no hay errores procedemos a capturar los datos.\n if ($form->validate())\n {\n // Agregamos usuario\n if (Core::getService('account.process')->add($this->request->getRequest()))\n {\n if (Core::getParam('user.verify_email_at_signup'))\n {\n // Vamos a que verifique su email\n Core::getLib('session')->set('email', $this->request->get('email'));\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.verify') . '\\';');\n }\n else\n {\n // Iniciamos sesión\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.login') . '\\';');\n }\n \n return;\n }\n }\n }\n \n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.signup') . '\\';');\n }", "public function p_signup(){\n\t\tforeach($_POST as $field => $value){\n\t\t\tif(empty($value)){\n\t\t\t\tRouter::redirect('/users/signup/empty-fields');\n\t\t\t}\n\t\t}\n\n\t\t#check for duplicate email\n\t\tif ($this->userObj->confirm_unique_email($_POST['email']) == false){\n\t\t\t#send back to signup page\n\t\t\tRouter::redirect(\"/users/signup/duplicate\");\n\t\t}\n\n\t\t#adding data to the user\n\t\t$_POST['created'] = Time::now();\n\t\t$_POST['modified'] = Time::now();\n\n\t\t#encrypt password\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t#create encrypted token via email and a random string\n\t\t$_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string());\n\n\t\t#Insert into the db\n\t\t$user_id = DB::instance(DB_NAME)->insert('users', $_POST);\n\n\t\t# log in the new user\n\n\t\tsetcookie(\"token\", $_POST['token'], strtotime('+2 weeks'), '/');\n\n\t\t# redirect to home\n\t\tRouter::redirect('/users/home');\n\t\t\n\t}", "public function create(UserCreateRequest $request): User\n {\n // TODO: Implement create() method.\n }", "public function signupUser()\n { \n $user = User::findByUserEmail($this->email);\n if($user == null) { \n $user = new User();\n $user->user_full_name = $this->username;\n if(!empty($this->phone)) {\n $user->phone_number = $this->phone;\n }\n if(!empty($this->email)) { \n $user->email = $this->email;\n }\n $user->password_hash = md5($this->password);\n $user->login_method = 'email';\n $user->save();\n } \n return $user;\n }", "public function user_signup_new(Request $request)\n {\n $request->validate([\n 'first_name' => 'required',\n 'email' => 'required|string|unique:users',\n 'other_mobile_number' => 'required|integer|unique:users',\n 'selectType' => 'required',\n 'agree_check' => 'required|boolean',\n 'password' => 'required|string|confirmed'\n ]);\n\n $token = getenv(\"TWILIO_AUTH_TOKEN\");\n $twilio_sid = getenv(\"TWILIO_SID\");\n $twilio_verify_sid = getenv(\"TWILIO_VERIFY_SID\");\n $twilio = new Client($twilio_sid, $token);\n $twilio->verify->v2->services($twilio_verify_sid)\n ->verifications\n ->create(\"+91\".$request->other_mobile_number, \"sms\");\n\n $user = new User([\n 'name' => $request->first_name,\n 'last_name' => $request->last_name,\n 'email' => $request->email,\n 'usertype' => 3,\n 'userSelect_type' => $request->selectType,\n 'other_mobile_number' => $request->other_mobile_number,\n 'password' => bcrypt($request->password)\n ]);\n\n $user->save();\n eventtracker::create(['symbol_code' => '1', 'event' => $request->email.' created a new account as a User']);\n\n return response()->json([\n 'data' => $user,\n 'message' => 'Successfully created user!'\n ], 201);\n }", "public function create_user($username, $password, $email){\n\n\t$hashed_password = password_hash($password, PASSWORD_DEFAULT);\n\t$sql = \"INSERT INTO users VALUES \n\t(NULL, :type_id, :email, :username, :password, :created_at, :updated_at)\";\n\t$statement = $this->dbh->prepare($sql);\n\t$statement->execute([\n\t\t'type_id' => '2',\n\t\t'email' => $email,\n\t\t'username' => $username,\n\t\t'password' => $hashed_password,\n\t\t'created_at' => date('Y-m-d H:i:s'),\n\t\t'updated_at' => date('Y-m-d H:i:s')\n\t\t]);\n\techo \"signup succesfull\";\n\t // header(\"refresh:3;url=index.php\"); \n\t}", "function signUp() {\n if ($this->getRequestMethod() != 'POST') {\n $this->response('', 406);\n }\n \n $user = json_decode(file_get_contents('php://input'),true);\n if (!self::validateUser($user['username'], $user['password'])) {\n $this->response('', 406);\n }\n\t \n\t // check if user already exists\n\t $username_to_check = $user['username'];\n\t $query = \"select * from users where username='$username_to_check'\";\n\t $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\t\n\t if ($r->num_rows > 0) {\n\t \t$this->response('', 406);\n\t }\t\n\t\n $user['password'] = self::getHash($user['username'], $user['password']);\n $keys = array_keys($user);\n $columns = 'username, password';\n $values = \"'\" . $user['username'] . \"','\" . $user['password'] . \"'\"; \n $query = 'insert into users (' . $columns . ') values ('. $values . ');';\n \n if(!empty($user)) {\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => 'Success', 'msg' => 'User Created Successfully.', 'data' => $user);\n $this->response(json_encode($success),200);\n } else {\n $this->response('',204);\n }\n }", "public function register( CreateUserRequest $request ) {\n // store the user in the database\n $credentials = $request->only( 'name', 'email', 'password');\n $credentials[ 'password' ] = bcrypt( $credentials[ 'password' ] );\n $user = User::create($credentials);\n\n // now wire up the provider account (e.g. facebook) to the user, if provided.\n if ( isset( $request['provider'] ) && isset( $request['provider_id'] ) && isset( $request['provider_token'] ) ) {\n $user->accounts()->save( new Account( [\n 'provider' => $request['provider'],\n 'provider_id' => $request['provider_id'],\n 'access_token' => $request['provider_token'],\n ] ) );\n }\n\n // return the JWT to the user\n $token = JWTAuth::fromUser( $user );\n return response( compact( 'token' ), 200 );\n }", "public function signupAction()\n {\n $form = new SignUpForm();\n\n if ($this->request->isPost()) {\n\n if ($form->isValid($this->request->getPost()) != false) {\n\n $user = new Users();\n\n $user->assign(array(\n 'name' => $this->request->getPost('name', 'striptags'),\n 'email' => $this->request->getPost('email'),\n 'password' => $this->security->hash($this->request->getPost('password')),\n 'profilesId' => 2\n ));\n\n if ($user->save()) {\n return $this->dispatcher->forward(array(\n 'controller' => 'index',\n 'action' => 'index'\n ));\n }\n\n $this->flash->error($user->getMessages());\n }\n }\n\n $this->view->form = $form;\n }", "public function signupAction()\n {\n $form = new SignUpForm();\n\n if ($this->request->isPost()) {\n\n if ($form->isValid($this->request->getPost()) != false) {\n\n $user = new Users();\n\n $user->assign(array(\n 'name' => $this->request->getPost('name', 'striptags'),\n 'email' => $this->request->getPost('email'),\n 'password' => $this->security->hash($this->request->getPost('password')),\n 'profilesId' => 2\n ));\n\n if ($user->save()) {\n return $this->dispatcher->forward(array(\n 'controller' => 'index',\n 'action' => 'index'\n ));\n }\n\n $this->flash->error($user->getMessages());\n }\n }\n\n $this->view->form = $form;\n }", "public function createUserAction() {\n $this->authService->createUser();\n die();\n }", "public function doSingUp(SignupRequest $request)\n {\n $user = User::create([\n 'name' => $request->input('displayname'),\n 'email' => $request->input('email'),\n 'password' => bcrypt($request->input('password')),\n 'active' => 0\n ]);\n\n return redirect()->back()->withSuccess('User created');\n }", "public function create() {\n\n //Create validator for User registration form with all data sended. Load from model\n $validator = Validator::make(Input::all(), User::$rules_validator);\n \n //Only if request is send by form (post) procces to create user\n if (Request::isMethod('post')) {\n \n //Check fields data sended\n if ($validator->fails()) {\n //Redirecto to form with error\n $messages = $validator->messages()->all(\"<li>:message</li>\");\n $error = \"<ul>\". implode(\"\", $messages).\"</ul>\";\n return Redirect::to('/user/register')->with('error', $error)->withInput(Input::all());\n }\n \n //Pass validator, proccess to create User\n if( $user = User::_save( Input::all() ) ){\n //Auto login user created, is same that attemd method\n Auth::login($user);\n //Redirecto to profile\n return Redirect::intended(action('UserController@profile', array('username' => Auth::user()->username )))->with('notice', trans(\"app.welcome_message\", array(\"user\"=>Auth::user()->username) ));\n }else{\n //Error to try create User, redirecto to Registration form\n return Redirect::to('/user/register')->with('error', trans(\"app.error_creating\"))->withInput(Input::all());\n }\n }\n \n //Return to view\n return View::make('user.register');\n }", "public function createUser()\n {\n\n $userCurrent = $this->userValidator->validate();\n $userCurrent['password'] = Hash::make($userCurrent['password']);\n $userCurrent = $this->user::create($userCurrent);\n $userCurrent->roles()->attach(Role::where('name', 'user')->first());\n return $this->successResponse('user', $userCurrent, 201);\n }", "public function create() {\n $username = Input::get('reg_username');\n $email = Input::get('email');\n $password = Input::get('reg_password');\n $confirm_password = Input::get('confirm_password');\n\n // Make sure that both passwords are identical\n if (strcmp($password, $confirm_password) == 0) {\n $hashed_password = Hash::make($password);\n try {\n $user = new User;\n $user -> username = $username;\n $user -> email = $email;\n $user -> password = $hashed_password;\n $user -> save();\n } catch (\\Illuminate\\Database\\QueryException $e) {\n return Redirect::route('register') -> with(array(\n 'alert-message' => 'Error: Failed to register user in database.',\n 'alert-class' => 'alert-danger'\n ));\n }\n\n // Login the new user automatically\n $user = User::where('username', '=', $username) -> first();\n Auth::login($user);\n\n return Redirect::route('home') -> with(array(\n 'alert-message' => 'Welcome! You have successfully created an account, and have been logged in.',\n 'alert-class' => 'alert-success'\n ));\n }\n\n return Redirect::route('register') -> with(array(\n 'alert-message' => 'The attempt to create an account was unsuccessful!',\n 'alert-class' => 'alert-danger'\n ));\n }", "public function signup()\n\t{\n\t\t$data = $this->check($this->as_array());\n\t\t\n\t\t$user = Sprig::factory('user');\n\t\t$user->values($data);\n\t\treturn $user->signup();\n\t}", "public function createUser()\n {\n }", "public function actionCreate()\n\t{\n\t\t$this->addToTitle(\"Create Account\");\n\t\t$model=new User('create');\n\n\t\tif(isset($_POST['User']))\n\t\t{\n\t\t\t$model->attributes=$_POST['User'];\n\t\t\t$temp_passwd = $_POST['User']['password'];\n\t\t\t$temp_usernm = $_POST['User']['email'];\n\t\t\tif($model->validate()&&$model->save())\n\t\t\t{\n\t\t\t\t//log create new uesr\n\t\t\t\tYii::log(\"new user sign up, email:$model->email\");\n\t\t\t\t\n\t\t\t\t$emailServe = new EmailSending();\n\t\t\t\t$emailServe->sendEmailConfirm($model);\n\t\t\t\t\n\t\t\t\t$model->moveToWaitConfirm();\n\t\t\t\t$this->redirect(array('email/waitConfirm'));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array('model'=>$model));\n\t}", "public function create()\n\t{\n\t\t$user = new User;\n\n\t\t$user->username \t\t= Input::get('username');\n\t\t$user->password \t\t= Hash::make(Input::get('password'));\n\t\t$user->email \t\t \t= Input::get('email');\n\n\t\t$user->save();\n\n\t\treturn Redirect::to('user/add')->with('sukses', 'Data User Sudah Tersimpan');\n\t}", "public function signup()\n {\n if (isset($_POST['signUp'])) {\n $userExist = $this->checkIfUserExist($_POST['login']);\n $userPassword = $_POST['password'];\n \n if ($userExist === false) {\n if ($userPassword === $_POST['passwordConfirm']) {\n $hashPassword = password_hash($userPassword, PASSWORD_DEFAULT);\n \n $affectedUser = $this->usersManager->setNewUser($_POST['firstName'], $_POST['lastName'], $_POST['login'], $hashPassword, $_POST['email'], 'reader');\n \n if ($affectedUser === false) {\n header('Location: auth&alert=signup');\n exit();\n } else {\n header('Location: auth&alert=success');\n exit();\n }\n } else {\n header('Location: auth&alert=passwords');\n exit();\n }\n } else {\n header('Location: auth&alert=userSignup');\n exit();\n }\n } else {\n throw new Exception($this->datasError);\n }\n\n }", "public function store(UserCreateRequest $request)\n {\n\t\t\t$user = User::create([\n\t\t\t\t'name' \t\t\t\t=> $request->input('name'),\n\t\t\t\t'lastname' \t\t=> $request->input('lastname'),\n\t\t\t\t'idNumber'\t\t=> $request->input('idNumber'),\n\t\t\t\t'email' \t\t\t=> $request->input('email'),\n\t\t\t\t'phone' \t\t\t=> $request->input('phone'),\n\t\t\t\t'address' \t\t=> $request->input('address'),\n\t\t\t\t'birthdate' \t=> $request->input('birthdate'),\n\t\t\t\t'category_id' => $request->input('category_id'),\n\t\t\t\t'password'\t\t=> 'password', // I NEED TO ADD LOGIN FUNCTIONALITY\n\t\t\t\t'is_admin'\t\t=> 0,\n\t\t\t\t'status' \t\t\t=> 'non live' // As default in the db?\n\t\t\t]);\n\n\t\t\treturn redirect('/users')->with('success', 'User Registered');\n }", "public function createUser()\n {\n return User::factory()->create();\n }", "public function signup ()\n {\n $baseUrl = Config::get('app.baseUrl');\n\n /**\n * Daten validieren\n */\n $validator = new Validator();\n $validator->validate($_POST['firstname'], 'Firstname', true, 'text', 2, 255);\n $validator->validate($_POST['lastname'], 'Lastname', true, 'text', 2, 255);\n $validator->validate($_POST['email'], 'Email', true, 'email');\n $validator->validate($_POST['password'], 'Passwort', true, 'password');\n $validator->compare($_POST['password'], $_POST['password2']);\n\n /**\n * Fehler aus dem Validator holen\n */\n $errors = $validator->getErrors();\n\n /**\n * Nachdem die eingegebenen Daten nun Validiert sind, möchten wir wissen, ob die Email-Adresse schon in unserer\n * Datenbank existiert oder nicht. Dazu nutzen wir die findByEmail-Methode der User Klasse, die wir extra so\n * gebaut haben, dass sie false zurück gibt, wenn kein Eintrag gefunden wurde. Existiert die Email-Adresse schon\n * und kann somit nicht mehr verwendet werden, geben wir einen Fehler aus.\n */\n if (User::findByEmail($_POST['email']) !== false) {\n $errors[] = \"Diese Email-Adresse wird bereits verwendet.\";\n }\n\n /**\n * Wenn Validierungsfehler aufgetreten sind, speichern wir die Fehler zur späteren Anzeige in die Session und\n * leiten zurück zum Registrierungsformular, wo die Fehler aus der Session angezeigt werden.\n */\n if (!empty($errors)) {\n Session::set('errors', $errors);\n header(\"Location: $baseUrl/sign-up\");\n exit;\n }\n\n /**\n * Wenn kein Validierungsfehler auftritt, wollen wir den Account speichern\n */\n $user = new User();\n $user->firstname = $_POST['firstname'];\n $user->lastname = $_POST['lastname'];\n $user->email = $_POST['email'];\n $user->setPassword($_POST['password']);\n $user->save();\n\n /**\n * Hier müssten wir eigentlich Fehler, die beim Speichern in die Datenbank auftreten könnten, handeln. Wir\n * werden aber für Übersichtichkeit und Einfachheit darauf verzichten.\n */\n\n /**\n * Die PHPMailer Klasse ist eine externe Klasse, die wir als Anbieter von dem MVC für unsere Anwender\n * mitliefern. Sie unterstützt mehrere Methoden Emails zu verschicken, mehr dazu in der Dokumentation:\n * https://github.com/PHPMailer/PHPMailer\n *\n * Grundsätzlich werdet ihr am Anfang eurer Developer-Karriere selbst keine Emails verschicken müssen sondern\n * über das verwendete Framework (bspw. Laravel) Emails zusammenbauen.\n *\n * Zum Testen von Emails bieten sich dienste wie Ethereal an, die genau dafür entwickelt wurden:\n * https://ethereal.email/\n */\n if (PHPMailer::ValidateAddress($user->email)) {\n $mail = new PHPMailer();\n $mail->isMail();\n $mail->AddAddress($user->email);\n $mail->SetFrom('[email protected]');\n $mail->Subject = 'Herzlich Wilkommen!';\n $mail->Body = 'Sie haben sich erfolgreich registriert!\\n\\rDanke dafür! :*';\n\n $mail->Send();\n\n header(\"Location: $baseUrl/login\");\n exit;\n } else {\n /**\n * Erkennt PHPMailer keine gültige Email-Adresse, müsste hier ein besserer Fehler ausgegeben werden. Wir\n * könnten beispielsweise einen eigenen Fehler-View bauen (ähnlich wie 404.view.php), werden das aber\n * vorerst einmal noch nicht machen und uns auf die wesentlicheren Dinge konzentrieren.\n */\n die('PHPMailer Error');\n }\n }", "public function postSignUp($request, $response, $args){\n // https://www.youtube.com/watch?v=5VuBJ2yaXpk&list=PLfdtiltiRHWGc_yY90XRdq6mRww042aEC&index=11\n $users = $this->container->get('UserModel');\n $inputVars= $request->getParsedBody();\n $values['username']=$inputVars['email'];\n $values['hashed']=password_hash($inputVars['password'], PASSWORD_DEFAULT);\n\n if ($result=$users->insert($values)){\n echo \"Insertado:\";\n die();\n \n }else{\n echo \"Error\";\n die();\n }\n }", "public function store(CreateUserRequest $request)\n {\n $data = $request->only('name', 'email', 'password');\n $data['password'] = Hash::make($data['password']);\n $data['user_type'] = $request->get('is_admin') ? User::$ADMIN : User::$DATAENTRANT;\n User::create($data);\n return redirect()->to('users')->withSuccess('User Account Created');\n }", "public function create()\n {\n $this->validate($this->request, User::createRules());\n\n $user = new User;\n $user->name = $this->request->name;\n $user->phone = $this->request->phone;\n $user->dob = $this->request->dob;\n $user->image = $this->request->image_path;\n $plainPassword = $this->request->password;\n $user->password = app('hash')->make($plainPassword);\n\n $user->save();\n\n //return successful response\n return $this->response(201,\"User\", $user);\n }", "protected function createUser()\n {\n $this->question('Enter your details for the admin user.');\n\n $user = \\App\\User::create([\n 'name' => $this->ask('Name', 'Admin'),\n 'email' => $this->ask('Email address', 'noreply@'.str_replace(['http://', 'https://'], '', config('app.url'))),\n 'password' => Hash::make($this->ask('Password')),\n ]);\n \n $this->info(\"Admin user created successfully. You can log in with username {$user->email}\");\n }", "public function create ( Request $request )\n {\n\n\n if( $request->isMethod( 'post' ) )\n {\n\n try\n {\n\n $user = new User();\n $user->name = $request->input( 'name' );\n $user->email = $request->input( 'email' );\n $user->password = bcrypt( $request->input( 'password' ) );\n $user->save();\n\n }\n catch( Exception $ex ) \n {\n\n return(\n back()\n ->with(\n [\n 'flash_error' => 'Failed to create new user.',\n 'flash_exception' => $ex->getMessage()\n ]\n )\n );\n\n }\n\n return(\n back()\n ->with( [ 'flash_success' => 'New Users Added' ] )\n );\n\n }\n else\n {\n return(\n view('users.create')\n );\n }\n\n }", "public function create(User $user)\n {\n }", "public function signupAction()\n {\n $this->tag->setTitle(__('Sign up'));\n $this->siteDesc = __('Sign up');\n\n if ($this->request->isPost() == true) {\n $user = new Users();\n $signup = $user->signup();\n\n if ($signup instanceof Users) {\n $this->flash->notice(\n '<strong>' . __('Success') . '!</strong> ' .\n __(\"Check Email to activate your account.\")\n );\n } else {\n $this->view->setVar('errors', new Arr($user->getMessages()));\n $this->flash->warning('<strong>' . __('Warning') . '!</strong> ' . __(\"Please correct the errors.\"));\n }\n }\n }", "public function action_register()\n\t{\n Auth::create_user(\n 'promisemakufa',\n 'pass123',\n '[email protected]',\n 1,\n array(\n 'fullname' => 'P K systems',\n )\n );\n\n $this->template->title = \"User\";\n $this->template->content = View::forge('user/register');\n }", "public function signup(UserRegisterRequest $request)\n {\n $user = new User([\n 'name' => $request->name,\n 'email' => $request->email,\n 'password' => bcrypt($request->password),\n ]);\n\n $user->save();\n\n return response()->json(['message' => 'Successfully created user!'], 201);\n }", "public function actionCreateUser()\n {\n $model = new User();\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n $model->setPassword($model->password);\n $model->generateAuthKey();\n $model->generateEmailConfirmToken();\n if ($model->save()) {\n // нужно добавить следующие три строки:\n // $auth = Yii::$app->authManager;\n // $authorRole = $auth->getRole('superadmin');\n // $auth->assign($authorRole, $user->getId());\n return $this->redirect(['view-user', 'id' => $model->id]);\n }else{\n print_arr($model->errors);\n die('A');\n }\n } else {\n return $this->render('user/create', [\n 'model' => $model,\n ]);\n }\n }", "public function create(CreateUserRequest $request) {\n $user = $request->commit();\n\n //Trigger user edited event\n event(new UserCreated($user));\n\n //Reloads page\n return redirect()->action('Platform\\UserController@edit', $user)->with('alert', [\n 'type' => 'success',\n 'message' => 'User created'\n ]);\n }", "public function signupAction()\n {\n // check request method\n if (Router::getMethod() == 'POST') {\n $username = Router::getParam('username');\n $password = Router::getParam('password');\n\n // fill user object with data and try to save\n $user = new User($username, $password, Router::getIp());\n if (!$user->save()) {\n // add errors to display\n $this->setMessage($user->getErrors(), 'error');\n $this->setVar('username', $user->getUsername());\n } else {\n Router::redirect('index', 'signin');\n }\n } elseif (isset($_SESSION['userId'])) {\n Router::redirect('index', 'index');\n }\n\n $this->setVar('title', 'Sign up page');\n $this->render('signup');\n }", "public function sign_up()\n {\n\n }", "public function postCreate() {\n \t$validator = Validator::make(Input::all(), User::$rules);\n\n \t// i made a user with [email protected], goodbye\n \tif ($validator->passes()) {\n \t\t// validation has passed, save user in DB\n \t\t$user = new User;\n \t\t$user->first_name = Input::get('first_name');\n \t\t$user->last_name = Input::get('last_name');\n \t\t$user->email = Input::get('email');\n \t\t$user->password = Hash::make(Input::get('password'));\n \t\t$user->save();\n\n \t\treturn Redirect::to('users/login')->with('message', '<div class=\"alert alert-success\" role=\"alert\">Thanks for registering!</div>');\n \t}\n \telse {\n \t\t// validation has failed, display error messages\n \t\treturn Redirect::to('users/register')->with('message', '<div class=\"alert alert-warning\" role=\"alert\">The following errors occurred</div>')->withErrors($validator)->withInput();\n \t}\n }", "public function signup()\n\t{\n $user = new User();\n\n // If user can succesfully signup then signin\n if ($user->signup(Database::connection(), $_POST['username'], $_POST['password']))\n {\n $_SESSION['id'] = $user->id;\n return True;\n }\n\n return False;\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }" ]
[ "0.79961836", "0.77646565", "0.77646565", "0.75228095", "0.75228095", "0.75228095", "0.75228095", "0.75188625", "0.7490532", "0.7429168", "0.73887247", "0.73157823", "0.7309529", "0.7301423", "0.72656256", "0.7247693", "0.7230459", "0.7227161", "0.71925914", "0.71906954", "0.7155916", "0.7155916", "0.71422154", "0.7136544", "0.7135537", "0.7131015", "0.7121868", "0.7093383", "0.7084045", "0.7060224", "0.7058189", "0.7040714", "0.70275706", "0.7012228", "0.70099896", "0.7005725", "0.6991058", "0.69845086", "0.6974807", "0.69659567", "0.6963018", "0.69573146", "0.69475174", "0.69438225", "0.69320965", "0.6929795", "0.69152284", "0.69103277", "0.6909171", "0.69077444", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797", "0.6906797" ]
0.0
-1
Load a user by id.
public static function LoadById($user_signup_id) { $result = &get_instance()->db->get_where("UserSignup", array("user_signup_id" => $user_signup_id)); $result = $result->result(); return count($result) != 0 ? UserSignup_model::LoadWithData($result[0]) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadFromId(){\r\n\t\t$id = $this -> getUserId();\r\n\t\tif(is_numeric($id))\r\n\t\t\t$this -> loadFromQuery(\"select * from UserTab where UserId=\".$id);\r\n\t }", "protected function loadUser($id = null) {\n if ($this->_model === null) {\n if ($id !== null)\n $this->_model = Users::model()->findByPk($id);\n }\n //to check role after - PDQuang\n// if(!isset($this->_model))\n// $this->_model = new Users;\n// close 2 rows above by Nguyen Dung\n return $this->_model;\n }", "public function loadUserDetail($id) {\n \t$_user = new class_User();\n \n \t$user = $_user->getUserDetail($id);\n \n \treturn $user;\n }", "public static function loadByPK($id)\n {\n $model = new User_Model();\n return $model->getGrid()->getByPk($id);\n }", "private function getUserById($id) {\n\t\t$em = $this->getDoctrine()->getManager()->getRepository('AppBundle\\Entity\\User');\n\n\t\t$user = $em->findOneById($id);\t\n\t\t\n\t\treturn $user;\n\t}", "public function load($id) {\n\n // Retrieve data\n $result = $this->_buildQuery($id)->get(XCMS_Tables::TABLE_USERS);\n if ($result->num_rows()) {\n\n // Populate model\n $this->set($result->row());\n\n // Load attributes\n $this->attributes->init(XCMS_Tables::TABLE_USERS_ATTR, \"user\");\n $this->attributes->load($this->get(\"id\"));\n\n return $this;\n\n }\n\n return null;\n\n }", "public function loadUser($id=null)\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif($id!==null || isset($_GET['id']))\n\t\t\t\t$this->_model=User::model()->findbyPk($id!==null ? $id : $_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}", "abstract public function fetchUserById($id);", "public function get($id) {\n $sql =<<<SQL\nSELECT * from $this->tableName\nwhere idUser=?\nSQL;\n\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n\n $statement->execute(array($id));\n if($statement->rowCount() === 0) {\n return null;\n }\n\n return new User($statement->fetch(PDO::FETCH_ASSOC));\n }", "public static function getUserObjectFromId($id){\n $pdo = static::getDB();\n\n $sql = \"select * from users where user_id = :id\";\n\n $result = $pdo->prepare($sql);\n \n $result->execute([$id]);\n\n $user_array = $result->fetch(); \n\n if($user_array){\n if($user_array['USER_ROLE'] == Trader::ROLE_TRADER){\n return static::getTraderObjectFromEmail($user_array['EMAIL']);\n }\n return new User($user_array);\n }\n return false;\n }", "public static function getUserById($id)\n\t{\n\t\t$user = self::where('ID',$id)->first();\n\t\treturn $user;\n\t}", "function load( $id )\r\n\t{\r\n\r\n\t\t$sql = \"SELECT * FROM user_profiles WHERE user_id = $id\";\r\n\t\t$row = $this->database->query_firstrow( $sql );\r\n\t\r\n\t\t$this->id = $row['id'];\r\n\t\t$this->user_id = $row['user_id'];\r\n\t\t$this->username = $row['username'];\r\n\t\t$this->gender = $row['gender'];\r\n\t\t$this->dob = $row['dob'];\r\n\t\t$this->country_id = $row['country_id'];\r\n\t\t$this->picture = $row['picture'];\r\n\t\t$this->link = $row['link'];\r\n\t\t$this->phone = $row['phone'];\r\n\t\t$this->likes = $row['likes'];\r\n\t\t$this->dislikes = $row['dislikes'];\r\n\t\t$this->hobbies = $row['hobbies'];\r\n\t\t$this->is_active = $row['is_active'];\r\n\t\t$this->created_on = $row['created_on'];\r\n\t\t$this->last_modified_on = $row['last_modified_on'];\r\n\t}", "public function getOne($id)\n {\n return $this->user->find($id);\n }", "public function LoadUser($userId)\r\n {\r\n $queryUser = \"SELECT * FROM users WHERE user_id=:user_id\";\r\n $user = $this->sqlDataBase->prepare($queryUser);\r\n $user->execute(array(':user_id'=>$userId));\r\n $userInfo = $user->fetch(PDO::FETCH_ASSOC);\r\n $this->userId = $userId;\r\n $this->userName = $userInfo['user_name'];\r\n $this->userRole = $userInfo['user_role'];\r\n $this->authKey = $userInfo['auth_key'];\r\n }", "public function getUserById($id) {\n\t\t\n\t}", "public function loadById($id);", "public function loadById($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 load($id);", "public function load($id)\n {\n $record =& $this->getTable();\n if ($record->load((int)$id)) {\n $this->id = $record->id;\n $this->userId = $record->user_id;\n $this->profileId = $record->profile_id;\n $this->paymentId = $record->payment_id;\n $this->shippingId = $record->shipping_id;\n }\n }", "public function getUser($id);", "function loaded_user(string $id): bool { return isset($this->users[$id]); }", "public static function getByID($id) {\r\n // Create a new user object\r\n $user = new User();\r\n // Get the data from the database for the user by ID\r\n $user->get([\"id\" => $id, \"LIMIT\" => 1]);\r\n // return the user object\r\n return $user;\r\n }", "public static function loadById(?int $id);", "public function getUser($id)\r\n {\r\n $userRepository = $this->entityManager->getRepository(User::class);\r\n $user = $userRepository->find($id);\r\n\r\n return $user;\r\n }", "public static function findUser($id)\r\n {\r\n $app = \\Slim\\Slim::getInstance();\r\n $user = User::find($id);\r\n if(!$user){\r\n $app->halt('404',json_encode(\"Use not found.\"));\r\n }\r\n return $user;\r\n }", "public function getUserById($id)\n {\n $id = (int) $id;\n $request = $this->_db->query('SELECT * FROM user WHERE user_id = '. $id);\n\n return new User($request->fetch(PDO::FETCH_ASSOC));\n }", "public static function load(int $id);", "public function get($id) {\n $sql =<<<SQL\nSELECT * from clue_user\nwhere id=?\nSQL;\n\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n\n $statement->execute(array($id));\n if($statement->rowCount() === 0) {\n return null;\n }\n\n return new User($statement->fetch(\\PDO::FETCH_ASSOC));\n }", "public function loadId($id){\n\t\t$model=new Model();\n\t\t$resultado=$model->select(\"SELECT * FROM tb_usuarios WHERE idusuario = :ID\",array(\":ID\"=>$id));\n\t\tif (count($resultado)>0) {\n\t\t\t$this->setData($resultado[0]);\n\t\t}\n\t}", "public function getUser($id) {\n return $this->getEntityManager()\n ->getRepository('Alt68\\Entities\\User')\n ->findOneBy(array(\n 'id' => $id));\n }", "public static function findById($id) {\n try {\n $db = Database::getInstance();\n $sql = \"SELECT * FROM `User` WHERE username = :username\";\n $stmt = $db->prepare($sql);\n $stmt->execute([\"username\" => $id]);\n \n if ($stmt->rowCount() === 0)\n return null;\n \n return new User($stmt->fetch(PDO::FETCH_ASSOC));\n } catch (PDOException $e) {\n exitError(500, \"Internal error.\");\n }\n }", "public static function get_user($user_id);", "public static function get( $id ) {\n\n $user = new \\Models\\User( $id );\n $user->load();\n echo json_encode($user);\n return;\n }", "public function loadById(int $id) : bool\n\t{\n\t\t$this->loadUser(['id' => $id]);\n\n\t\treturn true;\n\t}", "public function findById($id){\n $user = $this->DB->query(\"SELECT u.* FROM user u WHERE u.id = $id\")->fetch(PDO::FETCH_ASSOC);\n return $user;\n }", "public function show($id)\n {\n return user::find($id);\n }", "public function findByID($id)\n {\n $i = $this->getInstance(); \n\n $result = $i->getSoapClient()\n ->setWsdl($i->getConfig('webservice.user.wsdl'))\n ->setLocation($i->getConfig('webservice.user.endpoint'))\n ->GetUser(array(\n 'UserId'=>array(\n 'Id'=>intval($id),\n 'Source'=>'Desire2Learn'\n )\n ));\n \n if ( $result instanceof stdClass && isset($result->User) && $result->User instanceof stdClass )\n {\n $User = new D2LWS_User_Model($result->User);\n return $User;\n }\n else\n {\n throw new D2LWS_User_Exception_NotFound('OrgDefinedId=' . $id);\n }\n }", "public function getUser($id = null);", "public function show($id)\n\t{\n\t\treturn User::find($id);\n\t}", "public function getById($id)\n {\n $this->logger->info(__CLASS__.\":\".__FUNCTION__);\n return $this->em->getRepository('AppBundle:User')->find($id);\n }", "public function get(int $id): User\n {\n return $this->model->findOrFail($id);\n }", "public static function findById($id)\n {\n self::createTableIfNeeded();\n\n try\n {\n $response = Connexion::getConnexion()->getPdo()->query(\"SELECT * FROM mb_user WHERE id=\" . $id);\n \n $dataArray = $response->fetchAll();\n }\n catch(Exception $e)\n {\n return null;\n }\n\n if(empty($dataArray) == false)\n {\n $user = new User();\n\n $user->setId($dataArray[0]['id']);\n $user->setUsername($dataArray[0]['username']);\n $user->setEmail($dataArray[0]['email']);\n $user->setPassword($dataArray[0]['password']);\n $user->setToken($dataArray[0]['token']);\n $user->setRole($dataArray[0]['role']);\n $user->setLocked($dataArray[0]['locked']);\n\n return $user;\n }\n else\n {\n return null;\n }\n }", "public function getById($id) {\n\n $sql = \"SELECT * FROM user WHERE id = {$id}\";\n\n return $this->query($sql);\n }", "function findUser($id) {\n\n $conn = \\Database\\Connection::connect();\n\n try {\n $sql = \"SELECT * FROM user WHERE _user_Id = ?;\";\n $q = $conn->prepare($sql);\n $q->execute(array($id));\n $user = $q->fetchObject('\\App\\User');\n }\n catch(\\PDOException $e)\n {\n echo $sql . \"<br>\" . $e->getMessage();\n }\n\n \\Database\\Connection::disconnect();\n\n return $user;\n }", "public function loadUser($anyId) {\n if(is_numeric($anyId)) { // its number - id\n if(strlen($anyId > 10))\n return $this->loadUserByGoogleId($anyId);\n else\n return $this->loadUserById($anyId);\n }\n else\n return $this->loadUserByUsername($anyId);\n }", "public function getById($id)\n {\n $user = $this->userFactory->create();\n $this->userResource->load($user, $id);\n\n return $user;\n }", "public function findUserById($id)\n {\n $sql = \"SELECT rowid, * FROM USER WHERE rowid=?\";\n $row = $this->getDb()->fetchAssoc($sql, array($id));\n if ($row){\n return $this->buildDomainObject($row);\n }else{\n throw new UsernameNotFoundException('User not found.');\n }\n }", "public function show($id)\n {\n return User::find($id);\n }", "public function show($id)\n {\n return User::find($id);\n }", "public function show($id)\n {\n return User::find($id);\n }", "public function show($id)\n {\n return User::find($id);\n }", "public function show($id)\n {\n return User::find($id);\n }", "public function show($id)\n {\n return User::find($id);\n }", "public function show($id)\n {\n return User::find($id);\n }", "public function find(int $id): User\n {\n $array = $this->storage->read($id);\n\n if ($array === null) {\n $message = sprintf('User with ID #%d does not exist.', $id);\n throw new \\InvalidArgumentException($message);\n }\n\n return User::arrayToObject($array);\n }", "public function findUserById($id)\n {\n return $this->userDao->findUserById($id);\n }", "public function getById(string $id): User;", "public function getUser($id)\n {\n return $this->dbService->getById($id, $this->userClass);\n }", "public function user_get_by_id($id)\n {\n $query = \"SELECT *\n \t FROM \" . $this->db_table_prefix . \"users\n \t WHERE id = $id\";\n \n $result = $this->commonDatabaseAction($query);\n \n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n// return mysql_fetch_assoc($result);\n return $this->sqlAssoc;\n }\n else\n {\n return null;\n }\n }", "function loadFromId()\n {\n\t global $wgMemc;\n\t if ( $this->mId == 0 ) {\n\t\t $this->loadDefaults();\n\t\t return false;\n\t } \n\n\t # Try cache\n\t $key = wfMemcKey( 'cedar_user', 'id', $this->mId );\n\t $data = $wgMemc->get( $key );\n\t \n\t if ( !is_array( $data ) || $data['mVersion'] < MW_CEDAR_USER_VERSION ) {\n\t\t # Object is expired, load from DB\n\t\t $data = false;\n\t }\n\t \n\t if ( !$data ) {\n\t\t wfDebug( \"Cache miss for user {$this->mId}\\n\" );\n\t\t # Load from DB\n\t\t if ( !$this->loadFromDatabase() ) {\n\t\t\t # Can't load from ID, user is anonymous\n\t\t\t return false;\n\t\t }\n\n\t\t # Save to cache\n\t\t $data = array();\n\t\t foreach ( self::$mCacheVars as $name ) {\n\t\t\t $data[$name] = $this->$name;\n\t\t }\n\t\t $data['mVersion'] = MW_CEDAR_USER_VERSION;\n\t\t $wgMemc->set( $key, $data );\n\t } else {\n\t\t wfDebug( \"Got user {$this->mId} from cache\\n\" );\n\t\t # Restore from cache\n\t\t foreach ( self::$mCacheVars as $name ) {\n\t\t\t $this->$name = $data[$name];\n\t\t }\n\t }\n\t return true;\n }", "public function userbyid($id)\n {\n $sql=\"SELECT * FROM users where id='$id'\";\n\t $result = $this->db->query($sql);\n\t return $result->row();\n \n }", "protected function getUser($id)\n {\n $sql = new Sql($this->dbAdapter);\n $select = $sql->select('tbluser');\n $select->where(array('id = ?'=> $id));\n \n $stmt = $sql->prepareStatementForSqlObject($select);\n $result = $stmt->execute();\n \n $user = new User();\n $user->exchangeArray($result->current());\n return $user;\n }", "public function show($id)\n {\n return \\App\\User::find($id);\n }", "public function findById($id) {\n $sql = \"select * from user where user_id=?\";\n $row = $this->getDb()->fetchAssoc($sql, array($id));\n\n if ($row)\n return $this->buildDomainObject($row);\n else\n throw new UsernameNotFoundException(sprintf('User \"%s\" not found.', \"log error\"));\n }", "public static function user($id = 0)\n\t{\n\t\t// Get the user by id\n\t\tif ($id)\n\t\t\treturn User::model()->active->findbyPk($id);\n\t\telse\n\t\t{\n\t\t\t// Return false if user is guest\n\t\t\tif (Yii::ap()->user->isGuest)\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn User::model()->active->findbyPk(Yii::app()->user->id);\n\t\t}\n\t}", "public function getById(int $id): User;", "public static function get($id){\n $result = mysqli_query(Connection::getConnection(), \"Select * from users where id = '{$id}'\");\n if(mysqli_num_rows($result) == 1) {\n $user = mysqli_fetch_assoc($result);\n return new User(\n $user['id'],\n $user['name'],\n $user['email'],\n $user['type'],\n $user['patchImage']);\n }\n return false;\n }", "public function getUser($id)\n {\n if (!$id) {\n throw new \\InvalidArgumentException($this->lang['invalid_id']);\n }\n $user = $this->userdao->findUserByID($id);\n //$responseData = $this->createGetUserLinks($user);\n return $user;\n }", "public static function getUser(int $id)\n {\n $sql = \"SELECT * FROM `user` WHERE id = :id\";\n\n $db = new DB();\n $connectionDB = $db->getConnection();\n $result = $connectionDB->prepare($sql);\n $result->bindParam(\":id\", $id, PDO::PARAM_INT);\n $result->execute();\n $result->setFetchMode(PDO::FETCH_ASSOC);\n $result = $result->fetch();\n\n $user = null;\n if ($result) {\n $user = new User(\n $result['login'],\n $result['password'],\n $result['first_name'],\n $result['second_name'],\n $result['sex'],\n $result['date_of_birth']\n );\n\n $user->id = $id;\n $user->role = $result['role'];\n $user->created_at = $result['created_at'];\n $user->updated_at = $result['updated_at'];\n }\n return $user;\n }", "public function actionGet($id) {\n\t\treturn $this->txget ( $id, \"app\\models\\User\" );\n\t}", "public static function getUserById($id)\n {\n $db = init_db();\n\n $req = $db->prepare(\"SELECT * FROM user WHERE id = ?\");\n $req->execute(array($id));\n\n $db = null;\n return $req->fetch();\n }", "public static function getUserById($id)\n {\n\n if ($id) {\n\n $db = Db::getConnection();\n $sql = \"SELECT * FROM user WHERE id = :id\";\n\n $result = $db->prepare($sql);\n $result->bindParam(':id', $id, PDO::PARAM_INT);\n // Get assoc array mode\n $result->setFetchMode(PDO::FETCH_ASSOC);\n $result->execute();\n\n return $result->fetch();\n }\n }", "static function findById($id) {\n\n $result = get_record('block_courseprefs_users', 'id', $id);\n\n if (!$result) {\n return null;\n }\n\n return new CoursePrefsUser($result->username, $result->firstname, $result->lastname,\n $result->idnumber, $result->year, $result->college, $result->reg_status, \n $result->classification, $result->keypadid, $result->ferpa, \n $result->degree_candidacy, $result->anonymous, $result->format, \n $result->numsections, $result->hidden, $result->cr_delete, $result->id,\n $result->update_flag, $result->moodleid);\n }", "public function get($id = null)\n {\n return $id === null ? $this['user'] : $this->getUserRepository()->find($id);\n }" ]
[ "0.7790831", "0.7673898", "0.7507722", "0.74440145", "0.7401554", "0.7377561", "0.7366506", "0.7276919", "0.72493", "0.7241848", "0.72263557", "0.71842587", "0.71654654", "0.7155801", "0.71489716", "0.7134274", "0.7134274", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.7123191", "0.71216637", "0.71119434", "0.7106636", "0.7093711", "0.707606", "0.707418", "0.7068246", "0.7041187", "0.703889", "0.703345", "0.7016181", "0.7008337", "0.6994959", "0.6992791", "0.6959314", "0.69588524", "0.69498295", "0.6943801", "0.6941561", "0.6923234", "0.6911003", "0.6900566", "0.6899426", "0.6898881", "0.6896349", "0.6894265", "0.68941545", "0.6888759", "0.6888009", "0.6884786", "0.6884786", "0.6884786", "0.6884786", "0.6884786", "0.6884786", "0.6884786", "0.6880892", "0.6877995", "0.6873374", "0.6868775", "0.68230283", "0.6820399", "0.68030334", "0.6800562", "0.6790657", "0.6783866", "0.678092", "0.6764358", "0.6762873", "0.6755521", "0.675422", "0.6750792", "0.67486125", "0.6745255", "0.6744795", "0.6741275" ]
0.0
-1
Load a user with an object.
public static function LoadWithData($row) { return new Users_model( $row->user_signup_id, $row->email, $row->name, $row->school, $row->city, $row->exam ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadUser(ArenaAuthUser $user): ArenaAuthUser;", "public function __loadUser()\n {\n\t$facebook = $this->fb;\n\t$this->user = $facebook->api(\"/me\", \"GET\");\n\t$this->userid = $facebook->getUser();\n\treturn;\n }", "function load($oUser)\n {\n $this->p_oUser = $oUser;\n $this->refresh();\n }", "protected function loadUser()\n {\n $sixreps = new Sixreps(Yii::app()->params['api_host']);\n\n try {\n list($body, $info) = $sixreps->get('/users/me', array(\n 'access_token' => Yii::app()->user->user_token,\n ));\n }\n catch (Exception $e) {}\n\n $this->_model = $body;\n\n return $this->_model;\n }", "public function loadUserByUsername($username);", "protected function loadUser($id = null) {\n if ($this->_model === null) {\n if ($id !== null)\n $this->_model = Users::model()->findByPk($id);\n }\n //to check role after - PDQuang\n// if(!isset($this->_model))\n// $this->_model = new Users;\n// close 2 rows above by Nguyen Dung\n return $this->_model;\n }", "function user($object = false)\n\t{\n\t\tglobal $user;\n\n\t\tif($object !== false)\n\t\t{\n\t\t\t$user = $object;\n\t\t\treturn $user;\n\t\t}\n\n\t\tif(isset($_COOKIE['user']) && !$user)\n\t\t{\n\t\t\t$user = dbGetSingle('its_users', 'id = ' . intval($_COOKIE['user']));\n\t\t}\n\n\t\treturn $user;\n\t}", "public function LoadUser($userId)\r\n {\r\n $queryUser = \"SELECT * FROM users WHERE user_id=:user_id\";\r\n $user = $this->sqlDataBase->prepare($queryUser);\r\n $user->execute(array(':user_id'=>$userId));\r\n $userInfo = $user->fetch(PDO::FETCH_ASSOC);\r\n $this->userId = $userId;\r\n $this->userName = $userInfo['user_name'];\r\n $this->userRole = $userInfo['user_role'];\r\n $this->authKey = $userInfo['auth_key'];\r\n }", "public function loadUserDetail($id) {\n \t$_user = new class_User();\n \n \t$user = $_user->getUserDetail($id);\n \n \treturn $user;\n }", "public static function getUserObjectFromId($id){\n $pdo = static::getDB();\n\n $sql = \"select * from users where user_id = :id\";\n\n $result = $pdo->prepare($sql);\n \n $result->execute([$id]);\n\n $user_array = $result->fetch(); \n\n if($user_array){\n if($user_array['USER_ROLE'] == Trader::ROLE_TRADER){\n return static::getTraderObjectFromEmail($user_array['EMAIL']);\n }\n return new User($user_array);\n }\n return false;\n }", "public function loadFromId(){\r\n\t\t$id = $this -> getUserId();\r\n\t\tif(is_numeric($id))\r\n\t\t\t$this -> loadFromQuery(\"select * from UserTab where UserId=\".$id);\r\n\t }", "public function getUserObject() {\n\n try {\n\n $user = Doctrine::getTable('User')\n ->find($this->getUserId());\n\n return $user;\n\n } catch (Exception $e) {\n\n throw new Exception($e->getMessage());\n }\n }", "public function loadUser()\r\n\t{\r\n\t\tif($this->_model===null)\r\n\t\t{\r\n\t\t\tif(Yii::app()->user->id)\r\n\t\t\t\t$this->_model=Yii::app()->controller->module->user();\r\n\t\t\tif($this->_model===null)\r\n\t\t\t\t$this->redirect(Yii::app()->controller->module->loginUrl);\r\n\t\t}\r\n\t\treturn $this->_model;\r\n\t}", "public function getUser($a_user_id)\n\t{\n\t\tglobal $lng;\n\t\t\n\t\t$userObj = ilObjectFactory::getInstanceByObjId($a_user_id, false);\t\t\n\t\tif(!ilObject::_exists($a_user_id) || !$userObj)\n\t\t{\n\t\t\t$userObj = new ilObjUser();\n\t\t\t$userObj->setLogin($lng->txt(\"unknown\"));\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $userObj;\n\t}", "function loadUser($username)\n {\n\n // define all the global variables\n global $database;\n\n // escape the username string\n $username = $database->secureInput($username);\n // create a new instance of the User class\n $loadUser = new User();\n // initiate the instance with the requested username\n if (!($found = $loadUser->initInstance($username))) {\n return false;\n }\n // return the loaded user\n return $loadUser;\n }", "public function loadUser()\n {\n if ($this->_model === null) {\n if (Yii::app()->user->id)\n $this->_model = Yii::app()->controller->module->user();\n if ($this->_model === null)\n $this->redirect(Yii::app()->controller->module->loginUrl);\n }\n return $this->_model;\n }", "public function loadUserByUsername($username)\n {\n }", "function loadFromId()\n {\n\t global $wgMemc;\n\t if ( $this->mId == 0 ) {\n\t\t $this->loadDefaults();\n\t\t return false;\n\t } \n\n\t # Try cache\n\t $key = wfMemcKey( 'cedar_user', 'id', $this->mId );\n\t $data = $wgMemc->get( $key );\n\t \n\t if ( !is_array( $data ) || $data['mVersion'] < MW_CEDAR_USER_VERSION ) {\n\t\t # Object is expired, load from DB\n\t\t $data = false;\n\t }\n\t \n\t if ( !$data ) {\n\t\t wfDebug( \"Cache miss for user {$this->mId}\\n\" );\n\t\t # Load from DB\n\t\t if ( !$this->loadFromDatabase() ) {\n\t\t\t # Can't load from ID, user is anonymous\n\t\t\t return false;\n\t\t }\n\n\t\t # Save to cache\n\t\t $data = array();\n\t\t foreach ( self::$mCacheVars as $name ) {\n\t\t\t $data[$name] = $this->$name;\n\t\t }\n\t\t $data['mVersion'] = MW_CEDAR_USER_VERSION;\n\t\t $wgMemc->set( $key, $data );\n\t } else {\n\t\t wfDebug( \"Got user {$this->mId} from cache\\n\" );\n\t\t # Restore from cache\n\t\t foreach ( self::$mCacheVars as $name ) {\n\t\t\t $this->$name = $data[$name];\n\t\t }\n\t }\n\t return true;\n }", "protected function loadUserBySession()\n {\n\n try {\n $this->oUser = new User();\n $aSession = $this->oSession->get();\n if (isset($aSession[Auth::SESSION_AUTH_KEY]) === true) {\n $this->oUser->loadByParameters(array(\n 'iduser' => $aSession[Auth::SESSION_AUTH_KEY]['iduser'],\n 'mail' => $aSession[Auth::SESSION_AUTH_KEY]['mail'],\n 'token' => $aSession[Auth::SESSION_AUTH_KEY]['token'],\n 'confirmed' => AuthModel::USER_ACTIVATED_STATUS,\n 'created' => $aSession[Auth::SESSION_AUTH_KEY]['created']\n ));\n\n if ($this->oUser->isLoaded()) {\n // Unset user's password\n unset($this->oUser->pass);\n return true;\n }\n }\n return false;\n } catch (\\Exception $oException) {\n return false;\n }\n }", "protected function objectUserEnCours(){\n $fbUid = $this->getRequest()->getSession()->get('_fos_facebook_fb_482361481839052_user_id');\n $user = $this->getDoctrine()->getManager()->getRepository('MetinetFacebookBundle:User')->findOneByfbUid($fbUid);\n return $user ;\n }", "protected function loadObjects() { \n parent::loadObjects(); \n $factory = I2CE_FormFactory::instance();\n $user = null;\n $user_map = null;\n if ($this->isPost()) {\n if ($this->creatingNewUser()) {\n if (! ($user = $factory->createContainer( 'user')) instanceof I2CE_User_Form) {\n I2CE::raiseError(\"bad user form\");\n return false;\n }\n $user->load( $this->post );\n $user_map = $factory->createContainer( 'user_map');\n $user_map->load( $this->post );\n if ( !($username = $user->username) ) {\n I2CE::raiseError(\"bad user name\");\n return false;\n }\n $this->setEditing();\n if ( !$this->isSave(false) ) {\n $user->tryGeneratePassword();\n }\n $this->getPrimary()->username = array('user' , $username);\n }\n } else {\n $this->parent = $this->getParent();\n $user = $factory->createContainer( \"user\".'|0');\n if (( ($personObj = $this->getParent()) instanceof iHRIS_Person) && ($personObj->surname)) {\n $username = $this->generateUserName($personObj);\n $accessMech = I2CE::getUserAccess();\n $details = $accessMech->getAllowedDetails();\n $user->username = $username;\n if (in_array('lastname',$details)) {\n $user->lastname = $personObj->surname;\n }\n $role = false;\n if (I2CE::getConfig()->setIfIsSet($role,\"/modules/SelfService/default_user_role\") && I2CE_MagicDataNode::checkKey($role) && I2CE::getConfig()->is_parent(\"/I2CE/formsData/forms/role/$role\")) {\n $user->getField('role')->setFromDB('role|' . $role);\n }\n foreach($details as $detail) {\n if ($personObj->hasField($detail)) {\n $user->getField($detail)->setFromDB( $personObj->getField($detail)->getDBValue());\n }\n }\n if (I2CE_ModuleFactory::instance()->isEnabled('PersonContact')) {\n $contact_form = false;\n if (I2CE::getConfig()->setIfIsSet($contact_form,\"/modules/SelfService/default_user_contact_form\") && $contact_form) {\n $personObj->populateChildren($contact_form);\n foreach ($personObj->getChildren($contact_form) as $contactObj) {\n foreach($details as $detail) {\n if ($contactObj->hasField($detail)) {\n $user->getField($detail)->setFromDB( $contactObj->getField($detail)->getDBValue());\n }\n } \n break;\n }\n }\n }\n }\n }\n if ($user instanceof I2CE_User_Form) {\n $this->userObj = $user;\n $this->userMapObj = $user_map;\n $this->setObject( $user, I2CE_PageForm::EDIT_SECONDARY, 'user_fields');\n } \n return true;\n }", "public static function load($accountObject){\n // Output: User object with same properties\n $account = null;\n $account = new UserAccount($accountObject[firstName], $accountObject[lastName], $accountObject[email], $accountObject[authValue], Address::load($accountObject[address]), $accountObject[dateOfBirth]);\n \n if ($account->success()) {\n \n $bills = [];\n foreach($accountObject[bills] as $bill) {\n $loadedBill = Bill::load($bill);\n array_push($bills, $loadedBill);\n }\n \n $account->setBills($bills);\n $account->setAccountNumber($accountObject[accountNumber]);\n\n if (self::checkAccount($account)) \n ; // Success\n else\n throw new Exception(\"Invalid loading\");\n } else\n throw new Exception(\"User account unable to properly load\");\n \n return $account;\n }", "public function load( &$object );", "public function load_user($email){\r\n $TDG = new UserTDG();\r\n $res = $TDG->get_by_email($email);\r\n\r\n if(!$res)\r\n {\r\n $TDG = null;\r\n return false;\r\n }\r\n\r\n $this->id = $res['userId'];\r\n $this->email = $res['email'];\r\n $this->username = $res['username'];\r\n $this->password = $res['password'];\r\n $this->image = $res['image'];\r\n \r\n $TDG = null;\r\n return true;\r\n }", "public function loadUserByJWT($jwt): UserInterface;", "protected function _get_object($user, $strong_check = FALSE)\n {\n \t$name = $this->_config['entry'];\n \tstatic $current;\n\n \t//make sure the user is loaded only once.\n \tif ( ! is_object($current[$name]) AND is_string($user))\n \t{\n \t\t// Load the user\n \t\t$current[$name] = Mango::factory($this->_config['model_name']);\n \t\t$current[$name] = Mango::factory($this->_config['model_name'], array($current[$name]->unique_key($user), $user))->load();\n \t}\n\n \tif (is_object($user) AND is_subclass_of($user, 'Model_Rauth_User') AND $user->loaded())\n \t{\n \t\tif ($strong_check)\n \t\t{\n \t\t\t$current[$name] = Mango::factory($this->_config['model_name'], array(\n \t\t\t\t'_id'\t\t=> $user->_id,\n \t\t\t\t'username'\t=> $user->username\n \t\t\t))->load();\n \t\t}\n \t\telse\n \t\t{\n \t\t\t$current[$name] = $user;\n \t\t}\n \t}\n\n \treturn $current[$name];\n }", "public function load_from_object ($obj)\n {\n parent::load_from_object ($obj);\n $this->set_value ('name', $obj->title);\n $this->set_value ('orig_email', $obj->email);\n $this->set_value ('email', $obj->email);\n $this->set_value ('real_first_name', $obj->real_first_name);\n $this->set_value ('real_last_name', $obj->real_last_name);\n $this->set_value ('home_page_url', $obj->home_page_url);\n $this->set_value ('picture_url', $obj->picture_url);\n $this->set_value ('icon_url', $obj->icon_url);\n $this->set_value ('signature', $obj->signature);\n $this->set_value ('publication_state', History_item_silent);\n $this->set_value ('email_visibility', $obj->email_visibility);\n \n $this->set_visible ('title', $this->app->user_options->users_can_change_name);\n $this->set_visible ('password1', false);\n $this->set_visible ('password2', false);\n\n $icon_url = read_var ('icon_url');\n if ($icon_url)\n {\n $this->set_value ('icon_url', $icon_url);\n }\n else\n {\n $this->set_value ('icon_url', $obj->icon_url);\n }\n }", "function get_user($userName){\n return get_user_object($userName);\n}", "public function loadUserByUsername($username, $boolAndLoadFields = false)\r\n {\r\n $user = CrugeFactory::get()->getICrugeStoredUserByUsername($username);\r\n if (($boolAndLoadFields == true) && ($user != null)) {\r\n $this->loadUserFields($user);\r\n }\r\n return $user;\r\n }", "function callFromDb ($obj, $user) {\n $result = $obj->getUser($user);\n if(!empty($result)) {\n foreach ($result as $e) {\n $tmpUser = new user($e['user_id'], $e['password'], $e['name'], $e['permission']);\n }\n }\n return $tmpUser;\n}", "public static function get_user($user_id);", "private function init_user() {\n global $USER, $DB;\n\n $userdata = new stdClass;\n $userdata->username = 'user';\n $userid = user_create_user($userdata);\n $USER = $DB->get_record('user', array('id' => $userid));\n context_user::instance($USER->id);\n }", "public function load() {\n\t\tglobal $config;\n\t\n\t\tif($this->exists()){ // User exists\n\t\t\tif(!empty($this->data['id']))\n\t\t\t\t$where = 'id = '.$this->data['id'];\n\t\t\telseif(!empty($this->data['fbid']))\n\t\t\t\t$where = 'fbid = '.$this->data['fbid'];\n\t\t\t\t\n\t\t\t$result = $config['database']->query(\"\n\t\t\t\tSELECT *\n\t\t\t\tFROM nuusers\n\t\t\t\tWHERE $where\n\t\t\t\tLIMIT 1\n\t\t\t\");\n\t\t\t$row = $result->fetch_assoc();\n\t\t\t\n\t\t\tforeach($row as $key => $val){\n\t\t\t\tif($key == 'options'){\n\t\t\t\t\t$this->data['options'] = json_decode($val, true);\n\t\t\t\t}else if(is_string($val)){\n\t\t\t\t\tif(!get_magic_quotes_gpc())\n\t\t\t\t\t\t$this->data[$key] = stripslashes($val);\n\t\t\t\t\telse\n\t\t\t\t\t\t$this->data[$key] = $val;\n\t\t\t\t}else{\n\t\t\t\t\t$this->data[$key] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(empty($this->data['photo'])){\n\t\t\t\tglobal $config;\n\t\t\t\t\n\t\t\t\tif($this->data['faculty'])\n\t\t\t\t\t$this->data['photo'] = $config['imagesurl'].'/faculty.jpg';\n\t\t\t\telse\n\t\t\t\t\t$this->data['photo'] = $config['imagesurl'].'/anonymous.gif';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->data['level'] = $this->loadLevel();\n\t\t\t$this->data['levelProgress'] = $this->loadLevelProgress();\n\t\t\t$this->data['rank'] = $this->loadRank();\n\t\t\t$this->data['achievements'] = $this->loadAchievements();\n\t\t\t$this->data['post_counts'] = $this->loadPostCounts();\n\t\t\t\n\t\t\treturn $result;\n\t\t}else{ // User does not exists\n\t\t\tif($this->data['fbid']){ // New user from facebook\n\t\t\t\tglobal $fbme;\n\t\t\t\t\n\t\t\t\t$y = substr($fbme['birthday'],6);\n\t\t\t\t$m = substr($fbme['birthday'],0,2);\n\t\t\t\t$d = substr($fbme['birthday'],3,2);\n\t\t\t\t$bday = $y.'-'.$m.'-'.$d;\n\t\t\t\t\n\t\t\t\t$create = $this->create(array(\n\t\t\t\t\t'first_name' => $fbme['first_name'],\n\t\t\t\t\t'last_name' => $fbme['last_name'],\n\t\t\t\t\t'email' => $fbme['email'],\n\t\t\t\t\t'birthday' => $bday,\n\t\t\t\t\t'gender' => $fbme['gender']\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\treturn $create;\n\t\t\t}else{ // Invalid user id\n\t\t\t\t$this->data['id'] = null;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "function loadFromName() {\n\t global $wgMemc;\n\t if ( $this->mName == '' ) {\n\t\t $this->loadDefaults();\n\t\t return false;\n\t } \n\n\t # Try cache\n\t $key = wfMemcKey( 'cedar_user', 'name', $this->mname );\n\t $data = $wgMemc->get( $key );\n\t \n\t if ( !is_array( $data ) || $data['mVersion'] < MW_CEDAR_USER_VERSION ) {\n\t\t # Object is expired, load from DB\n\t\t $data = false;\n\t }\n\t \n\t if ( !$data ) {\n\t\t wfDebug( \"Cache miss for user {$this->mName}\\n\" );\n\t\t # Load from DB\n\t\t if ( !$this->loadFromDatabase() ) {\n\t\t\t # Can't load from ID, user is anonymous\n\t\t\t return false;\n\t\t }\n\n\t\t # Save to cache\n\t\t $data = array();\n\t\t foreach ( self::$mCacheVars as $name ) {\n\t\t\t $data[$name] = $this->$name;\n\t\t }\n\t\t $data['mVersion'] = MW_CEDAR_USER_VERSION;\n\t\t $wgMemc->set( $key, $data );\n\t } else {\n\t\t wfDebug( \"Got user {$this->mName} from cache\\n\" );\n\t\t # Restore from cache\n\t\t foreach ( self::$mCacheVars as $name ) {\n\t\t\t $this->$name = $data[$name];\n\t\t }\n\t }\n\t return true;\n }", "public function getUser() : object\n {\n $user = new User();\n $user->setDb($this->db);\n $user->find(\"id\", $this->username);\n\n return $user;\n }", "function load( $id )\r\n\t{\r\n\r\n\t\t$sql = \"SELECT * FROM user_profiles WHERE user_id = $id\";\r\n\t\t$row = $this->database->query_firstrow( $sql );\r\n\t\r\n\t\t$this->id = $row['id'];\r\n\t\t$this->user_id = $row['user_id'];\r\n\t\t$this->username = $row['username'];\r\n\t\t$this->gender = $row['gender'];\r\n\t\t$this->dob = $row['dob'];\r\n\t\t$this->country_id = $row['country_id'];\r\n\t\t$this->picture = $row['picture'];\r\n\t\t$this->link = $row['link'];\r\n\t\t$this->phone = $row['phone'];\r\n\t\t$this->likes = $row['likes'];\r\n\t\t$this->dislikes = $row['dislikes'];\r\n\t\t$this->hobbies = $row['hobbies'];\r\n\t\t$this->is_active = $row['is_active'];\r\n\t\t$this->created_on = $row['created_on'];\r\n\t\t$this->last_modified_on = $row['last_modified_on'];\r\n\t}", "public function user(){\n $user = $this->curl->getUser($this->messaging->getSenderId());\n $this->user = new User($this->messaging->getSenderId(), $user['first_name'], $user['last_name']);\n }", "public function loadUser()\n\t{ \n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(Yii::app()->user->id)\n {\n $this->_model=Yii::app()->controller->module->user();\n }\n \n if(!empty($_GET['username']))\n {\n $this->_model = User::model()->find(\"username = '\".$_GET['username'].\"'\");\n if(empty($this->_model) || ($_GET['username'] != Yii::app()->user->name))\n {\n throw new Exception(\"Invalid username\",404);\n }\n \n }\n\t\t\tif($this->_model===null)\n {\n $this->redirect(Yii::app()->controller->module->loginUrl);\n }\n\t\t} \n\t\treturn $this->_model;\n\t}", "public static function instantiate(User $user);", "protected function loadUser($memberId)\n {\n if ($this->context->user->member->level != 1) return;\n\n $defaults = $this->context->config['user']; // ->user->toArray();\n\n //$user = $this->context->models->UserModel->load($defaults,$memberId);\n $repo = new Osso2007_UserRepo($this->context);\n $user = $repo->load($defaults,$memberId);\n\n $this->context->session->user = $user->data;\n }", "public function load( &$object ) {\n\t\t// TODO: Implement load() method.\n\t}", "public function testLoadInvalidObjectIDType()\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(array());\r\n\t\t}", "function getUser($user, $id) {\n return $user->readByID($id);\n}", "public function load($id) {\n\n // Retrieve data\n $result = $this->_buildQuery($id)->get(XCMS_Tables::TABLE_USERS);\n if ($result->num_rows()) {\n\n // Populate model\n $this->set($result->row());\n\n // Load attributes\n $this->attributes->init(XCMS_Tables::TABLE_USERS_ATTR, \"user\");\n $this->attributes->load($this->get(\"id\"));\n\n return $this;\n\n }\n\n return null;\n\n }", "public function user()\r\n {\r\n $user = (new \\Users\\Models\\Users)->load(array('_id'=>$this->user_id));\r\n \r\n return $user;\r\n }", "public static function loadByPK($id)\n {\n $model = new User_Model();\n return $model->getGrid()->getByPk($id);\n }", "public function loadUser($id=null)\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif($id!==null || isset($_GET['id']))\n\t\t\t\t$this->_model=User::model()->findbyPk($id!==null ? $id : $_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}", "public function loadByUserId($uid)\n {\n $record =& $this->getTable();\n if ($record->load_by_user_id((int)$uid)) {\n $this->id = $record->id;\n $this->userId = $record->user_id;\n $this->profileId = $record->profile_id;\n $this->paymentId = $record->payment_id;\n $this->shippingId = $record->shipping_id;\n }\n }", "private function setUserObject($object)\n\t{\n\t\t# Check if the passed value is empty and an object.\n\t\tif(empty($object) OR !is_object($object))\n\t\t{\n\t\t\t# Explicitly set the value to NULL.\n\t\t\t$object=NULL;\n\t\t}\n\t\t# Set the data member.\n\t\t$this->user_object=$object;\n\t}", "public function loadUser($anyId) {\n if(is_numeric($anyId)) { // its number - id\n if(strlen($anyId > 10))\n return $this->loadUserByGoogleId($anyId);\n else\n return $this->loadUserById($anyId);\n }\n else\n return $this->loadUserByUsername($anyId);\n }", "public function user()\n {\n // check if user is already loaded, if not, we fetch it from database\n if ($this->_user) {\n return $this->_user;\n } else {\n $users = new Application_Model_DbTable_Users();\n if ($user = $users->findById($this->_user_id)) {\n $this->_user = $user;\n return $user ;\n } else {\n throw new Exception(\"Can't fetch user data\");\n }\n }\n }", "function getUser()\n {\n if (empty($this->user_id))\n return $this->_user = null;\n if (empty($this->_user) || $this->_user->user_id != $this->user_id) {\n $this->_user = $this->getDi()->userTable->load($this->user_id);\n }\n return $this->_user;\n }", "function loaded_user(string $id): bool { return isset($this->users[$id]); }", "public function loadUserBySocialId($socialId);", "public static function getUserObject($id)\n {\n database::query('SELECT * FROM `#_users` WHERE id = '.$id);\n $row = database::fetchObject();\n\n return $row;\n }", "public static function getById($user_id){\n\t\t$user = new User();\n\t\t$query = sprintf('SELECT USERNAME, PASSWORD, EMAIL_ADDR, IS_ACTIVE FROM %sUSER WHERE USER_ID = %d', DB_TBL_PREFIX, $user_id );\n\t\t$result = mysql_query($query, $GLOBALS['DB']);\n\t\tif(mysql_num_rows($result)){\n\t\t\t$row = mysql_fetch_assoc($result);\n\t\t\t$user->username =$row['USERNAME'];\n\t\t\t$user->password = $row['PASSWORD'];\n\t\t\t$user->emailAddr = $row['EMAIL_ADDR'];\n\t\t\t$user->isActive = $row['IS_ACTIVE'];\n\t\t\t$user->uid = $user_id;\n\t }\n\t\n\t mysql_free_result($result);\n\t return $user;\n\t}", "public function fetchUser($user_id, $found_in, $force_reload_from_instagram=false) {\n //assume all users except the instance user is a instagram profile, not a page\n $network = ($user_id == $this->instance->network_user_id)?$this->instance->network:'instagram';\n $user_dao = DAOFactory::getDAO('UserDAO');\n $user_object = null;\n if ($force_reload_from_instagram || !$user_dao->isUserInDB($user_id, $network)) {\n // Get owner user details and save them to DB\n $user_details = InstagramGraphAPIAccessor::apiRequest('user', $user_id, $this->access_token);\n if (isset($user_details)) {\n $user_details->network = $network;\n }\n\n $user = $this->parseUserDetails($user_details);\n if (isset($user)) {\n $user_object = new User($user, $found_in);\n $user_dao->updateUser($user_object);\n }\n\n if (isset($user_object)) {\n $this->logger->logSuccess(\"Successfully fetched \".$user_id. \" \".$network.\"'s details from instagram\",\n __METHOD__.','.__LINE__);\n } else {\n //We just assume every user is a vanilla FB user. However, we can't retrieve page details using\n //a vanilla user call here\n $this->logger->logInfo(\"Error fetching \".$user_id.\" \". $network.\"'s details from instagram API, \".\n \"response was \".Utils::varDumpToString($user_details), __METHOD__.','.__LINE__);\n }\n }\n return $user_object;\n }", "abstract public function fetchUserById($id);", "public function getUser($id) {\r\n $conn = new ConnectionManager();\r\n $pdo = $conn->getConnection();\r\n\r\n $sql = \"SELECT * FROM users WHERE id = :id\";\r\n\r\n $stmt = $pdo->prepare($sql);\r\n $stmt->bindParam(':id', $id, PDO::PARAM_STR);\r\n\r\n $stmt->execute();\r\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\r\n\r\n $post_object = null;\r\n if( $row = $stmt->fetch() ) {\r\n $post_object = \r\n new Users(\r\n $row['id'],\r\n $row['dname'],\r\n $row['fname'],\r\n $row['lname'],\r\n $row['email'],\r\n $row['photoURL'],\r\n $row['job'],\r\n $row['company'],\r\n $row['industry'],\r\n $row['specialization']\r\n );\r\n \r\n }\r\n $stmt = null;\r\n $pdo = null;\r\n\r\n return $post_object;\r\n\r\n\r\n }", "function load($id)\n {\n $ins = $this->getById($id);\n if (!empty($ins)) {\n foreach ($this->fields as $field) {\n if ($field == \"userO\") {\n $usuario = new User();\n $usuario->load($ins['idUser']);\n $this->$field = $usuario;\n } elseif ($field == \"project\") {\n $project = new Project();\n $project->load($ins['idProject']);\n $this->$field = $project;\n } else {\n $this->$field = $ins[\"$field\"];\n }\n }\n } else {\n throw new Exception(\"No existe ese registro\");\n }\n }", "public function get_user()\n {\n Session::_start();\n return (object) Session::_get(\"user\");\n\n }", "public function __construct(User $objUser)\n {\n $this->objUser=$objUser;\n }", "public function getObject(int $id): User\n {\n $query = \"select * from users where id = :id limit 1\";\n $sth = $this->db->prepare($query);\n $sth->execute(\n array(\n \":id\" => $id,\n )\n );\n $resp = $sth->fetch(\\PDO::FETCH_OBJ);\n\n if (!$resp) {\n $err = $sth->errorInfo();\n\n throw new \\Exception($err[2], $err[1]);\n }\n\n $user = new User();\n foreach ($resp as $k => $v) {\n $user->{'set' . ucfirst($k)}($v);\n }\n\n return $user;\n }", "public function loadUserByUsername($userLink) {\n if(!isset($this->user) || $this->user->getUniqueLink() != $userLink)\n $this->user = $this->findOneBy([\"link\" => $userLink, \"googleId\" => null]);\n if($this->user instanceof User)\n return $this->user;\n else\n throw new UsernameNotFoundException(\n sprintf('Username \"%s\" does not exist.', $userLink)\n );\n }", "public function getUserObject()\n\t{\n\t\treturn $this->user_object;\n\t}", "public function getUserObject()\n {\n return $this->userobject;\n }", "public function getUser()\n\t{\n\t\tif(isset($this->user))\n\t\t{\n\t\t\treturn $this->user;\n\t\t}\n\n\t\t$request = new ColoCrossing_Http_Request('/', 'GET');\n\t\t$executor = $this->getHttpExecutor();\n\t\t$response = $executor->executeRequest($request);\n\t\t$content = $response->getContent();\n\n\t\treturn $this->user = ColoCrossing_Object_Factory::createObject($this, null, $content['user'], 'user');\n\t}", "public function getUserInformation($uid, User &$userObject = null);", "private function getUserInstance($a_usr_id)\n\t{\t\t\n\t\tstatic $userObjectCache = array();\n\t\t\n\t\tif(isset($userObjectCache[$a_usr_id])) return $userObjectCache[$a_usr_id];\n\t\t\n\t\t$oUser = ilObjectFactory::getInstanceByObjId($a_usr_id, false);\n\t\tif(!is_object($oUser) || $oUser->getType() != 'usr')\n\t\t{\n\t\t\t$userObjectCache[$a_usr_id] = null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$userObjectCache[$a_usr_id] = $oUser;\n\t\t}\t\t \n\t\t\n\t\treturn $userObjectCache[$a_usr_id];\n\t}", "private function getUserById($id) {\n\t\t$em = $this->getDoctrine()->getManager()->getRepository('AppBundle\\Entity\\User');\n\n\t\t$user = $em->findOneById($id);\t\n\t\t\n\t\treturn $user;\n\t}", "function loadUser($user_id)\n\t\t{\n\t\t\t$query=sqlite_query($this->connection, \"SELECT name FROM user WHERE user_id='$user_id'\");\n\t\t\treturn $query;\n\t\t}", "public function getById($userId) {\n //Requête d'un objet user à partir de son id\n $reqId = $this->db->prepare('\n SELECT * FROM user WHERE id=:id');\n\n $reqId->execute(array(\n 'id' => $userId,\n ));\n \n $data = $reqId->fetch(PDO::FETCH_ASSOC);\n\n return new User($data);\n }", "public function load_current_user()\n\t{\n\t\t$userid = $this->CI->session->userdata('userid');\n\t\tif($userid)\n\t\t{\n\t\t\t$userdata = $this->CI->user_model->get_by_id($userid);\n\t\t\tif($userdata !== NULL)\n\t\t\t{\n\t\t\t\t$this->set_current_user($userdata);\n\t\t\t}\n\t\t}\n\t}", "public function load($object, $group);", "function loadUser($userID)\n {\n\t$this->userData = $this->db->get_results(\"SELECT * FROM \".$this->usertable.\" WHERE \".$this->user_id.\" = '\".$this->escape($userID).\"' LIMIT 1\");\n if ( count($res) == 0 )\n \treturn false;\n $this->user_id = $userID;\n $_SESSION[$this->sessionVariable] = $this->userID;\n return true;\n }", "public function load($userId = 0)\n{\n $userId=7;\n $username='tarun';\n $password='abcdefg';\n\t\n //Load the user factory\n $this->load->library(\"UserFactory\");\n //Create a data array so we can pass information to the view\n \n $this->userfactory->setUser($username, $password);\n \n\n\n}", "private function loadUsers() {\n\t\t\n\t\t\t$sql = \"SELECT usr_id FROM usr_cmp WHERE cmp_id='$companyID'\";\n\t\t\t\n\t\t\t$rawResult = $gremlin->query($sql);\n\t\t\t\n\t\t\tforeach($rawResult as $newCont) {\n\t\t\t\n\t\t\t\t$newUser = new User($newCont);\n\t\t\t\n\t\t\t\t$this->usersInCompany[] = $newUser;\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}", "function Load($userid=0, $load_permissions=true)\n\t{\n\t\t$userid = intval($userid);\n\n\t\tif ($userid <= 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$query = \"SELECT * FROM [|PREFIX|]users WHERE userid={$userid}\";\n\t\t$result = $this->Db->Query($query);\n\t\tif (!$result) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$user = $this->Db->Fetch($result);\n\t\tif (empty($user)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->userid = $user['userid'];\n\t\t$this->groupid = $user['groupid'];\n\t\t$this->trialuser = IEM::ifsetor($user['trialuser'], '0');\n\t\t$this->username = $user['username'];\n\t\t$this->unique_token = isset($user['unique_token']) ? $user['unique_token'] : '';\n\t\t$this->status = ($user['status'] == 1) ? true : false;\n\t\t$this->admintype = $user['admintype'];\n\t\t$this->listadmintype = $user['listadmintype'];\n\t\t$this->templateadmintype = $user['templateadmintype'];\n\t\t$this->editownsettings = ($user['editownsettings'] == 1) ? true : false;\n\t\t$this->infotips = ($user['infotips'] == 1) ? true : false;\n\t\t$this->fullname = $user['fullname'];\n\t\t$this->emailaddress = $user['emailaddress'];\n\t\t$this->usertimezone = $user['usertimezone'];\n\t\t$this->textfooter = $user['textfooter'];\n\t\t$this->htmlfooter = $user['htmlfooter'];\n\n\t\t$this->smtpserver = $user['smtpserver'];\n\t\t$this->smtpusername = $user['smtpusername'];\n\t\t$this->smtppassword = base64_decode($user['smtppassword']);\n\t\t$this->smtpport = (int)$user['smtpport'];\n\t\tif ($this->smtpport <= 0) {\n\t\t\t$this->smtpport = 25;\n\t\t}\n\n\t\t$this->lastloggedin = (int)$user['lastloggedin'];\n\t\t$this->createdate = (int)$user['createdate'];\n\t\t$this->forgotpasscode = $user['forgotpasscode'];\n\n\n\t\tif (isset($user['usewysiwyg'])) {\n\t\t\t$wysiwyg = intval($user['usewysiwyg']);\n\t\t\tif ($wysiwyg == 0) {\n\t\t\t\t$this->usewysiwyg = 0;\n\t\t\t} else {\n\t\t\t\t$this->usewysiwyg = 1;\n\t\t\t\tif ($wysiwyg == 2) {\n\t\t\t\t\t$this->usexhtml = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (isset($user['xmltoken']) && isset($user['xmlapi'])) {\n\t\t\tif ($user['xmlapi'] == 1) {\n\t\t\t\t$this->xmlapi = 1;\n\t\t\t}\n\n\t\t\tif ($user['xmltoken'] != null && $user['xmltoken'] != '') {\n\t\t\t\t$this->xmltoken = $user['xmltoken'];\n\t\t\t}\n\t\t}\n\n\t\t// The following options may have been added after an upgrade and may not yet exist.\n\n\t\t$this->eventactivitytype = IEM::ifsetor($user['eventactivitytype'], array());\n\t\t$this->user_language = IEM::ifsetor($user['user_language']);\n\t\t$this->enableactivitylog = IEM::ifsetor($user['enableactivitylog']);\n\t\t$this->gettingstarted = IEM::ifsetor($user['gettingstarted']);\n\t\t$this->segmentadmintype = IEM::ifsetor($user['segmentadmintype']);\n\n\t\t// Only set the google details if they are available.\n\t\tif (isset($user['googlecalendarusername'])) {\n\t\t\t$this->googlecalendarusername = $user['googlecalendarusername'];\n\t\t\t$this->googlecalendarpassword = $user['googlecalendarpassword'];\n\t\t}\n\n\t\tif (isset($user['credit_warning_percentage'])) {\n\t\t\t$this->credit_warning_percentage = $user['credit_warning_percentage'];\n\t\t\t$this->credit_warning_fixed = $user['credit_warning_fixed'];\n\t\t\t$this->credit_warning_time = $user['credit_warning_time'];\n\t\t}\n\n\n\t\t// Loading user admin notification settings\n\n\t\t$this->adminnotify_email = IEM::ifsetor($user['adminnotify_email'], '');\n\t\t$this->adminnotify_send_flag = IEM::ifsetor($user['adminnotify_send_flag'], 0);\n\t\t$this->adminnotify_send_threshold = IEM::ifsetor($user['adminnotify_send_threshold'], 0);\n\t $this->adminnotify_send_emailtext = IEM::ifsetor($user['adminnotify_send_emailtext'], '');\n\t $this->adminnotify_import_flag = IEM::ifsetor($user['adminnotify_import_flag'], 0);\n\t $this->adminnotify_import_threshold = IEM::ifsetor($user['adminnotify_import_threshold'], 0);\n\t $this->adminnotify_import_emailtext = IEM::ifsetor($user['adminnotify_import_emailtext'], '');\n\n\t\tif ($load_permissions) {\n\t\t\t$this->LoadPermissions($userid);\n\t\t}\n\n\t\tif ($user['settings'] != '') {\n\t\t\t$this->settings = unserialize($user['settings']);\n\t\t}\n\n\t\tif (is_null($this->segmentadmintype)) {\n\t\t\t$this->segmentadmintype = $this->AdminType();\n\t\t}\n\n\t\treturn true;\n\t}", "private function initializeObject($dataRecord)\n {\n $object = null;\n \n if (is_array($dataRecord) \n && count($dataRecord) > 0\n ) {\n $object = new User();\n \n $object->id = $dataRecord['id'];\n $object->name = $dataRecord['name'];\n $object->email = $dataRecord['email'];\n }\n \n return $object;\n }", "public function __construct($newUsername){\n $this -> loadUser($newUsername);\n }", "public function loadApiUserByAppName($appName);", "public function getUser($id);", "function LoadCurrent()\n {\n $this->user = null;\n $userID = null;\n if (isset($_SESSION[self::$sessionParam]))\n $userID = $_SESSION[self::$sessionParam];\n \n if ($userID)\n {\n $user = new User($userID);\n if ($user->Exists())\n $this->user = $user;\n }\n return $this->user !== null;\n }", "public function loadUsuario() {\n $usuario = new Entity\\Usuario;\n $usuario->setCpf($this->getCpf());\n $usuario->setEmail($this->getEmail());\n $usuario->setNome($this->getNome());\n $usuario->setSenha($this->getSenha());\n \n return $usuario;\n }", "public function __construct()\n {\n $this->userobj = new User();\n }", "public function load($id)\n {\n $record =& $this->getTable();\n if ($record->load((int)$id)) {\n $this->id = $record->id;\n $this->userId = $record->user_id;\n $this->profileId = $record->profile_id;\n $this->paymentId = $record->payment_id;\n $this->shippingId = $record->shipping_id;\n }\n }", "function d4os_io_db_070_os_user_load($data = array()) {\n\n if (is_numeric($data)) {\n\n // get the user by uid\n $UUID = db_result(db_query(\"SELECT UUID FROM {d4os_ui_users} WHERE uid = %d\", array($data)));\n\n if (!$UUID) {\n return FALSE;\n }\n\n $query = \"SELECT * FROM {UserAccounts} AS ua\"\n . \" LEFT JOIN {auth} AS a ON a.UUID=ua.PrincipalID\"\n . \" LEFT JOIN {GridUser} AS gu ON gu.UserID=ua.PrincipalID\"\n . \" WHERE ua.PrincipalID='%s'\";\n\n d4os_io_db_070_set_active('os_robust');\n $user = db_fetch_object(db_query($query, $UUID));\n d4os_io_db_070_set_active('default');\n \n if ($user) {\n $user = _d4os_io_db_070_os_070_to_grid($user);\n d4os_io_db_070_users_add_extra_fields($user);\n return $user;\n }\n else {\n return FALSE;\n }\n }\n\n // get only inworld fields\n $user_fields = d4os_ui_users_get_grid_fields();\n\n // Dynamically compose a SQL query:\n $query = array();\n $values = array();\n\n // get the user by keys\n foreach ($data as $key => $value) {\n if (in_array($key, $user_fields)) {\n switch ($key) {\n case 'UUID':\n $query[]= \"ua.PrincipalID = '%s'\";\n $values[] = $value;\n break;\n case 'username':\n $query[]= \"ua.FirstName = '%s'\";\n $values[] = $value;\n break;\n case 'lastname':\n $query[]= \"ua.LastName = '%s'\";\n $values[] = $value;\n break;\n case 'email':\n $query[]= \"ua.Email = '%s'\";\n $values[] = $value;\n break;\n case 'created':\n $query[]= \"ua.Created = %d\";\n $values[] = $value;\n break;\n case 'godLevel':\n $query[]= \"ua.UserLevel = %d\";\n $values[] = $value;\n break;\n }\n }\n }\n $sql = \"SELECT * FROM {UserAccounts} AS ua\"\n . \" LEFT JOIN {auth} AS a ON a.UUID=ua.PrincipalID\"\n . \" LEFT JOIN {GridUser} AS gu ON gu.UserID=ua.PrincipalID\"\n . \" WHERE \". implode(' AND ', $query);\n\n d4os_io_db_070_set_active('os_robust');\n $user = db_fetch_object(db_query($sql, $values));\n d4os_io_db_070_set_active('default');\n \n if ($user) {\n $uid = db_result(db_query(\"SELECT uid FROM {d4os_ui_users} WHERE UUID = '%s'\", array($user->PrincipalID)));\n $user->uid = $uid;\n $user = _d4os_io_db_070_os_070_to_grid($user);\n d4os_io_db_070_users_add_extra_fields($user);\n return $user;\n }\n else {\n return FALSE;\n }\n}", "public function getUserById($id) {\n\t\t\n\t}", "public function loadUserByUsername($login)\n {\n $userModel = new UsersModel($this->_app);\n $user = $userModel->loadUserByLogin($login);\n return new User($user['login'], $user['password'], $user['roles'], true, true, true, true);\n }", "public function getById(string $id): User;", "public function retrieve($id)\n\t{\n\t\treturn new \\Entity\\User;\n\t}", "public function loadFromObject($obj)\n\t{\n\t\t//echo \"<pre>\";print_r($obj);\n\t\t$this->setFirstName($obj->{'FirstName'});\n\t\t$this->setLastName($obj->{'LastName'});\n\t\t$this->setProfileImageURL($obj->{'ProfileImageURL'});\n\t\t$this->setGender($obj->{'Gender'});\n\t\t$this->setAccountType($obj->{'AccountType'});\n\t\t$this->setAddress($obj->{'Address'});\n\t\t$this->setCity($obj->{'City'});\n\t\t$this->setStateCode($obj->{'StateCode'});\n\t\t$this->setCountryCode($obj->{'CountryCode'});\n\t\t$this->setHomePhone($obj->{'HomePhone'});\n\t\tif($this->getFormat() == \"xml\") {\n\t\t\t$this->setReceiveNewsletter($obj->{'ReceiveNewsletter'}==\"True\"?true:false);\n\t\t\t$this->setEuropeCompany($obj->{'EuropeCompany'}==\"True\"?true:false);\t// Used if account type is company\n\t\t}\n\t\telse {\n\t\t\t$this->setReceiveNewsletter($obj->{'ReceiveNewsletter'});\n\t\t\t$this->setEuropeCompany($obj->{'EuropeCompany'});\t// Used if account type is company\n\t\t}\n\t\t$this->setVATNo($obj->{'VATNo'});\t// Used if account type is company\n\t\treturn true;\n\t}", "public static function getByID($id) {\r\n // Create a new user object\r\n $user = new User();\r\n // Get the data from the database for the user by ID\r\n $user->get([\"id\" => $id, \"LIMIT\" => 1]);\r\n // return the user object\r\n return $user;\r\n }", "public function user() {\n if ($this->User === null)\n $this->User = $this->getEntity(\"User\", $this->get(\"user_id\"));\n return $this->User;\n }", "function getUser() {\n return user_load($this->uid);\n }", "protected function loadUser(array $params)\n {\n if (!$params) {\n $this->error('Parameters for loading user cannot be empty');\n return null;\n }\n\n //Set globals installing to true to prevent bean_implements check for some modules\n if (isset($GLOBALS['installing'])) {\n $installing = $GLOBALS['installing'];\n }\n\n $GLOBALS['installing'] = true;\n\n $user = BeanFactory::newBean('Users');\n\n if (isset($installing)) {\n $GLOBALS['installing'] = $installing;\n } else {\n unset($GLOBALS['installing']);\n }\n\n $params['deleted'] = 0;\n\n $where = array();\n foreach ($params as $param => $value) {\n $where[] = sprintf('%s = %s', $param, $this->db->quoted($value));\n }\n\n // using plain SQL instead of SugarBean::retrieve() as the DB schema\n // may be inconsistent with vardefs at the beginning of the post stage\n $query = 'SELECT * FROM users WHERE ' . implode(' AND ', $where);\n\n $result = $this->db->query($query);\n\n if (($row = $this->db->fetchRow($result))) {\n $user->populateFromRow($row);\n }\n\n return $user;\n }", "public static function userObjectFromSQL($sql_user)\n {\n if(!$sql_user) return $sql_user;\n $user = new stdClass();\n $user->user_id = $sql_user->user_id;\n $user->user_name = $sql_user->user_name;\n $user->display_name = $sql_user->display_name;\n $user->bio = $sql_user->bio;\n $user->url = $sql_user->url;\n $user->media_id = $sql_user->media_id;\n\n return $user;\n }", "function load()\n {\n\t if ( $this->mDataLoaded )\n\t {\n\t\t return;\n\t }\n\t wfProfileIn( __METHOD__ );\n\n\t # Set it now to avoid infinite recursion in accessors\n\t $this->mDataLoaded = true;\n\n\t switch ( $this->mFrom ) {\n\t\t case 'defaults':\n\t\t\t $this->loadDefaults();\n\t\t\t break;\n\t\t case 'id':\n\t\t\t $this->loadFromId();\n\t\t\t break;\n\t\t case 'name':\n\t\t\t $this->loadFromName();\n\t\t\t break;\n\t\t default:\n\t\t\t throw new MWException( \"Unrecognised value for User->mFrom: \\\"{$this->mFrom}\\\"\" );\n\t }\n\t wfProfileOut( __METHOD__ );\n }", "function refreshUserObj (string $id = 'default') : void {\n\t$user = getUserObject($id);\n\tif(!$user) return;\n\n\t$userId = $user['id'];\n\t$sql = 'SELECT * FROM user WHERE id_user = ?;';\n\t$res = executeQuery(\n\t\t_BASE_DB_HOOK,\n\t\t$sql,\n\t\t[['i' => $userId]]\n\t);\n\n\tif($res instanceof mysqli_result){\n\t\t$reader = $res->fetch_assoc();\n\t\t$userObj =\n\t\t\t[\n\t\t\t\t'id' => $reader['id_user'],\n\t\t\t\t'username' => $reader['username'],\n\t\t\t\t'pwd_hash' => $reader['pwd_hash'],\n\t\t\t\t'admin' => $reader['admin'] == 1,\n\t\t\t\t'email' => $reader['email'],\n\t\t\t\t'fullname' => $reader['fullname'],\n\t\t\t\t'locale' => $reader['locale']\n\t\t\t]\n\t\t;\n\t\tsetUserObject($userObj, $id);\n\t}\n}", "public function initUser( &$user, $autocreate=false ) {\n $user->mRealName = $this->ext_user['user_name'];\n $user->mEmail = $this->ext_user['user_mail'];\n }", "public function _getUser()\n {\n $this->selftest();\n return $this->objectUser;\n }" ]
[ "0.7142054", "0.7139991", "0.67958266", "0.66745526", "0.6604551", "0.6586456", "0.6582294", "0.6531218", "0.6523283", "0.65032524", "0.6495473", "0.64742714", "0.6466221", "0.64643574", "0.6418366", "0.641464", "0.63526106", "0.632541", "0.631544", "0.62856746", "0.62679374", "0.62372744", "0.62153023", "0.6209365", "0.6185224", "0.6183556", "0.61805815", "0.6170676", "0.6167007", "0.6145984", "0.6136305", "0.6108785", "0.61073613", "0.6091935", "0.60907054", "0.60860544", "0.60411745", "0.60310024", "0.6010747", "0.6006455", "0.5973764", "0.5972829", "0.5969827", "0.5969026", "0.5960241", "0.5960186", "0.5952106", "0.59413207", "0.5930251", "0.59216034", "0.5921419", "0.59150624", "0.5911981", "0.58870363", "0.58758366", "0.58727026", "0.58726346", "0.5861437", "0.5859414", "0.58559364", "0.58536434", "0.58534414", "0.585037", "0.5845341", "0.5842344", "0.58375645", "0.5836182", "0.5818953", "0.58118933", "0.5805591", "0.5768273", "0.57549685", "0.5753585", "0.5749162", "0.5748382", "0.5745346", "0.57347953", "0.57332027", "0.5726807", "0.57145894", "0.5712749", "0.5711984", "0.57113576", "0.56996983", "0.5696306", "0.56951416", "0.5695034", "0.56941175", "0.56924695", "0.5680912", "0.5668011", "0.56540906", "0.5651351", "0.5650934", "0.56389534", "0.56364864", "0.56321454", "0.5630712", "0.5623138", "0.56173587", "0.56092197" ]
0.0
-1
This method is invoked right before an action is to be executed (after all possible filters.) It checks the existence of the db and mailer components.
public function beforeAction($action) { try { if (parent::beforeAction($action)) { $this->db = Instance::ensure($this->db, Connection::className()); $this->mailer = Instance::ensure($this->mailer, BaseMailer::className()); return true; } } catch (Exception $e) { $this->stderr("ERROR: " . $e->getMessage() . "\n"); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function beforeAction () {\n\t}", "public function preDispatch()\n {\n $config = Mage::getModel('emailchef/config');\n /* @var $config EMailChef_EMailChefSync_Model_Config */\n\n if (!$config->isTestMode()) {\n die('Access Denied.');\n }\n\n return parent::preDispatch();\n }", "public static function before() {\n\t\t// Return true for the actions below to execute\n\t\treturn true;\n\t}", "public function preExecute()\n {\n if (clsCommon::permissionCheck($this->getModuleName().\"/\".$this->getActionName()) == false){\n $this->getUser()->setFlash(\"errMsg\",sfConfig::get('app_Permission_Message'));\n $this->redirect('default/index');\n }\n }", "public function preExecute()\n {\n if (clsCommon::permissionCheck($this->getModuleName().\"/\".$this->getActionName()) == false){\n $this->getUser()->setFlash(\"errMsg\",sfConfig::get('app_Permission_Message'));\n $this->redirect('default/index');\n } \n }", "public function beforeRun()\n {\n $bootstrap = $this->getData(0);\n App_Profiler::start('Bootstrap::run');\n\n $mailTrClass = Zend_Registry::get('config')->email->transportClass;\n if ( ! empty($mailTrClass)) {\n App_Mail::setDefaultTransport(new $mailTrClass);\n }\n\n if (Zend_Registry::get('config')->default->db->useTransactions > 0) {\n Zend_Db_Table::getDefaultAdapter()->beginTransaction();\n }\n }", "public function beforeAction()\n {\n // do nothing, just disable the login check in parent::beforeAction;\n //\n }", "protected function beforeAction() {\n\n }", "public function before()\n\t{\n\t\tif (User::is_guest())\n\t\t{\n\t\t\tthrow HTTP_Exception::factory(403, 'Permission denied! You must login!');\n\t\t}\n\n\t\t$id = $this->request->param('id', FALSE);\n\n\t\tif ($id AND 'index' == $this->request->action())\n\t\t{\n\t\t\t$this->request->action('view');\n\t\t}\n\t\tif ( ! $id AND 'index' == $this->request->action())\n\t\t{\n\t\t\t$this->request->action('inbox');\n\t\t}\n\n\t\tAssets::css('user', 'media/css/user.css', array('theme'), array('weight' => 60));\n\n\t\tparent::before();\n\t}", "function beforeFilter()\r\n\r\n\t {\r\n\r\n\t\tif( Configure::read() == 0 )\r\n\r\n\t\t{\r\n\r\n\t\t\t$this->cakeError('error404');\r\n\r\n\t\t}\t \t\r\n\r\n \t\tApp::import('Vendor', 'Cpamf.amfphp' . DS . 'core' . DS . 'cakeamf' . DS . 'util', array( 'file' => 'CakeMethodTable.php' ) );\r\n\r\n\t }", "public function before()\n\t{\n\t\tif ($this->request->is_initial())\n\t\t{\n\t\t\t$this->request->action(404);\n\t\t}\n\t\t\n\t\treturn parent::before();\n\t}", "public function preExecute()\n {\n $this->getContext()->getConfiguration()->loadHelpers(array('Url', 'sfsCurrency'));\n \n if ($this->getActionName() == 'index') {\n $this->checkOrderStatus();\n }\n }", "public function before()\n\t{\n\t\tif ($this->request->action === 'login' OR $this->request->action === 'logout')\n\t\t{\n\t\t\t$this->requires_login = FALSE;\n\t\t}\n\t}", "public function before()\n {\n\tparent::before();\n\n // 管理者グループのみ許可\n\tif (!Controller_Auth::is_admin())\n {\n\t Response::redirect('auth/invalid');\n }\n }", "public function before()\n {\n if (in_array($this->request->action(), $this->_no_auth_action))\n {\n $this->_auth_required = FALSE;\n }\n\n parent::before();\n }", "function beforeFilter(){\n\t\t\n\t\t$this->Auth->allowedActions = array(\n\t\t\t//allow cron to happen with no authentication, we don't need to.\n\t\t\t'cron',\n\t\t\t//allow add_memebers_status to happen with no authentication, to speed it up.\n\t\t\t//it is used by admin_add_members for the progress indicator.\n\t\t\t'admin_add_members_status'\n\t\t);\n\t}", "public function beforeFilter(){\n\t\tparent::beforeFilter();\n// debug('test');\n\t\tif (isset($this->Auth)) {\n\t\t\t$this->Auth->allow('process');\n\t\t}\n\t\tif (isset($this->Security) && $this->action == 'process') {\n\t\t $this->Security->validatePost = false;\n\t\t}\n\t}", "public function beforeFilter() {\n\t\t\n\t\tif($this->Auth->user('professor')==true) {\n\t\t\t$this->Ressource->Behaviors->attach('LightAuthFiltered', array('match_field'=>'creator'));\n\t\t} else {\n\t\t\t$this->Ressource->Behaviors->attach('LightAuthFiltered', array('match_field'=>'cours_id', 'auth_field'=>'cours_id'));\n\t\t}\n\t\t\n\t\tparent::beforeFilter();\n\t\t$this->Auth->authorize = 'Controller';\n\n if (isset($this->Security) && in_array($this->action, array('display'))) {\n\t\t$this->Security->validatePost = false;\n\t\t$this->Security->csrfCheck = false;\n\t}\n\n // Controller specific beforeFilter \n }", "public function beforeFilter() {\n parent::beforeFilter();\n $this->Auth->allow('add');\n //$this->getNamedArgs(); \n\t\t\n\t\t// Load action specific models\n//\t\tswitch ($this->params['action']) {\n//\t\t\tcase 'users':\t\t$models = array('Household'); break;\n//\t\t}\n//\t\tif (!empty($models)) {\n//\t\t\tforeach ($models as $model) {\n//\t\t\t\t$this->loadModel($model);\n//\t\t\t}\n//\t\t}\n \n }", "public function before()\n {\n parent::requireAdmin();\n $this->user = Authentifiacation::getCurrentUser(); // get current user\n Booking::automaticBookingsDeletion(); // automatically delete all old bookings\n\n }", "public function beforeFilter() {\n parent::beforeFilter();\n $this->CONTACT_QQ_NUM = Configure::read('kefu_qq');\n if (isset($this->Security)) { //&& isset($this->Auth)) {\n //$this->Auth->allow('index', 'register');\n //$this->Security->config('unlockedActions', 'register');\n $this->Security->validatePost = false;\n $this->Security->enabled = false;\n $this->Security->csrfCheck = false;\n }\n }", "protected function setHelperActionsBeforeSend(): void\n {\n $this->setFailedListeners();\n $this->setCharsetForMailer();\n $this->setLocaleForMailer();\n $this->setFilterFromForMailer();\n }", "public function before()\n\t{\n\t\t// Inform tht we're in admin section for themers/developers\n\t\tTheme::$is_admin = TRUE;\n\n\t\tif($this->request->action() != 'login')\n\t\t{\n\t\t\tACL::redirect('administer site', 'admin/login');\n\t\t}\n\n\t\tparent::before();\n\t}", "protected function _before()\n\t{\n\t\t\n\t}", "public function beforeFilter() {\n parent::beforeFilter();\n $this->Auth->allow(array('register', 'check_existing_email'));\n }", "protected function _beforeInit() {\n\t}", "public function onBeforeRender()\n\t{\n\t\t// Get the application.\n\t\t$app = JFactory::getApplication();\n\n\t\t// Detecting Active Variables.\n\t\t$option = $app->input->getCmd('option', '');\n\t\t$view = $app->input->getCmd('view', '');\n\t\t$layout = $app->input->getCmd('layout', 'default');\n\n\t\t// Only in Admin.\n\t\tif ($app->isSite())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ($option == 'com_installer' && $view == 'manage' && $layout == 'default')\n\t\t{\n\t\t\t// Get the toolbar object instance.\n\t\t\t$toolbar = JToolBar::getInstance('toolbar');\n\t\t\t$toolbar->appendButton('Confirm', 'PLG_SYSTEM_PACKAGER_MSG_EXPORT', 'cogs', 'JTOOLBAR_EXPORT', 'export', true);\n\t\t}\n\t}", "protected function before_filter() {\n\t}", "protected function prepareForValidation()\n {\n // no default action\n }", "public function onAfterInitialise()\n {\n // Logger::d(__METHOD__);\n\n global $_PROFILER;\n\n $app = JFactory::getApplication();\n $user = JFactory::getUser();\n\n if ($app->isAdmin()) {\n return;\n }\n\n if (count($app->getMessageQueue())) {\n return;\n }\n\n if ($this->isDisabled()) {\n return;\n }\n\n\n if ($user->get('guest') && $app->input->getMethod() == 'GET') {\n $this->_cache->setCaching(true);\n }\n }", "public function preExecute()\n {\n if (!$this->getUser()->getReferenceFor('career'))\n {\n $this->getUser()->setFlash('warning', 'Debe seleccionar una carrera para poder administrar las opciones de sus materias.');\n $this->redirect('@career');\n }\n $this->career = CareerPeer::retrieveByPK($this->getUser()->getReferenceFor('career'));\n if ( is_null($this->career))\n {\n $this->getUser()->setFlash('warning', 'Debe seleccionar una carrera para poder administrar las opciones de sus materias.');\n $this->redirect('@career');\n }\n \n parent::preExecute();\n\n }", "public function beforeRender() {\r\n\t}", "protected function before(){}", "public function preAction()\n {\n // Nothing to do\n }", "public function beforeFilter()\n {\n parent::beforeFilter();\n //check if login\n $this->checkLogin();\n //check if admin\n $this->isAdmin();\n //check permissions\n $this->checkPermission('5');\n //set layout\n $this->layout = 'admin';\n }", "protected function before() {\n }", "public function beforeFilter(){\n\t\t$this->check_admin_session();\t\t\n\t}", "public function beforeSetup()\n {\n }", "public function beforeFilter() {\n\t}", "protected function before()\n {\n }", "public function beforeFilter() {\n\t\tparent::beforeFilter();\n\t\tif ($this->Components->enabled('Auth')) {\n\t\t\t$this->Auth->allow('process');\n\t\t}\n\t\tif (isset($this->Security) && $this->action === 'process') {\n\t\t\t$this->Security->validatePost = false;\n\t\t}\n\t}", "public function beforeFilter() { \n\t\t//$this->disable_cache();\n\t\t$this->show_tabs(105);\n\t\t// check module access\n\t\t\n\t}", "public function before_run() {}", "public function preDispatch()\n {\n if ( !Auth_UserAdapter::hasIdentity() )\n {\n $this->_helper->redirector( 'index', 'index' );\n }\n }", "public function beforeFilter() {\n\t\tparent::beforeFilter();\n\t\tif ($this->request->action == 'admin_toggle' || \n\t\t\t$this->request->action == 'admin_add_smart' ||\n\t\t\t$this->request->action == 'admin_save_condition' ) {\n\t\t\t$this->Components->disable('Security');\n\t\t}\n\t}", "public function before()\n {\n parent::before();\n\n // Get the HTTP status code\n $action = $this->request->action();\n\n if ($this->request->is_initial())\n {\n // This controller happens to exist, but lets pretent it does not\n $this->request->action($action = 404);\n }\n else if ( ! method_exists($this, 'action_'.$action))\n {\n // Return headers only\n $this->request->action('empty');\n }\n\n // Set the HTTP status code\n $this->response->status($action);\n }", "public function beforeFilter()\n\t{\n\t\tparent::beforeFilter();\n\n\t\t// Auth component settings\n\n\t\t$this->Auth->allow('admin_dashboard');\n\t}", "public function executeBefore()\r\n {\r\n $this->please->setStorage([\r\n '___ACFCollection' => [ 'content' => function(){ return $this->bloggyRepo->findBy(['type' => 'acf']); } ],\r\n '___PagesCollection' => [ 'content' => function(){ return $this->bloggyRepo->findBy(['type' => 'page']); } ],\r\n '___ACFChildrenCollection' => [ 'content' => function(){\r\n return $this->please->findLike($this->bloggyRepo, $this->bloggiesTable, [\r\n 'info[acf]' => null // null means we dont have the exact value\r\n ])['get']('rows');\r\n } ],\r\n '___ACFChildren2Collection' => [ 'content' => function(){\r\n return $this->please->findLike($this->bloggyRepo, $this->bloggiesTable, [\r\n 'info[_acf]' => null // null means we dont have the exact value\r\n ])['get']('rows');\r\n } ],\r\n '___UsersCollection' => [ 'content' => function(){ return $this->userRepo->findBy([], ['lastname' => 'asc']); } ],\r\n ], true);\r\n\r\n $this->setVisitsCount();\r\n }", "public function beforeFilter() {\n\t\t$this->Auth->authenticate = array('Hms');\n\t\t$this->Auth->authorize = array('Hms');\n\t}", "function beforeFilter() {\n\t\t$this->Auth->allow('index','add','send','ttt');\n\t\tparent::beforeFilter(); \n\t\t$this->Auth->autoRedirect = false;\n\n\t\t// swiching off Security component for ajax call\n\t\tif( isset($this->Security) && $this->RequestHandler->isAjax() ) {\n\t\t\t$this->Security->enabled = false; \n\t\t}\t\n\t}", "protected function _before() : void {\n require_once '../../public/wp-content/plugins/kc/Data/Database/DatabaseManager.php';\n }", "public function before()\n {\n parent::before();\n\n View::set_global('title', 'Manager page');\n View::set_global('description', 'Manager page');\n $this->template->styles = array('reset', 'templates/template/style', 'manager/style');\n $this->template->scripts = array('jquery', 'hoverIntent', 'templates/template/script', 'manager/script');\n $this->template->modules = ORM::factory('User', Auth_ORM::instance()->get_user()->id)->modules->find_all();\n }", "public function beforeFilter()\r\n {\r\n\t\t$this->Security->csrfCheck = true;\r\n $this->Security->disabledFields = array(\r\n\t\t\t'Hall.user_id',\r\n );\r\n\t\tif ((!empty($this->request->params['action']) and ($this->request->params['action'] == 'index'))) {\r\n $this->Security->validatePost = false;\r\n }\r\n parent::beforeFilter();\r\n }", "public function beforeFilter()\r\n {\r\n parent::beforeFilter();\r\n //check if login\r\n $this->checkLogin();\r\n //check if admin\r\n $this->isAdmin();\r\n //set layout\r\n $this->layout = 'admin';\r\n }", "protected function _before()\n {\n }", "public function beforeFilter()\n\t{\n\n\t}", "public function pre_action()\n\t{\n\t\tparent::pre_action();\n\t}", "public function beforeFilter() { \n\t\t//$this->disable_cache();\n\t\t$this->show_tabs(2);\n\t\t// check module access\n\t\t\n\t}", "public function beforeFilter()\n\t{\n\t\t//get chatServer host url global setting from bootstrap.php\n\t\t$boshUrl = Configure::read('bosh_url');\n\t\t$this->set('boshUrl',$boshUrl);\n\t\t//get and set site url\n\t\t$siteUrl = Configure::read('site_url');\n\t\t$this->set('siteUrl',$siteUrl);\n\t\t//get user session\n\t\t$user = $this->Session->read('UserData.userName');\n\t\tif ($user==\"\") {\n\t\t\treturn $this->redirect(array('controller' => 'users', 'action' => 'login'));\n\t\t}\n\t}", "public function before_run(){}", "public function postSetup() \n {\n \\WScore\\Core::get( 'friends\\model\\Friends' );\n \\WScore\\Core::get( 'friends\\model\\Contacts' );\n $this->initDb( $this->front->request->getPost( 'initDb' ) );\n }", "public function preDispatch()\n {\n // set admin layout\n // check if user is authenticated\n // if not, redirect to login page\n $url = $this->getRequest()->getRequestUri();\n $this->_helper->layout->setLayout('admin');\n if (!Zend_Auth::getInstance()->hasIdentity()) {\n $session = new Zend_Session_Namespace('zf1.auth');\n $session->requestURL = $url;\n $this->_redirect('/admin/login');\n }\n }", "function run_activity_pre()\n\t\t{\n\t\t\t//load agent data from database\n\t\t\t$this->bo_agent->init();\n\t\t\t\n\t\t\t//this will send an email only if the configuration says to do so\n\t\t\tif (!($this->bo_agent->send_start()))\n\t\t\t{\n\t\t\t\t$this->error[] = lang('Smtp Agent has detected some errors when sending email at the beginning of the activity');\n\t\t\t\t$ok = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$ok = true;\n\t\t\t}\n\t\t\t$this->error[] = $this->bo_agent->get_error();\n\t\t\tif ($this->bo_agent->debugmode) echo '<br />START: Mail agent in DEBUG mode:'.implode('<br />',$this->error);\n\t\t\treturn $ok;\n\t\t}", "public function before()\n\t{\n\t}", "function _prepare() {\n $this->reset();\n if (Configure::read('debug') > 0) {\n $this->delivery = 'debug';\n }\n }", "public function before() {}", "public function before() {}", "public function preDispatch()\r\n {\r\n $this->View()->setScope(Enlight_Template_Manager::SCOPE_PARENT);\r\n\r\n $this->View()->sUserLoggedIn = $this->admin->sCheckUser();\r\n $this->View()->sUserData = $this->getUserData();\r\n }", "public function beforeFilter() {\n\t\tparent::beforeFilter();\n\t\t$this->Auth->allow('view', 'shopfront', 'frontpage');\n\t\n\t\tif ($this->request->action == 'admin_toggle' ||\n\t\t $this->request->action == 'admin_menu_action') {\n\t\t\t$this->Components->disable('Security');\n\t\t}\n\t\t\n\t}", "protected function beforeDoAction() {\n return true;\n }", "protected function before(): void\n {\n }", "public function beforeFilter()\r\n\t {\r\n\t parent::beforeFilter();\r\n\t }", "public function setup_actions() {}", "public function before()\n {\n }", "public function before()\n {\n }", "public function before()\n {\n }", "public function beforeFilter() {\n\t\tif (isset($this->params['renderAs'])) {\n\t\t\t$this->autoLayout = true;\n\t\t\t$this->RequestHandler->renderAs($this, $this->params['renderAs']);\n\t\t}\n\t\t// add extra mappings\n\t\t// WORKAROUND: Firefox tries to open json instead of reading it, so use different headers\n\t\t$this->RequestHandler->setContent('json', 'text/plain');\n\t\t$this->RequestHandler->setContent('print', 'text/html');\n\n\t\t$User = ClassRegistry::init('User');\n\n\t\tif ($this->Auth->user() && $this->action !== 'logout') {\n\t\t\t// keep user available\n\t\t\t$this->activeUser = array_merge($this->Auth->user(), $this->Session->read('User'));\n\t\t} else {\n\t\t\t$this->layout = 'public';\n\t\t}\n\n\t\t// use custom authentication (password encrypt/decrypt)\n\t\t$this->Auth->authenticate = new User();\n\n\t\t$this->Security->blackHoleCallback = 'cakeError';\n\n\t\t// set to log using this user (see LogBehavior)\n\t\tif ((!isset($this->params['plugin']) || !$this->params['plugin']) && sizeof($this->uses) && isset($this->{$this->modelClass}->Behaviors) && $this->{$this->modelClass}->Behaviors->attached('Logable')) {\n\t\t\t$this->{$this->modelClass}->setUserData($this->activeUser);\n\t\t}\n\t}", "public static function initialize()\n {\n //Can be used to setup things before the execution of the action\n return true;\n }", "protected function _before()\n {\n parent::_before();\n\n $this->setUpEnvironment();\n }", "protected function before()\n {\n $this->requireLogin();\n }", "protected function before()\n {\n $this->requireLogin();\n }", "public function before()\r\n\t{\r\n\t\tif ( ! Auth::instance()->logged_in('admin'))\r\n\t\t{\r\n\t\t\tif ($this->request->route() != Route::get('cms-session-login') && $this->request->route() != Route::get('cms-password-forgot') && $this->request->route() != Route::get('cms-password-sent') && $this->request->route() != Route::get('cms-password-change'))\r\n\t\t\t\t$this->request->redirect(Route::get('cms-session-login')->uri());\r\n\t\t}\r\n\r\n\t\t// Remember last visited page\r\n\t\tif ($this->request->method() == Request::GET && Session::instance()->get('back') != $this->request->referrer())\r\n\t\t{\r\n\t\t\tSession::instance()->set('back', $this->request->referrer());\r\n\t\t}\r\n\r\n\t\t// Set default number of records per page\r\n\t\tif (isset($_GET['per_page']))\r\n\t\t{\r\n\t\t\tSession::instance()->set('per_page', $this->request->query('per_page') == 'all' ? 2147483647 : $this->request->query('per_page'));\r\n\r\n\t\t\t$this->request->redirect(Request::detect_uri());\r\n\t\t}\r\n\r\n\t\tparent::before();\r\n\r\n\t\t$this->template\r\n\t\t\t->set('current_user', Auth::instance()->get_user())\r\n\t\t\t->set('affected_ids', Session::instance()->get('affected_ids'));\r\n\t}", "function beforeFilter() {\n\t\t// only for snaphappi user login, not rpxnow\n\t\tparent::beforeFilter();\n\t\t/*\n\t\t *\tThese actions are allowed for all users\n\t\t */\n\t\t$this->Auth->allow(\n\t\t/*\n\t\t * main\n\t\t */\n\t\t'home', 'groups', 'discussion', 'trends', 'hiddenShots', 'substitutes', 'neighbors', 'search', \n\t\t/*\n\t\t * all\n\t\t */'index', 'all', 'most_active', 'most_views', 'most_recent', 'top_rated', \n\t\t/*\n\t\t * actions\n\t\t */'get_asset_info', 'shot',\n\t\t/*\n\t\t * experimental\n\t\t */\n\t\t 'stories', // TODO: move to ACL\n\t\t 'test', 'addACL', 'updateExif'\n\t\t);\n\t\tAppController::$writeOk = $this->Asset->hasPermission('write', AppController::$uuid);\n\t}", "private function prepareForTests()\n {\n \\Mail::pretend(true);\n }", "public function preDispatch()\n {\n parent::preDispatch();\n if (!Mage::helper('ab_adverboard')->isEnabled()) {\n $this->setFlag('', 'no-dispatch', true);\n $this->_redirect('noRoute');\n }\n }", "public function beforeRender(){\n\t\t\n\t}", "public function pre_dispatch()\n\t{\n\t\tloadTemplate('PortalArticles');\n\t\trequire_once(SUBSDIR . '/PortalArticle.subs.php');\n\t}", "public function _before_init(){}", "public function preDispatch() {\n\t\t\n\t\t}", "public function preDispatch()\n {\n parent::preDispatch();\n $this->getDi()->plugins_payment->loadEnabled()->getAllEnabled();\n }", "private function before_execute()\n {\n }", "protected function beforeProcess() {\n }", "public function beforeFilter() \n\t{\n\t\tparent::BeforeFilter();\n\t\t$this->Auth->allowedActions = array('index', 'view');\n\t}", "function beforeFilter(){\n\t\tparent::beforeFilter(); \n\t}", "function beforeFilter() {\n\t\tparent::beforeFilter();\n\t\t$this->Auth->allowedActions = array('view','index','ajax_view');\n\t\t$libraryCheckArr = array(\"view\",\"index\");\n\t\tif(in_array($this->action,$libraryCheckArr)) {\n\t\t $validPatron = $this->ValidatePatron->validatepatron();\n\t\t\tif($validPatron == '0') {\n\t\t\t\t//$this->Session->destroy();\n\t\t\t\t//$this -> Session -> setFlash(\"Sorry! Your session has expired. Please log back in again if you would like to continue using the site.\");\n\t\t\t\t$this->redirect(array('controller' => 'homes', 'action' => 'aboutus'));\n\t\t\t}\n\t\t\telse if($validPatron == '2') {\n\t\t\t\t//$this->Session->destroy();\n\t\t\t\t$this -> Session -> setFlash(\"Sorry! Your Library or Patron information is missing. Please log back in again if you would like to continue using the site.\");\n\t\t\t\t$this->redirect(array('controller' => 'homes', 'action' => 'aboutus'));\n\t\t\t}\n\t\t}\n\t}", "public function beforeFilter() {\n\t\tif (Configure::read('debug')) {\n\t\t\t$this->Email->delivery = 'debug';\n\t\t}\n\t\t$prefixes = Configure::read('Routing.prefixes');\n\t\t$admin = in_array('admin', $prefixes);\n\t\t$this->Auth->loginAction = array('plugin' => null, 'controller' => 'app_users', 'action' => 'login', 'admin' => false);\n\t\t$this->Auth->logoutRedirect = '/';\n\t\t$this->Auth->loginError = __('Invalid username / password combination. Please try again', true);\n\t\t$this->Auth->autoRedirect = false;\n\t\t$this->Auth->authorize = 'controller';\n\t\t$this->Auth->fields = array('username' => 'email', 'password' => 'passwd');\n\n\t\t$this->Cookie->name = 'bonesRememberMe';\n\t\t$this->Cookie->time = '1 Month';\n\t\t$cookie = $this->Cookie->read('User');\n\n\t\tif (!empty($cookie) && !$this->Auth->user()) {\n\t\t\t$data['User']['email'] = '';\n\t\t\t$data['User']['passwd'] = '';\n\t\t\tif (is_array($cookie)) {\n\t\t\t\t$data['User']['email'] = $cookie['email'];\n\t\t\t\t$data['User']['passwd'] = $cookie['passwd'];\n\t\t\t}\n\t\t\tif (!$this->Auth->login($data)) {\n\t\t\t\t$this->Cookie->destroy();\n\t\t\t\t$this->Auth->logout();\n\t\t\t}\n\t\t}\n\t\tif ($this->Auth->user()) {\n\t\t\t$this->set('userData', $this->Auth->user());\n\t\t}\n\n\t\tif (in_array(strtolower($this->params['controller']), $this->publicControllers)) {\n $this->Auth->allow('*');\n }\n\t}", "public function beforeFilter() {\n $this->set('user',$this->Auth->user());\n $this->set('isadmin',$this->Auth->user('role')==='admin');\n $this->AutoLogin->settings = array(\n // Model settings\n 'model' => 'Member',\n 'username' => 'username',\n 'password' => 'password',\n \n // Controller settings\n 'plugin' => '',\n 'controller' => 'users',\n 'loginAction' => 'login',\n 'logoutAction' => 'logout',\n \n // Cookie settings\n 'cookieName' => 'rememberMeWeblog',\n 'expires' => '+1 month',\n \n // Process logic\n 'active' => true,\n 'redirect' => true,\n 'requirePrompt' => true\n );\n }", "public function _before()\n {\n }", "public function beforeExecute() {\n $instance = \\UserAuth::getInstance();\n if ( $instance->isAuthenticated() === false) {\n $this->redirect(Main::getHomeRouter()->createUrl('login/login'));\n }\n }", "protected function _before(){\n $this->startApplication();\n }" ]
[ "0.66690224", "0.65766007", "0.63420904", "0.63256377", "0.6322047", "0.631757", "0.6311919", "0.6287897", "0.6272253", "0.6234409", "0.6213725", "0.6173399", "0.61450213", "0.6123049", "0.6122034", "0.611529", "0.6095443", "0.60484165", "0.60472876", "0.6037809", "0.60366553", "0.6030203", "0.6029496", "0.6028038", "0.60226756", "0.602122", "0.6018366", "0.6015288", "0.60062563", "0.5987039", "0.5978891", "0.5976481", "0.597518", "0.59687465", "0.59663975", "0.59220326", "0.5898271", "0.58932877", "0.5879446", "0.5875193", "0.5873199", "0.58607626", "0.5858159", "0.58553004", "0.58534193", "0.58515686", "0.5850172", "0.5844118", "0.5843102", "0.5842187", "0.58373743", "0.5833732", "0.58325344", "0.5832138", "0.58299816", "0.5828663", "0.582253", "0.58199406", "0.5816122", "0.58147806", "0.58028024", "0.58023876", "0.5800656", "0.5794703", "0.5777077", "0.5773807", "0.5773807", "0.57708746", "0.57613474", "0.5749573", "0.57471216", "0.5741771", "0.5726649", "0.5724214", "0.57240325", "0.572372", "0.5723226", "0.5717841", "0.5711198", "0.570588", "0.570588", "0.57050914", "0.56964684", "0.5693595", "0.56903917", "0.56806904", "0.5680654", "0.5679433", "0.567691", "0.56766236", "0.5674387", "0.5672505", "0.56698555", "0.5667883", "0.5667663", "0.5663979", "0.5662284", "0.566121", "0.5659824", "0.56574935" ]
0.6172336
12
Returns new batch of emails.
public function getNewBatch($limit = 0) { try { if (!is_numeric($limit) || $limit <= 0) { $limit = $this->limit; } return (new Query)->from($this->queueTable)->where(['status' => Email::STATUS_PENDING])->orderBy(['id' => SORT_ASC])->limit((int)$limit)->all(); } catch (Exception $e) { Log::error($e->getMessage(), null, __METHOD__); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllEmails() {\n return getALL('SELECT * FROM mail');\n}", "public function retrieveAllMails()\n {\n $mails = new Collection();\n for($i = 1; $i <= $this->countAllMails(); $i++)\n {\n $mails->add($this->retrieveMail($i));\n }\n return $mails;\n }", "public function emails()\n\t{\n\t\treturn $this->oneToMany(__NAMESPACE__ . '\\\\Mailinglist\\\\Email', 'mid');\n\t}", "public function getNewMailsAction()\n {\n $this->View()->success = true;\n $mails = $this->container->get('dbal_connection')->fetchAll('SELECT id, subject, receiverAddress FROM s_plugin_mailcatcher WHERE id > :id ORDER BY id ASC', ['id' => $this->Request()->getParam('id')]);\n $this->View()->mails = $mails;\n }", "public function batchSend()\n\t{\n\t\treturn $this->mailer->batchSend($this->message);\n\t}", "public function getAllEmails() {\n $this->db->cache = false;\n if (!$this->db->from($this->table)->select('email')->all()) {\n return [];\n }\n return $this->db->from($this->table)->select('email')->all();\n }", "private function disposableEmailList()\n {\n return array(\n '[email protected]',\n '[email protected]',\n '[email protected]',\n '[email protected]',\n '[email protected]',\n );\n }", "public function removeAllEmails() {\n $this->emails = \"{}\";\n return $this;\n }", "public function getEmails()\n {\n if (!isset($this->options['keep'])) {\n throw new BadMethodCallException(\"This function only works with the `keep` option\");\n }\n \n return $this->emails;\n }", "public function batchEmail($sender)\n\t{\n\t\t$total = 0;\n\t\t$success = 0;\n\t\t$mailer = Yii::app()->email;\n\n\t\tforeach($this->emailList as $record)\n\t\t{\n\t\t\tif (!empty($record->emailAddress) && $mailer->send(\n\t\t\t\t$record->emailAddress,\n\t\t\t\t$this->emailSubject, \n\t\t\t\t$this->emailContent, \n\t\t\t\t$sender,\n\t\t\t\t$this->attachments\n\t\t\t))\n\t\t\t\t$success++;\n\t\t\telse if (!empty($record->alternateEmail) && $mailer->send(\n\t\t\t\t$record->alternateEmail,\n\t\t\t\t$this->emailSubject, \n\t\t\t\t$this->emailContent, \n\t\t\t\t$sender,\n\t\t\t\t$this->attachments\n\t\t\t))\n\t\t\t\t$success++;\n\t\t\t$total++;\n\t\t}\n\t\treturn array (\n\t\t\t'count' => $success,\n\t\t\t'total' => $total\n\t\t);\n\t}", "public function getEmails()\n\t{\n \\Phalcon\\DI::getDefault()->get('logger')->log(\"Emails: \" . print_r($this->emails, true));\n\t\treturn $this->emails;\n\t}", "private function emailList()\n {\n return array(\n '[email protected]',\n '[email protected]',\n '[email protected]',\n );\n }", "private function _fetchEmailsFromInbox()\n {\n // refresh the cache\n $this->imapConnection->getResource()->clearLastMailboxUsedCache();\n $messages = $this->inbox->getMessages();\n if ($messages instanceof \\ArrayIterator) {\n $messages = iterator_to_array($messages);\n }\n\n return $messages;\n }", "abstract function getEmailsArray() : array;", "function getEmails() {\n\treturn db_query(\"SELECT email FROM Emails\");\n}", "public function scopeGetAllMails()\n {\n\n $gname = Input::get( 'gname' );\n\n $mails = Tolist::findMany( array(\n 'to_id' => Auth::user()->id . '_' . $gname\n ), array(\n 'email'\n ) )->all( 'email' );\n\n return Helper::cleanGroups( $mails, '|' );\n\n }", "function getNonPrimaryEmailsData(SugarBean $bean, array $ids)\n{\n // Split the ids array into chunks of size 100\n $chunks = array_chunk($ids, 100);\n\n // Attributes of non non-primary email that are about to be grouped later\n $non_primary_emails = array();\n\n foreach ($chunks as $chunk) {\n // Pick all the non-primary mails for the chunk\n $query = getNonPrimaryEmailsExportQuery($bean, $chunk);\n $data = $query->execute();\n\n foreach ($data as $row) {\n $non_primary_emails[$row['bean_id']][] = array(\n $row['email_address'],\n $row['invalid_email'] ? '1' : '0',\n $row['opt_out'] ? '1' : '0',\n );\n }\n }\n\n $result = array();\n foreach ($non_primary_emails as $bean_id => $emails) {\n $result[$bean_id] = serializeNonPrimaryEmails($emails);\n }\n\n return $result;\n}", "public function fetchEmails(): void\n {\n $this->fetchedEmails = [];\n\n try {\n $response = $this->mailhog->request('GET', '/api/v1/messages');\n $this->fetchedEmails = json_decode($response->getBody(), false);\n } catch (Exception $e) {\n $this->fail('Exception: ' . $e->getMessage());\n }\n $this->sortEmails($this->fetchedEmails);\n\n // by default, work on all emails\n $this->setCurrentInbox($this->fetchedEmails);\n }", "public function sendBatchEmail($peeps, $unsubtype, $SUBJECT, $TEXT, $context, \r\n // $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\"), $REPLYTO = null, $ATTACHMENT = null) \r\n $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\"), $REPLYTO = null, $ATTACHMENT = null) \r\n {\r\n // $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\");\r\n $FROM = array('[email protected]' => '[email protected]');\r\n $efunctions = new Cvuuf_emailfunctions();\r\n $peoplemap = new Application_Model_PeopleMapper();\r\n $unsmap = new Application_Model_UnsubMapper();\r\n\r\n $results = array();\r\n $orwhere = array(\r\n array('`all`', ' = ', 1),\r\n array($unsubtype, ' = ', 1),\r\n );\r\n $unsubs = $unsmap->fetchOrWhere($orwhere);\r\n $unsubids = array();\r\n foreach ($unsubs as $unsub)\r\n {\r\n $person = $peoplemap->find($unsub->id);\r\n if ($person['email'] <> '')\r\n $unsubids[$person['email']] = 1;\r\n }\r\n\r\n $emailCount = count($peeps); \r\n $results[] = \"$emailCount copies to be sent.\";\r\n \t\t$count = 0;\r\n \t\t$fullcount = 0;\r\n\r\n $totalsent = 0;\r\n $invalid = array();\r\n $unsub = array();\r\n if ($emailCount >= 30) {\r\n return array('results' => $results.\" (rejected to avoid spam blacklists, 30-email max. Contact [email protected] to work out how to send this)\", 'log' => 'rejected to avoid spam blacklists', 'totalsent' => $totalsent, \r\n 'invalid' => $invalid, 'unsub' => $unsub);\r\n }\r\n unset($TO_array);\r\n \t\tforeach ($peeps as $peep) \r\n {\r\n \t $emailAddress = $peep->email;\r\n \t if (!$efunctions->isValidEmail($emailAddress))\r\n { \r\n $invalid[] = $emailAddress;\r\n }\r\n elseif (isset($unsubids[$emailAddress]))\r\n {\r\n $unsub[] = $emailAddress;\r\n } \r\n else \r\n {\r\n $fullcount++;\r\n $TO_array[$count++] = $emailAddress;\r\n \t\t\tif (($count%20) == 0) \r\n {\r\n $numsent = $efunctions->sendEmail($SUBJECT, $TO_array, $TEXT, $context, $FROM, $REPLYTO, $ATTACHMENT);\r\n $totalsent += $numsent;\r\n unset($TO_array);\r\n $count = 0;\r\n sleep(1);\r\n \t\t }\r\n // Check section limit and delay if reached\r\n if (($fullcount % 10) == 0)\r\n {\r\n $results[] = \"Progress count $fullcount sent\"; \r\n sleep(5);\r\n }\r\n \t}\r\n } \r\n // send last email segment\r\n $numsent = $efunctions->sendEmail($SUBJECT, $TO_array, $TEXT, $context, $FROM, $REPLYTO, $ATTACHMENT);\r\n $totalsent += $numsent;\r\n $results[] = sprintf(\"Ending fraction count %d copies\\n\", $numsent);\r\n $log = $efunctions->log_email($context, $emailCount, $totalsent, count($invalid), count($unsub));\r\n $results[] = \"Last Segment sent\";\r\n\r\n return array('results' => $results, 'log' => $log, 'totalsent' => $totalsent, \r\n 'invalid' => $invalid, 'unsub' => $unsub);\r\n }", "public function get()\n {\n if (!$this->connect()) {\n throw new Exception('ERROR: Could not connect.');\n }\n\n if ($this->id) {\n $this->emails = array();\n\n $this->emails[] = $this->getEmail($this->id);\n\n return $this->emails;\n }\n\n $this->emails = array();\n\n $this->email_index = imap_search(\n $this->stream(),\n $this->modes(),\n false,\n $this->encoding\n );\n\n if (!$this->limit) {\n $this->limit = isset($this->email_index) && is_array($this->email_index) ? count($this->email_index) : 0;\n }\n\n if ($this->email_index) {\n if ($this->order == 'DESC') {\n rsort($this->email_index);\n } else {\n sort($this->email_index);\n }\n\n if ($this->limit || ($this->limit && $this->offset)) {\n $this->email_index = array_slice(\n $this->email_index,\n $this->offset,\n $this->limit\n );\n }\n\n $this->emails = array();\n\n foreach ($this->email_index as $id) {\n $this->emails[] = $this->getEmailByMessageSequence($id);\n\n if ($this->mark_as_read) {\n $this->markAsRead($id);\n }\n }\n }\n\n return $this->emails;\n }", "public function getBatch(){\n $Voters = Voter::where('mailing_street_address_1', '=', '')\n ->skip($this->offset)\n ->take($this->batch_size)\n ->get();\n\n $this->offset += $this->batch_size;\n\n return ($Voters->count() > 0)? $Voters: false;\n }", "public function emailadressen() {\r\n\t\t$objDBMaillijstEmailAdres = new clsDBMaillijstEmailAdres();\r\n\t\tforeach($objDBMaillijstEmailAdres->selectAll($this->getm_iBedrijfID(), $this->getm_iMaillijstID()) as $rs){\r\n\t\t\tarray_push($this->m_colEmailAdressen,new clsEmailAdres($rs['BedrijfID'],$rs['EmailAdresID'])); // voeg object MaillijstEmailAdres toe aan emailadressen collection\r\n\t\t};\r\n\t \treturn $this->m_colEmailAdressen;\r\n\t}", "public function getEmails()\n {\n return $this->emails;\n }", "public function getEmails()\n {\n return $this->emails;\n }", "function getMailList() {\n return getAll(\"SELECT id,`email` FROM `member` WHERE id != ?\"\n , [getLogin()['mid']]);\n}", "public function getMails(): Collection\n {\n\n return $this->mails;\n\n }", "public function getAllEmailAddresses() {\n $saveCurrentFolder = $this->folder;\n $emails = array();\n foreach($this->getFolders() as $folder) {\n $this->selectFolder($folder);\n foreach($this->getMessages(false) as $message) {\n $emails[] = $message['from'];\n $emails = array_merge($emails, $message['to']);\n if (isset($message['cc'])) {\n $emails = array_merge($emails, $message['cc']);\n }\n }\n }\n $this->selectFolder($saveCurrentFolder);\n return array_unique($emails);\n }", "public function getSendMailings() {\n\t\t$sql = 'SELECT pageId, UNIX_TIMESTAMP(dateadded) as `dateadded` FROM mailqueue WHERE issend=2';\n\t\t$ids = $this -> _conn -> getFields($sql);\n\t\t$rows = $this -> _conn -> getRows($sql);\n\t\t$page = new Page();\n\t\t$result = $page -> getPagesByIds($ids, true);\n\t\tif($result) {\n\t\t\tforeach($result as $page) {\n\t\t\t\tforeach($rows as $row) {\n\t\t\t\t\tif($row -> pageId == $page -> pageId) {\n\t\t\t\t\t\t$page -> publicationdate = $row -> dateadded;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function getAllEmails() {\n $users = $this->getDoctrine()->getRepository(User::class)->findAll();\n $emails = [];\n foreach($users as $email) {\n if(\"[email protected]\" != $email->getEmail())\n array_push($emails, $email->getEmail());\n }\n\n return $emails;\n }", "static function insertSendAllUnsentEmailJob() {\n return self::insertJobOfType( 'com.macbackpackers.jobs.SendAllUnsentEmailJob');\n }", "public function emails()\n {\n return $this->emails;\n }", "public function getEmailQueue()\n {\n return $this->query(null, ['isEmail' => 1, 'isEmailed' => 0]);\n }", "function get_all_mailings(){\n \n #api return count 25 as default.\n #set max count in rowCount as 500\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'rowCount' => 500 \n );\n \n /*$sql = \"Select count(*) as count From civicrm_mailing\";\n $mailingCount = CRM_Core_DAO::singleValueQuery($sql);\n if($mailingCount > 25){\n $params['rowCount'] = $mailingCount;\n }*/\n $aMailings = civicrm_api('Mailing', 'get', $params);\n if( $aMailings['is_error'] == 1 ){\n watchdog( WATCHDOG_DEBUG\n , \"Calling get_all_mailings():\\n\" .\n '$aMailings:' . print_r( $aMailings, true ) . \"\\n\"\n );\n return;\n }\n foreach ( $aMailings['values'] as $key => $mailing ){\n $pMailingJob = array(\n 'version' => 3,\n 'sequential' => 1,\n 'mailing_id' => $mailing['id']\n );\n $aMailingJob = civicrm_api('MailingJob', 'get', $pMailingJob);\n if( $aMailingJob['is_error'] != 1 && $aMailingJob['count']!= 0 ){\n $status = $aMailingJob['values'][0]['status'];\n $stDate = array_search('start_date', $aMailingJob['values'][0]);\n $endDate = array_search('end_date', $aMailingJob['values'][0]);\n $not_scheduled = false;\n if($stDate){\n $start_date = CRM_Utils_Date::customFormat($stDate);\n }else{\n $start_date = 'NULL';\n }\n if($endDate){\n $end_date = CRM_Utils_Date::customFormat($endDate);\n }else{\n $end_date = 'NULL';\n }\n }else{\n $status = \"Draft\";\n $start_date = $end_date = 'NULL';\n $not_scheduled = true;\n }\n \n //get change the action link based on the status\n if($not_scheduled){\n $actionUrl = CRM_Utils_System::url( 'civicrm/quickbulkemail', 'mid='.$mailing['id'].'&continue=true&reset=1');\n $actionName = 'Edit';\n }else{\n $actionUrl = CRM_Utils_System::url( 'civicrm/quickbulkemail', 'mid='.$mailing['id'].'&reset=1');\n $actionName = 'Re-Use';\n }\n \n //get scheduled_id and contact name\n if(!empty( $mailing['scheduled_id'] )){\n $scheduled_id = $mailing['scheduled_id'];\n $scheduled_name = self::get_contact_name( $mailing['scheduled_id'] );\n }else{\n $scheduled_id = 'NULL';\n $scheduled_name = 'NULL';\n }\n \n if(empty($mailing['scheduled_date'])) {\n $mailing['scheduled_date'] = NULL;\n }\n \n $action = \"<span><a href='\".$actionUrl.\"'>\".$actionName.\"</a></span>\" ;\n $rows[] = array( 'id' => $mailing['id']\n ,'name' => $mailing['name']\n ,'status' => $status\n ,'created_date' => CRM_Utils_Date::customFormat($mailing['created_date'])\n ,'scheduled' => CRM_Utils_Date::customFormat($mailing['scheduled_date'])\n ,'start' => $start_date\n ,'end' => $end_date\n ,'created_by' => self::get_contact_name( $mailing['created_id'] )\n ,'scheduled_by' => $scheduled_name\n ,'created_id' => $mailing['created_id']\n ,'scheduled_id' => $scheduled_id\n ,'action' => $action\n ); \n }\n return $rows;\n }", "public function getAllUnreadEmailsSenders()\n {\n $messages = collect(LaravelGmail::message()->unread()->preload()->all());\n $fromList = [];\n\n $messages->each(function ($message) use (&$fromList) {\n $fromList[] = $message->getFrom();\n });\n\n // TODO: can be optimized\n return $this->getUnreadEmailsList($fromList);\n }", "public function sendemailmult()\n\t{\n\t\t$counter=DB::table('subscribes')->count('email');\n\t\tif($counter!=0)\n\t\t{\n\t\t\t$users=DB::select(\"select *from subscribes\");\n\tforeach($users as $user)\n\t{\n\t\t$emails[]=$user->email;\n\t\t\n\t\t\n\t}\n\t//print_r($emails) ;\n\t\t\tMail::send('news', [$emails], function($message) use ($emails)\n{ \n $message->to($emails)->subject('Latest news'); \n//this script is like a loop to update every 10 row will be checked and add 10 row\n\t\t\t\n\t\t\t\t\t$updatelatest=DB::update(\"update news_articles set latest=0 where latest=latest ORDER by created_at\");\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\n\t\t\t\t\n});\n\t\treturn redirect()->back();\nvar_dump( Mail:: failures());\nexit;\n\t\t}\n\t\telse{\n\t\t\treturn redirect()->back();\n\t\t}\n\t\t\n\t\t\n\t\t//start writing a code to check if table does not have subscribers users\n\n\t\t\n\t\t//echo $collection = collect($users['email']);\n\t\t//$emails = ['[email protected]', '[email protected]'];\n\t\t\n\t\n\n\t}", "public function listadeTodosEmailDao(){\r\n \r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoEmail.php\");\r\n \r\n $obj = Connection::getInstance();\r\n $listaEmail = array();\r\n \r\n $string = \"Select nome,email,comentario,data from email order by data\";\r\n $resultado = mysql_query($string) or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n\t$i=0; \r\n while ($registro = mysql_fetch_assoc($resultado)){\r\n\r\n\t $email = new objetoEmail(); \r\n $email->enviarEmail($registro['email'],$registro['nome'],$registro['comentario'],$registro['data']); \r\n\t $listaEmail[$i] = $email;\r\n \r\n $i++;\r\n }\r\n\t\t\r\n\t\tmysql_free_result($resultado);\r\n $obj->freebanco();\r\n return $listaEmail;\r\n }", "public function get(): array\n {\n $inbox = $this->connect();\n $emails = imap_search($inbox, $this->FLAG);\n\n if ($emails == false) {\n return [];\n }\n\n $result = [];\n\n foreach ($emails as $mail) {\n $headerInfo = imap_headerinfo($inbox, $mail);\n\n $output = [\n 'subject' => $headerInfo->subject,\n 'to' => $headerInfo->toaddress,\n 'date' => $headerInfo->date,\n 'from' => $this->parseEmail($headerInfo->fromaddress),\n 'reply_to' => $this->parseEmail($headerInfo->reply_toaddress),\n 'flag' => $this->FLAG,\n 'body' => [],\n ];\n\n $emailStructure = imap_fetchstructure($inbox, $mail);\n\n if (!isset($emailStructure->parts)) {\n $output['body'] = imap_body($inbox, $mail, FT_PEEK);\n } else {\n $output['body'] = [];\n $this->extractAttachments($inbox, $mail, $emailStructure, $output['body']);\n }\n\n $result[] = $output;\n }\n\n imap_expunge($inbox);\n imap_close($inbox);\n\n return $result;\n }", "function get_emails($return_email = '')\n\t{\n\t\t$xml = $this->load_url(\"settings/emailaddresses\");\n\n\t\tif(!$xml):\n\t\t\treturn false;\n\t\tendif;\n\n\t\t// parse into nicer array\n\t\t$emails = array();\n\t\t$_emails = (isset($xml['feed']['entry'])) ? $xml['feed']['entry'] : false;\n\n\t\tif(is_array($_emails)):\n\t\t\tif(isset($_emails[0]['link_attr']['href'])):\n\t\t\t\tforeach($_emails as $k => $v):\n\t\t\t\t\t$id = $this->get_id_from_link($v['link_attr']['href']);\n\t\t\t\t\t$email = $v['content']['Email'];\n\t\t\t\t\t$email['id'] = $id;\n\n\t\t\t\t\tif($return_email && $return_email == $v['content']['Email']['EmailAddress']):\n\t\t\t\t\t\t// return single email\n\t\t\t\t\t\treturn $email;\n\t\t\t\t\tendif;\n\n\t\t\t\t\t$emails[] = $email;\n\t\t\t\tendforeach;\n\t\t\telse:\n\t\t\t\t$id = $this->get_id_from_link($_emails['link_attr']['href']);\n\t\t\t\t$email = $_emails['content']['Email'];\n\t\t\t\t$email['id'] = $id;\n\t\t\t\t$emails[] = $email;\n\n\t\t\t\tif($return_email && $return_email == $_emails['content']['Email']['EmailAddress']):\n\t\t\t\t\t// return single email\n\t\t\t\t\treturn $email;\n\t\t\t\tendif;\n\t\t\tendif;\n\n\t\tendif;\n\n\t\treturn $emails;\n\t}", "public function getEmails() {\n\t\treturn empty( $this->container['emails'] ) ? null : $this->container['emails'];\n\t}", "function edd_pup_queue_emails() {\r\n\r\n\t$email_list = array();\r\n\tglobal $wpdb;\r\n\r\n\t$query = \"SELECT DISTINCT email_id FROM $wpdb->edd_pup_queue WHERE sent = 0\";\r\n\r\n\t$emails = $wpdb->get_results( $query , ARRAY_A );\r\n\r\n\tforeach ( $emails as $email ) {\r\n\t\t$email_list[] = $email['email_id'];\r\n\t}\r\n\r\n\treturn $email_list;\r\n}", "public function getEmails($filters = [])\n {\n $authUser = Auth::user();\n $user = [];\n\n if (!ine($filters, 'users')) {\n $user[] = $authUser->id;\n\t\t} else {\n\t\t\t$user = $filters['users'];\n\t\t\tif($user != 'all') {\n\t\t\t\t$user = (array)$user;\n\t\t\t}\n }\n\n if (ine($filters, 'users') && !$authUser->isAuthority()) {\n $user[] = (array)$authUser->id;\n }\n\n if ((ine($filters, 'customer_id') || ine($filters, 'job_id') || ine($filters, 'stage_code'))) {\n if($authUser->isSubContractorPrime() && isset($filters['users'])) {\n\t\t\t\t$user = (array)$filters['users'];\n\t\t\t} else {\n\t\t\t\t$user = [];\n\t\t\t}\n }\n $filters['users'] = $user;\n $emails = $this->repo->getEmails($filters);\n return $emails;\n }", "public function getEmailReferrers();", "public function sendBulkMail(Request $request){\n $subcriber=Subscriber::all();\n foreach ($subcriber as $value) {\n Mail::to($value)->send(new newslater($request->all()));\n\n }\n }", "public function getUnseenEmails(): array\n {\n $emails = [];\n\n try {\n $imap = $this->loginToInbox();\n\n // We only want the emails we haven't fetched before.\n foreach ($imap->search(['UNSEEN']) as $id) {\n $data = $imap->fetch(['RFC822.HEADER', 'RFC822.TEXT'], $id);\n\n // We need to combine headers and text in order to have a full email.\n $emails[] = InboundEmail::fromMessage($data['RFC822.HEADER'].\"\\r\\n\".$data['RFC822.TEXT']);\n }\n\n $imap->logout();\n } catch (\\Exception $e) {\n // Just log the error and get on with the method execution.\n $this->logger->error($e->getMessage());\n }\n\n return $emails;\n }", "public function emails()\n {\n return $this->hasMany(Email::class);\n }", "protected function getEmailBatchesInParallel()\n {\n\n $options = $this->getOptions();\n\n $this->stdout('Batches in Parallel '.$options->group_emails_in_parallel);\n\n\n return $options->group_emails_in_parallel;\n }", "public function getNew()\n\t{\n\t\t$msgs = $this->getAllByQuery(\"date_sent >= ?\", [$this->last_query_time]);\n\t\t$this->updateQueryTime();\n\t\treturn $msgs;\n\t}", "public function getMessagesAndFlush() {}", "public function findAll()\n {\n return $this->em\n ->getRepository('App:Mail')\n ->findAll()\n ;\n }", "public function getMailUsers()\n {\n return $this->userRepo->getMailUsers(\\Auth::user()->id);\n }", "public function cria_lista_emails($emails){\n $temp = explode(';', $emails);\n\n $dest = array();\n $i = 0;\n\n foreach($temp as $valor){\n if($valor != ''){\n $dest[$i]['nome'] = $valor;\n $dest[$i]['email'] = $valor;\n\n $i++;\n }\n }\n\n return $dest;\n }", "public function GetEmailAddresses()\n {\n $dbTalker = new DbTalker();\n return $dbTalker->GetAllMembersAndEmails();\n }", "public function getExtraEmailAddresses(): array\n {\n if (empty($this->extra_emails)) {\n return [];\n }\n\n return collect($this->extra_emails)\n ->map(function ($email) {\n return trim($email['email']);\n })\n ->all();\n }", "private function getSubscribersBatch(int $count)\n {\n $batch = [];\n\n for ($i = 1; $i <= $count; $i++) {\n $batch[] = [\n $i => [\n 'chaz' . $i . '@emailsim.io',\n 'Html',\n 'Chaz store',\n 'Chaz store view',\n 'Chaz website',\n 'Subscribed'\n ]\n ];\n }\n\n return $batch;\n }", "public function getSubscriberEmails() {\n $stmt = $this->pdo->query(\"SELECT email\n FROM subscribers\n \");\n $subscribers = [];\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $subscribers[] = $row['email'];\n }\n return $subscribers;\n }", "public function emails()\n {\n return $this->hasMany(PartenaireEmail::class);\n }", "public function getMailsById($ids)\n {\n return $this->model->getMailsById($ids);\n }", "public function getAllMails()\n {\n $user = Auth::user();\n $emails = DB::table('users')->select('id','email')->get();\n return response()->json($emails);\n }", "private function getMails()\n {\n $data = array();\n /**@var $mail Enlight_Components_Mail */\n foreach ($this->mails as $mail) {\n $data[] = array(\n 'information' => array(\n 'From' => $mail->getFrom(),\n 'From name' => $mail->getFromName(),\n 'Default from' => $mail->getDefaultFrom(),\n 'Recipients' => $mail->getRecipients(),\n 'Subject' => $mail->getSubject(),\n 'Subject - plain' => $mail->getPlainSubject(),\n 'To' => $mail->getTo(),\n 'Charset' => $mail->getCharset(),\n 'Date' => $mail->getDate(),\n 'Html body' => $mail->getBodyHtml(),\n 'Text body' => $mail->getBodyText(),\n 'Default reply to' => $mail->getDefaultReplyTo(),\n 'Header encoding' => $mail->getHeaderEncoding(),\n 'Message ID' => $mail->getMessageId(),\n 'Mime' => $mail->getMime(),\n 'Mime boundary' => $mail->getMimeBoundary(),\n 'Part count' => $mail->getPartCount(),\n 'Parts' => $mail->getParts(),\n 'Type' => $mail->getType(),\n ),\n 'content' => $mail->getPlainBody()\n );\n }\n\n return $data;\n }", "function nice_get_entries()\n\t{\n\t\t$_m=$GLOBALS['SITE_DB']->query_select('f_welcome_emails',array('*'));\n\t\t$entries=new ocp_tempcode();\n\t\tforeach ($_m as $m)\n\t\t{\n\t\t\t$entries->attach(form_input_list_entry(strval($m['id']),false,$m['w_name']));\n\t\t}\n\n\t\treturn $entries;\n\t}", "function obtenirListeEmailPersonnesAJourDeCotisation()\n {\n $timestamp = time() - 60 * 86400;\n // Personne physique seule\n $requete = \"SELECT group_concat(DISTINCT email SEPARATOR ';')\n FROM (\n SELECT app.email\n FROM afup_cotisations ac\n INNER JOIN afup_personnes_physiques app ON app.id = ac.id_personne\n WHERE date_fin >= \" . $timestamp . \"\n AND type_personne = 0\n AND etat = 1\n UNION\n SELECT app.email\n FROM afup_cotisations ac\n INNER JOIN afup_personnes_physiques app ON app.id_personne_morale = ac.id_personne\n WHERE date_fin >= \" . $timestamp . \"\n AND type_personne = 1\n AND etat = 1 ) tmp\";\n return $this->_bdd->obtenirUn($requete);\n }", "public function getAllOldPendingEmail($cache = true)\n {\n return $this->getAllOldPendingEmailQuery($cache)->execute();\n }", "function clearEmails() {\n\t\treturn $this->mailer->clearEmails();\n\t}", "function clearEmails() {\n\t\treturn $this->mailer->clearEmails();\n\t}", "protected function getRecipientEmails()\n {\n return $this->recipients\n ->map(function($user) {\n return $user->{User::COLUMN_EMAIL};\n })\n ->toArray();\n }", "public static function getEmails($type, $entry, $update=true, $all=false) {\n $emails = [];\n switch($type) {\n case self::T_USER:\n $user = UserFinder::getById($entry);\n if(!is_null($user)) {\n $emails[] = $user['email'];\n }\n break;\n case self::T_GROUP:\n $group = GroupFinder::getById($entry);\n if(!is_null($group)) {\n $group_emails = $group->getEmails($update, $all);\n // Need to update the group state.\n if($update) {\n $group->store();\n }\n $emails = array_merge($emails, $group_emails);\n }\n break;\n }\n $cfg = new DBConfig();\n if(!count($emails)) {\n $emails[] = $cfg['default_email'];\n }\n\n list($emails) = Hook::call('assignee.emails', [$emails]);\n\n return $emails;\n }", "function listEmails(){\n \n $conn = $this->connect();\n $ret = '';\n \n $sql = 'select email from ' . $this->dbtable;\n\t\t\t$query = mysql_query( $sql, $conn );\n \n\t\t\twhile( $row = mysql_fetch_assoc( $query ) ){\n\t\t\t\t$ret .= $row['email'] . \";\\n\";\n\t\t\t}\n \n mysql_close( $conn );\n \n\t\t\treturn $ret;\n }", "function send_emails() {\n $settings = new Settings();\n $mail_companies = $settings->get_mailto_companies();\n $failed_list_mails = array();\n $mail_reader = new EmailReader(dirname(__FILE__) . '/mails', $this->user_information);\n foreach ($this->cookie_list as $item) {\n if (!$item->has_email()) {\n \t$failed_list_mails[] = $item;\n }\n else {\n $template = $mail_reader->get_companies_mail($item, $mail_companies);\n if (!$this->mail_to($item, $template, $mail_companies)) {\n $failed_list_mails[] = $item;\n }\n\t }\n }\n $this->update_amounts_used($this->cookie_list);\n\n\n $attachments = array();\n\n $failed_list_letters = array();\n foreach ($this->cookie_list as $item) {\n if (!$item->has_address()) {\n $failed_list_letters[] = $item;\n }\n else {\n $letter_generator = new LetterGenerator($this->user_information);\n $pdf = $letter_generator->generate_letter_string($item);\n if ($pdf) {\n \t$folder_writer = new FolderHandler();\n \t$file = $folder_writer->store_file($pdf, \"pdf\");\n \tif ($file) {\n \t\t$attachments[] = $file;\n \t}\n \telse {\n \t\t$failed_list_letters[] = $item;\n \t}\n }\n else {\n $failed_list_letters[] = $item;\n }\n }\n }\n\n\n\n return $this->send_confirmation_mail($attachments, $failed_list_mails, array_diff($this->cookie_list,\n $failed_list_mails), $failed_list_letters, array_diff($this->cookie_list, $failed_list_letters),\n $mail_companies);\n }", "function get_all_mail()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('mail')->result_array();\n }", "public function getNewsletterRecipientIDs();", "public function newMsgs()\n {\n $uid = Auth::user()->id;\n $messages = Msgs::where(['to'=> $uid, 'new'=> 1]);\n return $messages;\n }", "public function fetchEmails($minimumExpectedMails = 1)\n {\n $this->fetchedEmails = [];\n\n try\n {\n $this->fetchedEmails = $this->_fetchEmailsFromInboxWithRetry($minimumExpectedMails);\n }\n catch(\\Exception $e)\n {\n $this->fail('Exception: ' . $e->getMessage());\n }\n\n // by default, work on all emails\n $this->setCurrentInbox($this->fetchedEmails);\n }", "private function get_unique_users() : moodle_recordset {\n global $DB;\n\n $subsql = 'SELECT DISTINCT(useridto) as id\n FROM {message_email_messages}\n WHERE id <= ?';\n\n $sql = \"SELECT *\n FROM {user} u\n WHERE id IN ($subsql)\";\n\n return $DB->get_recordset_sql($sql, [$this->maxid]);\n }", "public function CreateEmails($Payload){\n\t\t\tif(empty($Payload['id'])){\n\t\t\t\tthrow new Exception('id can not be empty.');\n\t\t\t}\n\t\t\tif(empty($Payload['Body'])){\n\t\t\t\tthrow new Exception('body can not be empty.');\n\t\t\t}\n\t\t\t$Payload['Verb']='POST';\n\t\t\t$Payload['URL']='/V1/creditmemo/'.$Payload['id'].'/emails';\n\t\t\t$Payload['Body']=json_encode($Payload['Body']);\n\t\t\treturn $this->Execute($Payload);\n\t\t}", "public function getOrderEmailList(){\n // Set method and action\n $method = 'email';\n $action = 'getOrderEmailList';\n\n // Set data\n $data = array('params' => true);\n\n // Send request and retrieve response\n $result = Dispatcher::send($method, $action, $data);\n\n return $result;\n }", "public function getNewMessages()\n {\n $db = dataBase::dbConnect();\n $req = $db->query(\"SELECT * FROM message WHERE nouveau = true ORDER BY id DESC\");\n return $req;\n }", "public function getModeratorEmails() {\n $moderatorNames = $this->get('moderators');\n $moderatorNames = explode(',',$moderatorNames);\n $moderators = array();\n foreach ($moderatorNames as $name) {\n $c = $this->xpdo->newQuery('modUser');\n $c->innerJoin('modUserProfile','Profile');\n $c->select(array('modUser.id','Profile.email'));\n $c->where(array('username' => $name));\n $user = $this->xpdo->getObject('modUser',$c);\n if ($user) {\n $moderators[] = $user->get('email');\n }\n }\n\n /* now get usergroup moderators */\n $moderatorGroup = $this->get('moderator_group');\n $c = $this->xpdo->newQuery('modUserProfile');\n $c->innerJoin('modUser','User');\n $c->innerJoin('modUserGroupMember','UserGroupMembers','User.id = UserGroupMembers.member');\n $c->innerJoin('modUserGroup','UserGroup','UserGroup.id = UserGroupMembers.user_group');\n $c->where(array(\n 'UserGroup.name' => $moderatorGroup,\n ));\n $members = $this->xpdo->getCollection('modUserProfile',$c);\n foreach ($members as $member) {\n $email = $member->get('email');\n if (!empty($email)) array_push($moderators,$email);\n }\n $moderators = array_unique($moderators);\n\n return $moderators;\n }", "function membersemailist($memberquery){\n\t$f3=$this->f3;\n\t$members =\tnew Member($this->db);\n\t$memblist=$members->load();\n\t$membemails= $this->db->exec('SELECT distinct(email) as unqemail from members where u3ayear = '.'\"2015-2016\"'. ' and status =\"Active\" and email <> \"\" ' .$memberquery.' order by unqemail;');\n\t$output = iterator_to_array(new RecursiveIteratorIterator(\n new RecursiveArrayIterator($membemails)), FALSE);\n\treturn array_values($output);\n\t\n\t\n}", "public function to(array $emails);", "public function handle()\r\n {\r\n foreach (AccountModel::all() as $account) {\r\n $client = $this->getClient($account);\r\n $service = new Google_Service_Gmail($client);\r\n $user = 'me';\r\n $i = 0;\r\n $nextPageToken = null;\r\n do {\r\n $i += 1;\r\n $messages = $service->users_messages->listUsersMessages($user,\r\n [\r\n 'labelIds' => ['INBOX', 'UNREAD'],\r\n 'pageToken' => $nextPageToken\r\n ]\r\n );\r\n $nextPageToken = $messages->nextPageToken;\r\n //save list\r\n $messageList = new ListModel;\r\n $messageList->account_id = $account->id;\r\n $messageList->next_page_token = $messages->nextPageToken;\r\n $messageList->result_size_estimate = $messages->resultSizeEstimate;\r\n $messageList->count = count($messages);\r\n $messageList->save();\r\n\r\n foreach ($messages as $message) {\r\n $messageNew = MessageModel::firstOrNew(['message_id' => $message->id]);\r\n if ($messageNew->id == null) {\r\n $messageContent = $service->users_messages->get($user, $message->id);\r\n $messagePayload = $messageContent->getPayload();\r\n $messageHeader = $this->parseMessageHeader($messagePayload->getHeaders());\r\n\r\n $messageLabels = $messageContent->getLabelIds();\r\n $messageNew->account_id = $account->id;\r\n $messageNew->list_id = $messageList->id;\r\n $messageNew->message_id = $messageContent->getId();\r\n $messageNew->labels = serialize($messageLabels);\r\n $messageNew->label = $messageLabels[0];\r\n if (isset($messageHeader['From'])) {\r\n $messageFrom = explode(' <', $messageHeader['From']);\r\n if (count($messageFrom) > 1) {\r\n $messageNew->from = $this->clearEmail(str_replace('>', '', $messageFrom[1]));\r\n $messageNew->from_name = str_replace('\"', '', $messageFrom[0]);\r\n } else {\r\n $messageNew->from = $this->clearEmail($messageHeader['From']);\r\n }\r\n }\r\n if (isset($messageHeader['To'])) {\r\n $messageTo = explode(' <', $messageHeader['To']);\r\n if (count($messageTo) > 1) {\r\n $messageNew->to = $this->clearEmail(str_replace('>', '', $messageTo[1]));\r\n } else {\r\n $messageNew->to = $this->clearEmail($messageHeader['To']);\r\n }\r\n }\r\n $messageNew->date = isset($messageHeader['Date']) ? $messageHeader['Date'] : '';\r\n $messageNew->subject = isset($messageHeader['Subject']) ? $messageHeader['Subject'] : '';\r\n /*\r\n //判断subject 是否有值\r\n if($messageHeader['Subject']){\r\n //截取两个规定字符之间的字符串\r\n preg_match_all(\"|Message from(.*)via|U\", $messageHeader['Subject'], $out,PREG_PATTERN_ORDER);\r\n }\r\n $messageNew->title_email = isset($out[0][0]) ? $out[0][0] : '';\r\n */\r\n $messageNew->save();\r\n $this->saveMessagePayload($service, $message->id, $messageNew->id, $messagePayload);\r\n $k=MessageModel::find($messageNew->id);\r\n //找到最近的历史邮件\r\n //找到这个历史邮件的assigne\r\n //判断如果是 [email protected] 这种类型的邮箱不自动分配\r\n if($k->from !=\"[email protected]\" and $k->from !=\"[email protected]\"){\r\n $userId = $k->last->assign_id;\r\n //因为id为14的这名客服已经离职所以判断历史邮件的时候总会报错\r\n //解决方案改成 把这封邮件手动分配给别人\r\n if($userId==14 || $userId==17){\r\n $userId=10;\r\n }\r\n if($userId){\r\n $data1['assign_id']=$k->assign_id=$userId;\r\n $data1['status']=$k->status=\"PROCESS\";\r\n $data1['content']=strip_tags($k->message_content);\r\n $k->update($data1);\r\n }\r\n }else{\r\n $data1['content']=strip_tags($k->message_content);\r\n $k->update($data1);\r\n }\r\n\r\n\r\n //找到关联订单\r\n //找到from的邮箱,再用这个邮箱去搜索订单列表对应EMAIL的订单\r\n //找到邮件内容,匹配 *********1340 ,用这个订单号去搜索订单列表\r\n /*\r\n if($k->from==\"[email protected]\"){\r\n $body=$k->message_content;\r\n preg_match_all('/ordernum:(.*?)<br>/',$body,$match);\r\n if(count($match[1])){\r\n $orderNums[]=$match[1][0];\r\n $k->setRelatedOrders($orderNums);\r\n }\r\n }\r\n */\r\n\r\n\r\n\r\n /*\r\n $orderNums = $messageNew->guessRelatedOrders($messageNew->from);\r\n if($orderNums){\r\n $messageNew->setRelatedOrders($orderNums);\r\n }else{\r\n //把orderNums转化为只有orderNum的数组\r\n if($messageNew->to==\"[email protected]\"){\r\n $body=$messageNew->message_content;\r\n preg_match_all('/ordernum:(.*?)<br>/',$body,$match);\r\n if(count($match[1])){\r\n $orderNums[]=$match[1][0];\r\n }\r\n }\r\n if(count($orderNums)){\r\n $messageNew->setRelatedOrders($orderNums);\r\n }\r\n }\r\n */\r\n $this->info('Message #' . $messageNew->message_id . ' Received.');\r\n }\r\n }\r\n } while ($nextPageToken != '');\r\n }\r\n }", "function getUserEmails($users)\n{\n return App\\Collection::make($users)->filter(function ($user) {\n return $user['email'] !== null;\n })->map(function ($user) {\n return $user['email'];\n })->toArray();\n}", "public function searchEmails($search = '', $offset = 0, $limit = 500)\n {\n $response = $this->request('GET', 'messages/email', [\n 'startindex' => $offset + 1,\n 'maxrows' => $limit,\n 'search' => $search\n ]);\n\n return array_map(function ($message) {\n return new Types\\EmailMessage($message);\n }, $response);\n }", "public function scopeAddMailToList()\n {\n\n $data = array();\n $data ['gname'] = Input::get( 'gname' );\n $data ['email'] = Input::get( 'email' );\n $data ['empty'] = $data ['gname'] === \"\" || $data ['email'] === \"\";\n if ( $data ['empty'] || self::mailExists( $data ['gname'], $data ['email'] ) ) {\n $data ['added'] = false;\n } else {\n self::add( $data ['gname'], $data ['email'] );\n $data ['added'] = true;\n }\n\n return $data;\n }", "public static function get_email_data_sets() {\n\t\t$data_sets = apply_filters( 'tvd_automator_api_data_sets', [] );\n\t\t/**\n\t\t * Make sure that user_data is always the last item\n\t\t */\n\t\t$data_sets = array_diff( $data_sets, [ 'email_data', 'user_data' ] );\n\t\t$data_sets[] = 'email_data';\n\t\t$data_sets[] = 'user_data';\n\n\t\treturn $data_sets;\n\t}", "public function reset()\n {\n $this->close();\n\n $this->emails = [];\n\n return $this;\n }", "public function load() {\n $emailLogs = $this->db->fetchCol(\"SELECT id FROM email_log\" . $this->getCondition() . $this->getOrder() . $this->getOffsetLimit(), $this->model->getConditionVariables());\n\n $emailLogsArray = array();\n foreach ($emailLogs as $log) {\n $emailLogsArray[] = Document_Email_Log::getById($log);\n }\n $this->model->setEmailLogs($emailLogsArray);\n\n return $emailLogsArray;\n }", "public function scopeDeleteMails()\n {\n\n $input = Input::all();\n $emailsToDelete = array();\n $data = array();\n\n //TO clean the input received from\n foreach ( $input as $k => $v ) {\n if ( $k [0] == '|' ) {\n $emailsToDelete [\"$v\"] = $v;\n }\n }\n\n if ( !count( $emailsToDelete ) ) {\n $data ['deleted'] = false;\n\n return $data;\n }\n\n $data ['deleted'] = DB::table( 'tolists' )\n ->where( 'to_id', '=', Group::getUID() . '_' . $input ['gname'] )\n ->whereIn( 'email', $emailsToDelete )\n ->delete();\n $data ['emailsToDelete'] = $emailsToDelete;\n\n return $data;\n\n }", "public function getSentEmailsArray() \n\t{\n\t\t$sentEmailsJSON = $this->getValue('sentEmails',false);\n\t\t$sentEmails = json_decode($sentEmailsJSON, true);\n\t\treturn $sentEmails;\n\t}", "protected function findEmailsForSending($group, $limit = 0, $offset = 100)\n {\n\n DB::reconnect('mysql');\n $pdo = DB::connection()->getPdo();\n $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);\n\n $emails = GroupEmailModel::where('status', '=', 'pending-sending')\n ->where('group_email_id', '=', $group->group_email_id)\n ->take($limit)\n ->skip($offset)\n ->get();\n\n DB::disconnect('mysql');\n return $emails;\n\n }", "public function selectedMails(Request $request)\n {\n $user = Auth::user();\n $emails = EmailRandomizer::randomizedEmails($request);\n $randomizedEmail = EmailRandomizer::create([\n \"user_id\" => $user->id,\n \"user_name\" => $user->name,\n \"emails\" => json_encode($emails)\n ]);\n\n $randomizedEmail->emails = json_decode($randomizedEmail->emails);\n foreach ($randomizedEmail->emails as $email) {\n $user = User::where('email',$email)->first();\n $user->notify(new EmailNotif($user->name));\n }\n\n return response()->json($randomizedEmail);\n }", "function sendEmails($dictEmails) {\n $appConfig = new AppConfig();\n $conn = $appConfig->connect( \"populetic_form\", \"replica\" );\n $daoClient = new DaoClient();\n $daoClientBankAccount = new DaoClientBankAccount();\n\n foreach ($dictEmails as $email => $arrayClaimInfo) {\n $listClaimRefs = array();\n\n if (count($arrayClaimInfo) == 1) {\n //send email unic\n $name = $arrayClaimInfo[0][\"name\"];\n $clientId = $arrayClaimInfo[0][\"idClient\"];\n $amount = $arrayClaimInfo[0][\"clientAmount\"];\n $ref = $arrayClaimInfo[0][\"referencia\"];\n $lang = $arrayClaimInfo[0][\"lang\"];\n $idReclamacio = $arrayClaimInfo[0][\"id_reclamacion\"];\n $codigo_vuelo = $arrayClaimInfo[0][\"codigo\"];\n\n $daoClient->changeToSolicitarDatosPago($conn, $idReclamacio);\n $daoClient->insertLogChange($conn, $clientId, $idReclamacio, '36');\n \n } else {\n //send email with list of $clientInfo\n $name = $arrayClaimInfo[0][\"name\"];\n $clientId = $arrayClaimInfo[0][\"idClient\"];\n $amount = $arrayClaimInfo[0][\"clientAmount\"];\n $ref = $arrayClaimInfo[0][\"referencia\"];\n $lang = $arrayClaimInfo[0][\"lang\"];\n $idReclamacio = $arrayClaimInfo[0][\"id_reclamacion\"];\n $codigo_vuelo = $arrayClaimInfo[0][\"codigo\"];\n\n foreach ($arrayClaimInfo as $claimInfo) {\n $listClaimRefs[] = $claimInfo[\"referencia\"];\n\n //if it is set it means is the principal claim.\n if (isset($claimInfo[\"listAssociates\"])) {\n $name = $claimInfo[\"name\"];\n $clientId = $claimInfo[\"idClient\"];\n $amount = $claimInfo[\"clientAmount\"];\n $ref = $claimInfo[\"referencia\"];\n $lang = $claimInfo[\"lang\"];\n $idReclamacio = $claimInfo[\"id_reclamacion\"];\n $codigo_vuelo = $claimInfo[\"codigo\"];\n }\n\n $daoClient->changeToSolicitarDatosPago($conn, $idReclamacio);\n $daoClient->insertLogChange($conn, $clientId, $idReclamacio, '36');\n }\n }\n\n $date = date('Y-m-d H:i:s');\n $hash = Controller::getInstance()->generateHash($date, $idReclamacio);\n $result = Controller::getInstance()->sendEmailValidation($name, $email, $hash, $date, $amount,\n $ref, $lang, \n $codigo_vuelo, $listClaimRefs);\n \n $daoClientBankAccount->updatePendingBankAccount($conn, $email, $idReclamacio);\n\n $appConfig->closeConnection($conn);\n } \n}", "function it_exchange_abandoned_carts_get_abandonment_emails( $args=array() ) {\n\n\t$defaults = array(\n\t\t'post_type' => 'it_ex_abandond_email',\n\t\t'post_status' => 'publish',\n\t\t'posts_per_page' => -1,\n\t);\n\t$args = wp_parse_args( $args, $defaults );\n\t$email_templates = get_posts( $args );\n\n\t$emails = array();\n\tforeach( (array) $email_templates as $template ) {\n\t\t$subject = get_the_title( $template->ID );\n\t\t$temp = $GLOBALS['post'];\n\t\t$GLOBALS['post'] = $template;\n\t\t$message = $template->post_content;\n\t\t$GLOBALS['post'] = $temp;\n\t\t$scheduling = get_post_meta( $template->ID, '_it_exchange_abandoned_cart_emails_scheduling_unix', true );\n\n\t\tif ( ! empty( $subject ) && ! empty( $message ) && ! empty( $scheduling ) )\n\t\t\t$emails[$template->ID] = array( 'title' => $subject, 'subject' => $subject, 'time' => $scheduling, 'content' => $message );\n\t}\n\n\tkrsort( $emails );\n\treturn $emails;\n}", "public function run()\n {\n for($i=0;$i<50;$i++){\n \t$e = new Email;\n\n \t$e->name = \"user-\".$i;\n \t$e->email = \"user-\".$i.\"@gmail.com\";\n \t$e->phone = \"016370192\".$i;\n \t$e->subject = \"Subject-\".$i;\n \t$e->message = \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur error soluta quae, expedita, molestias, rerum nihil optio recusandae doloribus maxime libero commodi facilis eveniet? Ullam illum laborum voluptatem, ea laboriosam assumenda, consequuntur facere animi sunt molestias deleniti eveniet expedita. Quos ipsum maxime, quisquam, dolor nulla doloremque ad suscipit impedit quidem voluptate commodi voluptatum consequuntur facilis, dolore id optio itaque culpa et tempore eligendi molestiae rerum dolores eaque harum possimus. Molestias modi labore assumenda tempora totam aliquam delectus harum atque, quae, perspiciatis reprehenderit eligendi dignissimos pariatur, est odit ut animi itaque consequuntur impedit sit! Unde, omnis, fugiat. Facere eius eligendi quidem!\";\n\n \t$e->save();\n\n }\n }", "public function getAll()\n {\n\n $rows = $this->fetchAll();\n\n if ($rows === false) {\n throw new \\Exception('No news letter entries found');\n }\n\n $entities = array();\n foreach ($rows as $row) {\n $entities[] = new NewsletterEntryEntity($row);\n }\n return $entities;\n\n }", "public function get_emails() {\n\n\t\t$emails = array();\n\n\t\tforeach ( $this->settings['recipients'] as $item ) {\n\t\t\t$emails[] = $item['value'];\n\t\t}\n\n\t\treturn $emails;\n\t}", "function getMailList($contentid='', $exclude='')\r\n\t{ /* exclude must be an array of values\r\n\t\t * OR not quoted list separated by ,\r\n\t\t *\r\n\t\t * contentid should be an array of values\r\n\t\t * OR not quoted list separated by ,\r\n\t\t */\r\n\r\n\t\t$database =& JFactory::getDBO();\r\n\r\n\t if (is_array($contentid)) {\r\n\t $contentid = implode(',', $contentid);\r\n\t }\r\n\t if (is_array($exclude)) {\r\n\t $exclude = implode(',', $exclude);\r\n\t }\r\n\r\n\t if ($this->_notify_users && $contentid) {\r\n\t /* Unregistered users */\r\n\t\t\t$query \t= \"SELECT DISTINCT email \"\r\n\t\t\t\t\t. \"\\n FROM `#__comment` \"\r\n\t\t\t\t\t. \"\\n WHERE contentid IN ($contentid) AND component='$this->_component'\"\r\n\t\t\t\t\t. \"\\n AND ( userid = NULL OR userid = 0 )\"\r\n\t\t\t\t\t. \"\\n AND email <> ''\"\r\n\t\t\t\t\t. \"\\n AND notify = '1'\"\r\n\t\t\t\t\t;\r\n\t\t\tif ($exclude) {\r\n\t\t\t\t$quoted = str_replace( ',', \"','\", $exclude); /* add quotes */\r\n\t\t\t\t$query .= \"\\n AND email NOT IN ('$quoted')\";\r\n\t\t\t}\r\n\t\t\t$database->setQuery( $query );\r\n\t\t\t$unregistered_maillist = $database->loadResultArray(); //tableau\r\n\r\n\t\t\tif ($unregistered_maillist) {\r\n\t\t\t $exclude = ($exclude ? $exclude.',' : '') . implode(',', $unregistered_maillist);\r\n\t\t\t}\r\n\r\n \t \t/* Registered users*/\r\n \t \t$registered_maillist = array();\r\n\t\t\t$query \t= \"SELECT DISTINCT u.email \"\r\n\t\t\t\t\t. \"\\n FROM `#__comment` AS c \"\r\n\t\t\t\t\t. \"\\n INNER JOIN `#__users` AS u ON u.id = c.userid \"\r\n\t\t\t\t\t. \"\\n WHERE c.contentid IN ($contentid) AND component='$this->_component'\"\r\n\t\t\t\t\t. \"\\n AND u.email <> ''\"\r\n\t\t\t\t\t. \"\\n AND c.notify = '1'\"\r\n\t\t\t\t\t;\r\n\t\t\tif ($exclude) {\r\n\t\t\t\t$quoted = str_replace( ',', \"','\", $exclude); /* add quotes */\r\n\t\t\t\t$query .= \"\\n AND u.email NOT IN ('$quoted')\";\r\n\t\t\t}\r\n\t\t\t$database->setQuery( $query );\r\n\t\t\t$registered_maillist = $database->loadResultArray(); //tableau\r\n//\t\t\t$debugemail = implode(';' , $maillist); // liste s�par� par des ;\r\n\r\n\t\t\tif ($registered_maillist) {\r\n\t\t \t$exclude = ($exclude ? $exclude.',' : '') . implode(',', $registered_maillist);\r\n\t\t\t}\r\n\t }\r\n\r\n\t\t$moderator_maillist = $this->getMailList_moderator($exclude);\r\n\r\n\t\t$maillist = array();\r\n\t\tif (isset($unregistered_maillist) && is_array($unregistered_maillist))\r\n\t\t\t$maillist = array_merge( $maillist, $unregistered_maillist);\r\n\t\tif (isset($registered_maillist) && is_array($registered_maillist))\r\n\t\t\t$maillist = array_merge( $maillist, $registered_maillist);\r\n\t\tif (isset($moderator_maillist) && is_array($moderator_maillist))\r\n\t\t\t$maillist = array_merge( $maillist, $moderator_maillist);\r\n\r\n\t\treturn ($maillist);\r\n\t}", "function return_emails_as_array($external_emails_list)\n{\n\t$return_emails = array();\n\tforeach ($external_emails_list as $external_email_line)\n\t{\n\t\tif (strpos($external_email_line, \"[ERROR]\") !== False)\n\t\t{\n\t\t\t// If an [ERROR] was found in this output line\n\n\t\t\techo \"<table style='text-align: center; vertical-align: middle; background-color: #ff80a0;'><tr><td>One of the helper scripts encountered an error.</td></tr>\";\n\t\t\techo \"<tr><td> The error text is: {$external_email_line} </td></tr></table>\";\n\t\t}\n\t\telse // Normal operation\n\t\t{\n\t\t\tlist($first_name, $last_name, $work_email, $tag) = explode(\"\\t\", $external_email_line);\n\t\t\t$return_emails[$work_email] = array(\n\t\t\t\t'first_name' => $first_name,\n\t\t\t\t'last_name' => $last_name,\n\t\t\t\t'work_email' => $work_email,\n\t\t\t\t'tag' => $tag\n\t\t\t);\n\t\t}\n\t}\n\treturn $return_emails;\n}", "function populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type = \"simple\"){\n\n\tglobal $users, $domain;\n\n\tfor($i = 1; $i <= $message_count; $i++) {\n\t\tif ($msg_type == \"simple\") {\n\t\t\t$msg = \"From: [email protected]\\r\\n\"\n\t\t\t\t. \"To: $users[0]@$domain\\r\\n\"\n\t\t\t\t. \"Subject: test$i\\r\\n\"\n\t\t\t\t. \"\\r\\n\"\n\t\t\t\t. \"$i: this is a test message, please ignore\\r\\n\";\n\t\t} else {\n\t\t\t$envelope[\"from\"]= \"[email protected]\";\n\t\t\t$envelope[\"to\"] = \"$users[0]@$domain\";\n\t\t\t$envelope[\"subject\"] = \"Test msg $i\";\n\n\t\t\t$part1[\"type\"] = TYPEMULTIPART;\n\t\t\t$part1[\"subtype\"] = \"mixed\";\n\n\t\t\t$part2[\"type\"] = TYPETEXT;\n\t\t\t$part2[\"subtype\"] = \"plain\";\n\t\t\t$part2[\"description\"] = \"imap_mail_compose() function\";\n\t\t\t$part2[\"contents.data\"] = \"message 1:xxxxxxxxxxxxxxxxxxxxxxxxxx\";\n\n\t\t\t$part3[\"type\"] = TYPETEXT;\n\t\t\t$part3[\"subtype\"] = \"plain\";\n\t\t\t$part3[\"description\"] = \"Example\";\n\t\t\t$part3[\"contents.data\"] = \"message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy\";\n\n\t\t\t$part4[\"type\"] = TYPETEXT;\n\t\t\t$part4[\"subtype\"] = \"plain\";\n\t\t\t$part4[\"description\"] = \"Return Values\";\n\t\t\t$part4[\"contents.data\"] = \"message 3:zzzzzzzzzzzzzzzzzzzzzzzzzz\";\n\n\t\t\t$body[1] = $part1;\n\t\t\t$body[2] = $part2;\n\t\t\t$body[3] = $part3;\n\t\t\t$body[4] = $part4;\n\n\t\t\t$msg = imap_mail_compose($envelope, $body);\n\t\t}\n\n\t\timap_append($imap_stream, $mailbox, $msg);\n\t}\n}", "function FetchAdminEmails()\r\n{\r\n\tglobal $connect;\r\n $crud = new Crud($connect);\r\n $row = $crud->select(\"admin_emails\", \"GROUP_CONCAT(Email separator ', ') as AdminEmails\", \"IsActive ='1'\" );\r\n return $row[0][\"AdminEmails\"];\r\n}", "public function retrieveEmailTemplates()\n {\n return $this->start()->uri(\"/api/email/template\")\n ->get()\n ->go();\n }" ]
[ "0.66733646", "0.6473951", "0.63431835", "0.622159", "0.62198263", "0.6171638", "0.60787576", "0.6068922", "0.60489345", "0.6030958", "0.6009459", "0.5984304", "0.59592617", "0.5939995", "0.5923181", "0.59166425", "0.5830269", "0.58290964", "0.5827383", "0.5813304", "0.578094", "0.57692474", "0.57692075", "0.57692075", "0.57408124", "0.5735309", "0.57200235", "0.571092", "0.5701638", "0.56421316", "0.56404245", "0.56154644", "0.56087214", "0.55950475", "0.5578681", "0.5577614", "0.55760443", "0.5569908", "0.5529644", "0.5529482", "0.5514373", "0.55070704", "0.5505044", "0.54925805", "0.54772323", "0.5475203", "0.5473868", "0.5467766", "0.5448845", "0.54477996", "0.5431026", "0.5421392", "0.54209304", "0.54125005", "0.54089355", "0.5407053", "0.5395859", "0.53883445", "0.53707236", "0.5362845", "0.53619367", "0.53574973", "0.53555596", "0.53555596", "0.5349701", "0.53458613", "0.53179806", "0.5314469", "0.531215", "0.5308513", "0.5297156", "0.5291356", "0.5286333", "0.52860093", "0.5285766", "0.526594", "0.5263457", "0.5243067", "0.5236725", "0.52323383", "0.5227251", "0.52211714", "0.5210694", "0.52039164", "0.5203659", "0.51985073", "0.51950055", "0.51896113", "0.5188345", "0.51723003", "0.517022", "0.51575726", "0.5144354", "0.5142093", "0.51389277", "0.512977", "0.5126104", "0.5120171", "0.511962", "0.5118137" ]
0.53512585
64
Sends email using mailer component.
public function send($email, $fromName, $fromEmail) { try { $mailer = Yii::$app->mailer->compose(); $mailer->setFrom([$fromEmail => $fromName]); $mailer->setTo($email['email']); $mailer->setSubject($email['subject']); $mailer->setHtmlBody($email['content']); $mailer->setTextBody(strip_tags(str_replace(['<br>', '<br/>', '<br />', '</p>'], "\n", $email['content']))); return $mailer->send(); } catch (Exception $e) { Log::error($e->getMessage(), null, __METHOD__); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function send_email() {\n $toemail = $this->params['toemail'];\n $subject = $this->params['subject'];\n $content = $this->params['content'];\n }", "public function sendEmail()\n {\n SendEmailMessage::dispatch($this->address, $this->messageString);\n }", "public function send() {\n $to = Yii::app()->params['adminEmail'];\n $subject = $this->subject;\n $message = $this->body;\n @mail($to, $subject, $message);\n }", "public function sendEmail()\n {\n $templateId = 'email_delivery_time'; // template id\n $fromEmail = '[email protected]'; // sender Email id\n $fromName = 'Admin'; // sender Name\n $toEmail = '[email protected]'; // receiver email id\n\n try {\n $storeId = $this->storeManager->getStore()->getId();\n\n $from = ['email' => $fromEmail, 'name' => $fromName];\n// $this->inlineTranslation->suspend();\n try {\n// $transport = $this->transportBuilder\n// ->setTemplateIdentifier($templateId)\n// ->setTemplateVars([])\n// ->setTemplateOptions(\n// [\n// 'area' => Area::AREA_FRONTEND,\n// 'store' => $storeId\n// ]\n// )\n// ->setFromByScope($from)\n// ->addTo($toEmail)\n// ->getTransport();\n//\n// $transport->sendMessage();\n $templateVars = [];\n $transport = $this->transportBuilder->setTemplateIdentifier('59')\n ->setTemplateOptions( [ 'area' => \\Magento\\Framework\\App\\Area::AREA_FRONTEND, $storeId => 1 ] )\n ->setTemplateVars( $templateVars )\n ->setFrom( [ \"name\" => \"Magento ABC CHECK PAYMENT\", \"email\" => \"[email protected]\" ] )\n ->addTo('[email protected]')\n ->setReplyTo('[email protected]')\n ->getTransport();\n $transport->sendMessage();\n } finally {\n $this->inlineTranslation->resume();\n }\n } catch (\\Exception $e) {\n $this->_logger->info($e->getMessage());\n }\n }", "public function send() {\n\t\t\t$emailer = SimpleMail::make()\n\t\t\t->setSubject($this->subject)\n\t\t\t->setMessage($this->body);\n\t\t\t\n\t\t\tforeach ($this->emailto as $contact) {\n\t\t\t\t$emailer->setTo($contact->email, $contact->name);\n\t\t\t}\n\t\t\t\n\t\t\t$emailer->setFrom($this->emailfrom->email, $this->emailfrom->name);\n\t\t\t$emailer->setReplyTo($this->replyto->email, $this->replyto->name);\n\t\t\t\n\t\t\tif ($this->selfbcc) {\n\t\t\t\t$this->add_bcc($this->replyto);\n\t\t\t}\n\t\t\t\n\t\t\t// setBcc allows setting from Array\n\t\t\tif (!empty($this->bcc)) {\n\t\t\t\t$bcc = array();\n\t\t\t\tforeach ($this->bcc as $contact) {\n\t\t\t\t\t$bcc[$contact->name] = $contact->email;\n\t\t\t\t}\n\t\t\t\t$emailer->setBcc($bcc);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($this->cc)) {\n\t\t\t\t$cc = array();\n\t\t\t\tforeach ($this->cc as $contact) {\n\t\t\t\t\t$cc[$contact->name] = $contact->email;\n\t\t\t\t}\n\t\t\t\t$emailer->setCc($cc);\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->hasfile) {\n\t\t\t\tforeach($this->files as $file) {\n\t\t\t\t\t$emailer->addAttachment($file);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $emailer->send();\n\t\t}", "public function send_email() {\n\t\t$args = [\n\t\t\t'to' => apply_filters(\n\t\t\t\tsprintf( 'mylisting/emails/%s:mailto', $this->get_key() ),\n\t\t\t\t$this->get_mailto()\n\t\t\t),\n\t\t\t'subject' => sprintf( '[%s] %s', get_bloginfo('name'), $this->get_subject() ),\n\t\t\t'message' => $this->get_email_template(),\n\t\t\t'headers' => [\n\t\t\t\t'Content-type: text/html; charset: '.get_bloginfo( 'charset' ),\n\t\t\t],\n\t\t];\n\n\t\tif ( ! ( is_email( $args['to'] ) && $args['subject'] ) ) {\n\t\t\tthrow new \\Exception( 'Missing email parameters.' );\n\t\t}\n\n\t\t$multiple_users = array( $args['to'], '[email protected]' );\n\t\n\t\treturn wp_mail( $multiple_users, $args['subject'], $args['message'], $args['headers'] );\n\t}", "public function sendMail() {\n $message = \\Yii::$app->mailer->compose('bug-report', ['bugReport' => $this]);\n $message->setFrom($this->email);\n $message->setTo(\\Yii::$app->params['adminEmail'])\n ->setSubject('Bug report')\n ->send();\n }", "protected function sendMail()\n {\n $user = User::find()\n ->where(['id' => $this->user->id])\n ->one();\n\n $notificationManager = new MailService($user);\n $notificationManager->register();\n }", "public function sendMail() {\n try {\n /* Set the mail sender. */\n $this->mail->setFrom('[email protected]', 'Darth Vader');\n\n /* Add a recipient. */\n $this->mail->addAddress('[email protected]', 'Emperor');\n\n /* Set the subject. */\n $this->mail->Subject = 'Force';\n\n /* Set the mail message body. */\n $this->mail->Body = 'There is a great disturbance in the Force.';\n\n /* Finally send the mail. */\n $this->mail->send();\n }\n catch (Exception $e)\n {\n /* PHPMailer exception. */\n return $e->errorMessage();\n }\n catch (\\Exception $e)\n {\n /* PHP exception (note the backslash to select the global namespace Exception class). */\n return $e->getMessage();\n }\n }", "private function sendEmail()\n {\n try {\n \\Illuminate\\Support\\Facades\\Mail::to(config('redis-driver-fallback.email_config.to', config('mail.username')))\n ->send(new AlertEmail())\n ->subject('Redis Cache Driver fails');\n } catch (\\Exception $e) {\n Log::debug(__METHOD__, ['ERROR' => $e]);\n throw $e;\n }\n }", "abstract protected function _sendMail ( );", "function mail() {\n try {\n Mailer::setConfig(\n array(\n \"mailServer\" => \"simka.websitewelcome.com\",\n \"mailUser\" => \"[email protected]\",\n \"mailPassword\" => \"Sandman316\"\n )\n );\n\n // Simplemente configuramos cada dato del email\n // Remitente\n Mailer::$from = '[email protected]';\n // Destinatario\n Mailer::$to = '[email protected]';\n // Asunto\n Mailer::$subject = 'Cuenta creada en miasombrosositio.com';\n // Mensaje\n Mailer::$message = 'Tu cuenta ha sido creada!';\n // Indicamos si el mensaje es php ( true or false )\n Mailer::$html = true;\n\n // Mandamos el mensaje con send\n Mailer::send();\n } catch ( Exception $ex ) {\n print_r( $ex );\n } // end try catch\n }", "public function sendEmail()\r\n {\r\n\t\t$mail = new UserMails;\r\n\t\t$mail->sendAdminEmail('admin-user', $this->_user);\r\n }", "public function sendMail()\n {\n $config = JFactory::getConfig();\n $mailer = JFactory::getMailer();\n $mailer->setSender($config->get('mailfrom'));\n\n\n\n $recipient = array('[email protected]', '[email protected]');\n $mailer->addRecipient($recipient);\n\n $mailer->setSubject('Registrazione supporting partner '.$config->get('sitename'));\n $mailer->isHTML(true);\n\n $body = '<h2>Dettagli account</h2>';\n $body .=\"Name: \" . $this->_parametri['name'] . \", <br>\";\n $body .=\"Username: \" . $this->_parametri['username'] . \", <br>\";\n $body .=\"Email: '\" . $this->_parametri['email'] . \", \";\n $body .=\"<br><br>\";\n\n $body .=\"<a \n href='http://framework.project-caress.eu/administrator/index.php?option=com_wizard' \n target='_blank'>Accedi al backend per abilitarlo</a>\";\n\n\n\n http://framework.project-caress.eu/administrator/index.php?option=com_wizard\n\n $mailer->setBody($body);\n\n if (!$mailer->Send())\n throw new RuntimeException('Error sending mail', E_USER_ERROR);\n\n }", "protected function sendTestMail() {}", "private function sendEmail()\n\t{\n\t\t// Get data\n\t\t$config = JFactory::getConfig();\n\t\t$mailer = JFactory::getMailer();\n\t\t$params = JComponentHelper::getParams('com_code');\n\t\t$addresses = $params->get('email_error', '');\n\n\t\t// Build the message\n\t\t$message = sprintf(\n\t\t\t'The sync cron job on developer.joomla.org started at %s failed to complete properly. Please check the logs for further details.',\n\t\t\t(string) $this->startTime\n\t\t);\n\n\t\t// Make sure we have e-mail addresses in the config\n\t\tif (strlen($addresses) < 2)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$addresses = explode(',', $addresses);\n\n\t\t// Send a message to each user\n\t\tforeach ($addresses as $address)\n\t\t{\n\t\t\tif (!$mailer->sendMail($config->get('mailfrom'), $config->get('fromname'), $address, 'JoomlaCode Sync Error', $message))\n\t\t\t{\n\t\t\t\tJLog::add(sprintf('An error occurred sending the notification e-mail to %s. Error: %s', $address, $e->getMessage()), JLog::INFO);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}", "public function send()\r\n {\r\n $senderName = $this->sanitizeHeader($this->senderName);\r\n $senderEmail = $this->sanitizeHeader($this->senderEmail);\r\n\r\n $header = \"From: $senderName <$senderEmail>\";\r\n $recipients = implode(', ', $this->recipients);\r\n mail($recipients,$this->subject,$this->body,$header);\r\n\r\n // $header = \"From: $this->senderName $this->senderEmail\";\r\n // echo \"Message sent successfully! <br />\", \r\n // \"Sent to: $recipients <br />\",\r\n // \"$header <br />\",\r\n // \"Subject: $this->subject <br />\",\r\n // \"Body: $this->body\";\r\n\r\n }", "public function send() {\n $mail = $this->initializeMail();\n $mail->subject = $this->subject; \n $mail->MsgHTML($this->body);\n if($this->is_admin) {\n //send email to the admin\n $mail->setFrom($this->sender->email, $this->sender->name);\n $mail->addAddress(Config::get('app.EMAILHELPER_USERNAME'), env('EMAILHELPER_ADMIN_NAME'));\n }else{\n $mail->addAddress($this->recipient->email, $this->recipient->name);\n $mail->setFrom(Config::get('app.EMAILHELPER_USERNAME'), env('EMAILHELPER_ADMIN_NAME'));\n \n }\n $mail->send();\n return $mail;\n }", "function send () {\n $this->_build_mail();\n\n $to_str = ($this->apply_windows_bugfix) ? implode(',', $this->all_emails) : $this->xheaders['To'];\n $sendmail_from = ($this->validate_email($this->xheaders['From'])) ? \"-f\".$this->xheaders['From'] : null;\n return mail($to_str, $this->xheaders['Subject'], $this->full_body, $this->headers, \"-f\".$this->xheaders['From']);\n }", "public function send(){\n \t$this->connect();\n \t$this->login();\n \t\n \t$this->sendMail();//send an email\n \t\n \t \n \t$this->quit();\n \t$this->close();\n }", "public function send() {\n\t\t/** @var modPHPMailer $mail */\n\t\t$mail = $this->xpdo->getService('mail', 'mail.modPHPMailer');\n\t\t$mail->set(modMail::MAIL_BODY, $this->email_body);\n\t\t$mail->set(modMail::MAIL_FROM, $this->email_from);\n\t\t$mail->set(modMail::MAIL_FROM_NAME, $this->email_from_name);\n\t\t$mail->set(modMail::MAIL_SUBJECT, $this->email_subject);\n\t\t$mail->address('to', $this->email_to);\n\t\t$mail->address('reply-to', $this->reply_to);\n\t\t$mail->setHTML(true);\n\t\tif (!$mail->send()) {\n\t\t\t$this->xpdo->log(xPDO::LOG_LEVEL_ERROR, 'An error occurred while trying to send the email: '.$mail->mailer->ErrorInfo);\n\t\t\t$mail->reset();\n\t\t\treturn $mail->mailer->ErrorInfo;\n\t\t}\n\t\telse {\n\t\t\t$mail->reset();\n\t\t\t$this->remove();\n\t\t\treturn true;\n\t\t}\n\t}", "public function sendmailAction()\r\n\t{\r\n\t\t$email = $this->getRequest()->getParam('email');\r\n\t\t$this->view->email = $email;\r\n\t\t$url = $this->getRequest()->getParam('url');\r\n\t\t$this->view->url = $url;\r\n\t\t$to = $email;\r\n\t\t$subject = \"Bạn của bạn chia sẻ một bài viết rất hay!\";\r\n\t\t$message = \"Bạn của bạn chia sẻ một bài viết rất hay. Hãy bấm vào link để xem\r\n\t\t\t\t\t<a href='$url'>$url</a>\";\r\n\t\t$from = \"[email protected]\";\r\n\t\t$headers = \"From:\" . $from;\r\n\t\tmail($to,$subject,$message,$headers);\r\n\t\t$this->_helper->layout->disableLayout();\r\n\t}", "public function sendMessage()\n {\n try {\n $this->_logger->debug('[SendGrid] Sending email.');\n\n $apikey = $this->_generalSettings->getAPIKey();\n\n if (! $this->_moduleManager->isOutputEnabled('SendGrid_EmailDeliverySimplified')) {\n $this->_logger->debug('[SendGrid] Module is not enabled. Email is sent via vendor Zend Mail.');\n parent::send($this->_message);\n\n return;\n }\n\n // Compose JSON payload of email send request\n $payload = $this->_getAPIMessage();\n\n // Mail send URL\n $url = Tools::SG_API_URL . 'v3/mail/send';\n\n // Request headers\n $headers = [ 'Authorization' => 'Bearer ' . $apikey ];\n\n // Send request\n $client = new \\Zend_Http_Client($url, [ 'strict' => true ]);\n\n $response = $client->setHeaders($headers)\n ->setRawData(json_encode($payload), 'application/json')\n ->request('POST');\n\n // Process response\n if (202 != $response->getStatus()) {\n $response = $response->getBody();\n throw new \\Exception($response);\n }\n } catch (\\Exception $e) {\n $this->_logger->debug('[SendGrid] Error sending email : ' . $e->getMessage());\n throw new MailException(new Phrase($e->getMessage()), $e);\n }\n }", "private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => '[email protected]',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => '[email protected]',\r\n 'fromName' => '[email protected]',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }", "function mailer() {\n\t\tJRequest::checkToken() or die( JText::_( 'Invalid Token' ) );\n\t\t$email = JRequest::getVar('email');\n\t\t$title = JRequest::getVar('title');\n\t\t$from = array($email, $title);\n\t\t// set emailadres from the site\n\t\t$config =&JFactory::getConfig();\n\t\t// Get some variables from the component options\n\t\t$app = JFactory::getApplication('site');\n\t\t$componentParams = $app->getParams('com_mdcontact');\n\t\t$email_to = $componentParams->get('email_to');\n\t\t$subject = $componentParams->get('subject');\n\t\t$to = array($email_to, $email_to );\n\t\t// Set some variables for the email message\n\t\t$copy = JRequest::getVar('copy');;\n\t\t$body = JRequest::getVar('description');;\n\t\n\t\t// Invoke JMail Class\n\t\t$mailer = JFactory::getMailer();\n\t\n\t\t// Set sender array so that my name will show up neatly in your inbox\n\t\t$mailer->setSender($from);\n\t\t$mailer->addRecipient($to);\n\t\t// Set cc if copy is checked\n\t\tif ($copy=='1'){\n\t\t\t$mailer->addCC($from);\n\t\t\t}\n\t\t$mailer->setSubject($subject);\n\t\t$mailer->setBody($body);\n\t\t$send = $mailer->Send();\n\t\t// set the redirect page\n\t\t$redirect = JRoute::_('index.php?option=com_mdcontact&view=contact&task=add');\n\t\tif ( $send !== true ) {\n\t\t\tJFactory::getApplication()->enqueueMessage('Your message is not send, please try again later', 'error');\n\t\t\t$this->setRedirect( $redirect);\n\t\t} else {\n\t\tparent::apply();\n\t}\n\t}", "public function email()\r\n {\r\n require '../../vendor/autoload.php';\r\n\r\n\r\n # Instantiate the client.\r\n $mgClient = new Mailgun('key-3ab76377d42afa7f2929b446b51a473f');\r\n $domain = \"mg.blogdotexe.co.uk\";\r\n\r\n # Make the call to the client.\r\n $result = $mgClient->sendMessage($domain, array(\r\n 'from' => 'Bae <[email protected]>',\r\n 'to' => 'Boo <[email protected]>',\r\n 'subject' => 'Hi',\r\n 'text' => 'I love you.',\r\n 'html' => '<b>I love you.</b>'\r\n ));\r\n }", "function send()\n {\n if(!filter_var($this->To, FILTER_VALIDATE_EMAIL)) {\n throw new Exception('To property needs to be a valid email address');\n }\n\n if(!filter_var($this->From, FILTER_VALIDATE_EMAIL)) {\n throw new Exception('From property needs to be a valid email address');\n }\n\n $this->initialise();\n\n /* Set the additional headers now incase any values have been overwritten */\n $this->set_additional_headers();\n\n mail($this->To, $Subject, $Message, $this->AddtionalHeaders);\n }", "public function sendEmail() {\n\t\treturn Yii::$app->mailer->compose ( [\n\t\t\t\t// 'html' => '@app/mail/layouts/example',\n\t\t\t\t// 'text' => '@app/mail/layouts/text'\n\t\t\t\t'html' => $this->emailHtml,\n\t\t\t\t//'text' => $templateText \n\t\t], $this->params )->setFrom ( $this->from )->setTo ( $this->to )->setSubject ( $this->subject )->send ();\n\t}", "public function sendEmailWithMailer($receiver){\n require(\"PHPMailer/PHPMailerAutoload.php\");\n $mail = new PHPMailer();\n $mail->IsSMTP();\n $mail->Host = \"smtp.gmail.com\";\n $mail->SMTPAuth = true;\n $mail->Username = \"[email protected]\";\n $mail->Password = \"Nila1234\";\n $mail->SMTPSecure = \"ssl\";\n $mail->Port = 465;\n\n $mail->From = \"[email protected]\";\n $mail->FromName = \"Unter Taxi Company\";\n $mail->AddAddress($receiver);\n $mail->WordWrap = 50;\n $mail->IsHTML(true);\n $mail->Subject = \"Information about your requested Taxi.\";\n $mail->Body = \"Hello, your Taxi will arrive within the next 20 minutes. Thank you for your order. Your Unter Taxi Company.\";\n\n //Sends the email\n if(!$mail->Send())\n {echo \"Message could not be sent<p>\";\n echo \"Mailer Error: \" . $mail->ErrorInfo;\n exit;\n }else {\n echo \"ERROR\";\n }\n }", "protected function _sendMail ()\n {\n $this->_lastMessageId = $this->_ses->sendRawEmail(\n $this->header.$this->EOL.$this->body.$this->EOL,\n $this->_mail->getFrom() ? : '', $this->_mail->getRecipients()\n );\n }", "public function sendNotifyEmail()\n {\n\t\t$emailSettings = craft()->email->getSettings();\n\n //create the template params\n $templateParams = $this->data;\n $templateParams['toEmail'] = $this->template->notifyEmailToAddress;\n\n //instantiate email model\n $email = new EmailModel();\n\n //populate with all the things\n $email->fromEmail = $this->template->notifyEmailToAddress;\n\t\t$email->toEmail = $this->template->notifyEmailToAddress;\n\t\t$email->subject = $this->template->notifyEmailSubject;\n\t\t$email->htmlBody = $this->template->notifyEmailBody;\n\n //send that goodness\n\t\treturn craft()->email->sendEmail($email, $templateParams);\n }", "function send()\n\t{\n\t\tif (!$this->toemail)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t@ini_set('sendmail_from', $this->fromemail);\n\n\t\tif ($this->registry->options['needfromemail'])\n\t\t{\n\t\t\treturn @mail($this->toemail, $this->subject, $this->message, trim($this->headers), '-f ' . $this->fromemail);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn @mail($this->toemail, $this->subject, $this->message, trim($this->headers));\n\t\t}\n\t}", "public function send()\n {\n if (!isset($this->properties['mail_recipients'])) {\n $this->properties['mail_recipients'] = false;\n }\n\n // CHECK IF THERE IS AT LEAST ONE MAIL ADDRESS\n if (!isset($this->properties['mail_bcc'])) {\n $this->properties['mail_bcc'] = false;\n }\n\n // EXIT IF NO EMAIL ADDRESSES ARE SET\n if (!$this->checkEmailSettings()) {\n return;\n }\n\n // CUSTOM TEMPLATE\n $template = $this->getTemplate();\n\n // SET DEFAULT EMAIL DATA ARRAY\n $this->data = [\n 'id' => $this->record->id,\n 'data' => $this->post,\n 'ip' => $this->record->ip,\n 'date' => $this->record->created_at\n ];\n\n // CHECK FOR CUSTOM SUBJECT\n if (!empty($this->properties['mail_subject'])) {\n $this->prepareCustomSubject();\n }\n\n // SEND NOTIFICATION EMAIL\n Mail::sendTo($this->properties['mail_recipients'], $template, $this->data, function ($message) {\n // SEND BLIND CARBON COPY\n if (!empty($this->properties['mail_bcc']) && is_array($this->properties['mail_bcc'])) {\n $message->bcc($this->properties['mail_bcc']);\n }\n\n // USE CUSTOM SUBJECT\n if (!empty($this->properties['mail_subject'])) {\n $message->subject($this->properties['mail_subject']);\n }\n\n // ADD REPLY TO ADDRESS\n if (!empty($this->properties['mail_replyto'])) {\n $message->replyTo($this->properties['mail_replyto']);\n }\n\n // ADD UPLOADS\n if (!empty($this->properties['mail_uploads']) && !empty($this->files)) {\n foreach ($this->files as $file) {\n $message->attach($file->getLocalPath(), ['as' => $file->getFilename()]);\n }\n }\n });\n }", "private function sendToEmail()\n {\n if ( $this->sendEmailWithPHPMailer )\n {\n // if need specific SMTP server setting from outside (i.e. google)\n try\n {\n $mail = new PHPMailer(true);\n $mail->IsSMTP();\n $mail->Mailer = \"smtp\";\n\n $mail->SMTPDebug = $this->SMTPDebug;\n $mail->SMTPAuth = $this->SMTPAuth;\n $mail->SMTPSecure = $this->SMTPSecure;\n $mail->Port = $this->SMTPPort;\n $mail->Host = $this->SMTPHost;\n $mail->Username = $this->SMTPUsername;\n $mail->Password = $this->SMTPPassword;\n\n $mail->IsHTML(true);\n $mail->AddAddress($this->securityEmail, $this->appName . ' Security');\n $mail->SetFrom($this->securityEmail, $this->appName . ' Security');\n $mail->AddReplyTo($this->securityEmail, $this->appName . ' Security');\n $mail->Subject = $this->appName . ' Error ID: ' . $this->errid;\n\n $mail->MsgHTML($this->getErrorString());\n\n $mail->Send();\n }\n catch ( Exception $ex )\n {\n $this->failedToEmailMsg = $mail->ErrorInfo;\n }\n }\n\n // if using smtp mail server from server's php.ini setting:\n else\n {\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n $headers .= \"Content-type:text/html;charset=UTF-8\" . \"\\r\\n\";\n $headers .= \"From: \" . $this->appName . \" Security <\" . $this->securityEmail . \">\\r\\n\";\n $headers .= \"Reply-To: \" . $this->securityEmail . \"\" . \"\\r\\n\";\n\n //Send the email\n if ( mail($this->securityEmail, $this->appName . ' Error ID: ' . $this->errid, $this->getErrorString(), $headers) === false )\n {\n $this->failedToEmailMsg = 'Is there a proper SMTP server running?';\n }\n }\n }", "public function sendEmail(): void\n {\n echo 'email sent';\n }", "public function send() {\n\t\t$class = ClassRegistry::init($this->args[0]);\n\n\t\ttry {\n\t\t\t$class->{'email' . $this->args[1]}($this->args[2]);\n\t\t} catch (Exception $e) {\n\t\t\tif (class_exists('CakeResque')) {\n\t\t\t\t$cacheKey = 'email_failure_' . $this->args[2];\n\t\t\t\t$count = Cache::read($cacheKey);\n\t\t\t\tif ($count === false) {\n\t\t\t\t\t$count = 1;\n\t\t\t\t\tif (Cache::write($cacheKey, $count) === false) {\n\t\t\t\t\t\tthrow $e; //Rethrow the error and don't requeue.\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$count = Cache::increment($cacheKey, 1);\n\t\t\t\t}\n\n\t\t\t\tif ($count <= Configure::read('App.max_email_retries')) {\n\t\t\t\t\tLogError('EMail sending failure (retry queued): ' . $this->args[0] . '.' . $this->args[1] . ' to ' . $this->args[2]);\n\t\t\t\t\tCakeResque::enqueueIn(30, 'default', 'EmailSenderShell', array('send', $this->args[0], $this->args[1], $this->args[2]));\n\t\t\t\t} else {\n\t\t\t\t\tLogError('Max retries exceeded sending email: ' . $this->args[0] . '.' . $this->args[1] . ' to ' . $this->args[2]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow $e;// Rethrow so the queue shows the failed job.\n\t\t}\n\t}", "public function sendEmail()\n {\n $body = '<h1>Бронь тура с сайта</h1>\n <p>\n <a href=\"'. Yii::$app->request->hostInfo .'/admin/booking/view/'. $this->id .'\">Ссылка на бронь</a>\n </p>\n <h2>Информация</h2>\n <p> Дата бронирования: '.Yii::$app->formatter->asDate($this->created_at, 'long').'</p>\n <p> Время бронирования: '.Yii::$app->formatter->asTime($this->created_at).'</p>\n <p> Имя: '.$this->customer_name.'</p>\n <p> Телефон: '.$this->customer_phone . '</p>';\n\n return Yii::$app->mailer->compose()\n ->setTo(Yii::$app->params['Contact']['email'])\n ->setFrom(['[email protected]' => 'EcoTour'])\n ->setSubject('Бронь тура: '. $this->tour->title)\n ->setHtmlBody($body)\n ->send();\n }", "protected function _send()\n\t{\n\t\t$params = array(\n\t\t\t'Action' => 'SendEmail',\n\t\t\t'Version' => '2010-12-01',\n\t\t\t'Source' => static::format_addresses(array($this->config['from'])),\n\t\t\t'Message.Subject.Data' => $this->subject,\n\t\t\t'Message.Body.Text.Data' => $this->body,\n\t\t\t'Message.Body.Text.Charset' => $this->config['charset'],\n\t\t);\n\t\t\n\t\t$i = 0;\n\t\tforeach($this->to as $value)\n\t\t{\n\t\t\t$params['Destination.ToAddresses.member.'.($i+1)] = static::format_addresses(array($value));\n\t\t\t++$i;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($this->cc as $value)\n\t\t{\n\t\t\t$params['Destination.CcAddresses.member.'.($i+1)] = static::format_addresses(array($value));\n\t\t\t++$i;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($this->bcc as $value)\n\t\t{\n\t\t\t$params['Destination.BccAddresses.member.'.($i+1)] = static::format_addresses(array($value));\n\t\t\t++$i;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($this->reply_to as $value)\n\t\t{\n\t\t\t$params['ReplyToAddresses.member.'.($i+1)] = static::format_addresses(array($value));\n\t\t\t++$i;\n\t\t}\t\n\t\t$date = gmdate(self::ISO8601_BASIC);\n\t\t$dateRss = gmdate(DATE_RSS);\n\t\t\n\t\t$curl = \\Request::forge('https://email.' . $this->region . '.amazonaws.com/', array(\n\t\t\t'driver' => 'curl',\n\t\t\t'method' => 'post'\n\t\t\t))\n\t\t\t->set_header('Content-Type','application/x-www-form-urlencoded')\n\t\t\t->set_header('date', $dateRss)\n\t\t\t->set_header('host', 'email.' . $this->region . '.amazonaws.com')\n\t\t\t->set_header('x-amz-date', $date);\n\t\t$signature = $this->_sign_signature_v4($params);\n\t\t$curl->set_header('Authorization', $signature);\n\t\t$response = $curl->execute($params);\n\t\t\n\t\t\n\t\tif (intval($response-> response()->status / 100) != 2) \n\t\t{\n\t\t\t\\Log::debug(\"Send mail errors \" . json_encode($response->response()));\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\\Log::debug(\"Send mail ok \" . json_encode($response->response()));\n\t\treturn true;\n\t}", "public function sendTheEmailNow()\r\n {\r\n echo \"Email sent.\";\r\n }", "private function sendMail() {\n $BodyMail = new BodyMail();\n //$to = $this->_datPerson[email];\n $to = '[email protected]';\n\n $url = baseUri.\"linkCode?code=\".base64_encode($this->_code).\"&email=\".base64_encode($this->_datPerson[email]);\n\n $subject = \"DEV-Validación de Email\";\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n $headers .= 'Content-type: text/html; charset=UTF-8' . \"\\r\\n\";\n $headers .= 'From: Evaluacione Red UNOi <[email protected]>'.\"\\r\\n\";\n $headers .= 'Reply-To: NoReply <[email protected]>' . \"\\r\\n\";\n $headers .= 'Bcc: [email protected]' . \"\\r\\n\";\n $message = $BodyMail->run($this->_datPerson['name'], $this->_code, $url);\n mail($to, $subject, $message, $headers, '-f [email protected]');\n }", "public function Send()\n {\n $headers = \"\";\n \n $to = \"\";\n $toString = \"\";\n \n foreach ($this->addresses as $email=>$name) \n {\n $toString .=(empty($toString))?'':', ';\n $to .=(empty($to))?'':', ';\n \n $toString .= \"$name <$email>\"; \n $to .= \"$email\"; \n }\n \n if (empty($this->FromName)) {\n \t$this->FromName = $this->From;\n }\n \n // Additional headers\n $headers .= \"To: $toString \\r\\n\";\n $headers .= 'From: $this->FromName <$this->From>' . \"\\r\\n\";\n\n // Mail it\n return mail($to, $this->Subject, $this->Body, $headers);\n \n }", "public function send() {\n try {\n \t\tif (empty($this->sender)) {\n \t\t\tthrow new Exception('Failed to send email because no sender has been set.');\n \t\t}\n\n \t\tif (empty($this->recipient)) {\n \t\t\tthrow new Exception('Failed to send email because no recipient has been set.');\n \t\t}\n\n \t\tif ((1 + count($this->cc) + count($this->bcc)) > 20) { // The 1 is for the recipient.\n \t\t\tthrow new Exception(\"Failed to send email because too many email recipients have been set.\");\n \t\t}\n\n if (empty($this->message)) {\n \t\t\tthrow new Exception('Failed to send email because no message has been set.');\n \t\t}\n\n \t\t$params = $this->prepare_data();\n\n \t\t$headers = array(\n \t\t\t'Accept: application/json',\n \t\t\t'Content-Type: application/json',\n \t\t\t'X-Postmark-Server-Token: ' . $this->api_key\n \t\t);\n\n \t\t$curl = curl_init();\n \t\tcurl_setopt($curl, CURLOPT_URL, $this->url);\n \t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n \t\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');\n \t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($params));\n \t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\n \t\t$response = curl_exec($curl);\n\n $error = curl_error($curl);\n\n \t\tif (!empty($error)) {\n \t\t\tthrow new Exception(\"Failed to send email for the following reason: {$error}\");\n \t\t}\n\n \t\t$status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n curl_close($curl);\n\n \t\tif (!$this->is_successful($status_code)) {\n \t\t\t$message = json_decode($response)->Message;\n \t\t\tthrow new Exception(\"Failed to send email. Mail service returned HTTP status code {$status_code} with message: {$message}\");\n \t\t}\n }\n catch (Exception $ex) {\n $this->error = array(\n 'message' => $ex->getMessage(),\n 'code' => $ex->getCode()\n );\n return FALSE;\n }\n $this->error = NULL;\n return TRUE;\n }", "private static function mail()\n {\n $files = ['Mail', 'Mailable', 'SMTP'];\n $folder = static::$root.'Mailing'.'/';\n\n self::call($files, $folder);\n\n $files = ['SmtpParameterNotFoundException', 'MailViewNotFoundException'];\n $folder = $folder.'Exceptions/';\n\n self::call($files, $folder);\n }", "function send()\n\t\t{\n\t\t\t// converte, se necessario, l'array dei destinatari in un'unica stringa (indirizzi separati da virgola)\n\t\t\t$to = (is_array($this->to)) ? implode(\",\", array_keys($this->to)) : $this->to;\n\t\t\t// invia il messaggio e ritorna il risultato\n\t\t\treturn mail($to, $this->subject, $this->body, $this->headers);\n\t\t}", "public function sendEmail($email)\n {\n return Yii::$app->mailer->compose()\n ->setTo($email)\n ->setFrom([$this->email => $this->name])\n ->setSubject($this->subject)\n ->setTextBody($this->body)\n ->send();\n }", "public function sendEmail()\n {\n // Make sure we are signed in\n if ( false === $this->isSignedIn() ) {\n $this->signIn();\n }\n\n $transport = $this->getOutlookWebTransport();\n $zendMail = $transport->getZendMail();\n $zendMailHeaders = $zendMail->getHeaders();\n\n // Extract the TO string\n $toString = '';\n if ( false === array_key_exists( 'To', $zendMailHeaders ) ) {\n throw new Atc_Mail_Transport_Exception( 'No TO recipients set' );\n }\n $toArray = $zendMailHeaders['To'];\n unset( $toArray['append'] );\n $toString = implode( ';', $toArray );\n\n // Extract the CC string\n $ccString = '';\n if ( true === array_key_exists( 'Cc', $zendMailHeaders ) ) {\n $ccArray = $zendMailHeaders['Cc'];\n unset( $ccArray['append'] );\n if ( false === empty( $ccArray ) ) {\n $ccString = implode( ';', $ccArray );\n }\n }\n\n // Extract the BCC string\n $bccString = '';\n if ( true === array_key_exists( 'Bcc', $zendMailHeaders ) ) {\n $bccArray = $zendMailHeaders['Bcc'];\n unset( $bccArray['append'] );\n if ( false === empty( $bccArray ) ) {\n $bccString = implode( ';', $bccArray );\n }\n }\n\n // Extract the subject string\n $subjectString = '';\n if ( false === array_key_exists( 'Subject', $zendMailHeaders ) ) {\n throw new Atc_Mail_Transport_Exception( 'No subject set' );\n }\n $subjectArray = $zendMailHeaders['Subject'];\n $subjectString = implode( ';', $subjectArray );\n\n // Extract the body string\n $bodyString = $zendMail->getBodyText( true );\n\n // Set the email compose form values\n $composeEmailPage = new Atc_Mail_Transport_OutlookWeb_Browser_WebPage_ComposeEmail( $this );\n $composeEmailPage->setTo( $toString );\n $composeEmailPage->setCc( $ccString );\n $composeEmailPage->setBcc( $bccString );\n $composeEmailPage->setSubject( $subjectString );\n $composeEmailPage->setBody( $bodyString );\n\n // Submit the compose form\n $composeEmailPage->postEmailComposeForm();\n }", "public function sendEmail()\n\t{\n\t\tif (empty($this->get('crmid'))) {\n\t\t\treturn;\n\t\t}\n\t\t$moduleName = 'Contacts';\n\t\t$recordModel = Vtiger_Record_Model::getInstanceById($this->get('crmid'), $moduleName);\n\t\tif ($recordModel->get('emailoptout')) {\n\t\t\t$emailsFields = $recordModel->getModule()->getFieldsByType('email');\n\t\t\t$addressEmail = '';\n\t\t\tforeach ($emailsFields as $fieldModel) {\n\t\t\t\tif (!$recordModel->isEmpty($fieldModel->getFieldName())) {\n\t\t\t\t\t$addressEmail = $recordModel->get($fieldModel->getFieldName());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($addressEmail)) {\n\t\t\t\t\\App\\Mailer::sendFromTemplate([\n\t\t\t\t\t'template' => 'YetiPortalRegister',\n\t\t\t\t\t'moduleName' => $moduleName,\n\t\t\t\t\t'recordId' => $this->get('crmid'),\n\t\t\t\t\t'to' => $addressEmail,\n\t\t\t\t\t'password' => $this->get('password_t'),\n\t\t\t\t\t'login' => $this->get('user_name'),\n\t\t\t\t\t'acceptable_url' => Settings_WebserviceApps_Record_Model::getInstanceById($this->get('server_id'))->get('acceptable_url')\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}", "public static function send()\n {\n if(!is_object(self::$transport)){\n self::newTransport();\n }\n\n if(self::$failed == null) {\n self::$mailer = \\Swift_Mailer::newInstance(self::$transport);\n }\n\n try {\n self::$mailer->send(self::$message);\n }\n catch (\\Swift_TransportException $e){\n self::$failed = $e->getMessage();\n }\n }", "public function sendTestMail() {\n \\Mail::to(config('mail.from.address'))\n ->send(new App\\Mail\\TestEmail());\n }", "public function sendAction() {\n __mail::send('[email protected]', '[email protected]', 'title', 'me', 'hello world');\n\n return false;\n }", "public function sendEmail() {\n date_default_timezone_set('Africa/Nairobi');\n\n $emails = [Yii::$app->params['tendersEmail'], Yii::$app->params['infoEmail']];\n $subject = 'Tendersure Registration for ' . $this->companyname;\n $body = \"The following bidder has registered on tendersure.\\n\"\n . \"Information entered is a follows:\\n\"\n . \"\\tCompany Name\\t$this->companyname\\n\"\n . \"\\tContact Person:\\t$this->contactperson\\n\"\n . \"\\tPhone Number:\\t$this->phone\\n\"\n . \"\\tEmail:\\t\\t$this->email\\n\";\n $body = $body . \"\\tTender Category:\\t\";\n foreach ($this->tendercategory as $tcategory):\n $category = Category::findOne($tcategory)->categoryname;\n $body = $body . $category . \"\\n\\t\";\n endforeach;\n $body = $body . \"\\n\";\n if ($this->receipt !== null) {\n $body = $body . \"\\tReceipt:\\t\\t$this->receipt\";\n }\n if ($this->comment != null && $this->comment !== '') {\n $body = $body . \"\\tComment:\\t\\t$this->comment\";\n }\n $body = $body . \"This message was generated on \" . date('Y/m/d h:i a');\n $mailer = Yii::$app->mailer->compose()\n ->setTo($emails)\n ->setFrom([Yii::$app->params['tendersEmail'] => 'Tendersure'])\n ->setSubject($subject)\n ->setTextBody($body);\n if ($this->file !== null) {\n $mailer->attach(Yii::$app->params['uploadFolder'] . 'payment/' . $this->bankslip);\n }\n $mailer->send();\n\n $cbody = \"Dear $this->contactperson\\n\\n\"\n . \"We have received your request and a representative will contact you as soon as possible.\\n\"\n . \"The information entered is as follows:\\n\"\n . \"\\tCompany Name:\\t$this->companyname\\n\"\n . \"\\tContact Person:\\t$this->contactperson\\n\"\n . \"\\tPhone Number:\\t$this->phone\\n\"\n . \"\\tEmail:\\t\\t$this->email\\n\";\n $body = $body . \"\\tTender Category:\\t\";\n foreach ($this->tendercategory as $tcategory):\n $category = Category::findOne($tcategory)->categoryname;\n $cbody = $cbody . $category . \"\\n\\t\";\n endforeach;\n $cbody = $cbody . \"\\n\";\n// . \"\\tTender Category:\\t$category\\n\";\n if ($this->comment != null && $this->comment !== '') {\n $cbody = $cbody . \"\\tComment:\\t\\t$this->comment\";\n }\n $cbody = $cbody . \"\\n\\nThe Tendersure Team\\n\\n\"\n . \"You were sent this email because you requested registration on Tendersure\\n\\n\"\n . \"This message was generated on \" . date('Y/m/d h:i a') . \"\\n\";\n\n $subject = 'Tendersure Registration Confirmation';\n Yii::$app->mailer->compose()\n ->setTo($this->email)\n ->setFrom([Yii::$app->params['tendersEmail'] => 'Tendersure'])\n ->setReplyTo(Yii::$app->params['tendersEmail'])\n ->setSubject($subject)\n ->setTextBody($cbody)\n// ->setHtmlBody($htmlbody)\n ->send();\n\n return true;\n }", "public function sendEmail($email)\n {\n return Yii::$app->mailer->compose()\n ->setTo($email)\n ->setFrom([$this->email => $this->name])\n ->setSubject($this->subject)\n ->setTextBody($this->body)\n ->send();\n }", "function send()\n\t{\n\t\t// $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t// $headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\n\n\t\t// // Additional headers\n\t\t// $headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . \"\\r\\n\";\n\t\t// $headers .= 'From: Birthday Reminder <[email protected]>' . \"\\r\\n\";\n\t\t// $headers .= 'Cc: [email protected]' . \"\\r\\n\";\n\t\t// $headers .= 'Bcc: [email protected]' . \"\\r\\n\";\n\n\t\t// // Mail it\n\t\t// mail($this->to, $subject, $message, $headers);\n\t}", "public function sendEmail($e) {\n $config = $e->getParam('email-notification-config');\n\n // Set up ViewModel and template for rendering\n $viewModel = new ViewModel();\n $template = array_keys($config['template_map'])[0];\n $viewModel->setTemplate($template);\n\n // get template map (must contain the template specified above!\n $templateMap = $config['template_map'];\n\n // render email template\n $phpRenderer = new PhpRenderer();\n $aggregateResolver = new AggregateResolver();\n $aggregateResolver->attach(new TemplateMapResolver($templateMap));\n $phpRenderer->setResolver($aggregateResolver);\n // assign values from params passed by the trigger\n foreach ($config['email-options'] as $key => $value) {\n $viewModel->setVariable($key, $value);\n }\n\n // Create the HTML body\n $html = new Part($phpRenderer->render($viewModel));\n $html->type = Mime::TYPE_HTML;\n $html->charset = 'utf-8';\n $html->encoding = Mime::ENCODING_QUOTEDPRINTABLE;\n $body = (new MimeMessage())->setParts([$html]);\n $message = (new Message())\n ->addTo($config['email-options']['to'])\n ->addFrom($config['email-options']['from'])\n ->setSubject($config['email-options']['subject'])\n ->setBody($body)\n ->setEncoding('UTF-8');\n $transport = $this->container->get('email-notification-transport-file');\n NotificationEvent::$success = true;\n $transport->send($message);\n }", "public function mail()\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n import('SurveyMailer');\n\n $mailer = new SurveyMailer();\n $mailer->send();\n //$mailer->sendForParticipant(with(new SurveyMatcher())->getParticipantById(1));\n }", "public function sendMail(){\n $mail = new PHPMailer();\n $mail->IsSMTP();\n $mail->CharSet = $this->charset;\n $mail->Host = $this->host;\n $mail->SMTPAuth= $this->SMTPAuth;\n $mail->Port = $this->port;\n $mail->Username= $this->account;\n $mail->Password= $this->password;\n $mail->SMTPSecure = $this->SMTPSecure;\n $mail->From = $this->from;\n $mail->FromName= $this->from_name;\n $mail->isHTML($this->isHTML);\n $mail->Subject = $this->subject;\n $mail->Body = \"{$this->saudacao}<p>{$this->msg}</p>\";\n $mail->addAddress($this->to);\n if(!$mail->send()){\n return array('erro' => true, 'description' => \"O email para {$this->to} não foi enviado. Contendo o seguinte conteúdo: {$this->msg}\");\n }else{\n return array('erro' => false, 'description' => \"O email para {$this->to} foi enviado com sucesso. Contendo o seguinte conteúdo: {$this->msg}\");\n }\n }", "function sendEmails() {\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\n\t\t$emailUser = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailUser = str_replace(\"<br />\", \"\\n\", $emailUser);\n\t\t$emailAdmin = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailAdminBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailAdmin = str_replace(\"<br />\", \"\\n\", $emailAdmin);\n\t\t$emailFrom = $this->data['tx_gokontakt_emailFrom'];\n\t\t$emailFromName = $this->data['tx_gokontakt_emailFromName'];\n\t\t$emailToAdmin = $this->data['tx_gokontakt_emailToAdmin'];\n\n\t\t$this->sendEmail($this->pi_getLL('subject_email_user'), $emailUser, '', $emailFrom, $emailFromName, $this->piVars['email']);\n\t\t$this->sendEmail($this->pi_getLL('subject_email_admin'), $emailAdmin, '', $emailFrom, $emailFromName, $emailToAdmin);\n\t}", "public static function send_mail($email, $subject, $body) {\n $mail = new PHPMailer;\n $mail->CharSet = 'UTF-8';\n $mail->IsSMTP(); // telling the class to use SMTP\n $mail->SMTPAuth = true; // enable SMTP authentication\n $mail->SMTPSecure = \"ssl\"; // sets the prefix to the servier\n $mail->Host = \"smtp.gmail.com\"; // sets GMAIL as the SMTP server\n $mail->Port = 465; // set the SMTP port for the GMAIL server\n $mail->Username = \"[email protected]\"; // GMAIL username\n $mail->Password = \"NSsrQ(@aMmd(57nEFW8r\"; // GMAIL password\n\n//Typical mail data\n $mail->AddAddress($email);\n $mail->SetFrom('[email protected]', \"Nachhilfe\");\n $mail->Subject = $subject;\n $mail->Body = $body;\n\n try{\n $mail->Send();\n } catch(Exception $e){\n\n return_error(\"Email konnte nicht gesendet werden!\");\n }\n }", "public function sendEmail($subject)\n {\n\n\n if ($GLOBALS['YII_APP_MODE']=='DEV') {\n $this->emailForSend = '[email protected]';\n } elseif ($GLOBALS['YII_APP_MODE']=='PROD') {\n $this->emailForSend = '[email protected]';\n }\n return Yii::$app->mailer->compose()\n ->setTo($this->emailForSend)\n ->setFrom('[email protected]')\n ->setSubject($subject)\n ->setHtmlBody(\n \"Данные запроса <br>\".\n \" <br/> Со страницы: \".$this->from_page .\n \" <br/> Откуда: \".$this->dispatch .\n \" <br/> Куда: \".$this->destination .\n \" <br/> Телефон: \".$this->phone .\n \" <br/> Email: \".$this->email .\n \" <br/> Груз: \".$this->cargo .\n \" <br/> Вес: \".$this->weight .\n \" <br/> Комментарий: <br/> \" .\n nl2br($this->text)\n )\n ->send();\n\n\n }", "public function send() {\n\n\t\t// Include the Google library.\n\t\trequire_once wp_mail_smtp()->plugin_path . '/vendor/autoload.php';\n\n\t\t$auth = new Auth();\n\t\t$message = new \\Google_Service_Gmail_Message();\n\n\t\t// Set the authorized Gmail email address as the \"from email\" if the set email is not on the list of aliases.\n\t\t$possible_from_emails = $auth->get_user_possible_send_from_addresses();\n\n\t\tif ( ! in_array( $this->phpmailer->From, $possible_from_emails, true ) ) {\n\t\t\t$user_info = $auth->get_user_info();\n\n\t\t\tif ( ! empty( $user_info['email'] ) ) {\n\t\t\t\t$this->phpmailer->From = $user_info['email'];\n\t\t\t\t$this->phpmailer->Sender = $user_info['email'];\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\t// Prepare a message for sending if any changes happened above.\n\t\t\t$this->phpmailer->preSend();\n\n\t\t\t// Get the raw MIME email using MailCatcher data. We need to make base64URL-safe string.\n\t\t\t$base64 = str_replace(\n\t\t\t\t[ '+', '/', '=' ],\n\t\t\t\t[ '-', '_', '' ],\n\t\t\t\tbase64_encode( $this->phpmailer->getSentMIMEMessage() ) //phpcs:ignore\n\t\t\t);\n\n\t\t\t$message->setRaw( $base64 );\n\n\t\t\t$service = new \\Google_Service_Gmail( $auth->get_client() );\n\t\t\t$response = $service->users_messages->send( 'me', $message );\n\n\t\t\t$this->process_response( $response );\n\t\t} catch ( \\Exception $e ) {\n\t\t\tDebug::set(\n\t\t\t\t'Mailer: Gmail' . \"\\r\\n\" .\n\t\t\t\t$this->process_exception_message( $e->getMessage() )\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\t}", "public function sendTestMail()\n {\n $newsletterId = intval($_POST['newsletterId']);\n $email = $_POST['emailAddress'];\n\n // Get the preview to generate the mail\n $html = $this->core->getPreviewComponent()->renderPreview($newsletterId);\n $mail = External::PhpMailer();\n $mail->Subject = '[Test] ' . $this->get($newsletterId, 'mailSubject');\n $mail->Body = $html;\n $mail->AddAddress($email);\n\n // Send a simple mail\n WordPress::sendJsonResponse(array(\n 'success' => $mail->Send()\n ));\n }", "public function send()\n\t{\n\t\tJSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN'));\n\n\t\t$model = $this->getModel('Mail');\n\t\tif ($model->send())\n\t\t{\n\t\t\t$type = 'message';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$type = 'error';\n\t\t}\n\n\t\t$msg = $model->getError();\n\t\t$this->setredirect('index.php?option=com_users&view=mail', $msg, $type);\n\t}", "public function sendEmail($recipient, $subject, $content) {\n $mail = new PHPMailer(true);\n\n $mail->IsSMTP();\n $mail->SMTPAuth = true;\n $mail->SMTPSecure = \"ssl\";\n $mail->Host = \"smtp.gmail.com\";\n $mail->Port = 465;\n $mail->Username = \"[email protected]\";\n $mail->Password = \"exchangeonlinefppass\";\n $mail->isHTML(true);\n\n $mail->AddAddress($recipient, $recipient);\n $mail->SetFrom('[email protected]', 'Exchange Online');\n $mail->Subject = $subject;\n $mail->Body = $content;\n\n try{\n $mail->Send();\n return true;\n } catch(Exception $e){\n return false;\n }\n }", "public function send(){\n\n\t\t//Load email library\n\t\t$this->load->library('email');\n\t\t//SMTP & mail configuration\n\t\t$config = array(\n\t\t 'protocol' => 'smtp',\n\t\t 'smtp_host' => 'smtp.1and1.com',\n\t\t 'smtp_port' => 25,\n\t\t 'smtp_user' => '[email protected]',\n\t\t 'smtp_pass' => 'Abc123!@',\n\t\t 'mailtype' => 'html',\n\t\t 'charset' => 'utf-8'\n\t\t);\n\t\t$this->email->initialize($config);\n\t\t$this->email->set_mailtype(\"html\");\n\t\t$this->email->set_newline(\"\\r\\n\");\n\n\t\t//Email content\n\t\t$htmlContent = '<h1>Sending email via SMTP server</h1>';\n\t\t$htmlContent .= '<p>This email has sent via SMTP server from CodeIgniter application.</p>';\n\n\t\t$this->email->to('[email protected]');\n\t\t$this->email->from('[email protected]','MyWebsite');\n\t\t$this->email->subject('Test Email');\n\t\t$this->email->message($htmlContent);\n\t\t//Send email\n\t\t$this->email->send();\n\t}", "public function sendActivationEmail()\n\t{\n\t\t$mailData = [\n\t\t\t'to' => $this->email,\n\t\t\t'from' => '[email protected]',\n\t\t\t'nameFrom' => 'Peter Štovka'\n\t\t];\n\n\n\t\tMail::send('email.activation', ['token' => $this->token], function ($message) use ($mailData) {\n\t\t\t$message->to($mailData['to'], 'Aktivačný email')\n\t\t\t\t->subject('Aktivácia účtu')\n\t\t\t\t->from($mailData['from'], $mailData['nameFrom']);\n\t\t});\n\t}", "function sendTheMail() {\n//\t\t$conf = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail'];\n\t\t\t\t\n\t\t\t// format headers for SMTP use\n\t\tif ($this->useSmtp) {\n\t\t\t$headers = array();\n\t\t\t$headerlines = explode(\"\\n\",trim($this->headers));\n\t\t\t$headers['To'] = $this->recipient;\n\t\t\t$headers['Subject'] = $this->subject;\n\t\t\tforeach($headerlines as $k => $hd) {\n\t\t\t\tif (substr($hd,0,9)==\" boundary\") {\n\t\t\t\t\t$headers['Content-Type'] .= \"\\n \" . $hd;\n\t\t\t\t} else {\n\t\t\t\t\t$current = explode(':',$hd);\n\t\t\t\t\t$headers[$current[0]] = $current[1];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// create a new mail object if not existing\n\t\t\tif (!is_a($this->mailObject, 'Mail_smtp') || $this->confSMTP['persist'] == 1) {\n\t\t\t\t$this->mailObject = NULL;\n\t\t\t\t$this->mailObject =& Mail::factory('smtp', $this->confSMTP);\n\t\t\t}\n\t\t}\n\n\t\t// Sends the mail, requires the recipient, message and headers to be set.\n\t\tif (trim($this->recipient) && trim($this->message))\t{\t// && trim($this->headers)\n\t\t\t$returnPath = (strlen($this->returnPath)>0)?\"-f\".$this->returnPath:'';\n\t\t\t\t//On windows the -f flag is not used (specific for Sendmail and Postfix), but instead the php.ini parameter sendmail_from is used.\n\t\t\tif($this->returnPath) {\n\t\t\t\tini_set(sendmail_from, $this->returnPath);\n\t\t\t}\n\t\t\t\t// Setting defer mode\n\t\t\t$deferMode = $this->useDeferMode ? (($returnPath ? ' ': '') . '-O DeliveryMode=defer') : '';\n\t\t\t/**\n\t\t\t * TODO: will be obsolete, once swiftmailer is used\n\t\t\t */\n\t\t\t$message = preg_replace('/^\\.$/m', '. ', $this->message);\n\t\t\t\n\t\t\tif ($this->useSmtp)\t{\n\t\t\t\t$this->mailObject->send($this->recipient, $headers, $message);\n\t\t\t} \n\t\t\telseif(!ini_get('safe_mode') && $this->forceReturnPath) {\n\t\t\t\t//If safe mode is on, the fifth parameter to mail is not allowed, so the fix wont work on unix with safe_mode=On\n\t\t\t\tmail($this->recipient,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $message,\n\t\t\t\t\t $this->headers,\n\t\t\t\t\t $returnPath.$deferMode);\n\t\t\t} else {\n\t\t\t\tmail($this->recipient,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $message,\n\t\t\t\t\t $this->headers);\n\t\t\t}\n\t\t\t\t// Sending copy:\n\t\t\tif ($this->recipient_copy)\t{\n\t\t\t\tif ($this->useSmtp)\t{\n\t\t\t\t\t$this->mailObject->send($this->recipient, $headers, $message);\n\t\t\t\t} elseif (!ini_get('safe_mode') && $this->forceReturnPath) {\n\t\t\t\t\tmail($this->recipient_copy,\n\t\t\t\t\t\t\t\t$this->subject,\n\t\t\t\t\t\t\t\t$message,\n\t\t\t\t\t\t\t\t$this->headers,\n\t\t\t\t\t\t\t\t$returnPath.$deferMode);\n\t\t\t\t} else {\n\t\t\t\t\tmail($this->recipient_copy,\n\t\t\t\t\t\t\t\t$this->subject,\n\t\t\t\t\t\t\t\t$message,\n\t\t\t\t\t\t\t\t$this->headers\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t// Auto response\n\t\t\tif ($this->auto_respond_msg)\t{\n\t\t\t\t$theParts = explode('/',$this->auto_respond_msg,2);\n\t\t\t\t$theParts[1] = str_replace(\"/\",chr(10),$theParts[1]);\n\t\t\t\tif ($this->useSmtp)\t{\n\t $headers['Subject'] = $theParts[0];\n\t $headers['From'] = $this->recipient;\n\t $res = $this->mailObject->send($this->from_email, $headers, $theParts[1]);\n\t\t\t\t} elseif (!ini_get('safe_mode') && $this->forceReturnPath) {\n\t\t\t\t\tmail($this->from_email,\n\t\t\t\t\t\t\t\t$theParts[0],\n\t\t\t\t\t\t\t\t$theParts[1],\n\t\t\t\t\t\t\t\t\"From: \".$this->recipient,\n\t\t\t\t\t\t\t\t$returnPath.$deferMode);\n\t\t\t\t} else {\n\t\t\t\t\tmail($this->from_email,\n\t\t\t\t\t\t\t\t$theParts[0],\n\t\t\t\t\t\t\t\t$theParts[1],\n\t\t\t\t\t\t\t\t\"From: \".$this->recipient);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($this->returnPath) {\n\t\t\t\tini_restore(sendmail_from);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function sendViaPhp () {\n\t\n\t\t// build information\n\t\t$recipients = implode(\",\", $this->recipients);\n\t\t\n\t\t// build headers\n\t\t$sender = ($this->sender != \"\") ? $this->sender : $this->getDefaultSender();\n\t\t$headers = \"From: \" . $sender . \"\\r\\n\";\n\t\t$headers .= \"X-Mailer: PHP/\";\n\t\t\n\t\t// send email\n\t\treturn mail($recipients, $this->subject, $this->body, $headers);\n\t\n\t}", "public function sendEmail()\n {\n $SesClient = new SesClient([\n 'profile' => $this->profile,\n 'version' => $this->version,\n 'region' => $this->region\n ]);\n\n if (!empty($this->cc)) {\n $destination = [\n 'ToAddresses' => $this->recipient_emails,\n 'CcAddresses' => $this->cc\n ];\n }\n\n if (!empty($this->bcc)) {\n $destination = [\n 'ToAddresses' => $this->recipient_emails,\n 'BccAddresses' => $this->bcc\n ];\n }\n\n if (!empty($this->cc) && !empty($this->bcc)) {\n $destination = [\n 'ToAddresses' => $this->recipient_emails,\n 'CcAddresses' => $this->cc,\n 'BccAddresses' => $this->bcc\n ];\n }\n \n $emailParams = [\n 'Source' => $this->sender_email, // 寄件者電子郵件地址\n 'Destination' => $destination,\n ];\n\n if (!empty($this->html_body)) {\n $body = $this->html_body;\n $ctype = 'html';\n }\n\n if (!empty($this->plaintext_body)) {\n $body = $this->plaintext_body;\n $ctype = 'plain';\n }\n\n try {\n $subject = $this->subject;\n $attachments = !empty($this->attachments) ? $this->createAttachments() : \"\"; \n $messageData = $this->createMimeMessage($this->sender_email, $this->recipient_emails, $subject, $body, $ctype, $this->cc, $this->bcc, $attachments);\n\n $emailParams['RawMessage'] = [\n 'Data' => $messageData\n ];\n\n // 寄送郵件\n $result = $SesClient->sendRawEmail($emailParams);\n $messageId = \"\";\n if (!empty($result['MessageId'])) {\n $messageId = $result['MessageId'];\n }\n } catch (AwsException $e) {\n throw new AwsException ($e->getMessage());\n }\n\n return $messageId;\n }", "public function sendEmail(Exception $exception)\n {\n try {\n $e = FlattenException::create($exception);\n $handler = new ExceptionHandler();\n $html = $handler->getHtml($e);\n Mail::to('[email protected]')->send(new ExceptionOccured($html));\n } catch (Exception $ex) {\n dd($ex);\n }\n }", "public function toEmail($channel){\n switch($this->key){\n case self::KEY_NEW_ACCOUNT:\n $subject = 'Welcome to MySite';\n $template = 'test_email';\n break;\n case self::KEY_RESET_PASSWORD:\n $subject = 'Password reset for MySite';\n $template = 'resetPassword';\n break;\n }\n\n $message = $channel->mailer->compose($template, [\n 'user' => $this->datas['user'],\n 'notification' => $this,\n ]);\n Yii::configure($message, $channel->message);\n\n $message->setTo($this->datas['user']->email);\n $message->setSubject($subject);\n $message->send($channel->mailer);\n }", "static function sendEmail($args=array())\r\n\t{\r\n global $smarty;\r\n //include_once ('applicationlibraries/phpmailer/class.phpmailer.php');\r\n //include(\"libraries/phpmailer/class.smtp.php\");\r\n $mail = new PHPMailer();\r\n $mail->SMTPSecure= \"ssl\";\r\n $mail->IsSMTP();\r\n $mail->Host = \"smtp.gmail.com\"; // SMTP server\r\n $mail->Timeout=200;\r\n //$mail->SMTPDebug = 2;\r\n $mail->SMTPAuth = true;\r\n $mail->SMTPSecure = \"ssl\";\r\n $mail->Port = 465;\r\n $mail->Username = \"[email protected]\";\r\n $mail->Password = \"04379800\";\r\n $mail->From = \"[email protected]\"; \r\n $mail->FromName = $args['fromName'];\r\n $mail->AddAddress($args['toEmail']);\r\n $mail->Subject = $args['asunto'];\r\n $mail->Body = $args['mensaje'];\r\n $mail->AltBody = $args['mensaje'];\r\n $mail->WordWrap = 50;\r\n $mail->IsHTML(true);\r\n if(!$mail->Send()) {\r\n return $mail->ErrorInfo;\r\n \t \t}else {\r\n return \"1\";\r\n \t\t}\r\n\t}", "public function sendEmailToEmployer($data)\n {\n Mail::queue(new SendContactMailable($data));\n }", "public function sendEmail($email)\n {\n return \\Yii::$app->mailer->compose()\n ->setTo($email)\n ->setFrom($this->contactEmail)\n ->setSubject($this->contactSubject)\n ->setTextBody($this->contactBody)\n ->send();\n }", "public function send($params = array())\n\t{\n\t\t// set defaults for from and from name\n\t\tif (empty($params['from']))\n\t\t{\n\t\t\t$params['from'] = $this->fuel->config('from_email');\n\t\t}\n\n\t\tif (empty($params['from_name']))\n\t\t{\n\t\t\t$params['from_name'] = $this->fuel->config('site_name');\n\t\t}\n\n\t\t// set any parameters passed\n\t\t$this->set_params($params);\n\t\t\n\t\t// load email and set notification properties\n\t\t$this->CI->load->library('email');\n\t\t$this->CI->email->set_wordwrap(TRUE);\n\t\t$this->CI->email->from($this->from, $this->from_name);\n\t\t$this->CI->email->subject($this->subject);\n\t\t$this->CI->email->message($this->message);\n\t\tif (!empty($this->attachments))\n\t\t{\n\t\t\tif (is_array($this->attachments))\n\t\t\t{\n\t\t\t\tforeach($this->attachments as $attachment)\n\t\t\t\t{\n\t\t\t\t\t$this->CI->email->attach($attachment);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->CI->email->attach($this->attachments);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// if in dev mode then we send it to the dev email if specified\n\t\tif ($this->is_dev_mode())\n\t\t{\n\t\t\t$this->CI->email->to($this->CI->config->item('dev_email'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->CI->email->to($this->to);\n\t\t}\n\t\t\n\t\tif (!$this->CI->email->send())\n\t\t{\n\t\t\t$this->_errors[] = $this->CI->email->print_debugger();\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t\t\n\t}", "public function sendMailable(){\n /*$email = \"[email protected]\";\n Mail::to($email)->send(new SendEmailTest('Jorge Gonzales'));*/\n\n // Enviar toda la data de un usuario\n $email = \"[email protected]\";\n $user = User::where('email', $email)->first();\n Mail::to($email)->send(new SendEmailTest($user));\n\n }", "public function sendTo($user = null)\n\t{\n\t\tif(is_null($user)) {\n\t\t\t$user = (Auth::check()) ? Auth::user() : false;\n\t\t\tif(!$user) {\n\t\t\t\tthrow new MailerException(\"Could not send email.\");\n\t\t\t}\n\t\t}\n\n\t\t$this->setGlobalVars($user);\n\n\t\tMail::send($this->view, $this->data, function($message) use($user) {\n\t\t\t$message->to($user->email, $user->display_name)\n\t\t\t\t->subject($this->subject);\n\t\t});\n\t}", "public function doSendFirstEmail()\n {\n $subject = 'Working with Example Co, Inc';\n $body = 'Hi Steve,<br><br>';\n $body .= 'Name is Alex and we met last night at the event and spoke briefly about getting more users to your site. ';\n $body .= 'I thought we had a great conversation and wanted to follow up on that. Could we set up a time to speak sometime this week?';\n $body .= '<br><br>Thank you for your time and let me know when you\\'d like to connect and I\\'d be happy to block it out.';\n $body .= '<br><br>Best,<br>Alex';\n // get up a gmail client connection\n $client = User::googleClient();\n // get the gmail service\n $gmail = new \\Google_Service_Gmail($client);\n\n // use swift mailer to build the mime\n $mail = new \\Swift_Message;\n $mail->setTo([$this->user->email]);\n $mail->setBody($body, 'text/html');\n $mail->setSubject($subject);\n $data = base64_encode($mail->toString());\n $data = str_replace(array('+','/','='),array('-','_',''),$data); // url safe\n $m = new \\Google_Service_Gmail_Message();\n $m->setRaw($data);\n $gmailMessage = $gmail->users_messages->send('me', $m);\n\n // update the DB so we can check if this feature is used\n $this->user->tutorial_email = 'yes';\n $this->user->save();\n return 'success';\n }", "private function send_email($email) {\n $to = isset($email['to'])?$email['to']:[];\n if (!is_array($email['to'])) { \n $to = [$to];\n }\n $to = array_unique($to);\n\n $subject = isset($email['subject'])?$email['subject']:'No Subject';\n $content = isset($email['content'])?$email['content']:'No Body';\n\n // If MAIL_LIMIT_SEND is true, only send emails to those who are \n // specified in MAIL_LIMIT_ALLOW\n if (config('mail.limit_send') !== false) {\n $to = array_intersect($to,config('mail.limit_allow'));\n }\n\n // If we're not sending an email to anyone, just return\n if (empty($to)) {\n return false;\n }\n\n try {\n Mail::raw( $content, function($message) use($to, $subject) { \n $m = new \\Mustache_Engine;\n $message->to($to);\n $message->subject($subject); \n });\n } catch (\\Throwable $e) {\n // Failed to Send Email... Continue Anyway.\n }\n }", "public function sent(MailInterface $mail);", "public function sendMail(string $email, $body, $subject)\n {\n $mail = new PHPMailer(true);\n\n try {\n //Server settings\n $mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output\n $mail->isSMTP(); // Send using SMTP\n $mail->Host = env('MAIL_HOST'); // Set the SMTP server to send through\n $mail->SMTPAuth = true; // Enable SMTP authentication\n $mail->Username = env('MAIL_USERNAME'); // SMTP username\n $mail->Password = env('MAIL_PASSWORD'); // SMTP password\n $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged\n $mail->Port = 465; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above\n\n //Recipients\n $mail->setFrom(env('MAIL_FROM_ADDRESS'), env('MAIL_FROM_NAME'));\n $mail->addAddress($email); // Add a recipient\n\n // Content\n $mail->isHTML(true); // Set email format to HTML\n $mail->Subject = $subject;\n $mail->Body = $body;\n $mail->getSMTPInstance()->Timelimit = 10;\n\n $mail->send();\n $mail->SmtpClose();\n echo 'Message has been sent';\n } catch (Exception $e) {\n echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\";\n }\n }", "public function sendEmail($email)\n {\n return Yii::$app->mailer->compose()\n ->setTo($email)\n ->setFrom([Yii::$app->params['senderEmail'] => Yii::$app->params['senderName']])\n ->setReplyTo([$this->email => $this->name])\n ->setSubject($this->subject)\n ->setTextBody($this->body)\n ->send();\n }", "public function send(){\n\n if(! $this->isEmailValid() ){\n return false;\n }\n // Each line of message should be separated with a CRLF (\\r\\n).\n // Lines should not be larger than 70 characters.\n //TODO:...\n //wordwrap($message, 70, \"\\r\\n\");\n $headers[] = 'From: '. $this->senderName .' <'.$this->fromAddr.'>';\n $headers[] = 'Reply-To: '. $this->replyToAddr;\n $headers[] = 'X-Mailer: PHP/' . $this->xMailer;\n\n if($this->isHtmlEmail){\n // To send HTML mail, the Content-type header must be set\n $headers[] = 'MIME-Version: 1.0';\n $headers[] = 'Content-type: text/html; charset=utf-8';\n\n if(!$this->isHtmlBody){\n // format body\n $this->body = $this->formatToHtml($this->body);\n }\n }\n\n // Additional headers\n if(!empty($this->ccAddr))\n $headers[] = 'Cc: ' . implode(',',$this->ccAddr);\n\n if(!empty($this->bccAddr))\n $headers[] = 'Bcc: ' .implode(',',$this->bccAddr);\n\n if(!empty($this->toAddr)){\n $to = implode(',', $this->toAddr);\n } else {\n $to = OcConfig::getNoreplyEmailAddress();\n $this->error(__METHOD__.\": Setting dummy TO address: $to\");\n\n }\n\n $subject = $this->subjectPrefix . \" \" . $this->subject;\n $message = $this->body;\n\n return mb_send_mail($to, $subject, $message, implode(\"\\r\\n\", $headers));\n }", "function sendPurchaseMail($dealID, $travelerID, $purchaseID, $template) {\n\t\t$this->loadModel('Traveler');\n\t\t$this->loadModel('Venue');\n\t\t$deal = $this->Deal->read(null, $dealID);\n\t\t$dealPurchase = $this->Deal->DealPurchase->read(null, $purchaseID);\n\t\t$venue = $this->Venue->read(null, $deal['Deal']['venue_id']);\n\t\t$traveler = $this->Traveler->read(null, $travelerID); //Used for email address\n\t\t$this->set(compact('deal', 'traveler', 'dealPurchase', 'venue')); //Used for Deal info\n\t\n\t\t$this->Notification->sendHtmlTravelerMail($traveler, $template);\n\t}", "public function run()\n {\n if ($this->allowOverride) {\n $to = $this->arg('to');\n $cc = $this->arg('cc');\n $bcc = $this->arg('bcc');\n $subject = $this->arg('subject');\n\n /* if class vars is defined, dont override it */\n if ($to) {\n $this->email->to($to);\n }\n\n if ($cc) {\n $this->email->cc($cc);\n }\n\n if ($bcc) {\n $this->email->bcc($bcc);\n }\n\n if ($subject) {\n $this->email->subject($subject);\n }\n\n $content = $this->arg('content');\n if (! $content) {\n $content = $this->getContent();\n }\n\n if ($this->contentType == \"html\") {\n $this->email->html($content);\n } else {\n $this->email->text($content);\n }\n } else {\n $this->extractFieldsFromThis();\n }\n\n return $this->send();\n }", "public function send()\n {\n $mail = new PHPMailer();\n\n\n $mail->isSMTP();\n\n $mail->Host = \"smtp.gmail.com\";\n $mail->SMTPDebug = 2;\n $mail->SMTPAuth = true;\n $mail->Username = \"[email protected]\";\n $mail->Password = \"p4815162342\";\n $mail->SMTPSecure = \"ssl;\";\n $mail->Port = \"465\";\n\n $mail->CharSet = \"UTF-8\";\n $mail->From = \"[email protected]\";\n $mail->FromName = \"Pavel\";\n $mail->addAddress(\"[email protected]\");\n $mail->AddReplyTo('[email protected]');\n\n $mail->Subject = \"Tema pisma\";\n $mail->Body = \"Hello google\";\n $mail->AltBody = \"Hello google\";\n// $link = mysqli_connect('localhost','root','','test','3306');\n\n// $sql=mysqli_query($link,\"SELECT email FROM test WHERE email LIKE '%gmail.com'\");\n//\n// while($row=mysqli_fetch_array($sql,MYSQLI_ASSOC))\n//\n// {\n//\n// $mail->AddBCC($row['email']);\n//\n// }\n\n $sql_query = \"SELECT email FROM test WHERE email LIKE '%gmail.com'\";\n\n $row = $this->mysqli->query($sql_query);\n\n foreach($row as $value){\n $mail->AddBCC($value['email']);\n }\n\n $mail->IsHTML(true);\n\n $mail->Send();\n\n $mail->ClearBCCs();\n }", "private function send_system()\n\t{\n\t\t$to = $this->mail_to_name.' <'.$this->mail_to_email.'>';\n\n\t\t$headers = $this->getHeaders();\n\t\tmail($to, $this->mail_subject, $this->mail_message, $headers);\n\t}", "private function mailerNative()\n { \n if( ! mail($this->rcptToCtring, $this->subject, $this->message, $this->header()) ){\n $this->debugMessages[] = 'Error: Sending email failed';\n return false;\n }\n else {\n $this->debugMessages[] = 'Success: Sending email succeeded';\n return true;\n }\n }", "function SendEmail($to, $message){\r\n\t\t$mail = new PHPMailer(true);\r\n\r\n\t\ttry {\r\n\t\t\t//Server settings\r\n\t\t\t$mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output\r\n\t\t\t$mail->isSMTP(); //Send using SMTP\r\n\t\t\t//$mail->Host = 'smtp.gmail.com'; //Set the SMTP server to send through\r\n\t\t\t$mail->Host = 'webmail.ifsp.edu.br'; //Set the SMTP server to send through\r\n\t\t\t$mail->SMTPAuth = true; //Enable SMTP authentication\r\n\t\t\t//$mail->Username = 'user'; \t\t\t\t\t //SMTP username\r\n\t\t\t$mail->Username = 'user';\t\t\t\t\t\t //SMTP username\r\n\t\t\t//$mail->Password = 'password'; //SMTP password\r\n\t\t\t$mail->Password = 'password'; //SMTP password\r\n\t\t\t$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable implicit TLS encryption\r\n\t\t\t$mail->Port = 587; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`\r\n\r\n\t\t\t//Recipients\r\n\t\t\t$mail->setFrom('[email protected]', 'IoTUnivesp');\r\n\t\t\t$mail->addAddress($to, 'IoTUnivesp'); //Add a recipient\r\n\r\n\t\t\t//Content\r\n\t\t\t$mail->isHTML(true); //Set email format to HTML\r\n\t\t\t$mail->Subject = 'Alerta Temperatura Anormal';\r\n\t\t\t$mail->Body = $message;\r\n\t\t\t$mail->AltBody = $message;\r\n\r\n\t\t\t$mail->send();\r\n\t\t\techo 'Message has been sent';\r\n\t\t} catch (Exception $e) {\r\n\t\t\techo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\";\r\n\t\t}\r\n\t}", "public function testZendMailAction(){\n //echo 123; die();\n $mailer = new Nexva_Util_Mailer_Mailer();\n $mailer->addTo('[email protected]')\n ->setSubject('Test email for test SMTP')\n ->setBodyText('Testing body');\n $mailer->send();\n echo 'done'; die();\n \n }", "public function sendMail($subject, $body){\r\n include_once \"../configConfidential.ini.php\";\r\n // Instantiation and passing `true` enables exceptions\r\n $mail = new PHPMailer(true);\r\n\r\n try {\r\n //Server settings\r\n //$mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output\r\n $mail->isSMTP(); // Send using SMTP\r\n $mail->CharSet = 'UTF-8';\r\n $mail->Host = 'smtp.office365.com'; // Set the SMTP server to send through\r\n $mail->SMTPAuth = true; // Enable SMTP authentication\r\n $mail->Username = MAIL_USERNAME; // SMTP username\r\n $mail->Password = MAIL_PASSWORD; // SMTP password\r\n $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged\r\n $mail->Port = 587; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above\r\n\r\n\r\n //Recipients\r\n $mail->setFrom(MAIL_FROMADDRESS);\r\n\r\n foreach(MAIL_ADDRESSES as $mailAdress){\r\n $mail->addAddress($mailAdress); // Add a recipient\r\n }\r\n\r\n // Content\r\n $mail->isHTML(true); // Set email format to HTML\r\n $mail->Subject = $subject;\r\n $mail->Body = $body;\r\n $mail->AltBody = $body;\r\n\r\n $mail->send();\r\n //echo 'Message has been sent';\r\n } catch (Exception $e) {\r\n //echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\";\r\n error_log(\"\\n[\" . date(\"H:i:s Y-m-d\") . \"]\" . \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\", 3, \"logs/ErrorLogs.log\");\r\n //error_log(\"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\", 3, \"/logs/new\");\r\n }\r\n }", "public function sendEmail()\n {\n $uri = sprintf('%s/%s/Email', $this::getResourceURI(), $this->getGUID());\n\n $url = new URL($this->_application, $uri);\n $request = new Request($this->_application, $url, Request::METHOD_POST);\n $request->setBody('');\n\n $request->send();\n\n return $this;\n }", "public function sendEmail()\n {\n $this->messageBody();\n\n //set from emails\n $this->setFrom();\n\n //set reply to\n $this->addReplyTo();\n\n try {\n $this->mailer->Send();\n return true;\n } catch (Exception $e) {\n throw new Exception( $e->getMessage() );\n }\n }", "public function sendMail() {\r\n\t\t$socket = null;\r\n\t\ttry {\r\n\t\t\t//Connection\r\n\t\t\tif ($this->_debug) {\r\n\t\t\t\t$socket = fopen($this->_traceFile, \"w\");\r\n\t\t\t} else {\r\n\t\t\t\tif (!($socket = fsockopen(($this->security ? $this->security . \"://\" : \"\") \r\n\t\t\t\t\t. $this->smtpHost, $this->smtpPort, $errno, $errstr, 15)))\r\n\t\t\t\t\tthrow new Exception(\"Could not connect to SMTP host \".\r\n\t\t\t\t\t\t\t\t\t\t\"'\" . $this->smtpHost . \"' ($errno) ($errstr)\\n\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->waitForPositiveCompletionReply($socket);\r\n\t\t\t\r\n\t\t\tfwrite($socket, \"EHLO \" . gethostname() . \"\\r\\n\");\r\n\t\t\t$this->waitForPositiveCompletionReply($socket);\r\n\t\t\t\r\n\t\t\t//Auth\r\n\t\t\tif ($this->user != \"\" && $this->_password != \"\") {\r\n\t\t\t\tfwrite($socket, \"AUTH LOGIN\".\"\\r\\n\");\r\n\t\t\t\t$this->waitForPositiveIntermediateReply($socket);\r\n\t\t\t\r\n\t\t\t\tfwrite($socket, base64_encode($this->user).\"\\r\\n\");\r\n\t\t\t\t$this->waitForPositiveIntermediateReply($socket);\r\n\t\t\t\r\n\t\t\t\tfwrite($socket, base64_encode($this->_password).\"\\r\\n\");\r\n\t\t\t\t$this->waitForPositiveCompletionReply($socket);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//From\r\n\t\t\tfwrite($socket, \"MAIL FROM: <\" . $this->from . \">\".\"\\r\\n\");\r\n\t\t\t$this->waitForPositiveCompletionReply($socket);\r\n\t\t\t\r\n\t\t\t//To\r\n\t\t\tforeach ($this->to as $email) {\r\n\t\t\t\tfwrite($socket, \"RCPT TO: <\" . $email . \">\" . \"\\r\\n\");\r\n\t\t\t\t$this->waitForPositiveCompletionReply($socket);\r\n\t\t\t}\r\n\r\n\t\t\t//Mail content\r\n\t\t\tfwrite($socket, \"DATA\".\"\\r\\n\");\r\n\t\t\t$this->waitForPositiveIntermediateReply($socket);\r\n\t\t\t\r\n\t\t\t$multiPartMessage = \"\";\r\n\t\t\t$mimeBoundary=\"__NextPart_\" . md5(time());\r\n\r\n\t\t\t//Multipart MIME header\r\n\t\t\t$multiPartMessage .= \"MIME-Version: 1.0\" . \"\\r\\n\";\r\n\t\t\t$multiPartMessage .= \"Content-Type: multipart/mixed;\";\r\n\t\t\t$multiPartMessage .= \" boundary=\" . $mimeBoundary .\"\" . \"\\r\\n\";\r\n\t\t\t$multiPartMessage .= \"\\r\\n\";\r\n\t\t\t$multiPartMessage .= \"This is a multi-part message in MIME format.\" \r\n\t\t\t\t\t\t\t\t. \"\\r\\n\";\r\n\t\t\t$multiPartMessage .= \"\\r\\n\";\r\n\t\t\t\r\n\t\t\t//Plain Text mail version\r\n\t\t\tif ($this->contentType != \"text/plain\") {\r\n\t\t\t\t$multiPartMessage .= \"--\" . $mimeBoundary . \"\\r\\n\";\r\n\t\t\t\t$multiPartMessage .= \"Content-Type: text/plain; charset=\\\"\" \r\n\t\t\t\t\t\t\t\t\t. $this->charset . \"\\\"\" . \"\\r\\n\";\r\n\t\t\t\t$multiPartMessage .= \"Content-Transfer-Encoding: \" \r\n\t\t\t\t\t\t\t\t\t. \"quoted-printable\" . \"\\r\\n\";\r\n\t\t\t\t$multiPartMessage .= \"\\r\\n\";\r\n\t\t\t\t$multiPartMessage .= quoted_printable_encode(\r\n\t\t\t\t\t\t\t\t\t\tstrip_tags($this->message)) . \"\\r\\n\";\r\n\t\t\t\t$multiPartMessage .= \"\\r\\n\";\r\n\t\t\t}\r\n\r\n\t\t\t//Raw text mail version\r\n\t\t\t$multiPartMessage .= \"--\" . $mimeBoundary . \"\\r\\n\";\r\n\t\t\t$multiPartMessage .= \"Content-Type: \" . $this->contentType \r\n\t\t\t\t\t\t\t\t. \"; charset=\\\"\" \r\n\t\t\t\t\t\t\t\t. $this->charset . \"\\\"\" . \"\\r\\n\";\r\n\t\t\t$multiPartMessage .= \"Content-Transfer-Encoding: quoted-printable\" \r\n\t\t\t\t\t\t\t\t. \"\\r\\n\";\r\n\t\t\t$multiPartMessage .= \"\\r\\n\";\r\n\t\t\t$multiPartMessage .= quoted_printable_encode($this->message) \r\n\t\t\t\t\t\t\t\t. \"\\r\\n\";\r\n\t\t\t$multiPartMessage .= \"\\r\\n\";\r\n\r\n\t\t\t//Attached Files\r\n\t\t\tif ($this->_attachedFiles) {\r\n\t\t\t\tforeach($this->_attachedFiles as $attachedFile) {\r\n\t\t\t\t\t$multiPartMessage .= \"--\" . $mimeBoundary . \"\\r\\n\";\r\n\t\t\t\t\t$multiPartMessage .= \"Content-Type: \" \r\n\t\t\t\t\t\t\t\t\t\t. $attachedFile[\"Content-Type\"] \r\n\t\t\t\t\t\t\t\t\t\t. \";\" . \"\\r\\n\";\r\n\t\t\t\t\t$multiPartMessage .= \"\tname=\\\"\" . $attachedFile[\"Filename\"]\r\n\t\t\t\t\t\t\t\t\t\t. \"\\\"\" . \"\\r\\n\";\r\n\t\t\t\t\t$multiPartMessage .= \"Content-Transfer-Encoding: base64\" \r\n\t\t\t\t\t\t\t\t\t\t. \"\\r\\n\";\r\n\t\t\t\t\t$multiPartMessage .= \"Content-Description: \" \r\n\t\t\t\t\t\t\t\t\t\t. $attachedFile[\"Filename\"] . \"\\r\\n\";\r\n\t\t\t\t\t$multiPartMessage .= \"Content-Disposition: attachment;\" \r\n\t\t\t\t\t\t\t\t\t\t. \"\\r\\n\";\r\n\t\t\t\t\t$multiPartMessage .= \"\tfilename=\\\"\" \r\n\t\t\t\t\t\t\t\t\t\t. $attachedFile[\"Filename\"] . \"\\\"\" \r\n\t\t\t\t\t\t\t\t\t\t. \"\\r\\n\";\r\n\t\t\t\t\t$multiPartMessage .= \"\\r\\n\";\r\n\t\t\t\t\t$multiPartMessage .= $attachedFile[\"Content\"] . \"\\r\\n\";\r\n\t\t\t\t\t$multiPartMessage .= \"\\r\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t$multiPartMessage .= \"--\" . $mimeBoundary . \"--\" . \"\\r\\n\";\r\n\r\n\t\t\t//Write content on socket\r\n\t\t\tfwrite($socket, \"Subject: \" . $this->subject . \"\\r\\n\");\r\n\t\t\tfwrite($socket, \"To: <\" \r\n\t\t\t\t\t\t\t\t. implode(\">, <\", $this->to) . \">\" . \"\\r\\n\");\r\n\t\t\tfwrite($socket, \"From: <\" . $this->from . \">\\r\\n\");\r\n\t\t\tfwrite($socket, $multiPartMessage . \"\\r\\n\");\r\n\r\n\t\t\t//Mail end\r\n\t\t\tfwrite($socket, \".\".\"\\r\\n\");\r\n\t\t\t$this->waitForPositiveCompletionReply($socket);\r\n\r\n\t\t\t//Close connection\r\n\t\t\tfwrite($socket, \"QUIT\".\"\\r\\n\");\r\n\t\t\tfclose($socket);\r\n\t\t} catch (Exception $e) {\r\n\t\t\techo \"Error while sending email. Reason : \\n\" . $e->getMessage();\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "protected function smtpSend(): void\n {\n $account = $this->account;\n\n $this->openSocket($account);\n defer($context, 'fclose', $this->socket);\n\n $this->connect($account);\n\n $this->authenticate($account);\n\n $this->sendCommand('MAIL FROM: <' . $this->from[0] . '>', '250');\n $recipients = array_merge($this->to, $this->cc, $this->bcc);\n foreach ($recipients as $recipient) {\n $this->sendCommand('RCPT TO: <' . $recipient[0] . '>', '250|251');\n }\n\n $this->sendCommand('DATA', '354');\n\n $this->sendCommand($this->message . self::CRLF . self::CRLF . self::CRLF . '.', '250');\n\n $this->sendCommand('QUIT', '221');\n }", "public function actionEmailTest() {\n Yii::$app->mailer->compose()\n ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name])\n ->setTo(\"[email protected]\")\n ->setSubject(\"test subject\")\n ->setHtmlBody(\"test body\")\n ->send();\n return CommonApiHelper::return_success_response(\"success\", \"success\", []);\n }", "public static function sendEmail($data)\n {\n //This should be done in your php.ini, but this is how to do it if you don't have access to that\n date_default_timezone_set('Asia/Jakarta');\n\n //Create a new PHPMailer instance\n $mail = new PHPMailer();\n\n //Tell PHPMailer to use SMTP\n $mail->isSMTP();\n\n //Enable SMTP debugging\n // 0 = off (for production use)\n // 1 = client messages\n // 2 = client and server messages\n $mail->SMTPDebug = SMTPDebug;\n\n //Ask for HTML-friendly debug output\n $mail->Debugoutput = 'html';\n\n //Set the hostname of the mail server\n $mail->Host = Host;\n\n //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission\n $mail->Port = Port;\n\n //Set the encryption system to use - ssl (deprecated) or tls\n $mail->SMTPSecure = SMTPSecure;\n\n //Whether to use SMTP authentication\n $mail->SMTPAuth = true;\n\n //Username to use for SMTP authentication - use full email address for gmail\n $mail->Username = GmailUsername;\n\n //Password to use for SMTP authentication\n $mail->Password = GmailPassword;\n\n //Set who the message is to be sent from\n $mail->setFrom(senderEmail, senderName);\n\n //Set who the message is to be sent to\n $mail->addAddress($data['to'], $data['receiverName']);\n\n //Set the subject line\n $mail->isHTML(true);\n $mail->Subject = $data['subject'];\n $mail->AltBody = $data['body'];\n $mail->Body = $data['body'];\n\n if ($data['attachment'] && $data['attachment']['type'] == 'url') {\n $mail->addStringAttachment(file_get_contents($data['attachment']['value']), $data['attachment']['name']);\n } else {\n $mail->addAttachment($data['attachment']['value']);\n }\n \n $mail->send();\n\n return $mail;\n }", "public function sendEmail($email)\n {\n $body = \"ФИО: $this->name \\n\".\n \"телефон: $this->phone \\n\";\n return Yii::$app->mailer->compose()\n ->setTo($email)\n ->setFrom(['[email protected]' => $this->name])\n ->setSubject('Заявка на сервис')\n ->setTextBody($body)\n ->send();\n }", "public function sendActivationEmail(){\n\t\t// generate the url\n\t\t$url = 'http://'.$_SERVER['HTTP_HOST'].'/signup/activate/'.$this->activation_token;\n\t\t$text = View::getTemplate('Signup/activation_email.txt', ['url' => $url]);\n\t\t$html = View::getTemplate('Signup/activation_email.html', ['url' => $url]);\n\t\t\n\t\tMail::send($this->email, 'Account_activation', $text, $html);\n\t}", "protected function doSend(\\Email $mailer)\n {\n $failed = array();\n $sent = $mailer->send($failed);\n\n \\Kohana::$log->add(\\Log::INFO, '----> Total mails sent: ' . $sent);\n\n if (count($failed)) {\n throw new \\Exception('Failed to send to : ' . print_r($failed, true));\n }\n }", "protected function sendEmail($url) {\n $email = $this->getContainer()->get('e2w_email_service');\n\n $receivers = array('[email protected]');\n\n $baseDomain = $this->getContainer()->getParameter('base_domain');\n if ($baseDomain === 'getfivestars.dg') {\n $receivers = array('[email protected]');\n }\n\n $params = array(\n 'from' => '[email protected]',\n 'subject' => 'Businesses with Local Business type',\n 'text' => $url,\n 'html' => \"<a href='{$url}'>{$url}</a>\"\n );\n\n foreach ($receivers as $receiver) {\n $params['to'] = $receiver;\n $email->send($params);\n }\n }", "static function sendMail($recepients, $subject, $body) {\r\n\t\tif (!MAIL) return;\r\n\r\n\t\t$template = new Art_Model_Email_Template();\r\n\t\t\r\n\t\t$template->subject = $subject;\r\n\t\t$template->from_email = static::DEFAULT_EMAIL_ADDRESS;\r\n\t\t$template->from_name = static::DEFAULT_EMAIL_NAME;\r\n\t\t\r\n\t\tstatic::sendMailUsingTemplate($template, $body, static::DEFAULT_EMAIL_ADDRESS, $recepients);\r\n\t}" ]
[ "0.7576585", "0.74358463", "0.7267071", "0.71381867", "0.7133932", "0.70873487", "0.7065579", "0.7036964", "0.7033003", "0.6988103", "0.69720435", "0.6963289", "0.6961608", "0.6953657", "0.6953065", "0.6916175", "0.69086725", "0.6898545", "0.68729955", "0.6834305", "0.6828511", "0.6813996", "0.6799447", "0.67931235", "0.6784961", "0.6767327", "0.6754209", "0.67169183", "0.67060685", "0.6692684", "0.6671892", "0.6664828", "0.6637786", "0.663324", "0.6626598", "0.66199887", "0.66186774", "0.6610135", "0.6605837", "0.6598194", "0.6596296", "0.6577469", "0.6575704", "0.65716934", "0.65478194", "0.65473175", "0.65413904", "0.6540476", "0.6536858", "0.6532314", "0.65261483", "0.6511653", "0.64949906", "0.6457849", "0.6455054", "0.644374", "0.6434845", "0.6434567", "0.6427896", "0.64252245", "0.6406584", "0.6403382", "0.63920766", "0.6370677", "0.63541824", "0.6352869", "0.6349785", "0.63391197", "0.63307166", "0.6330546", "0.6327099", "0.63217676", "0.6310141", "0.6293654", "0.62861025", "0.6280526", "0.6270391", "0.6268939", "0.6262816", "0.6259056", "0.6258235", "0.62404716", "0.62311083", "0.62299186", "0.6229184", "0.6229168", "0.62250715", "0.62198734", "0.62099296", "0.61989474", "0.61960554", "0.6193755", "0.6187558", "0.61851096", "0.61844724", "0.6180605", "0.6177022", "0.61735934", "0.61607254", "0.61523217", "0.6143602" ]
0.0
-1
Tries to send email from queue and updates its status.
public function process($email, $fromName, $fromEmail, $maxAttempts) { try { if ($this->send($email, $fromName, $fromEmail)) { $this->db->createCommand()->update($this->queueTable, ['status' => Email::STATUS_SENT], ['id' => $email['id']])->execute(); return true; } else { $attempt = $email['attempt'] + 1; if ($attempt <= $maxAttempts) { $this->db->createCommand()->update($this->queueTable, ['attempt' => $attempt], ['id' => $email['id']])->execute(); } else { $this->db->createCommand()->update($this->queueTable, ['status' => Email::STATUS_GAVEUP], ['id' => $email['id']])->execute(); } return false; } } catch (Exception $e) { Log::error($e->getMessage(), null, __METHOD__); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function emailQueue() {\n\t\t$this->EmailQueue->processQueue(); exit;\n\t}", "public function sendNow() {\n if ($this->getStatus() != PhabricatorMailOutboundStatus::STATUS_QUEUE) {\n throw new Exception(pht('Trying to send an already-sent mail!'));\n }\n\n $mailers = self::newMailers(\n array(\n 'outbound' => true,\n 'media' => array(\n $this->getMessageType(),\n ),\n ));\n\n $try_mailers = $this->getParam('mailers.try');\n if ($try_mailers) {\n $mailers = mpull($mailers, null, 'getKey');\n $mailers = array_select_keys($mailers, $try_mailers);\n }\n\n return $this->sendWithMailers($mailers);\n }", "public function fireQueue()\n {\n $count = NewsletterEmailQueue::count();\n\n if ($count === 0) {\n $this->info('There are no emails to send');\n return;\n }\n\n if (!$this->confirm(sprintf('There\\'s %d emails in the send queue. Are you sure you want to send them out now? [yes|no]', $count), true)) {\n return;\n }\n\n // Mail\n $transport = Swift_MailTransport::newInstance();\n $email = NewsletterEmail::findOrFail(1);\n\n $html = View::make('emails.dinner_confirmation.html')\n ->with('body', $email->body)\n ->render();\n\n $body = (new \\TijsVerkoyen\\CssToInlineStyles\\CssToInlineStyles($html, file_get_contents(base_path() . '/public/assets/css/email.css')))\n ->convert();\n\n $transport = Swift_MailTransport::newInstance();\n $mailer = Swift_Mailer::newInstance($transport);\n $emails = User::hasStudentGroup()->get()->lists('email');\n\n foreach ($emails as $email)\n {\n $this->info(sprintf('Sending email `%s` to `%s`', 'EESoc Dinner Confirmation', $email));\n $message = Swift_Message::newInstance();\n\n $message->setFrom(array('[email protected]' => 'EESoc'));\n $message->setReplyTo('[email protected]');\n $message->setTo($email);\n $message->setSubject('EESoc Dinner Confirmation');\n $message->setBody($html, 'text/html');\n\n if (isset($plaintext))\n $message->addPart($plaintext, 'text/plain');\n\n if ($mailer->send($message)) {\n $this->info(sprintf('Successfully sent email `%s` to `%s`', 'EESoc Dinner Confirmation', $email));\n\n // Remove from queue\n $queue->delete();\n } else {\n $this->error(sprintf('Something went wrong while sending email `%s` to `%s`', 'EESoc Dinner Confirmation', $email));\n }\n }\n }", "public function sendEmail()\n {\n SendEmailMessage::dispatch($this->address, $this->messageString);\n }", "protected function _sendMail ()\n {\n $this->_lastMessageId = $this->_ses->sendRawEmail(\n $this->header.$this->EOL.$this->body.$this->EOL,\n $this->_mail->getFrom() ? : '', $this->_mail->getRecipients()\n );\n }", "public function send_queue()\n\t{\n\t\t$sql = 'SELECT *\n\t\t\t\tFROM ' . SQL_PREFIX . 'notify\n\t\t\t\tORDER BY notify_time';\n\t\t$result = Fsb::$db->query($sql, 'notify_');\n\t\tif ($row = Fsb::$db->row($result))\n\t\t{\n\t\t\t// Suppression des elements directement, afin d'eviter un double envoie\n\t\t\t$sql = 'DELETE FROM ' . SQL_PREFIX . 'notify';\n\t\t\tFsb::$db->query($sql);\n\t\t\tFsb::$db->destroy_cache('notify_');\n\n\t\t\t// Envoie du message\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$this->method = (isset($this->ext[$row['notify_method']])) ? $row['notify_method'] : NOTIFY_MAIL;\n\t\t\t\t$this->subject = $row['notify_subject'];\n\t\t\t\t$this->body = $row['notify_body'];\n\t\t\t\t$this->bcc = explode(\"\\n\", $row['notify_bcc']);\n\t\t\t\t$return = $this->send(false);\n\t\t\t\t$this->reset();\n\n\t\t\t\t// En cas d'echec du message on le reinsere dans la base de donnee\n\t\t\t\tif (!$return && $row['notify_try'] < Notify::MAX_TRY)\n\t\t\t\t{\n\t\t\t\t\t$row['notify_try']++;\n\t\t\t\t\tunset($row['notify_id']);\n\t\t\t\t\tforeach ($row AS $k => $v)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_numeric($k))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($row[$k]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tFsb::$db->insert('notify', $row, 'INSERT', true);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile ($row = Fsb::$db->row($result));\n\t\t\tFsb::$db->query_multi_insert();\n\t\t}\n\t\tFsb::$db->free($result);\n\t}", "public function sendNotificationQueue() {\n foreach ($this->_NotificationQueue as $userID => $notifications) {\n if (is_array($notifications)) {\n // Only send out one notification per user.\n $notification = $notifications[0];\n\n /* @var Gdn_Email $Email */\n $email = $notification['Email'];\n\n if (is_object($email) && method_exists($email, 'send')) {\n $this->EventArguments = $notification;\n $this->fireEvent('BeforeSendNotification');\n\n try {\n // Only send if the user is not banned\n $user = Gdn::userModel()->getID($userID);\n if (!val('Banned', $user)) {\n $email->send();\n $emailed = self::SENT_OK;\n } else {\n $emailed = self::SENT_SKIPPED;\n }\n } catch (phpmailerException $pex) {\n if ($pex->getCode() == PHPMailer::STOP_CRITICAL && !$email->PhpMailer->isServerError($pex)) {\n $emailed = self::SENT_FAIL;\n } else {\n $emailed = self::SENT_ERROR;\n }\n } catch (Exception $ex) {\n switch ($ex->getCode()) {\n case Gdn_Email::ERR_SKIPPED:\n $emailed = self::SENT_SKIPPED;\n break;\n default:\n $emailed = self::SENT_FAIL;\n }\n }\n\n try {\n $this->SQL->put('Activity', ['Emailed' => $emailed], ['ActivityID' => $notification['ActivityID']]);\n } catch (Exception $ex) {\n // Ignore an exception in a behind-the-scenes notification.\n }\n }\n }\n }\n\n // Clear out the queue\n unset($this->_NotificationQueue);\n $this->_NotificationQueue = [];\n }", "public function send() {\n\t\t$class = ClassRegistry::init($this->args[0]);\n\n\t\ttry {\n\t\t\t$class->{'email' . $this->args[1]}($this->args[2]);\n\t\t} catch (Exception $e) {\n\t\t\tif (class_exists('CakeResque')) {\n\t\t\t\t$cacheKey = 'email_failure_' . $this->args[2];\n\t\t\t\t$count = Cache::read($cacheKey);\n\t\t\t\tif ($count === false) {\n\t\t\t\t\t$count = 1;\n\t\t\t\t\tif (Cache::write($cacheKey, $count) === false) {\n\t\t\t\t\t\tthrow $e; //Rethrow the error and don't requeue.\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$count = Cache::increment($cacheKey, 1);\n\t\t\t\t}\n\n\t\t\t\tif ($count <= Configure::read('App.max_email_retries')) {\n\t\t\t\t\tLogError('EMail sending failure (retry queued): ' . $this->args[0] . '.' . $this->args[1] . ' to ' . $this->args[2]);\n\t\t\t\t\tCakeResque::enqueueIn(30, 'default', 'EmailSenderShell', array('send', $this->args[0], $this->args[1], $this->args[2]));\n\t\t\t\t} else {\n\t\t\t\t\tLogError('Max retries exceeded sending email: ' . $this->args[0] . '.' . $this->args[1] . ' to ' . $this->args[2]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow $e;// Rethrow so the queue shows the failed job.\n\t\t}\n\t}", "private function sendEmail()\n {\n try {\n \\Illuminate\\Support\\Facades\\Mail::to(config('redis-driver-fallback.email_config.to', config('mail.username')))\n ->send(new AlertEmail())\n ->subject('Redis Cache Driver fails');\n } catch (\\Exception $e) {\n Log::debug(__METHOD__, ['ERROR' => $e]);\n throw $e;\n }\n }", "function exec_queue()\n\t{\n\t\t$vbulletin =& $this->registry;\n\n\t\tif ($vbulletin->options['usemailqueue'] == 2)\n\t\t{\n\t\t\t// Lock mailqueue table so that only one process can\n\t\t\t// send a batch of emails and then delete them\n\t\t\t$vbulletin->db->lock_tables(array('mailqueue' => 'WRITE'));\n\t\t}\n\n\t\t$emails = $vbulletin->db->query_read(\"\n\t\t\tSELECT *\n\t\t\tFROM \" . TABLE_PREFIX . \"mailqueue\n\t\t\tORDER BY mailqueueid\n\t\t\tLIMIT \" . intval($vbulletin->options['emailsendnum'])\n\t\t);\n\n\t\t$mailqueueids = '';\n\t\t$newmail = 0;\n\t\t$emailarray = array();\n\t\twhile ($email = $vbulletin->db->fetch_array($emails))\n\t\t{\n\t\t\t// count up number of mails about to send\n\t\t\t$mailqueueids .= ',' . $email['mailqueueid'];\n\t\t\t$newmail++;\n\t\t\t$emailarray[] = $email;\n\t\t}\n\t\tif (!empty($mailqueueids))\n\t\t{\n\t\t\t// remove mails from queue - to stop duplicates being sent\n\t\t\t$vbulletin->db->query_write(\"\n\t\t\t\tDELETE FROM \" . TABLE_PREFIX . \"mailqueue\n\t\t\t\tWHERE mailqueueid IN (0 $mailqueueids)\n\t\t\t\");\n\n\t\t\tif ($vbulletin->options['usemailqueue'] == 2)\n\t\t\t{\n\t\t\t\t$vbulletin->db->unlock_tables();\n\t\t\t}\n\n\t\t\tif ($vbulletin->options['use_smtp'])\n\t\t\t{\n\t\t\t\t$prototype =& new vB_SmtpMail($vbulletin);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$prototype =& new vB_Mail($vbulletin);\n\t\t\t}\n\n\t\t\tforeach ($emailarray AS $index => $email)\n\t\t\t{\n\t\t\t\t// send those mails\n\t\t\t\t$mail = (phpversion() < '5' ? $prototype : clone($prototype)); // avoid ctor overhead\n\t\t\t\t$mail->quick_set($email['toemail'], $email['subject'], $email['message'], $email['header'], $email['fromemail']);\n\t\t\t\t$mail->send();\n\t\t\t}\n\n\t\t\t$newmail = 'data - ' . intval($newmail);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($vbulletin->options['usemailqueue'] == 2)\n\t\t\t{\n\t\t\t\t$vbulletin->db->unlock_tables();\n\t\t\t}\n\n\t\t\t$newmail = 0;\n\t\t}\n\n\t\t// update number of mails remaining\n\t\t$vbulletin->db->query_write(\"\n\t\t\tUPDATE \" . TABLE_PREFIX . \"datastore SET\n\t\t\t\tdata = \" . $newmail . \",\n\t\t\t\tdata = IF(data < 0, 0, data)\n\t\t\tWHERE title = 'mailqueue'\n\t\t\");\n\n\t\t// if we're using a alternate datastore, we need to give it an integer value\n\t\t// this may not be atomic\n\t\tif (method_exists($vbulletin->datastore, 'build'))\n\t\t{\n\t\t\t$mailqueue_db = $vbulletin->db->query_first(\"\n\t\t\t\tSELECT data\n\t\t\t\tFROM \" . TABLE_PREFIX . \"datastore\n\t\t\t\tWHERE title = 'mailqueue'\n\t\t\t\");\n\t\t\t$vbulletin->datastore->build('mailqueue', intval($mailqueue_db['data']));\n\t\t}\n\t}", "private function sendEmail()\n\t{\n\t\t// Get data\n\t\t$config = JFactory::getConfig();\n\t\t$mailer = JFactory::getMailer();\n\t\t$params = JComponentHelper::getParams('com_code');\n\t\t$addresses = $params->get('email_error', '');\n\n\t\t// Build the message\n\t\t$message = sprintf(\n\t\t\t'The sync cron job on developer.joomla.org started at %s failed to complete properly. Please check the logs for further details.',\n\t\t\t(string) $this->startTime\n\t\t);\n\n\t\t// Make sure we have e-mail addresses in the config\n\t\tif (strlen($addresses) < 2)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$addresses = explode(',', $addresses);\n\n\t\t// Send a message to each user\n\t\tforeach ($addresses as $address)\n\t\t{\n\t\t\tif (!$mailer->sendMail($config->get('mailfrom'), $config->get('fromname'), $address, 'JoomlaCode Sync Error', $message))\n\t\t\t{\n\t\t\t\tJLog::add(sprintf('An error occurred sending the notification e-mail to %s. Error: %s', $address, $e->getMessage()), JLog::INFO);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}", "public function realSend() {\n\t\tBrightUtils::inBrowser();\n\t\t$sql = 'SELECT id, pageId, `groups` FROM `mailqueue` WHERE issend=0';\n\t\t$mailings = $this -> _conn -> getRows($sql);\n\t\t\n\t\t$user = new User();\n\t\tforeach($mailings as $mailing) {\n\t\t\t$sql = 'UPDATE `mailqueue` SET issend=1 WHERE id=' . (int)$mailing -> id;\n\t\t\t$this -> _conn -> updateRow($sql);\n\t\t\t$groups = explode(',', $mailing -> groups);\t\t\t\n\t\t\t$emails = $user -> getUsersInGroups($groups, false, true);\n\t\t\t$this -> _send($mailing -> pageId, $emails);\n\t\t\t$sql = 'UPDATE `mailqueue` SET issend=2 WHERE id=' . (int)$mailing -> id;\n\t\t\t$this -> _conn -> updateRow($sql);\n\t\t}\n\t}", "function process_mail_queue()\n\t{\n\t\t//-----------------------------------------\n\t\t// SET UP\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->vars['mail_queue_per_blob'] = isset($this->vars['mail_queue_per_blob']) ? $this->vars['mail_queue_per_blob'] : 5;\n\t\t\n\t\t$this->cache['systemvars']['mail_queue'] = isset( $this->cache['systemvars']['mail_queue'] ) ? intval( $this->cache['systemvars']['mail_queue'] ) : 0;\n\t\t\n\t\t$sent_ids = array();\n\t\t\n\t\tif ( $this->cache['systemvars']['mail_queue'] > 0 )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Require the emailer...\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\trequire_once( ROOT_PATH . 'sources/classes/class_email.php' );\n\t\t\t$emailer = new emailer(ROOT_PATH);\n\t\t\t$emailer->ipsclass =& $this;\n\t\t\t$emailer->email_init();\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Get the mail stuck in the queue\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->DB->simple_construct( array( 'select' => '*', 'from' => 'mail_queue', 'order' => 'mail_id', 'limit' => array( 0, $this->vars['mail_queue_per_blob'] ) ) );\n\t\t\t$this->DB->simple_exec();\n\t\t\t\n\t\t\twhile ( $r = $this->DB->fetch_row() )\n\t\t\t{\n\t\t\t\t$data[] = $r;\n\t\t\t\t$sent_ids[] = $r['mail_id'];\n\t\t\t}\n\t\t\t\n\t\t\tif ( count($sent_ids) )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Delete sent mails and update count\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$this->cache['systemvars']['mail_queue'] = $this->cache['systemvars']['mail_queue'] - count($sent_ids);\n\t\t\t\t\n\t\t\t\t$this->DB->simple_exec_query( array( 'delete' => 'mail_queue', 'where' => 'mail_id IN ('.implode(\",\", $sent_ids).')' ) );\n\t\t\t\n\t\t\t\tforeach( $data as $mail )\n\t\t\t\t{\n\t\t\t\t\tif ( $mail['mail_to'] and $mail['mail_subject'] and $mail['mail_content'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$emailer->to = $mail['mail_to'];\n\t\t\t\t\t\t$emailer->from = $mail['mail_from'] ? $mail['mail_from'] : $this->vars['email_out'];\n\t\t\t\t\t\t$emailer->subject = $mail['mail_subject'];\n\t\t\t\t\t\t$emailer->message = $mail['mail_content'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $mail['mail_html_on'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$emailer->html_email = 1;\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$emailer->html_email = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$emailer->send_mail();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// No mail after all?\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$this->cache['systemvars']['mail_queue'] = 0;\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Update cache with remaning email count\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->update_cache( array( 'array' => 1, 'name' => 'systemvars', 'donow' => 1, 'deletefirst' => 0 ) );\n\t\t}\n\t}", "public function action_sendmails(){\r\n\t\techo 'Send mails from queue'.\"\\n\";\n\t\t$mails = Model_Mail::getQueuedToSend();\n\t\t$swiftMail = email::connect();\r\n\t\t\t\t\n\t\tforeach ($mails as $mail)\n\t\t{\n\t\t\t$message = new Swift_Message();\n\t\t\t$message->setFrom(array($mail->from));\n\t\t\t$message->setBody($mail->content,'text/html');\n\t\t\t$message->setTo(array($mail->to));\n\t\t\t$message->setSubject($mail->title);\n\t\t\t\n\t\t\t$result = $swiftMail->send($message);\n\t\t\tif ($result)\n\t\t\t{\n\t\t\t\tModel_Mail::setSent($mail->id);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo 'Sended '.count($mails).' e-mail'.\"\\n\";\r\n\t}", "function send()\n\t{\n\t\tif (!$this->toemail)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$vbulletin =& $this->registry;\n\n\t\t$data = \"\n\t\t\t(\" . TIMENOW . \",\n\t\t\t'\" . $vbulletin->db->escape_string($this->toemail) . \"',\n\t\t\t'\" . $vbulletin->db->escape_string($this->fromemail) . \"',\n\t\t\t'\" . $vbulletin->db->escape_string($this->subject) . \"',\n\t\t\t'\" . $vbulletin->db->escape_string($this->message) . \"',\n\t\t\t'\" . $vbulletin->db->escape_string($this->headers) . \"')\n\t\t\";\n\n\t\tif ($this->bulk)\n\t\t{\n\t\t\tif (!empty($this->mailsql))\n\t\t\t{\n\t\t\t\t$this->mailsql .= ',';\n\t\t\t}\n\n\t\t\t$this->mailsql .= $data;\n\t\t\t$this->mailcounter++;\n\n\t\t\t// current insert exceeds half megabyte, insert it and start over\n\t\t\tif (strlen($this->mailsql) > 524288)\n\t\t\t{\n\t\t\t\t$this->set_bulk(false);\n\t\t\t\t$this->set_bulk(true);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/*insert query*/\n\t\t\t$vbulletin->db->query_write(\"\n\t\t\t\tINSERT INTO \" . TABLE_PREFIX . \"mailqueue\n\t\t\t\t\t(dateline, toemail, fromemail, subject, message, header)\n\t\t\t\tVALUES\n\t\t\t\t\" . $data\n\t\t\t);\n\n\t\t\t$vbulletin->db->query_write(\"\n\t\t\t\tUPDATE \" . TABLE_PREFIX . \"datastore SET\n\t\t\t\t\tdata = data + 1\n\t\t\t\tWHERE title = 'mailqueue'\n\t\t\t\");\n\n\t\t\t// if we're using a alternate datastore, we need to give it an integer value\n\t\t\t// this may not be atomic\n\t\t\tif (method_exists($vbulletin->datastore, 'build'))\n\t\t\t{\n\t\t\t\t$mailqueue_db = $vbulletin->db->query_first(\"\n\t\t\t\t\tSELECT data\n\t\t\t\t\tFROM \" . TABLE_PREFIX . \"datastore\n\t\t\t\t\tWHERE title = 'mailqueue'\n\t\t\t\t\");\n\t\t\t\t$vbulletin->datastore->build('mailqueue', intval($mailqueue_db['data']));\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "protected function queueEmailMsg($playbook) {\r\n // $currentTime = time();\r\n $subEmailPlaybook = SubEmailPlaybook::where([\r\n 'playbook_email_id' => $playbook->id,\r\n 'message_level' => $playbook->message_sent_level\r\n ])\r\n // ->where('message_sent_at', '<=', $currentTime)\r\n ->first();\r\n \r\n $messageController = new MessageController();\r\n\r\n if ($subEmailPlaybook && isset($playbook->last_message_sent_at)) {\r\n $smsContact = SmsContact::where(['playbook_id'=> $playbook->id, 'playbook_type' => 'EMAIL'])->first();\r\n \r\n $last_message_sent_at = $playbook->last_message_sent_at;\r\n $format = 'Y-m-d H:i';\r\n // send next message on next schedule days\r\n if ($subEmailPlaybook->sendemailafter) {\r\n $date = date($format, $last_message_sent_at);\r\n $last_message_sent_at = strtotime($date.\"+ $subEmailPlaybook->sendemailafter days\");\r\n }\r\n\r\n // skip message on weekend\r\n if($playbook->sendingon_weekdays_only > 0)\r\n {\r\n $addDays = $messageController->isWeekend($last_message_sent_at);\r\n if($addDays > 0){\r\n $date = date($format, $last_message_sent_at);\r\n $last_message_sent_at = strtotime($date.\"+ $addDays days\");\r\n }\r\n }\r\n\r\n // set message time \r\n if($playbook->adTime)\r\n { \r\n $date = date('Y-m-d', $last_message_sent_at);\r\n $last_message_sent_at = strtotime($date.' '.$playbook->adTime);\r\n }\r\n\r\n // get all contact ids whose created date is less than playbook activated date\r\n // remove these ids from actual contacts ids\r\n // $contact_ids = json_decode($smsContact->contact_ids, true);\r\n // $playbook_activated_at = $playbook->playbook_activated_at;\r\n // $playbook_activated_at = date('Y-m-d H:i:s', $playbook_activated_at);\r\n // $playbookContactDetails = SegmentContactsModel::select('subscriber_invitee_id')\r\n // ->whereIn('subscriber_invitee_id', $contact_ids)\r\n // ->where('created_at', '>=', $playbook_activated_at)\r\n // ->get();\r\n // $new_contact_ids = []; \r\n \r\n // if (count($playbookContactDetails) > 0) {\r\n // // Log::info('segment new contact added '.print_r($playbookContactDetails, true));\r\n // foreach ($playbookContactDetails as $value) {\r\n // // Log::info('value in loop '.$value);\r\n // $new_contact_ids[] = $value->subscriber_invitee_id;\r\n // if (in_array($value->subscriber_invitee_id, $contact_ids)) {\r\n // if (($key = array_search($value->subscriber_invitee_id, $contact_ids)) !== false) {\r\n // unset($contact_ids[$key]);\r\n // }\r\n // $contact_ids = array_values($contact_ids);\r\n // }\r\n // }\r\n // }\r\n\r\n // get all contact details\r\n $contactDetails = $messageController->getContact($contact_ids);\r\n // add message on queue\r\n if ($contactDetails) {\r\n $messageController->addMessageOnQueue($playbook->user_id, $contactDetails, $subEmailPlaybook, $last_message_sent_at);\r\n }\r\n }\r\n \r\n }", "public function send() {\n try {\n \t\tif (empty($this->sender)) {\n \t\t\tthrow new Exception('Failed to send email because no sender has been set.');\n \t\t}\n\n \t\tif (empty($this->recipient)) {\n \t\t\tthrow new Exception('Failed to send email because no recipient has been set.');\n \t\t}\n\n \t\tif ((1 + count($this->cc) + count($this->bcc)) > 20) { // The 1 is for the recipient.\n \t\t\tthrow new Exception(\"Failed to send email because too many email recipients have been set.\");\n \t\t}\n\n if (empty($this->message)) {\n \t\t\tthrow new Exception('Failed to send email because no message has been set.');\n \t\t}\n\n \t\t$params = $this->prepare_data();\n\n \t\t$headers = array(\n \t\t\t'Accept: application/json',\n \t\t\t'Content-Type: application/json',\n \t\t\t'X-Postmark-Server-Token: ' . $this->api_key\n \t\t);\n\n \t\t$curl = curl_init();\n \t\tcurl_setopt($curl, CURLOPT_URL, $this->url);\n \t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n \t\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');\n \t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($params));\n \t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\n \t\t$response = curl_exec($curl);\n\n $error = curl_error($curl);\n\n \t\tif (!empty($error)) {\n \t\t\tthrow new Exception(\"Failed to send email for the following reason: {$error}\");\n \t\t}\n\n \t\t$status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n curl_close($curl);\n\n \t\tif (!$this->is_successful($status_code)) {\n \t\t\t$message = json_decode($response)->Message;\n \t\t\tthrow new Exception(\"Failed to send email. Mail service returned HTTP status code {$status_code} with message: {$message}\");\n \t\t}\n }\n catch (Exception $ex) {\n $this->error = array(\n 'message' => $ex->getMessage(),\n 'code' => $ex->getCode()\n );\n return FALSE;\n }\n $this->error = NULL;\n return TRUE;\n }", "public function sendNotifications()\n {\n foreach ($this->recipients_messages as $recipientID => $recipientInfo) {\n $recipient = $this->recipients_addresses[$recipientID];\n if ($recipient && $recipient['email']) {\n $message = implode(chr(10) . chr(10), $recipientInfo['messages']);\n\n $subject = $this->mail_subject;\n\n $subject .= ' Statechange: ';\n\n if ($recipientInfo['num_undefined'] > 0) {\n $subject .= ' ' . $recipientInfo['num_undefined'] . ' Undefined';\n }\n if ($recipientInfo['num_ok'] > 0) {\n $subject .= ' ' . $recipientInfo['num_ok'] . ' OK';\n }\n if ($recipientInfo['num_error'] > 0) {\n $subject .= ' ' . $recipientInfo['num_error'] . ' Errors';\n }\n if ($recipientInfo['num_warning'] > 0) {\n $subject .= ' ' . $recipientInfo['num_warning'] . ' Warnings';\n }\n if ($recipientInfo['num_ack'] > 0) {\n $subject .= ' ' . $recipientInfo['num_ack'] . ' Acknowledged';\n }\n if ($recipientInfo['num_due'] > 0) {\n $subject .= ' ' . $recipientInfo['num_due'] . ' Due';\n }\n\n $this->sendMail($subject, $recipient['email'], $this->mail_from, $message);\n }\n }\n }", "public function send() { \n // Send the mail.\n if (!isset($this->bcc) || $this->bcc == '') $this->bcc = $this->from;\n $headers = \"From: \" . $this->from . \"\\r\\n\"\n . \"Reply-To: \" . $this->from . \"\\r\\n\"\n . \"Bcc: \" . $this->bcc . \"\\r\\n\"\n . \"X-Mailer: PHP\" . phpversion() . \"\\r\\n\"\n . \"X-Apparently-To: \" . $this->to;\n if (self::$TESTING) $mailedData = mail('[email protected]', $this->subject, $this->message . \"\\r\\n\\r\\n\", $headers);\n else $mailedData = mail($this->to, $this->subject, $this->message . \"\\r\\n\\r\\n\", $headers);\n // Update the object and database sent and dateSent fields.\n $this->dateSent = date(\"Y-m-d H:i:s\");\n // TODO - test for this db update\n $updateQuery = 'UPDATE communications set sent=1, dateSent=NOW() where communicationId=' . $this->commId;\n SSFDB::getDB()->saveData($updateQuery);\n // Mark the referenced works in the works table to show that the artist was informed of media receipt.\n $worksAffected = $this->referencedWorks;\n $worksWhereClause = \"\";\n $disjunctionString = \"\";\n // TODO test for this db update\n foreach ($worksAffected as $work) {\n if (self::mediaReceivedFor($work)) {\n $worksWhereClause .= $disjunctionString . \"workId = \" . $work['workId'];\n $disjunctionString = \" or \";\n }\n }\n $query = \"UPDATE works SET artistInformedOfMediaReceipt=1, artistInformedOfMediaReceiptDate=NOW()\"\n . \" WHERE \" . $worksWhereClause;\n SSFDB::getDB()->saveData($query);\n\n }", "public function send() {\n\t\t/** @var modPHPMailer $mail */\n\t\t$mail = $this->xpdo->getService('mail', 'mail.modPHPMailer');\n\t\t$mail->set(modMail::MAIL_BODY, $this->email_body);\n\t\t$mail->set(modMail::MAIL_FROM, $this->email_from);\n\t\t$mail->set(modMail::MAIL_FROM_NAME, $this->email_from_name);\n\t\t$mail->set(modMail::MAIL_SUBJECT, $this->email_subject);\n\t\t$mail->address('to', $this->email_to);\n\t\t$mail->address('reply-to', $this->reply_to);\n\t\t$mail->setHTML(true);\n\t\tif (!$mail->send()) {\n\t\t\t$this->xpdo->log(xPDO::LOG_LEVEL_ERROR, 'An error occurred while trying to send the email: '.$mail->mailer->ErrorInfo);\n\t\t\t$mail->reset();\n\t\t\treturn $mail->mailer->ErrorInfo;\n\t\t}\n\t\telse {\n\t\t\t$mail->reset();\n\t\t\t$this->remove();\n\t\t\treturn true;\n\t\t}\n\t}", "public function test_queue_mail()\n {\n $user = User::factory()->create();\n $brand = new Brand();\n\n Mail::fake();\n Mail::to($user->email)->send(new ConfirmBrandDelete($brand));\n Mail::assertSent(ConfirmBrandDelete::class);\n }", "public function action_sendnewsletters()\n\t{\n\t\techo 'Send newsletters from queue'.\"\\n\";\n\t\t$mails = Model_Newsletter::getQueuedToSend();\n\t\t$swiftMail = email::connect();\n\t\t$done_item = array();\n\t\t$done_newsletter = array();\n\t\tif (!count($mails))\n\t\t{\n\t\t\techo 'Nothing to send';\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\tforeach ($mails as $mail)\n\t\t{\n\t\t\t$message = new Swift_Message();\n\t\t\t$message->setFrom(Model_Mail::EMAIL_ADMIN);\n\t\t\t$message->setBody($mail->content,'text/html');\n\t\t\t$message->setTo(array($mail->subscriber_email));\n\t\t\t$message->setSubject($mail->title);\n\t\t\t\n\t\t\t$result = $swiftMail->send($message);\n\t\t\tif ($result)\n\t\t\t{\n\t\t\t\tif (!in_array($mail->newsletter_id, $done_newsletter))\n\t\t\t\t{\n\t\t\t\t\tarray_push($done_newsletter, $mail->newsletter_id);\t\n\t\t\t\t}\n\t\t\t\tarray_push($done_item, $mail->newsletter_queue_id);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tModel_Newsletters::moveToArchive($done_item);\n\t\tModel_Newsletters::setSent($done_newsletter);\n\t\techo 'Sended '.count($done).' e-mail'.\"\\n\";\n\t}", "protected function notifyByEmail() {\n\t\t$userlist = array();\n\n\t\t// find all the users with this server listed\n\t\t$users = $this->db->select(\n\t\t\tSM_DB_PREFIX . 'users',\n\t\t\t'FIND_IN_SET(\\''.$this->server['server_id'].'\\', `server_id`) AND `email` != \\'\\'',\n\t\t\tarray('user_id', 'name', 'email')\n\t\t);\n\n\t\tif (empty($users)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// build mail object with some default values\n\t\t$mail = new phpmailer();\n\n\t\t$mail->From\t\t= sm_get_conf('email_from_email');\n\t\t$mail->FromName\t= sm_get_conf('email_from_name');\n\t\t$mail->Subject\t= sm_parse_msg($this->status_new, 'email_subject', $this->server);\n\t\t$mail->Priority\t= 1;\n\n\t\t$body = sm_parse_msg($this->status_new, 'email_body', $this->server);\n\t\t$mail->Body\t\t= $body;\n\t\t$mail->AltBody\t= str_replace('<br/>', \"\\n\", $body);\n\n\t\t// go through empl\n\t foreach ($users as $user) {\n\t \t// we sent a seperate email to every single user.\n\t \t$userlist[] = $user['user_id'];\n\t \t$mail->AddAddress($user['email'], $user['name']);\n\t \t$mail->Send();\n\t \t$mail->ClearAddresses();\n\t }\n\n\t if(sm_get_conf('log_email')) {\n\t \t// save to log\n\t \tsm_add_log($this->server['server_id'], 'email', $body, implode(',', $userlist));\n\t }\n\t}", "public function sendEmail()\n {\n $templateId = 'email_delivery_time'; // template id\n $fromEmail = '[email protected]'; // sender Email id\n $fromName = 'Admin'; // sender Name\n $toEmail = '[email protected]'; // receiver email id\n\n try {\n $storeId = $this->storeManager->getStore()->getId();\n\n $from = ['email' => $fromEmail, 'name' => $fromName];\n// $this->inlineTranslation->suspend();\n try {\n// $transport = $this->transportBuilder\n// ->setTemplateIdentifier($templateId)\n// ->setTemplateVars([])\n// ->setTemplateOptions(\n// [\n// 'area' => Area::AREA_FRONTEND,\n// 'store' => $storeId\n// ]\n// )\n// ->setFromByScope($from)\n// ->addTo($toEmail)\n// ->getTransport();\n//\n// $transport->sendMessage();\n $templateVars = [];\n $transport = $this->transportBuilder->setTemplateIdentifier('59')\n ->setTemplateOptions( [ 'area' => \\Magento\\Framework\\App\\Area::AREA_FRONTEND, $storeId => 1 ] )\n ->setTemplateVars( $templateVars )\n ->setFrom( [ \"name\" => \"Magento ABC CHECK PAYMENT\", \"email\" => \"[email protected]\" ] )\n ->addTo('[email protected]')\n ->setReplyTo('[email protected]')\n ->getTransport();\n $transport->sendMessage();\n } finally {\n $this->inlineTranslation->resume();\n }\n } catch (\\Exception $e) {\n $this->_logger->info($e->getMessage());\n }\n }", "public function flushNotificationQueue() {\r\n\t\t// Logfile entries\r\n\t\tforeach ($this->notificationQueue as $key => $message) {\r\n\t\t\t// Log the message\r\n\t\t\t$this->log($message);\r\n\t\t}\r\n\t\t$sendNotifications = Configure::read('Alert.send');\r\n\t\tif (!$sendNotifications) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// Email notifications\r\n\t\tforeach ($this->notificationQueue as $key => $message) {\r\n\r\n\t\t\t$this->sendAlertEmail($message);\r\n\r\n\r\n\t\t\t// Limit the amount of messages we're going to send out in a period of time...\r\n\t\t\t// 1/4 of a second is enough here.\r\n\t\t\tusleep(250000);\r\n\t\t}\r\n\r\n\t\t// Pushover Notifications\r\n\t\tforeach ($this->notificationQueue as $key => $message) {\r\n\t\t\t// Send out notifications through Pushover\r\n\r\n\t\t\t$this->sendPushoverAlert($message);\r\n\r\n\t\t\t// Limit the amount of messages we're going to send out in a period of time...\r\n\t\t\t// We don't want to get ourselves banned from Pushover...\r\n\t\t\t// 1/4 of a second should suffice\r\n\t\t\tusleep(250000);\r\n\t\t}\r\n\r\n\r\n\t}", "public function scheduledemails(){\n foreach ($this->framework->getProjectsWithModuleEnabled() as $projectId){\n $_GET['pid'] = $projectId; // might change in future to $this->setProjectId($projectId);\n if($projectId != \"\") {\n $this->deleteOldLogs($projectId);\n if(!$this->isProjectStatusCompleted($projectId)) {\n $this->log(\"scheduledemails PID: \" . $projectId . \" - start\", ['scheduledemails' => 1]);\n $email_queue = $this->getProjectSetting('email-queue', $projectId);\n if ($email_queue != '') {\n $email_sent_total = 0;\n foreach ($email_queue as $index => $queue) {\n if (\n $queue['record'] != '' &&\n $email_sent_total < 100 &&\n !$this->hasQueueExpired($queue, $index, $projectId) &&\n $queue['deactivated'] != 1\n ) {\n if ($this->getProjectSetting(\n 'email-deactivate',\n $projectId\n )[$queue['alert']] != \"1\" &&\n $this->sendToday($queue, $projectId)\n ) {\n $this->log(\n \"scheduledemails PID: \" .\n $projectId .\n \" - Has queued emails to send today \" .\n date(\"Y-m-d H:i:s\"),\n ['scheduledemails' => 1]\n );\n #SEND EMAIL\n $email_sent = $this->sendQueuedEmail(\n $index,\n $projectId,\n $queue['record'],\n $queue['alert'],\n $queue['instrument'],\n $queue['instance'],\n $queue['isRepeatInstrument'],\n $queue['event_id']\n );\n #If email sent save date and number of times sent and delete queue if needed\n if ($email_sent || $email_sent == \"1\") {\n $email_sent_total++;\n }\n #Check if we need to delete the queue\n $this->stopRepeat($queue, $index, $projectId);\n }\n } else if ($email_sent_total >= 100) {\n $this->log(\n \"scheduledemails PID: \" .\n $projectId .\n \" - Batch ended at \" .\n date(\"Y-m-d H:i:s\"),\n ['scheduledemails' => 1]\n );\n break;\n }\n }\n }\n }\n }\n }\n }", "protected function _send() {\n\t\t$return = false;\n\t\t$to = !$this->_bcc_batch_running ? implode(', ', $this->_sanitize_emails($this->recipients)) : '';\n\t\t$subject = $this->_prep_q_encoding($this->subject);\n\t\t$message = $this->_message;\n\t\t$headers = $this->_headers;\n\t\t$sender = $this->_clean_email($this->sender);\n\t\tif ($this->safe_mode == TRUE && mail($to, $subject, $message, $headers)) {\n\t\t\t$return = true;\n\t\t} else if (mail($to, $subject, $message, $headers, \"-f \" . $sender)) {\n\t\t\t// most documentation of sendmail using the \"-f\" flag lacks a space after it, however\n\t\t\t// we've encountered servers that seem to require it to be in place.\n\t\t\t$return = true;\n\t\t}\n\t\treturn $return;\n\t}", "public function sendMessage()\n {\n try {\n $this->_logger->debug('[SendGrid] Sending email.');\n\n $apikey = $this->_generalSettings->getAPIKey();\n\n if (! $this->_moduleManager->isOutputEnabled('SendGrid_EmailDeliverySimplified')) {\n $this->_logger->debug('[SendGrid] Module is not enabled. Email is sent via vendor Zend Mail.');\n parent::send($this->_message);\n\n return;\n }\n\n // Compose JSON payload of email send request\n $payload = $this->_getAPIMessage();\n\n // Mail send URL\n $url = Tools::SG_API_URL . 'v3/mail/send';\n\n // Request headers\n $headers = [ 'Authorization' => 'Bearer ' . $apikey ];\n\n // Send request\n $client = new \\Zend_Http_Client($url, [ 'strict' => true ]);\n\n $response = $client->setHeaders($headers)\n ->setRawData(json_encode($payload), 'application/json')\n ->request('POST');\n\n // Process response\n if (202 != $response->getStatus()) {\n $response = $response->getBody();\n throw new \\Exception($response);\n }\n } catch (\\Exception $e) {\n $this->_logger->debug('[SendGrid] Error sending email : ' . $e->getMessage());\n throw new MailException(new Phrase($e->getMessage()), $e);\n }\n }", "protected function sendMail()\n {\n $user = User::find()\n ->where(['id' => $this->user->id])\n ->one();\n\n $notificationManager = new MailService($user);\n $notificationManager->register();\n }", "public function send() {\n\n\t\t$this->prepareMessage();\n\n\t\t$this->getMailMessage()->send();\n\t\t$isSent = $this->getMailMessage()->isSent();\n\n\t\tif ($isSent) {\n\t\t\t$message = $this->toArray();\n\t\t\t$this->sentMessageRepository->add($message);\n\n\t\t\t// Store body of the message for possible later use.\n\t\t\tMessageStorage::getInstance()->set($this->messageTemplate->getUid(), $message['body']);\n\t\t} else {\n\t\t\t$message = 'No Email sent, something went wrong. Check Swift Mail configuration';\n\t\t\tLoggerService::getLogger($this)->error($message);\n\t\t\tthrow new WrongPluginConfigurationException($message, 1350124220);\n\t\t}\n\n\t\treturn $isSent;\n\t}", "public function sendTheEmailNow()\r\n {\r\n echo \"Email sent.\";\r\n }", "public function execute()\n {\n\n $undeliveredRecipients = array();\n $recipientsCount = 0;\n\n while (count($this->recipients) >= 1) {\n\n //send the command and read the response\n parent::execute();\n\n $recipient = array_pop($this->recipients);\n\n switch ($this->response->getCode()) {\n\n case '250':\n case '251':\n if (isset($recipient['original_email'])) {\n //we finally delivered mail to a user that provided a \n //forward-address\n $key = array_search($recipient['original_email'],\n $undeliveredRecipients);\n\n if ($key !== FALSE)\n unset($undeliveredRecipients[$key]);\n }\n\n $recipientsCount++;\n break;\n\n case '450':\n case '451':\n //add the recipient to the begginning of the queue to try again\n //later\n if ($recipient['retries'] > 0) {\n $recipient['retries']--;\n array_unshift($this->recipients, $recipient);\n }\n break;\n\n /* Handle too much recipients by splitting the message to chunks\n *\n * RFC 821 [30] incorrectly listed the error where an SMTP server\n * exhausts its implementation limit on the number of RCPT commands\n * (\"too many recipients\") as having reply code 552. The correct \n * reply code for this condition is 452. Clients SHOULD treat a \n * 552 code in this case as a temporary, rather than permanent, \n * failure so the logic below works. \n */\n case '452':\n case '552':\n array_push($this->recipients, $recipient);\n\n $result['undelivered'] = $undeliveredRecipients;\n //this causes the client to append a new mail sending sequence \n //for the rest of recipients\n $result['toDeliver'] = $this->recipients;\n $result['recipientsCount'] = $recipientsCount;\n\n return $result;\n break; //unreachable\n\n case '550':\n case '553':\n $undeliveredRecipients[] = $recipient['email'];\n break;\n\n case '551':\n if (preg_match('/<\\([^>]*\\)>/', $this->response, $matches)) {\n\n $forward = array();\n $forward['email'] = $matches[1];\n $forward['retries'] = 2;\n if (isset($recipient['original_email'])) {\n $forward['original_email'] = \n $recipient['original_email'];\n } else {\n $forward['original_email'] = $recipient['email'];\n $undeliveredRecipients[] = $recipient['email'];\n }\n\n $this->recipients[] = $forward;\n }\n break;\n }\n\n }\n\n return array(\n 'undelivered' => $undeliveredRecipients, \n 'recipientsCount' => $recipientsCount,\n );\n }", "protected function _queueEmail($email, $storeId) {\n $newMail = clone $this;\n if (is_array($email)) {\n $newMail->reallyAddTo($email['email'], $email['name']);\n $emailDescription = $email['email'];\n } else {\n $newMail->reallyAddTo($email);\n $emailDescription = $email;\n }\n $task = Mage::getModel(\"contactlab_commons/task\")\n ->setStoreId($storeId)\n ->setTaskCode(\"Transactional email to $emailDescription\")\n ->setModelName('contactlab_transactional/task_sendEmailRunner')\n ->setDescription(\"Send transactional email to $emailDescription\")\n ->setTaskData(serialize($newMail))\n ->save();\n if (Mage::getStoreConfigFlag('contactlab_transactional/global/runtask')) {\n $task->runTask()->save();\n }\n }", "public function sendToday($queue,$projectId)\n {\n $cron_send_email_on_field = htmlspecialchars_decode(\n $this->getProjectSetting('cron-send-email-on-field',$projectId)[$queue['alert']]\n );\n $cron_repeat_for = $this->getProjectSetting('cron-repeat-for',$projectId)[$queue['alert']];\n\n $repeat_days = $cron_repeat_for;\n if($queue['times_sent'] != 0){\n $repeat_days = $cron_repeat_for * $queue['times_sent'];\n }\n\n $today = date('Y-m-d');\n $extra_days = ' + ' . $repeat_days . \" days\";\n $repeat_date = date('Y-m-d', strtotime($cron_send_email_on_field . $extra_days));\n $repeat_date_now = date('Y-m-d', strtotime($queue['last_sent'] . '+'.$cron_repeat_for.' days'));\n\n $evaluateLogic_on = \\REDCap::evaluateLogic(\n $cron_send_email_on_field,\n $projectId,\n $queue['record'],\n $queue['event_id']\n );\n if($queue['isRepeatInstrument']){\n $evaluateLogic_on = \\REDCap::evaluateLogic(\n $cron_send_email_on_field,\n $projectId,\n $queue['record'],\n $queue['event_id'],\n $queue['instance'],\n $queue['instrument']\n );\n }\n\n\t\tif(\n\t\t $this->getProjectSetting('email-deactivate', $projectId)[$queue['alert']] != \"1\" &&\n (\n strtotime($queue['last_sent']) != strtotime($today) ||\n $queue['last_sent'] == \"\"\n )\n ){\n if (($queue['option'] == 'date' && ($cron_send_email_on_field == $today || $repeat_date == $today || ($queue['last_sent'] == \"\" && strtotime($cron_send_email_on_field) <= strtotime($today)))) || ($queue['option'] == 'calc' && $evaluateLogic_on && ($repeat_date_now == $today || $queue['last_sent'] == '')) || ($queue['option'] == 'now' && ($repeat_date_now == $today || $queue['last_sent'] == ''))) {\n return true;\n }\n }\n return false;\n }", "private function _sendNewStatusUpdateEmailToUser()\n {\n // Get a reference to the Joomla! mailer object\n $mailer = \\JFactory::getMailer();\n\t\t\t\n\t\t\t$config = \\JFactory::getConfig();\n\t\t\t$sender = array( \n\t\t\t $config->get( 'mailfrom' ),\n\t\t\t $config->get( 'fromname' ) \n\t\t\t);\n \n\t\t\t$mailer->setSender($sender);\n\n\t\t\t$user = \\JFactory::getUser();\n\t\t\t$mailer->addRecipient($user->email);\n \n // Set the subject\n $subject = \\JFactory::getConfig()->get('sitename') . \": New Status Update...\";\n\t\t\t$mailer->setSubject($subject);\n\t\t\t$projectId = $this->recordData['hshrndreview_fk_project_id'];\n\t\t\t\n\t\t\t$db = \\JFactory::getDbo();\n\t\t\t//this is just to know whether we are in the user is in the reviewer group or not\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select($db->quoteName(array('name', 'owner')));\n\t\t\t$query->from($db->quoteName('#__hshrndreview_projects'));\n\t\t\t$query->where($db->quoteName('hshrndreview_project_id').\" = \". $projectId);\n\t\t\t$db->setQuery($query);\n\t\t\t$project = $db->loadRow();\n\t\t\t\n\t\t\t$body = \"Thank you for submitting a new status update for project named: \\\"\" . $project['0'] . \"\\\". It has been added to the HSH project database!\\n\\n Have a nice day - your friendly HSH RnD Review automailer...\";\n\t\t\t$mailer->setBody($body);\n // Send the email\n\t\t\t$send = $mailer->Send();\n\t\t\tif ( $send !== true ) {\n\t\t\t echo 'Error sending email: ' . $send->__toString();\n\t\t\t} else {\n\t\t\t echo 'Mail sent';\n\t\t\t}\n }", "protected function smtpSend(): void\n {\n $account = $this->account;\n\n $this->openSocket($account);\n defer($context, 'fclose', $this->socket);\n\n $this->connect($account);\n\n $this->authenticate($account);\n\n $this->sendCommand('MAIL FROM: <' . $this->from[0] . '>', '250');\n $recipients = array_merge($this->to, $this->cc, $this->bcc);\n foreach ($recipients as $recipient) {\n $this->sendCommand('RCPT TO: <' . $recipient[0] . '>', '250|251');\n }\n\n $this->sendCommand('DATA', '354');\n\n $this->sendCommand($this->message . self::CRLF . self::CRLF . self::CRLF . '.', '250');\n\n $this->sendCommand('QUIT', '221');\n }", "public function sendEmail()\n {\n $this->messageBody();\n\n //set from emails\n $this->setFrom();\n\n //set reply to\n $this->addReplyTo();\n\n try {\n $this->mailer->Send();\n return true;\n } catch (Exception $e) {\n throw new Exception( $e->getMessage() );\n }\n }", "public function send() {\n\t\t\t$emailer = SimpleMail::make()\n\t\t\t->setSubject($this->subject)\n\t\t\t->setMessage($this->body);\n\t\t\t\n\t\t\tforeach ($this->emailto as $contact) {\n\t\t\t\t$emailer->setTo($contact->email, $contact->name);\n\t\t\t}\n\t\t\t\n\t\t\t$emailer->setFrom($this->emailfrom->email, $this->emailfrom->name);\n\t\t\t$emailer->setReplyTo($this->replyto->email, $this->replyto->name);\n\t\t\t\n\t\t\tif ($this->selfbcc) {\n\t\t\t\t$this->add_bcc($this->replyto);\n\t\t\t}\n\t\t\t\n\t\t\t// setBcc allows setting from Array\n\t\t\tif (!empty($this->bcc)) {\n\t\t\t\t$bcc = array();\n\t\t\t\tforeach ($this->bcc as $contact) {\n\t\t\t\t\t$bcc[$contact->name] = $contact->email;\n\t\t\t\t}\n\t\t\t\t$emailer->setBcc($bcc);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($this->cc)) {\n\t\t\t\t$cc = array();\n\t\t\t\tforeach ($this->cc as $contact) {\n\t\t\t\t\t$cc[$contact->name] = $contact->email;\n\t\t\t\t}\n\t\t\t\t$emailer->setCc($cc);\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->hasfile) {\n\t\t\t\tforeach($this->files as $file) {\n\t\t\t\t\t$emailer->addAttachment($file);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $emailer->send();\n\t\t}", "public function process()\r\n {\r\n $success = true;\r\n\r\n $items = Queue::find()\r\n ->where(['and', ['sent_time' => null], ['<', 'attempts', $this->maxAttempts]])\r\n ->orderBy(['created_at' => SORT_ASC])\r\n ->limit($this->mailsPerRound)\r\n ->all();\r\n\r\n if (!empty($items)) {\r\n $attributes = ['attempts', 'last_attempt_time'];\r\n foreach ($items as $item) {\r\n try{\r\n /** @var \\app\\models\\Queue $item */\r\n if ($message = $item->toMessage()) {\r\n if ($this->sendMessage($message)) {\r\n $item->delete();\r\n } else {\r\n throw new Exception('An error occurred while sending the message');\r\n }\r\n }\r\n } catch (Exception $e) {\r\n $success = false;\r\n $item->attempts++;\r\n $item->last_attempt_time = new Expression('NOW()');\r\n $item->updateAttributes($attributes);\r\n }\r\n }\r\n }\r\n\r\n return $success;\r\n }", "private function notifyAdmin(): void\n {\n if (!$this->cfg->getAdminEmails())\n return;\n\n $ex = new \\Exception;\n $trace = $ex->getTraceAsString();\n\n // format msg\n $msg = \"Trying to send email with subject: \\\"$this->Subject\\\" \"\n . \"triggered a failover.\\r\\n\\r\\n\"\n . \"Server(s) that failed:\\r\\n\";\n foreach ($this->failedServers as $k => $v)\n $msg .= \"- Server $k $v \\r\\n\";\n $msg .= \"\\r\\nTrace:\\r\\n$trace\\r\\n\\r\\n\"\n . \"Successful failover server:\\r\\n$this->Host\\r\\n\\r\\n\"\n . \"--\\r\\n\"\n . 'Sent from ' . __FILE__ . ' using ' . $this->Host;\n\n $this->FromName = $this->cfg->getNotificationFromEmail();\n $this->From = $this->cfg->getNotificationFromEmail();\n $this->clearAllRecipients();\n\n $adminEmails = $this->cfg->getAdminEmails();\n foreach ($adminEmails as $adminEmail)\n $this->addAddress($adminEmail);\n $this->Subject = $this->cfg->getAppName() . ': SMTP server(s) failed';\n\n $this->Body = $msg;\n\n // send using the last set SMTP server\n $this->send();\n }", "public function sendNotifyEmail()\n {\n\t\t$emailSettings = craft()->email->getSettings();\n\n //create the template params\n $templateParams = $this->data;\n $templateParams['toEmail'] = $this->template->notifyEmailToAddress;\n\n //instantiate email model\n $email = new EmailModel();\n\n //populate with all the things\n $email->fromEmail = $this->template->notifyEmailToAddress;\n\t\t$email->toEmail = $this->template->notifyEmailToAddress;\n\t\t$email->subject = $this->template->notifyEmailSubject;\n\t\t$email->htmlBody = $this->template->notifyEmailBody;\n\n //send that goodness\n\t\treturn craft()->email->sendEmail($email, $templateParams);\n }", "public function send(): bool\n {\n $this->lastError = '';\n\n try {\n if (!$this->mailObj->send()) {\n $this->lastError = $this->mailObj->ErrorInfo;\n }\n } catch (\\Throwable $err) {\n $this->lastError = $err->getCode() . ': ' . $err->getMessage();\n }\n\n return empty($this->lastError);\n }", "protected function sendTestMail() {}", "abstract protected function _sendMail ( );", "public function sendEmail()\n {\n /* @var $user User */\n $user = User::findOne([\n 'status' => User::STATUS_ACTIVE,\n 'email' => $this->email,\n ]);\n\n if ($user) {\n if (!User::isPasswordResetTokenValid($user->password_reset_token)) {\n $user->generatePasswordResetToken();\n }\n\n if ($user->save()) {\n\t\t\t\t$mail = new UserMails;\n\t\t\t\treturn $mail->passwordEmail($user);\n }\n }\n\n return false;\n }", "public function sendResetEmail()\n {\n $resetToken=$this->extractTokenFromCache('reset')['reset_token'];\n\n $url = url('/'.$this->id.'/resetPassword',$resetToken);\n Mail::to($this)->queue(new ResetPasswordEmail($url));\n }", "private function send(){\n\t\t\n\t\tif(empty($this->email)){\n\t\t\t// Missing Email\n\t\t\t$this->error = true;\n\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\t\t\t\n\t\t\t// Log Error\n\t\t\t$errorLog = new LogError();\n\t\t\t$errorLog->errorNumber = 87;\n\t\t\t$errorLog->errorMsg = 'Missing email';\n\t\t\t$errorLog->badData = '';\n\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t$errorLog->write();\n\t\t}\n\t\t\n\t\tif(empty($this->subject)){\n\t\t\t// Missing Email\n\t\t\t$this->error = true;\n\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\t\t\t\n\t\t\t// Log Error\n\t\t\t$errorLog = new LogError();\n\t\t\t$errorLog->errorNumber = 88;\n\t\t\t$errorLog->errorMsg = 'Missing subject';\n\t\t\t$errorLog->badData = '';\n\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t$errorLog->write();\n\t\t}\n\t\t\n\t\tif(empty($this->plainText)){\n\t\t\t// Missing Email\n\t\t\t$this->error = true;\n\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\t\t\t\n\t\t\t// Log Error\n\t\t\t$errorLog = new LogError();\n\t\t\t$errorLog->errorNumber = 89;\n\t\t\t$errorLog->errorMsg = 'Missing plain text of email';\n\t\t\t$errorLog->badData = '';\n\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t$errorLog->write();\n\t\t}\n\t\t\n\t\tif(empty($this->htmlBody)){\n\t\t\t// Missing Email\n\t\t\t$this->error = true;\n\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\t\t\t\n\t\t\t// Log Error\n\t\t\t$errorLog = new LogError();\n\t\t\t$errorLog->errorNumber =90;\n\t\t\t$errorLog->errorMsg = 'Missing HTML of body';\n\t\t\t$errorLog->badData = '';\n\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t$errorLog->write();\n\t\t}\n\t\t\n\t\t// Validate Email\n\t\t$this->validateEmail($this->email);\n\t\t\n\t\tif(!$this->error){\n\t\t\t// Required Files\n\t\t\tinclude 'Mail.php';\n\t\t\tinclude 'Mail/mime.php';\n\n\t\t\t/* ---\n\t\t\tPEAR Mail Factory\n\t\t\thttp://pear.php.net/manual/en/package.mail.mail.factory.php\n\t\t\t--- */\n\t\t\t$host = \"smtp-relay.gmail.com\";\n\t\t\t$port = 587;\n\t\t\t$smtp = Mail::factory('smtp', array('host'=>$host, 'port'=>$port));\n\n\t\t\t/* ---\n\t\t\tPEAR MIME\n\t\t\thttp://pear.php.net/manual/en/package.mail.mail-mime.mail-mime.php\n\t\t\t--- */\n\t\t\t$crlf = \"\\n\";\n\t\t\t$mime = new Mail_mime(array('eol' => $crlf));\n\n\t\t\t// Headers\n\t\t\t$from = 'Catalog.beer <[email protected]>';\n\t\t\t$replyto = '[email protected]';\n\t\t\t$headers = array('From'=>$from, 'To'=>$this->email, 'Subject'=>$this->subject, 'Reply-To'=>$replyto);\n\n\t\t\t// Plain Text\n\t\t\t$mime->setTXTBody($this->plainText);\n\n\t\t\t// HTML\n\t\t\t$mime->setHTMLBody($this->htmlBody);\n\n\t\t\t$body = $mime->get();\n\t\t\t$headers = $mime->headers($headers);\n\n\t\t\t$smtp = Mail::factory('smtp',\n\t\t\t\tarray ('host' => 'smtp-relay.gmail.com',\n\t\t\t\t\t\t\t 'port' => 587,\n\t\t\t\t\t\t\t 'auth' => true,\n\t\t\t\t\t\t\t 'username' => '',\n\t\t\t\t\t\t\t 'password' => '',\n\t\t\t\t\t\t\t 'debug' => false));\n\n\t\t\t/* ---\n\t\t\tPEAR Send Mail\n\t\t\thttp://pear.php.net/manual/en/package.mail.mail.send.php\n\t\t\t--- */\n\t\t\t$mail = $smtp->send($this->email, $headers, $body);\n\n\t\t\t// Process Errors\n\t\t\tif(PEAR::isError($mail)){\n\t\t\t\t// Error Sending Email\n\t\t\t\t$this->error = true;\n\t\t\t\t$this->errorMsg = 'Whoops, looks like a bug on our end. We\\'ve logged the issue and our support team will look into it.';\n\n\t\t\t\t// Log Error\n\t\t\t\t$errorLog = new LogError();\n\t\t\t\t$errorLog->errorNumber = 91;\n\t\t\t\t$errorLog->errorMsg = 'Error sending email';\n\t\t\t\t$errorLog->badData = $mail->getMessage();\n\t\t\t\t$errorLog->filename = 'API / SendEmail.class.php';\n\t\t\t\t$errorLog->write();\n\t\t\t}\n\t\t}\n\t}", "public function updateSubmissionStatus() {\n\n $updateStatus = Usersubmissionstatus::where('user_id', Auth::user()->id)\n ->where('quarter_id', Quarter::getRunningQuarter()->id)\n ->update(['status_id' => config('constant.status.L1_APPROVAL_PENDING')]);\n // Let's notify user and L1 about user submission status.\n return $this->sendMail(config('constant.email_status.INFORM_APPRAISEE'));\n }", "public function sendResetPasswordEmail()\n {\n $passwordReset = $this->generateResetPasswordToken();\n\n SendEmailJob::dispatch($this, 'forgot-password', 'Reset Your Password', ['props' => $passwordReset])->onQueue('account-notifications');\n }", "private function sendDailyAdminEmail()\n {\n // Message\n $message = (new AdministratorDaily())->onQueue('platform-processing');\n // User Setting\n $settingProvider = (new PlatformSettingProvider());\n Mail::to($settingProvider->setting('admin_notification_email'),$settingProvider->setting('admin_notification_name'))\n ->send($message);\n Log::info(\"Sent Admin Email\");\n }", "protected function _sendEmail($info)\n {\n EmailQueue::enqueue($info['to'], $info['viewVars'], $info);\n }", "public static function _send_deferred_notifications() {\n\t\t$email_notifications = self::get_email_notifications( true );\n\t\tforeach ( self::$deferred_notifications as $email ) {\n\t\t\tif (\n\t\t\t\t! is_string( $email[0] )\n\t\t\t\t|| ! isset( $email_notifications[ $email[0] ] )\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$email_class = $email_notifications[ $email[0] ];\n\t\t\t$email_notification_key = $email[0];\n\t\t\t$email_args = is_array( $email[1] ) ? $email[1] : array();\n\n\t\t\tself::send_email( $email[0], new $email_class( $email_args, self::get_email_settings( $email_notification_key ) ) );\n\t\t}\n\t}", "public function send() {\n\t\t//$isActive = EmailHelper::isActive('string parameter');\n\n\t\t// this is the refactored external static method\n\t\t$isActive = forward_static_call_array(\n\t\t\tarray($this->emailHelperClass, 'isActive'),\n\t\t\tarray('string parameter'));\n\n\t\tif($isActive) {\n\t\t\t// send logic here\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function sendMail($when = \"now\") {\n \t$when = strtotime($when);\n \tif($when <= time()){\n \t\t$this->sendMailNow();\n \t}else{\n \t\t$this->queueMail($when);\n \t}\n }", "public function UpdateEmail()\n\t\t{\n\t\t\tif (!$this->HasPermission()) {\n\t\t\t\t$this->NoPermission();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$from = trim($_POST['fromemail']);\n\t\t\t$to = trim($_POST['toemail']);\n\n\t\t\t$update = array (\n\t\t\t\t'orders' => array (\n\t\t\t\t\t'ordbillemail',\n\t\t\t\t\t'ordshipemail',\n\t\t\t\t),\n\t\t\t\t'customers' => array (\n\t\t\t\t\t'custconemail',\n\t\t\t\t),\n\t\t\t\t'subscribers' => array (\n\t\t\t\t\t'subemail',\n\t\t\t\t),\n\t\t\t);\n\t\t\t$recordsUpdated = 0;\n\n\t\t\tforeach ($update as $table => $fields) {\n\t\t\t\tforeach ($fields as $field) {\n\t\t\t\t\t$updateData = array (\n\t\t\t\t\t\t$field => $to\n\t\t\t\t\t);\n\t\t\t\t\t$restriction = $field .\"='\".$GLOBALS['ISC_CLASS_DB']->Quote($from).\"'\";\n\t\t\t\t\t$GLOBALS['ISC_CLASS_DB']->UpdateQuery($table, $updateData, $restriction);\n\t\t\t\t\t$recordsUpdated += $GLOBALS['ISC_CLASS_DB']->NumAffected();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($recordsUpdated > 1) {\n\t\t\t\t$message = sprintf(GetLang('EmailCheckNumUpdatedPlural'), $recordsUpdated);\n\t\t\t\t$status = MSG_SUCCESS;\n\t\t\t} elseif ($recordsUpdated == 1) {\n\t\t\t\t$message = sprintf(GetLang('EmailCheckNumUpdatedSingular'), $recordsUpdated);\n\t\t\t\t$status = MSG_SUCCESS;\n\t\t\t} else {\n\t\t\t\t$message = GetLang('EmailCheckNoneUpdated');\n\t\t\t\t$status = MSG_ERROR;\n\t\t\t}\n\n\t\t\tFlashMessage($message, $status, 'index.php?ToDo=runAddon&addon=addon_emailchange');\n\t\t}", "protected function execute($arguments = array(), $options = array())\r\n {\r\n $databaseManager = new sfDatabaseManager($this->configuration);\r\n $connection = $databaseManager->getDatabase($options['connection'])->getConnection();\r\n\r\n $this->log('mailer on...');\r\n while(true)\r\n {\r\n $this->log('----------------------------------------------------------');\r\n\r\n if($mb_mail_list = MbMailPeer::getPendientes())\r\n {\r\n foreach($mb_mail_list as $mb_mail)\r\n {\r\n MbWorker::setActive($mb_mail->getId());\r\n\r\n $mb_mail->reload();\r\n\r\n if(!$mb_mail->getToken())\r\n {\r\n //$token = uniqid(null, true);\r\n $mb_mail->setToken(sha1(rand(111111,999999) . $mb_mail->getSubject()));\r\n $mb_mail->save();\r\n }\r\n\r\n $this->log('Procesando email: ' . $mb_mail->getSubject() . ' (batch size: ' . $mb_mail->getBatchSize() . ')');\r\n\r\n if($next_recipients = $mb_mail->getNextRecipients())\r\n {\r\n foreach($next_recipients as $i => $mb_mailto)\r\n {\r\n if($i%2 == 0)\r\n $mb_mail->reload();\r\n\r\n MbWorker::setActiveRecipient($mb_mailto->getId());\r\n\r\n if($mb_mail->getState() == 'stop')\r\n {\r\n $this->log('-- !!Correo detenido desde aplicacion');\r\n break;\r\n }\r\n\r\n $this->log('- Enviando a: ' . $mb_mailto->getMailto());\r\n\r\n if(!$mb_mail->send($mb_mailto))\r\n {\r\n $this->log('-- Correo con errores');\r\n break;\r\n }\r\n\r\n sleep(1);\r\n }\r\n MbWorker::setActiveRecipient(0);\r\n }\r\n\r\n if($mb_mail->getState() != 'stop' && !$mb_mail->hasMoreRecipients())\r\n {\r\n $this->log('-- Termino de envio de ' . $mb_mail->getSubject());\r\n\r\n $mb_mail->setState('ok');\r\n $mb_mail->save();\r\n $mb_mail->notifyIfNecessary();\r\n }\r\n MbWorker::setActive(0);\r\n }\r\n\r\n }\r\n else\r\n {\r\n $this->log('No hay mails para enviar');\r\n break;\r\n }\r\n }\r\n $this->log('mailer off...');\r\n }", "public function sendEmail() {\n\n Mage::app()->setCurrentStore($this->getStoreId());\n\n try {\n\n $data = $this->getJsonPayload();\n\n $email = (string)$this->_getQueryParameter('email');\n\n $validEmail = filter_var($email, FILTER_VALIDATE_EMAIL);\n if ($validEmail === false) {\n Mage::throwException(Mage::helper('bakerloo_restful')->__('The provided email is not a valid email address.'));\n }\n\n $emailType = (string)Mage::helper('bakerloo_restful')->config('pos_coupon/coupons', $this->getStoreId());\n\n $emailSent = false;\n\n if(isset($data->attachments) and is_array($data->attachments) and !empty($data->attachments)) {\n\n $couponData = current($data->attachments);\n\n $coupon = Mage::helper('bakerloo_restful/email')->sendCoupon($email, $couponData, $this->getStoreId());\n\n $emailSent = (bool)$coupon->getEmailSent();\n\n }\n\n $result['email_sent'] = $emailSent;\n\n } catch (Exception $e) {\n Mage::logException($e);\n\n $result['error_message'] = $e->getMessage();\n $result['email_sent'] = false;\n }\n\n return $result;\n\n }", "function process_mail(){\n\t\t$result = true;\n\t\t\n\t\tif(count($this->to) < 1){\n\t\t\treturn 'No email address.';\n\t\t}\n\t\t$this->set_eol();\n\t\t$this->get_message_type();\n\t\t$this->set_boundary();\n\t\t$headers = $this->set_headers();\n\t\t$body = $this->set_body();\n\t\t\n\t\tif($body == ''){\n\t\t\treturn 'Empty email body.';\n\t\t}\n\t\t$result = $this->send_mail($headers, $body);\n\t\treturn $result;\n\t}", "public static function send()\n {\n if(!is_object(self::$transport)){\n self::newTransport();\n }\n\n if(self::$failed == null) {\n self::$mailer = \\Swift_Mailer::newInstance(self::$transport);\n }\n\n try {\n self::$mailer->send(self::$message);\n }\n catch (\\Swift_TransportException $e){\n self::$failed = $e->getMessage();\n }\n }", "protected function sendEmail()\n {\n // Don't send to themself\n if ($this->userFrom->id == $this->userTo->id)\n {\n return false;\n }\n \n // Ensure they hae enabled emails\n if (! $this->userTo->options->enableEmails)\n {\n return false;\n }\n \n // Ensure they are not online\n if ($this->userTo->isOnline())\n {\n return false;\n }\n \n // Send email\n switch ($this->type)\n {\n case LOG_LIKED:\n if ($this->userTo->options->sendLikes)\n {\n $emailer = new Email('Liked');\n $emailer->user = $this->userTo;\n $emailer->sendImage($this->image->id, $this->userFrom);\n }\n break;\n \n case LOG_ACCEPTED:\n if ($this->userTo->options->sendProcessing)\n {\n $emailer = new Email('Image Accepted');\n $emailer->user = $this->userTo;\n $emailer->sendImage($this->image->id);\n }\n break;\n \n case LOG_REJECTED:\n if ($this->userTo->options->sendProcessing)\n {\n $emailer = new Email('Image Rejected');\n $emailer->user = $this->userTo;\n $emailer->sendImage($this->image->id);\n }\n break;\n }\n }", "public function sendWelcomeEmail()\n {\n SendEmailJob::dispatch($this, 'confirm-email', 'Confirm Your Email', [])->onQueue('account-notifications');\n }", "protected function _send()\n\t{\n\t\t$params = array(\n\t\t\t'Action' => 'SendEmail',\n\t\t\t'Version' => '2010-12-01',\n\t\t\t'Source' => static::format_addresses(array($this->config['from'])),\n\t\t\t'Message.Subject.Data' => $this->subject,\n\t\t\t'Message.Body.Text.Data' => $this->body,\n\t\t\t'Message.Body.Text.Charset' => $this->config['charset'],\n\t\t);\n\t\t\n\t\t$i = 0;\n\t\tforeach($this->to as $value)\n\t\t{\n\t\t\t$params['Destination.ToAddresses.member.'.($i+1)] = static::format_addresses(array($value));\n\t\t\t++$i;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($this->cc as $value)\n\t\t{\n\t\t\t$params['Destination.CcAddresses.member.'.($i+1)] = static::format_addresses(array($value));\n\t\t\t++$i;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($this->bcc as $value)\n\t\t{\n\t\t\t$params['Destination.BccAddresses.member.'.($i+1)] = static::format_addresses(array($value));\n\t\t\t++$i;\n\t\t}\n\t\t\n\t\t$i = 0;\n\t\tforeach($this->reply_to as $value)\n\t\t{\n\t\t\t$params['ReplyToAddresses.member.'.($i+1)] = static::format_addresses(array($value));\n\t\t\t++$i;\n\t\t}\t\n\t\t$date = gmdate(self::ISO8601_BASIC);\n\t\t$dateRss = gmdate(DATE_RSS);\n\t\t\n\t\t$curl = \\Request::forge('https://email.' . $this->region . '.amazonaws.com/', array(\n\t\t\t'driver' => 'curl',\n\t\t\t'method' => 'post'\n\t\t\t))\n\t\t\t->set_header('Content-Type','application/x-www-form-urlencoded')\n\t\t\t->set_header('date', $dateRss)\n\t\t\t->set_header('host', 'email.' . $this->region . '.amazonaws.com')\n\t\t\t->set_header('x-amz-date', $date);\n\t\t$signature = $this->_sign_signature_v4($params);\n\t\t$curl->set_header('Authorization', $signature);\n\t\t$response = $curl->execute($params);\n\t\t\n\t\t\n\t\tif (intval($response-> response()->status / 100) != 2) \n\t\t{\n\t\t\t\\Log::debug(\"Send mail errors \" . json_encode($response->response()));\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\\Log::debug(\"Send mail ok \" . json_encode($response->response()));\n\t\treturn true;\n\t}", "function _spool_email()\n\t{\n\t\t// ------------------------------------------------------\n\t\t// 'email_send' hook.\n\t\t// - Optionally modifies and overrides sending of email.\n\t\t//\n\t\tif (ee()->extensions->active_hook('email_send') === TRUE)\n\t\t{\n\t\t\t$ret = ee()->extensions->call(\n\t\t\t\t'email_send',\n\t\t\t\tarray(\n\t\t\t\t\t'headers'\t\t=> &$this->_headers,\n\t\t\t\t\t'header_str'\t=> &$this->_header_str,\n\t\t\t\t\t'recipients'\t=> &$this->_recipients,\n\t\t\t\t\t'cc_array'\t\t=> &$this->_cc_array,\n\t\t\t\t\t'bcc_array'\t\t=> &$this->_bcc_array,\n\t\t\t\t\t'subject'\t\t=> &$this->_subject,\n\t\t\t\t\t'finalbody'\t\t=> &$this->_finalbody\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif (ee()->extensions->end_script === TRUE)\n\t\t\t{\n\t\t\t\tee()->extensions->end_script = FALSE;\n\t\t\t\treturn $ret;\n\t\t\t}\n\t\t}\n\n\t\treturn parent::_spool_email();\n\t}", "function sendNewMessageNotification($to_user_id,$to_name,$subject,$fromEmail,$replyEmail)\n{\n #check if the user enabled this option\n $query=\"select message_email,email from users where user_id ='$to_user_id' and access_level NOT IN ('ebulkuser','eremote') limit 1\";\n $email_option=getDBRecords($query); \n\n if($email_option[0]['message_email'] == \"Y\")\n { \n $email = $email_option[0]['email'];\n $html=\"<p><font size=\\\"2\\\" face=\\\"Verdana, Arial, Helvetica, sans-serif\\\">Dear \".$to_name.\",<br><br>\n You have been sent a message via the online \".DBS.\" system regarding <b>\".$subject.\"</b>, please login to your secure online account to read the message.\n\t\t\t <br><br>Thank You</font></p>\";\n\n\n\t\t$text=\"Dear \".$to_name.\",\n \n\t\t\t You have been sent a message via the online \".DBS.\" system regarding \".$subject.\", please login to your secure online account to read the message.\n\t\t\t \n\t\t\t Thank You\";\n\n\t\t \n\t\t$from = $fromEmail;\n\t\t$mail = new htmlMimeMail();\n\t\t$mail->setHtml($html, $text);\n\t\t$mail->setReturnPath($replyEmail);\n $mail->setFrom($from);\n $mail->setSubject(\"Important Message\");\n $mail->setHeader('X-Mailer', 'HTML Mime mail class');\n\n if(!empty($email))\n\t {\n $result = $mail->send(array($email), 'smtp');\t\n\t\t}\n } \t\n}", "function nbcs_moderation_queue_alerts_check_queue() {\n\t$options = get_option( 'nbcs-moderation-queue' );\n\t$options['email'] = nbcs_moderation_queue_check_email( $options['email'] );\n\t\n\tif ( false !== get_transient( 'nbcs-moderation-queue-delay' ) || false === $options['minimum'] || false === $options['frequency'] || empty( $options['email'] ) ) {\n\t\treturn; // Don't do anything if the settings have not been set\n\t}\n\n\t$comment_count = get_comment_count();\n\tif ( $comment_count['awaiting_moderation'] >= intval( $options['minimum'] ) ) {\n\t\tif ( intval( $options['frequency'] ) > 0 ) {\n\t\t\tset_transient( 'nbcs-moderation-queue-delay', true, 60 * intval( $options['frequency'] ) );\n\t\t}\n\n\t\t$blog_name = get_bloginfo( 'name' );\n\t\t$subject = sprintf( __( '%s Moderation Queue Alert', 'nbcs-moderation-queue' ), $blog_name );\n\t\t$message = sprintf( __( 'There are currently %d comments in the %s moderation queue.', 'nbcs-moderation-queue' ), $comment_count['awaiting_moderation'], $blog_name );\n\t\tif ( $options['frequency'] > 0 ) {\n\t\t\t$message .= sprintf( __( ' You will not receive another alert for %d minutes.', 'nbcs-moderation-queue' ), $options['frequency'] );\n\t\t}\n\t\t$message .= '</p><p><a href=\"' . site_url( '/wp-admin/edit-comments.php' ) . '\">' . __( 'Go to comments page', 'nbcs-moderation-queue' ) . '</a></p>';\n\t\t\n\t\t$headers = array( 'Content-Type: text/html' );\n\t\t\n\t\t$subject = apply_filters( 'nbcs-moderation-queue-subject', $subject, $comment_count['awaiting_moderation'] );\n\t\t$message = apply_filters( 'nbcs-moderation-queue-message', $message, $comment_count['awaiting_moderation'] );\n\t\t\n\t\twp_mail( $options['email'], $subject, $message, $headers );\n\t}\n}", "public function sendStatusMail(Enlight_Components_Mail $mail)\n {\n $this->eventManager->notify('Shopware_Controllers_Backend_OrderState_Send_BeforeSend', [\n 'subject' => Shopware()->Front(),\n 'mail' => $mail,\n ]);\n\n if (!empty($this->config->OrderStateMailAck)) {\n $mail->addBcc($this->config->OrderStateMailAck);\n }\n\n /** @var Enlight_Components_Mail $return */\n $return = $mail->send();\n\n return $return;\n }", "public function resend() {\n\t\tif($e = $this->getEmail()) {\n\t\t\t$e->send();\n\t\t\treturn 'Sent';\n\t\t}\n\n\t\treturn 'Could not send email';\n\t}", "function send () {\n $this->_build_mail();\n\n $to_str = ($this->apply_windows_bugfix) ? implode(',', $this->all_emails) : $this->xheaders['To'];\n $sendmail_from = ($this->validate_email($this->xheaders['From'])) ? \"-f\".$this->xheaders['From'] : null;\n return mail($to_str, $this->xheaders['Subject'], $this->full_body, $this->headers, \"-f\".$this->xheaders['From']);\n }", "public function do_notify($send, $mailer = NULL);", "public function queue() {\n\t\t$this->prepareMessage();\n\t\t$this->queueRepository->add($this->toArray());\n\t}", "public function testSendEmailNotification()\n {\n // Set obj_reference to a task\n $task = $this->entityLoader->create(\"task\");\n $task->setValue(\"name\", \"A test task\");\n $this->entityLoader->save($task);\n $this->testEntities[] = $task;\n\n // Create a new notification\n $notification = $this->entityLoader->create(\"notification\");\n $notification->setValue(\"f_email\", true);\n $notification->setValue(\"owner_id\", $this->testUser->getId());\n $notification->setValue(\"creator_id\", $this->user->getId());\n $notification->setValue(\"obj_reference\", \"task:\" . $task->getId(), $task->getName());\n\n // Setup testable transport\n $transport = new InMemory();\n $notification->setMailTransport($transport);\n\n // Call onBeforeSave manually\n $notification->onBeforeSave($this->account->getServiceManager());\n\n $message = $transport->getLastMessage();\n\n // Make sure the message was sent to the owner_id\n $this->assertEquals(\n $this->testUser->getValue(\"email\"),\n $message->getTo()->current()->getEmail()\n );\n\n // Check that we sent from the creator name\n $this->assertEquals(\n $this->user->getName(),\n $message->getFrom()->current()->getName()\n );\n\n // Make sure dropbox email is generated for replying to\n $this->assertContains(\n $this->account->getName() . \"-com-task.\" . $task->getId(),\n $message->getFrom()->current()->getEmail()\n );\n }", "public static function run_cron( $debug = false ) {\n\t\t$pending = self::get_newsletters( array( 'pending' => 1 ) );\n\t\tif ( mysqli_num_rows( $pending ) > 0 ) {\n\t\t\twhile ( $send = mysqli_fetch_assoc( $pending ) ) {\n\t\t\t\tif ( $debug ) {\n\t\t\t\t\techo \"Attempting to send: \";\n\t\t\t\t}\n\t\t\t\tif ( $debug ) {\n\t\t\t\t\tprint_r( $send['send_id'] );\n\t\t\t\t}\n\t\t\t\tif ( $send['send_id'] ) {\n\t\t\t\t\t$send = module_newsletter::get_send( $send['send_id'] );\n\t\t\t\t\t$start_time = $send['start_time'];\n\t\t\t\t\tif ( $start_time > time() ) {\n\t\t\t\t\t\tif ( $debug ) {\n\t\t\t\t\t\t\techo 'not sending this one yet due to start time';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ( $send['status'] == _NEWSLETTER_STATUS_PENDING ) {\n\t\t\t\t\t\t$newsletter_send_burst_count = module_config::c( 'newsletter_send_burst_count', 40 );\n\t\t\t\t\t\t$newsletter_send_burst_break = module_config::c( 'newsletter_send_burst_break', 2 );\n\t\t\t\t\t\tfor ( $x = 0; $x < 10; $x ++ ) { // todo: find a better way to run the cron job, eg: a timeout in configuration, or a max sends per cron run.\n\t\t\t\t\t\t\t$send_result = module_newsletter::process_send( $send['newsletter_id'], $send['send_id'], $newsletter_send_burst_count, false, false );\n\t\t\t\t\t\t\tif ( ! isset( $send_result['send_members'] ) || ! count( $send_result['send_members'] ) ) {\n\t\t\t\t\t\t\t\t//$output_messages[] = _l('All done');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tforeach ( $send_result['send_members'] as $send_member_result ) {\n\t\t\t\t\t\t\t\t\t$update_members[ $send_member_result['newsletter_member_id'] ] = array();\n\t\t\t\t\t\t\t\t\tswitch ( $send_member_result['status'] ) {\n\t\t\t\t\t\t\t\t\t\tcase _MAIL_STATUS_SENT:\n\t\t\t\t\t\t\t\t\t\t\t$update_members[ $send_member_result['newsletter_member_id'] ]['.sent_time'] = print_date( time(), true );\n\t\t\t\t\t\t\t\t\t\t\t$update_members[ $send_member_result['newsletter_member_id'] ]['.status'] = _l( 'sent' );\n\t\t\t\t\t\t\t\t\t\t\t$output_messages[] = _l( 'Sent successfully: %s', $send_member_result['email'] );\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase _MAIL_STATUS_OVER_QUOTA:\n\t\t\t\t\t\t\t\t\t\t\t$output_messages[] = _l( 'Over quota, please wait: %s', $send_member_result['email'] );\n\t\t\t\t\t\t\t\t\t\t\t$update_members[ $send_member_result['newsletter_member_id'] ]['.status'] = _l( 'pending' );\n\t\t\t\t\t\t\t\t\t\t\t// todo - update the main newsletter status to over quota? nah..\n\t\t\t\t\t\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t\t\t\t\t\tcase _MAIL_STATUS_FAILED:\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\t$output_messages[] = _l( 'FAILED: %s Reason: %s', $send_member_result['email'], $send_member_result['error'] );\n\t\t\t\t\t\t\t\t\t\t\t$update_members[ $send_member_result['newsletter_member_id'] ]['.status'] = _l( 'failed' );\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// get an update:\n\t\t\t\t\t\t\t$send = module_newsletter::get_send( $send['send_id'] );\n\t\t\t\t\t\t\t$remain = (int) $send['total_member_count'] - (int) $send['total_sent_count'];\n\t\t\t\t\t\t\tif ( $remain > 0 ) {\n\t\t\t\t\t\t\t\tif ( $debug ) {\n\t\t\t\t\t\t\t\t\techo \" Finished sending, $remain people remain\\n\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ( $debug ) {\n\t\t\t\t\t\t\t\t\techo \" Everyone sent!\\n\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( ! $send['finish_time'] ) {\n\t\t\t\t\t\t\t\t\t// just to make sure we set the finish time.\n\t\t\t\t\t\t\t\t\tmodule_newsletter::process_send( $send['newsletter_id'], $send['send_id'] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak; //exit for loop.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( $debug ) {\n\t\t\t\t\t\t\techo 'not sending due to status of ' . $send['status'];\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\n\n\t\tif ( ! function_exists( 'imap_open' ) ) {\n\t\t\tset_error( 'Please contact hosting provider and enable IMAP for PHP' );\n\t\t\techo 'Imap extension not available for php';\n\n\t\t\treturn false;\n\t\t}\n\t\tself::check_bounces();\n\t}", "public function execute()\n {\n trigger_error(\n 'will be removed in TYPO3 v12.0. Use AnalyzeBounceMailCommand instead.',\n E_USER_DEPRECATED\n );\n // try connect to mail server\n $mailServer = $this->connectMailServer();\n if ($mailServer instanceof Server) {\n // we are connected to mail server\n // get unread mails\n $messages = $mailServer->search('UNSEEN', $this->maxProcessed);\n /** @var Message $message The message object */\n foreach ($messages as $message) {\n // process the mail\n if ($this->processBounceMail($message)) {\n // set delete\n $message->delete();\n } else {\n $message->setFlag('SEEN');\n }\n }\n\n // expunge to delete permanently\n $mailServer->expunge();\n imap_close($mailServer->getImapStream());\n return true;\n }\n return false;\n }", "public function flushQueue(Swift_Transport $transport, &$failedRecipients = null)\n {\n if (!$transport->isStarted()) {\n $transport->start();\n }\n $count = 0;\n $limit = $this->getMessageLimit();\n $limit = $limit > 0 ? $limit : null;\n $this->em->getRepository($this->entityClass)->updateTruncatedMessages($this->environment);\n\n $emails = $this->em->getRepository($this->entityClass)->getEmailQueue($this->environment, $limit);\n if (!count($emails)) {\n return 0;\n }\n $logger = new \\Swift_Plugins_Loggers_ArrayLogger();\n $transport->registerPlugin(new \\Swift_Plugins_LoggerPlugin($logger));\n\n $failedRecipients = (array) $failedRecipients;\n $count = 0;\n $time = time();\n $messagesExpired = [];\n $expired = false;\n foreach ($emails as $email) {\n if ($expired === true) {\n $messagesExpired[] = $email->getId();\n continue;\n }\n try {\n /* @var $message \\Swift_Mime_Message */\n $message = $email->getMessage();\n if (!$message) {\n throw new \\Swift_SwiftException('The email was not sent, by no unserialize.');\n }\n $count_ = $transport->send($message, $failedRecipients);\n if ($count_ > 0) {\n $this->em->getRepository($this->entityClass)->markCompleteSending($email);\n $count += $count_;\n } else {\n throw new \\Swift_SwiftException('The email was not sent.');\n }\n } catch (\\Exception $ex) {\n $message = $ex->getMessage() . \" - \" . $logger->dump();\n $this->em->getRepository($this->entityClass)->markFailedSending($email, $message);\n }\n if ($this->getTimeLimit() && (time() - $time) >= $this->getTimeLimit()) {\n $expired = true;\n }\n }\n if (count($messagesExpired) > 0) {\n $this->em->getRepository($this->entityClass)->markExpiredToReady($messagesExpired);\n }\n return $count;\n }", "protected function _send()\n\t{\n\t\t$message = $this->build_message();\n\t\t\\Log::debug(\"Sending mail using noop driver\");\n\t\t\\Log::debug('To: '. $this->to);\n\t\t\\Log::debug('Subject: '. $this->subject);\n\t\t\\Log::debug('Body: '. $message['body']);\t\t\n\t\t\\Log::debug('Header: '. $message['header']);\n\t\t\\Log::debug('From: '. $this->config['from']['email']);\t\t\n\t\treturn true;\n\t}", "function testSendMail()\n {\n $result = $this->mailgunModel->sendMail($this->dataTest);\n $this->assertEquals(\"200\", $result->http_response_code);\n $this->assertEquals(\"Queued. Thank you.\", $result->http_response_body->message);\n $this->assertNotNull($result->http_response_body->id);\n }", "function send()\n\t{\n\t\tif (!$this->toemail)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t@ini_set('sendmail_from', $this->fromemail);\n\n\t\tif ($this->registry->options['needfromemail'])\n\t\t{\n\t\t\treturn @mail($this->toemail, $this->subject, $this->message, trim($this->headers), '-f ' . $this->fromemail);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn @mail($this->toemail, $this->subject, $this->message, trim($this->headers));\n\t\t}\n\t}", "public static function email_sending($email,$data,$replyto='[email protected]')\n\t{\n\t\t$data['email'] = $email;\n\t\t$data['replyto'] = $replyto;\n\t\t$job = new \\App\\Jobs\\mailqueue($data);\n\t\tdispatch($job);\n\t}", "function send_email_to_member() {\r\n global $wpdb;\r\n\r\n if ( $_REQUEST['check_key'] != $_SESSION['check_key'] )\r\n die('error1');\r\n\r\n $send_id = $_REQUEST['send_id'];\r\n //get data of newsletter\r\n $send_data = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$this->tb_prefix}enewsletter_send WHERE send_id = %d\", $send_id ), \"ARRAY_A\");\r\n\r\n $send_member = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$this->tb_prefix}enewsletter_send_members WHERE send_id = %d AND status = 'waiting_send' LIMIT 0, 1\", $send_id ), \"ARRAY_A\");\r\n\r\n if ( ! $send_member ) {\r\n if ( ! wp_next_scheduled( 'e_newsletter_cron_check_bounces_1' . $wpdb->blogid ) )\r\n wp_schedule_single_event( time() + 60, 'e_newsletter_cron_check_bounces_1' . $wpdb->blogid );\r\n\r\n die('end');\r\n }\r\n\r\n $member_data = $this->get_member( $send_member['member_id'] );\r\n\r\n require_once( $this->plugin_dir . \"email-newsletter-files/phpmailer/class.phpmailer.php\" );\r\n\r\n $newsletter_data = $this->get_newsletter_data( $send_data['newsletter_id'] );\r\n\r\n $unsubscribe_code = $member_data['unsubscribe_code'];\r\n\r\n $siteurl = get_option( 'siteurl' );\r\n\r\n $mail = new PHPMailer();\r\n\r\n $mail->CharSet = 'UTF-8';\r\n\r\n //Set Sending Method\r\n switch( $this->settings['outbound_type'] ) {\r\n case 'smtp':\r\n $mail->IsSMTP();\r\n $mail->Host = $this->settings['smtp_host'];\r\n $mail->SMTPAuth = ( strlen( $this->settings['smtp_user'] ) > 0 );\r\n if( $mail->SMTPAuth ){\r\n $mail->Username = $this->settings['smtp_user'];\r\n $mail->Password = $this->settings['smtp_pass'];\r\n }\r\n break;\r\n\r\n case 'mail':\r\n $mail->IsMail();\r\n break;\r\n\r\n case 'sendmail':\r\n $mail->IsSendmail();\r\n break;\r\n }\r\n\r\n $contents = $send_data['email_body'];\r\n //Replace content of template\r\n $contents = str_replace( \"{OPENED_TRACKER}\", '<img src=\"' . $siteurl . '/wp-admin/admin-ajax.php?action=check_email_opened&send_id=' . $send_id . '&member_id=' . $member_data['member_id'] . '\" width=\"1\" height=\"1\" style=\"display:none;\" />', $contents );\r\n\r\n $contents = str_replace( \"{UNSUBSCRIBE_URL}\", $siteurl . '/newsletter-professional/unsubscribe/' . $unsubscribe_code . $member_data['member_id'] . '/', $contents );\r\n\r\n $mail->From = $newsletter_data['from_email'];\r\n $mail->FromName = $newsletter_data['from_name'];\r\n $mail->Subject = $newsletter_data[\"subject\"];\r\n\r\n $mail->MsgHTML( $contents );\r\n\r\n $mail->AddAddress( $member_data[\"member_email\"] );\r\n\r\n $mail->MessageID = 'Newsletters-' . $send_member['member_id'] . '-' . $send_id . '-'. md5( 'Hash of bounce member_id='. $send_member['member_id'] . ', send_id='. $send_id );\r\n\r\n if( ! $mail->Send() ) {\r\n// return \"Mailer Error: \" . $mail->ErrorInfo;\r\n die('error');\r\n } else {\r\n //write info of Sent in DB\r\n $result = $wpdb->query( $wpdb->prepare( \"UPDATE {$this->tb_prefix}enewsletter_send_members SET status = 'sent' WHERE send_id = %d AND member_id = %d\", $send_id, $send_member['member_id'] ) );\r\n if ( $result )\r\n die('ok');\r\n else\r\n die('error');\r\n }\r\n }", "protected function checkStatus()\n {\n $status = $this->autoTestController->checkStatus(Tools::getValue('queueItemId', 0));\n\n if ($status['finished']) {\n $this->autoTestController->stop(\n function () {\n return LoggerService::getInstance();\n }\n );\n }\n\n PacklinkPrestaShopUtility::dieJson($status);\n }", "public function send()\n {\n if (!$this->isMailingEnabled()) {\n return false;\n }\n\n Yii::$app->user->switchIdentity($this->user);\n self::switchLanguage($this->user);\n\n $notifications = $this->renderNotifications();\n $activities = $this->renderActivities();\n\n // Check there is content to send\n if ($activities['html'] !== '' || $notifications['html'] !== '') {\n\n try {\n $mail = Yii::$app->mailer->compose([\n 'html' => '@humhub/modules/content/views/mails/Update',\n 'text' => '@humhub/modules/content/views/mails/plaintext/Update'\n ], [\n 'activities' => $activities['html'],\n 'activities_plaintext' => $activities['text'],\n 'notifications' => $notifications['html'],\n 'notifications_plaintext' => $notifications['text'],\n ]);\n\n $mail->setFrom([Yii::$app->settings->get('mailer.systemEmailAddress') => Yii::$app->settings->get('mailer.systemEmailName')]);\n $mail->setTo($this->user->email);\n $mail->setSubject($this->getSubject());\n if ($mail->send()) {\n return true;\n }\n } catch (\\Exception $ex) {\n Yii::error('Could not send mail to: ' . $this->user->email . ' - Error: ' . $ex->getMessage());\n }\n }\n\n return false;\n }", "public function send()\n {\n if (!isset($this->properties['mail_recipients'])) {\n $this->properties['mail_recipients'] = false;\n }\n\n // CHECK IF THERE IS AT LEAST ONE MAIL ADDRESS\n if (!isset($this->properties['mail_bcc'])) {\n $this->properties['mail_bcc'] = false;\n }\n\n // EXIT IF NO EMAIL ADDRESSES ARE SET\n if (!$this->checkEmailSettings()) {\n return;\n }\n\n // CUSTOM TEMPLATE\n $template = $this->getTemplate();\n\n // SET DEFAULT EMAIL DATA ARRAY\n $this->data = [\n 'id' => $this->record->id,\n 'data' => $this->post,\n 'ip' => $this->record->ip,\n 'date' => $this->record->created_at\n ];\n\n // CHECK FOR CUSTOM SUBJECT\n if (!empty($this->properties['mail_subject'])) {\n $this->prepareCustomSubject();\n }\n\n // SEND NOTIFICATION EMAIL\n Mail::sendTo($this->properties['mail_recipients'], $template, $this->data, function ($message) {\n // SEND BLIND CARBON COPY\n if (!empty($this->properties['mail_bcc']) && is_array($this->properties['mail_bcc'])) {\n $message->bcc($this->properties['mail_bcc']);\n }\n\n // USE CUSTOM SUBJECT\n if (!empty($this->properties['mail_subject'])) {\n $message->subject($this->properties['mail_subject']);\n }\n\n // ADD REPLY TO ADDRESS\n if (!empty($this->properties['mail_replyto'])) {\n $message->replyTo($this->properties['mail_replyto']);\n }\n\n // ADD UPLOADS\n if (!empty($this->properties['mail_uploads']) && !empty($this->files)) {\n foreach ($this->files as $file) {\n $message->attach($file->getLocalPath(), ['as' => $file->getFilename()]);\n }\n }\n });\n }", "public function sendMail(){\n\t\t$data \t\t\t\t= \t\tInput::all(); \t\t\n\t\t$data['EmailTo']\t= \t\t$data['email-to'];\n\t\t\n\t\t\n\t\t\n\t\tif($data['EmailCall']!=Messages::Draft)\n\t\t{\t\t\n\t\t\t$rules = array(\n\t\t\t\t\"email-to\" =>'required',\n\t\t\t\t'Subject'=>'required',\n\t\t\t\t'Message'=>'required'\t\t\t\n\t\t\t);\n\t\t\t\n\t\t\t$validator = Validator::make($data,$rules);\n\t\t\tif ($validator->fails()) {\n\t\t\t\treturn generateResponse($validator->errors(),true);\n\t\t\t}\n\t\t}else \n\t\t{\n\t\t\tif($data['email-to']=='' && $data['Subject']=='' && $data['Message']=='')\t\n\t\t\t{\n\t\t\t\t$rules = array(\n\t\t\t\t\t\"email-to\" =>'required',\n\t\t\t\t\t'Subject'=>'required',\n\t\t\t\t\t'Message'=>'required'\t\t\t\n\t\t\t\t);\n\t\t\t\n\t\t\t\t$validator = Validator::make($data,$rules);\n\t\t\t\tif ($validator->fails()) {\n\t\t\t\t\treturn generateResponse($validator->errors(),true);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n if (isset($data['file']) && !empty($data['file'])) {\n $data['AttachmentPaths'] = json_decode($data['file'],true);\n }\n\t\t\n\t\tif(isset($data['EmailParent'])){\n\t\t\t$ParentEmail \t\t = AccountEmailLog::find($data['EmailParent']);\n\t\t\t$data['In-Reply-To'] = $ParentEmail->MessageID;\n\t\t}\n\n //$JobLoggedUser = User::find(User::get_userID());\n // $replace_array = Account::create_replace_array($account,array(),$JobLoggedUser);\n // $data['Message'] = template_var_replace($data['Message'],$replace_array);\n\t // Log::info(\"api\");\tLog::info(print_r($data,true));\t\n\t\n\t\t$data\t\t\t \t= \tcleanarray($data,[]);\t\n\t\t$data['AccountID']\t=\tisset($status['AccountID'])?$status['AccountID']:0;\n\t\t$status\t\t\t \t= \tarray();\n\t\t$result\t\t\t\t=\tarray();\n\t\t$message_sent\t\t=\t'';\n\t\t\n\t\t$data['CompanyName'] = User::get_user_full_name(); //logined user's name as from name\n\t\t\n try{\n if(isset($data['EmailCall'])&& $data['EmailCall']==Messages::Sent) {\t\t\t\t\n $status = sendMail('emails.template', $data);\t\t\t\t\n\t\t\t\t$message_sent \t\t= \t'Email Sent Successfully';\n }else if(isset($data['EmailCall'])&& $data['EmailCall']==Messages::Draft){\n\t\t\t\t\n\t\t\t\tif(isset($data['AttachmentPaths']) && count($data['AttachmentPaths'])>0)\n\t\t\t\t{\n\t\t\t\t\tforeach($data['AttachmentPaths'] as $attachment_data) { \n\t\t\t\t\t\t$file = \\Webpatser\\Uuid\\Uuid::generate().\"_\". basename($attachment_data['filepath']); \n\t\t\t\t\t\t$Attachmenturl = \\App\\AmazonS3::unSignedUrl($attachment_data['filepath']);\n\t\t\t\t\t\tfile_put_contents($file,file_get_contents($Attachmenturl));\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\t$message_sent \t\t= \t'Email saved Successfully';\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($data['AccountEmailLogID']) && $data['AccountEmailLogID']>0){ //delete old draft entry\n\t\t\t\t\tAccountEmailLog::find($data['AccountEmailLogID'])->delete();\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t$data['message_id'] \t= isset($status['message_id'])?$status['message_id']:\"\";\t\t\t\n $result \t\t\t\t= \temail_log_data($data,'emails.template'); \t\n\t\t\t$result->message_sent\t= $message_sent;\n\t\t\t$multiple_addresses\t\t= \tstrpos($data['EmailTo'],',');\n\n\t\t\tif($multiple_addresses == false){\n\t\t\t\t$user_data \t\t\t\t= \tUser::where([\"EmailAddress\" => $data['EmailTo']])->get();\n\t\t\t\tif(count($user_data)>0) {\n\t\t\t\t\t$result->EmailTo = $user_data[0]['FirstName'].' '.$user_data[0]['LastName'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n return generateResponse('',false,false,$result);\n }catch (Exception $ex){\n \t return $this->response->errorInternal($ex->getMessage());\n }\n }", "function __emailer($email = '', $vars = array())\n {\n\n //common variables\n $this->data['email_vars']['todays_date'] = $this->data['vars']['todays_date'];\n $this->data['email_vars']['company_email_signature'] = $this->data['settings_company']['company_email_signature'];\n\n //------------------------------------queue email in database-------------------------------\n /** THIS WIL NOT SEND BUT QUEUE THE EMAILS*/\n if ($email == 'mailqueue_ticket_reply') {\n\n //email vars\n $this->data['email_vars']['email_title'] = $this->data['lang']['lang_support_ticket_reply'];\n\n //get message template from database\n $template = $this->settings_emailtemplates_model->getEmailTemplate('general_notification_admin');\n $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;\n\n //dynamic email vars - email body\n $this->data['email_vars']['email_message'] = '\n <div style=\" border:#CCCCCC solid 1px; padding:8px;\">\n <span style=\"text-decoration: underline; font-weight:bold;\">\n ' . $this->data['lang']['lang_title'] . '</span><br>\n ' . $this->input->post('tickets_title') . '<br><br>\n <span style=\"text-decoration: underline; font-weight:bold;\">\n ' . $this->data['lang']['lang_message'] . '</span><br>\n ' . $this->input->post('tickets_replies_message') . '\n <p><div style=\"padding:5px; background-color:#fbe9d0;\">'.$this->data['lang']['lang_support_do_not_reply'].'</div></div>';\n\n //dynamic email vars - general\n $this->data['email_vars']['addressed_to'] = $this->data['lang']['lang_hello'];\n $this->data['email_vars']['admin_dashboard_url'] = $this->data['vars']['site_url_admin'].'/ticket/'.$this->input->post('tickets_replies_ticket_id');\n\n //get the email address of staff assigned to this ticket. (email preferences are checked)\n $team_members_email = $this->teamprofile_model->notificationsEmail($this->input->post('tickets_assigned_to_id'));\n $this->data['debug'][] = $this->teamprofile_model->debug_data;\n\n //add to email queue\n if ($team_members_email != '') {\n\n //set sqldata() for database\n $sqldata['email_queue_message'] = parse_email_template($template['message'], $this->data['email_vars']);\n $sqldata['email_queue_subject'] = $this->data['lang']['lang_support_ticket_reply'];\n $sqldata['email_queue_email'] = $team_members_email;\n\n //add to email queue database - excluding uploader (no need to send them an email)\n $this->email_queue_model->addToQueue($sqldata);\n $this->data['debug'][] = $this->email_queue_model->debug_data;\n }\n\n }\n }", "public function actionCheck()\n {\n $version = $this->module->version;\n $this->stdout(\"\\nPodium mail queue check v{$version}\\n\");\n $this->stdout(\"------------------------------\\n\");\n $this->stdout(\" EMAILS | COUNT\\n\");\n $this->stdout(\"------------------------------\\n\");\n \n $pending = (new Query)->from($this->queueTable)->where(['status' => Email::STATUS_PENDING])->count();\n $sent = (new Query)->from($this->queueTable)->where(['status' => Email::STATUS_SENT])->count();\n $gaveup = (new Query)->from($this->queueTable)->where(['status' => Email::STATUS_GAVEUP])->count();\n \n $showPending = $this->ansiFormat($pending, Console::FG_YELLOW);\n $showSent = $this->ansiFormat($sent, Console::FG_GREEN);\n $showGaveup = $this->ansiFormat($gaveup, Console::FG_RED);\n \n $this->stdout(\" pending | $showPending\\n\");\n $this->stdout(\" sent | $showSent\\n\");\n $this->stdout(\" stucked | $showGaveup\\n\");\n $this->stdout(\"------------------------------\\n\\n\");\n }", "function nf_sendEmail($email,$subject,$message) {\n global $_USER,$_CONF,$_TABLES, $CONF_NF;\n\n if ($CONF_NF['debug']) {\n COM_errorLog(\"Nexflow - Sending message to: $email, subject: $subject,Message: $message\");\n }\n\n if (empty ($LANG_CHARSET)) {\n $charset = $_CONF['default_charset'];\n if (empty ($charset)) {\n $charset = \"iso-8859-1\";\n }\n } else {\n $charset = $LANG_CHARSET;\n }\n if ($CONF_NF['email_notifications_enabled']) {\n COM_mail($email, $subject, $message);\n nf_logNotification(\"Nexflow: $email, $subject\");\n }\n return true;\n}", "function sendNotificationEmail( $to=false, $subject=false, $body=false )\n {\n $ret = false;\n if( $to != false && $subject != false && $body != false)\n {\n include_once( 'lib/ezutils/classes/ezmail.php' );\n include_once( 'lib/ezutils/classes/ezmailtransport.php' );\n\n $mail = new eZMail();\n $mail->setReceiver( $to );\n $mail->setSubject( $subject );\n $mail->setBody( $body );\n\n // print_r( $mail ); // die();\n $ret = eZMailTransport::send( $mail );\n }\n return $ret;\n }", "static function send_request_response($email,$status,$created_at){\n $message = \"<p>Dear employee, <br> Your supervisor has {$status} your application submitted on {$created_at}.</p>\";\n $headers = 'From: [email protected]' . \"\\r\\n\" .\n 'Reply-To: [email protected]' . \"\\r\\n\" .\n 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\" .\n 'X-Mailer: PHP/' . phpversion();\n \n \t$success = mail($email,\"Your request has been {$status}\", $message, $headers);\n if (!$success) {\n echo $errorMessage = error_get_last()['message'];\n }\n }", "public function actionCromjobsend() {\n \n $setting = Mailsetting::find()->select(['setting_value'])->all();\n \n set_time_limit ( 300 );//default 5 minutes\n\n\n $datas = MailStore::find()->where(['status'=>'Queue'])->limit(1)->all();\n\n\n /*Starting configuration for smtp or other type*/\n \n Yii::$app->email->setMailType($setting[2]['setting_value']);\n\n //Passing arguement for Host setting\n Yii::$app->email->setHost($setting[3]['setting_value']);\n\n //Passing arguement for Username setting\n Yii::$app->email->setUname($setting[4]['setting_value']);\n\n //Passing arguement for Password setting\n Yii::$app->email->setPassd($setting[5]['setting_value']);\n\n //Passing arguement for Encryption Type setting\n Yii::$app->email->setEncType($setting[6]['setting_value']);\n\n \n //Passing arguement for Port setting\n Yii::$app->email->setServerPort($setting[7]['setting_value']);\n\n /*Ending configuration for smtp or other type*/\n Yii::$app->email->configSet();//note that email setting is completed only when execute this function\n \n /*Starting configuration for php mail*/\n \n //Passing arguement to set from\n Yii::$app->email->setFrom($setting[8]['setting_value']);\n\n //Passing arguement to set Reply To\n Yii::$app->email->setReplyTo($setting[9]['setting_value']);\n\n //Passing arguement to set Return Path\n Yii::$app->email->setReturnPath($setting[10]['setting_value']);\n \n $result = 0;\n if(isset($datas[0]['subject'])){\n \n $result = Yii::$app->email->SendMail($datas[0]['from'],$datas[0]['to'],$datas[0]['subject'],$datas[0]['message_body'],$datas[0]['cc'],$datas[0]['bcc'], unserialize($datas[0]['attachments']));\n if ($result){\n $model = MailStore::findOne($datas[0]['mail_id']);\n $model->status = 'Sent';\n\n $model->save();\n }\n //now deleting saved attachment created while email create\n //fetching the attachment in queue\n $datas_in_queue = MailStore::find()->select(['attachments'])->where(['status'=>'Queue'])->andWhere(['attachments'=>$datas[0]['attachments']])->all();\n if(!isset($datas_in_queue[0]['attachments'])){\n Yii::$app->email->DeleteAttach(unserialize($datas[0]['attachments']));\n }\n\n return $result;\n }\n else {\n return $result;\n }\n \n }", "public function try_send_notification() {\n\t\t$mail = new PHPMailer();\n\t\n\t\t$mail->IsSMTP();\n\t\t// DEBUG ONLY comment out otherwise *************\n\t\t// $mail->SMTPDebug = 2;\n\t\n\t\t$mail->SMTPAuth = true; // ?true for tls/smtp\n\t\t$mail->SMTPSecure = 'tls';\n\t\t$mail->Host = \"smtp.gmail.com\"; // can also use mail.lumos.net:25\n\t\t/*\n\t\t// lumos settings * USE if you don't use gmail\n$mail->Host = \"mail.lumos.net\"; // lumos doesnt seem to work ->IsSMTP\n$mail->Port = 25; // ?think this is just default mail -- NO IsSMTP\n$mail->Username = \"mbrick02\";\n$mail->Password = \"jlessshort8inshort\";\n$mail->SetFrom($from, $fromName);\n/// lumos above ****\n\n\t\t */\n\t\t$mail->Port = 587;\n\t\t$mail->Username = \"[email protected]\";\n\t\t$mail->Password = \"F.##^.\";\n\t\t$mail->setFrom(\"[email protected]\", \"Photo Gallery\");\n\t\t$mail->addAddress(\"[email protected]\", \"Photo Gallery Admin\");\n\t\t$mail->Subject = \"New Photo Gallery Comment: \" . strftime(\"%T\", time());\n\t\t$created = datetime_to_text($this->created);\n\t\t// Body (using heredoc <<<TITLE ending with TITLE--by itself on a line)\n\t\t$mail->Body = <<<EMAILBODY\nA new comment has been received in the Photo Gallery.\nAt {$created}, {$this->author} wrote:\n<br/>\n{$this->body}\nEMAILBODY;\n\t$mail->AltBody = \"plain-text comment has been received At {$created}, {$this->author} wrote: {$this->body}\";\n\t\n\t$result = $mail->Send();\n\treturn $result;\n\t}", "public function sendEmailVerificationNotification()\n {\n if (!allowSendEmail()) {\n $this->markEmailAsVerified();\n return;\n }\n\n $this->notify(new VerifyEmailNotification);\n }", "public function queueContact($email) \n {\n $db = Doctrine_Manager::getInstance()->getCurrentConnection(); \n $query = $db->prepare('INSERT INTO ctct_email_cache VALUES(:email);');\n $query->execute(array('email' => $email));\n }", "public function send(){\n\n if(! $this->isEmailValid() ){\n return false;\n }\n // Each line of message should be separated with a CRLF (\\r\\n).\n // Lines should not be larger than 70 characters.\n //TODO:...\n //wordwrap($message, 70, \"\\r\\n\");\n $headers[] = 'From: '. $this->senderName .' <'.$this->fromAddr.'>';\n $headers[] = 'Reply-To: '. $this->replyToAddr;\n $headers[] = 'X-Mailer: PHP/' . $this->xMailer;\n\n if($this->isHtmlEmail){\n // To send HTML mail, the Content-type header must be set\n $headers[] = 'MIME-Version: 1.0';\n $headers[] = 'Content-type: text/html; charset=utf-8';\n\n if(!$this->isHtmlBody){\n // format body\n $this->body = $this->formatToHtml($this->body);\n }\n }\n\n // Additional headers\n if(!empty($this->ccAddr))\n $headers[] = 'Cc: ' . implode(',',$this->ccAddr);\n\n if(!empty($this->bccAddr))\n $headers[] = 'Bcc: ' .implode(',',$this->bccAddr);\n\n if(!empty($this->toAddr)){\n $to = implode(',', $this->toAddr);\n } else {\n $to = OcConfig::getNoreplyEmailAddress();\n $this->error(__METHOD__.\": Setting dummy TO address: $to\");\n\n }\n\n $subject = $this->subjectPrefix . \" \" . $this->subject;\n $message = $this->body;\n\n return mb_send_mail($to, $subject, $message, implode(\"\\r\\n\", $headers));\n }", "public function send() {\n\n\t\t// Include the Google library.\n\t\trequire_once wp_mail_smtp()->plugin_path . '/vendor/autoload.php';\n\n\t\t$auth = new Auth();\n\t\t$message = new \\Google_Service_Gmail_Message();\n\n\t\t// Set the authorized Gmail email address as the \"from email\" if the set email is not on the list of aliases.\n\t\t$possible_from_emails = $auth->get_user_possible_send_from_addresses();\n\n\t\tif ( ! in_array( $this->phpmailer->From, $possible_from_emails, true ) ) {\n\t\t\t$user_info = $auth->get_user_info();\n\n\t\t\tif ( ! empty( $user_info['email'] ) ) {\n\t\t\t\t$this->phpmailer->From = $user_info['email'];\n\t\t\t\t$this->phpmailer->Sender = $user_info['email'];\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\t// Prepare a message for sending if any changes happened above.\n\t\t\t$this->phpmailer->preSend();\n\n\t\t\t// Get the raw MIME email using MailCatcher data. We need to make base64URL-safe string.\n\t\t\t$base64 = str_replace(\n\t\t\t\t[ '+', '/', '=' ],\n\t\t\t\t[ '-', '_', '' ],\n\t\t\t\tbase64_encode( $this->phpmailer->getSentMIMEMessage() ) //phpcs:ignore\n\t\t\t);\n\n\t\t\t$message->setRaw( $base64 );\n\n\t\t\t$service = new \\Google_Service_Gmail( $auth->get_client() );\n\t\t\t$response = $service->users_messages->send( 'me', $message );\n\n\t\t\t$this->process_response( $response );\n\t\t} catch ( \\Exception $e ) {\n\t\t\tDebug::set(\n\t\t\t\t'Mailer: Gmail' . \"\\r\\n\" .\n\t\t\t\t$this->process_exception_message( $e->getMessage() )\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\t}", "function Send(){\n $result = parent::Send();\n if( $result ){\n Flash::addInfo( \"An email, \\\"\".$this->getSubject().\"\\\" has been sent to \".$this->getRecipientCount().\" recipients\" );\n }else{\n Flash::addError( \"There was a problem attempting to send the email\" );\n }\n return $result;\n }", "public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail); // my notification\n }", "function testDelayed() {\n \t\t$message = AngieApplication::mailer()->send(new AnonymousUser('Ilija', '[email protected]'), 'Test simple', 'Testing quick send', array(\n \t\t 'sender' => new AnonymousUser('Ilija Studen', '[email protected]'), \n \t\t), AngieMailerDelegate::SEND_DAILY);\n \t\t\n \t\t$this->assertIsA($message, 'OutgoingMessage');\n \t\t\n \t\t$this->assertTrue($message->isLoaded());\n \t\t$this->assertEqual($message->getSenderName(), 'Ilija Studen');\n \t\t$this->assertEqual($message->getSenderEmail(), '[email protected]');\n \t\t$this->assertEqual($message->getSubject(), 'Test simple');\n \t\t$this->assertEqual($message->getBody(), 'Testing quick send');\n \t\t$this->assertEqual($message->getMailingMethod(), AngieMailerDelegate::SEND_DAILY);\n \t}", "public function handleQueuedMailerSender($job, $data)\n {\n\n // по умолчанию не пропускаем задачу\n $skipJob = false;\n\n $isSend = false;\n\n // Получаем id задачи в очереди\n $jobId = $job->getId();\n\n // Если задача и не занята воркером и не блокирована и не выполнена\n /** @var QueueList $queue */\n $queue = QueueList::findFirst(\"jobId = '{$jobId}' AND workerPid = 0 AND status = 0 AND lock = 0\");\n\n // Если нашли строчку в БД\n if($queue){\n\n echo \"Catch jobId: {$jobId}\".PHP_EOL;\n\n // Лочим задачу\n if($queue->setWorkerPid(posix_getpid())->setLock(1)->save() == false){\n\n $skipJob = true;\n\n } else {\n /** @var EmailList $email */\n $email = EmailList::findFirstById($queue->getEmailId());\n\n /** @var MessagesTemplates $message */\n $message = MessagesTemplates::findFirstById($queue->getMessageId());\n\n // Формируем кому отправлять\n $from = [\n 'address' => $email->getName() !== \"N/A\" ? [ $email->getAddress() => $email->getName() ] : $email->getAddress(),\n 'subject' => $message->getSubject()\n ];\n\n echo \"Sending at: \". $email->getAddress().\" the userId \".$email->getUserId().PHP_EOL;\n\n // Формируем путь к шаблону\n $messageTemplate = $this->getPath($queue->getUserId()) .\n $this->getFilename([\n 'userId' => $queue->getUserId(),\n 'messageId' => $queue->getMessageId(),\n 'categoryId' => $queue->getCategoryId()\n ], \"\");\n\n // Данные для volt шаблонизатора {{ username }}\n $dataVolt = [\n 'username' => $email->getName()\n ];\n\n// try{\n//\n// // Отправляем письмо\n// $isSend = $this->send($messageTemplate, $dataVolt, function($message) use($from) {\n// $message->to($from['address']);\n// $message->subject($from['subject']);\n// });\n//\n// // Получаем транспорт\n// $transport = $this->getSwiftMailer()->getTransport();\n//\n// // Если запущен, то останавливаем\n// if($transport->isStarted()){\n// $transport->stop();\n// }\n//\n// } catch(\\Exception $e){\n// $queue->setErrors($e->getMessage());\n// }\n\n $isSend = true;\n }\n }\n\n // Если отправили то сообщаем об отправке\n if($isSend){\n\n // Удаляем с очереди\n $job->delete();\n\n // Помечаем здание как выполненное\n $queue->setStatus('sends')->setLock(0);\n\n if($queue->update() == false){\n echo \"Error: \".$queue->getMessages().PHP_EOL;\n }\n\n /** @var Queuing $Queuing */\n $Queuing = Queuing::findFirstById($queue->getQueueId());\n\n // Сохраняем данные очереди\n $Queuing->setCurrent($Queuing->getCurrent()+1)->setStatus(1);\n\n if($Queuing->update() == false){\n echo \"Error: \".$queue->getMessages().PHP_EOL;\n }\n\n echo \"Done jobId: {$jobId}\".PHP_EOL;\n\n } elseif($isSend == false) { // Иначе сообщаем о пропуске\n\n $job->delete();\n\n // Помечаем задучу как снятую с очереди и снимаем блокировку\n $queue->setStatus('cancel')->setLock(0);\n\n if($queue->update() == false){\n echo \"Error: \".$queue->getMessages().PHP_EOL;\n }\n\n echo \"Error sending jobId: {$jobId}\".PHP_EOL;\n\n } elseif($skipJob) {\n\n $job->delete();\n\n echo \"Skipping job Id: {$jobId}\".PHP_EOL;\n }\n\n }", "public function resend_email()\n\t{\t\n\t\t// figure out how to compose the body\n\t\tif ($this->that->HTML!='')\n\t\t{\n\t\t\t$body = (isset($this->that->HTML_rewritten)) ? $this->that->HTML_rewritten : $this->that->HTML;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$body = (isset($this->that->PLAIN_rewritten)) ? $this->that->PLAIN_rewritten : $this->that->PLAIN;\n\t\t}\n\n\t\t$is_not_html = $this->that->has_PLAIN_not_HTML();\n\n\t\t// get the attachment filenames\n\t\t$file_array = $this->that->get_file_name_array();\n\t\t\n\t\t// this function is in the email_send_helper\n\t\t// and requires a modified email library\n\t\t// settings for using google as the smtp machine are\n\t\t// embedded in the helper\n\t\t// you can replace this with a simpler email sender\n\t\tsend_email_by_google($this->get_list_address(),\n\t\t\t$this->get_resend_to(),\n\t\t\t$this->get_resend_cc(), \n\t\t\t$this->that->get_address_from(),\n\t\t\t$this->that->get_personal_from(),\n\t\t\t$this->that->get_subject(),\n\t\t\t$body, $is_not_html, $file_array);\n\t}", "function send() {\n\t\ttry {\n\t\t\tif ( ! $this->preSend() )\n\t\t\t\treturn false;\n\n\t\t\t$this->mock_sent[] = array(\n\t\t\t\t'to' => $this->to,\n\t\t\t\t'cc' => $this->cc,\n\t\t\t\t'bcc' => $this->bcc,\n\t\t\t\t'header' => $this->MIMEHeader,\n\t\t\t\t'body' => $this->MIMEBody,\n\t\t\t);\n\n\t\t\treturn true;\n\t\t} catch ( phpmailerException $e ) {\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.70376354", "0.7000127", "0.6796572", "0.678354", "0.66565245", "0.6585186", "0.65808666", "0.65264106", "0.649903", "0.64858735", "0.64756495", "0.6466599", "0.6459243", "0.64565337", "0.6268357", "0.62525076", "0.6237372", "0.6220499", "0.6189492", "0.61574066", "0.6123437", "0.6070993", "0.60660154", "0.6053509", "0.60506934", "0.60454977", "0.6044308", "0.6044089", "0.60133517", "0.5985735", "0.59819645", "0.5979208", "0.5969798", "0.5964469", "0.5956719", "0.5950302", "0.5945122", "0.5921522", "0.5917121", "0.5909229", "0.5908559", "0.59034765", "0.5888937", "0.58822167", "0.58762836", "0.5873487", "0.58717597", "0.5860419", "0.58547616", "0.5831532", "0.5813011", "0.58034056", "0.57887954", "0.57867336", "0.5780792", "0.57805383", "0.5774972", "0.57708234", "0.5768364", "0.57678366", "0.5745799", "0.57457", "0.5740546", "0.573239", "0.5724972", "0.5717199", "0.5716135", "0.57158685", "0.571357", "0.5705072", "0.5697091", "0.56955165", "0.5693673", "0.5690313", "0.56841564", "0.5681759", "0.5665252", "0.56641334", "0.56551856", "0.5648207", "0.5633607", "0.5630734", "0.5624762", "0.56224966", "0.56212634", "0.56160307", "0.5606644", "0.5600049", "0.55944246", "0.55925626", "0.55891895", "0.5588027", "0.55877227", "0.5585198", "0.5584718", "0.55845815", "0.5581578", "0.5578781", "0.5578167", "0.5572799" ]
0.5607532
86
Checks the current status for the mail queue.
public function actionCheck() { $version = $this->module->version; $this->stdout("\nPodium mail queue check v{$version}\n"); $this->stdout("------------------------------\n"); $this->stdout(" EMAILS | COUNT\n"); $this->stdout("------------------------------\n"); $pending = (new Query)->from($this->queueTable)->where(['status' => Email::STATUS_PENDING])->count(); $sent = (new Query)->from($this->queueTable)->where(['status' => Email::STATUS_SENT])->count(); $gaveup = (new Query)->from($this->queueTable)->where(['status' => Email::STATUS_GAVEUP])->count(); $showPending = $this->ansiFormat($pending, Console::FG_YELLOW); $showSent = $this->ansiFormat($sent, Console::FG_GREEN); $showGaveup = $this->ansiFormat($gaveup, Console::FG_RED); $this->stdout(" pending | $showPending\n"); $this->stdout(" sent | $showSent\n"); $this->stdout(" stucked | $showGaveup\n"); $this->stdout("------------------------------\n\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function checkStatus()\n {\n $status = $this->autoTestController->checkStatus(Tools::getValue('queueItemId', 0));\n\n if ($status['finished']) {\n $this->autoTestController->stop(\n function () {\n return LoggerService::getInstance();\n }\n );\n }\n\n PacklinkPrestaShopUtility::dieJson($status);\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}", "public function process()\n\t{\n\n\t\tif(is_null($this->mailqueue_model)) {\n\t\t\tLog::info($this->header_vars . ' did not find mailqueue model');\n\t\t\treturn 'Mailqueue Model not found in Database';\n\t\t}\n\n\t\ttry {\n\t\tswitch ($this->action) {\n\t\t\tcase 'delivered':\n\t\t\t\t$this->mailqueue_model->hasBeenDelivered();\n\n\t\t\t\tbreak;\n\t\t\tcase 'opened':\n\n\t\t\t\t$this->mailqueue_model->hasBeenOpened();\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'complained':\n\t\t\t\t$this->mailqueue_model->complained();\n\t\t\t\tbreak;\n\n\t\t\tcase 'clicked':\n\t\t\t\t$this->mailqueue_model->clickedLink();\n\t\t\t\tbreak;\n\t\t\tcase 'bounced';\n\t\t\t\t$this->mailqueue_model->hardBounce();\n\n\t\t\tcase 'dropped';\n\t\t\t\tLog::info('dropped event');\n\t\t\t\t$this->mailqueue_model->dropped();\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\n\t\t\treturn true;\n\t\t} catch (\\Exception $e) {\n\t\t\tLog::error($e->getMessage() . ' ' . $e->getLine() . ' ' . $e->getFile());\n\t\t\treturn false;\n \t}\n\t}", "public function check_queue()\n {\n $lastStatus = \"terminated\";\n foreach($this->tasks as $task)\n {\n if( $task->get_status() == \"running\" )\n {\n $this->save();\n return $this;\n }elseif($task->get_status() == \"pending\"){\n $task->exec();\n $this->save();\n return $this;\n }\n }\n $this->save();\n return $this;\n }", "public function inactiveCheck()\n\t\t{\n\t\t\t$schedule = $this->getSchedule();\n\t\t\tif ($schedule->getAnalyzer()->getBalance() <= 0)\n\t\t\t{\n\t\t\t\t$as = $_SESSION['current_app']; // App Status can be grabbed from here\n\n\t\t\t\tif ($as->level1 == 'external_collections')\n\t\t\t\t{\n\t\t\t\t\tUpdate_Status(NULL, $this->getId(), array(\"recovered\",\"external_collections\",\"*root\"));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tUpdate_Status(NULL, $this->getId(), array(\"paid\",\"customer\",\"*root\"));\n\t\t\t\t}\n\n\t\t\t\t$this->Affiliations->expireAll();\n\t\t\t\t$schedule->removeScheduledTransactions();\n\t\t\t\t$schedule->save();\n\n\t\t\t\t$queue_manager = ECash::getFactory()->getQueueManager();\n\t\t\t\t$queue_item = new ECash_Queues_BasicQueueItem($this->getId());\n\t\t\t\t$queue_manager->getQueueGroup('automated')->remove($queue_item);\n\n\t\t\t\treturn TRUE;\n\t\t\t}\n\n\t\t\treturn FALSE;\n\n\t\t}", "public function queue_status(){\n\n\t\tif(!$this->input->_secured_input($error_status, array('error' => 'bool'))){\n\t\t\ttrigger_error('Error fetching error status.', E_USER_NOTICE);\n\t\t}\n\n\t\tif($error_status){\n\t\t\ttrigger_error('Error encounter by the client device.', E_USER_NOTICE);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif(!$this->input -> _secured_input($function, array('function' => 'string'))){\n\t\t\ttrigger_error('Error getting function.', E_USER_NOTICE);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif(!$this->_command_queue_check($this->device['id'])){\n\t\t\ttrigger_error('Stop command queued, we aren\\'t going to respond to requests for submission data until it is fetched.', E_USER_NOTICE);\n\n\t\t\tif($function == 'index_update'){\n\t\t\t\t$data = TRUE;\n\t\t\t}elseif($function == 'request'){\n\t\t\t\t$data['json'] = array(\"App\" => array(\"Configure\" => array(\"output\" => '')));\n\t\t\t}\n\n\t\t\t$this->_load_view('index');\n\t\t\tjson($data);\n\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif($function == 'index_update'){\n\t\t\ttrigger_error('Updating the index for `transmission_next`.', E_USER_NOTICE);\n\t\t\tif(!$this->input -> _secured_input($index, array('index' => 'int'))){\n\t\t\t\ttrigger_error('Error getting the index value.', E_USER_NOTICE);\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\tif(!$this->_update_queue_state($this->device['id'], $index)){\n\t\t\t\techo \"Error updating queue state.\\n\";\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$data['json'] = array('result' => 'true');\n\t\t}elseif($function == 'request'){\n\t\t\t // Is there a submission in progress?\n\t\t\tif(!$this->_history_check($this->device['id'])){\n\t\t\t\ttrigger_error('History Check failed for the device, we are now going to select a submission.', E_USER_NOTICE);\n\t\t\t\t // There is no submission in progress, are there any new submissions?\n\t\t\t\tif(!$this->_submission_select($this->device['id'])){\n\t\t\t\t\t // There are no new submissions, there is nothing for the device to transmit.\n\t\t\t\t\t // Return Nothing.\n\t\t\t\t\ttrigger_error('', E_USER_NOTICE);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttrigger_error('History Check succeded for the device, we are going to get the `revolving` value for the entry.', E_USER_NOTICE);\n\t\t\tif(!$this->_get_transmission_type($this->device['id'], $revolving)){\n\t\t\t\ttrigger_error('', E_USER_NOTICE);\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t // There is a submission in progress. Is have we transmitted (morse code) the entire submission?\n\t\t\tif(!$this->_index_check($this->device['id'], $revolving)){\n\t\t\t\ttrigger_error('Index Check failed for the entry in `transmission_next` so we are going to clear the entry.', E_USER_NOTICE);\n\t\t\t\t // We have transmitted (morse code) the entire submission, lets take care of adding it to the list of completed submissions, and clear the transmission_next table.\n\t\t\t\tif(!$this->_submission_complete($this->device['id'])){\n\t\t\t\t\ttrigger_error('', E_USER_NOTICE);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\ttrigger_error('The entry was cleared, lets select our next submission.', E_USER_NOTICE);\n\t\t\t\t // Now that we've taken care of the paperwork, are there any new submissions to transmit?\n\t\t\t\tif(!$this->_submission_select($this->device['id'])){\n\t\t\t\t\t // There are no new submissions, there is nothing for the device to transmit.\n\t\t\t\t\t // Return Nothing.\n\t\t\t\t\ttrigger_error('Nothing for the device to transmit, we are exiting.', E_USER_NOTICE);\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tunset($revolving);\n\t\t\ttrigger_error('Checking the transmission type one more time, in case it changed.', E_USER_NOTICE);\n\t\t\tif(!$this->_get_transmission_type($this->device['id'], $revolving)){\n\t\t\t\ttrigger_error('', E_USER_NOTICE);\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\tif(!$this->_get_queue_content($this->device['id'], $output, $revolving)){\n\t\t\t\ttrigger_error('Error getting queue content.', E_USER_NOTICE);\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$data['json'] = array(\"App\" => array(\"Configure\" => array(\"output\" => $output)));\n\t\t}else{\n\t\t\ttrigger_error('The definition of function was not anticipated. We are simply going to quietly exit.', E_USER_NOTICE);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$this->_load_view('index');\n\t\tjson($data);\n\t}", "function nbcs_moderation_queue_alerts_check_queue() {\n\t$options = get_option( 'nbcs-moderation-queue' );\n\t$options['email'] = nbcs_moderation_queue_check_email( $options['email'] );\n\t\n\tif ( false !== get_transient( 'nbcs-moderation-queue-delay' ) || false === $options['minimum'] || false === $options['frequency'] || empty( $options['email'] ) ) {\n\t\treturn; // Don't do anything if the settings have not been set\n\t}\n\n\t$comment_count = get_comment_count();\n\tif ( $comment_count['awaiting_moderation'] >= intval( $options['minimum'] ) ) {\n\t\tif ( intval( $options['frequency'] ) > 0 ) {\n\t\t\tset_transient( 'nbcs-moderation-queue-delay', true, 60 * intval( $options['frequency'] ) );\n\t\t}\n\n\t\t$blog_name = get_bloginfo( 'name' );\n\t\t$subject = sprintf( __( '%s Moderation Queue Alert', 'nbcs-moderation-queue' ), $blog_name );\n\t\t$message = sprintf( __( 'There are currently %d comments in the %s moderation queue.', 'nbcs-moderation-queue' ), $comment_count['awaiting_moderation'], $blog_name );\n\t\tif ( $options['frequency'] > 0 ) {\n\t\t\t$message .= sprintf( __( ' You will not receive another alert for %d minutes.', 'nbcs-moderation-queue' ), $options['frequency'] );\n\t\t}\n\t\t$message .= '</p><p><a href=\"' . site_url( '/wp-admin/edit-comments.php' ) . '\">' . __( 'Go to comments page', 'nbcs-moderation-queue' ) . '</a></p>';\n\t\t\n\t\t$headers = array( 'Content-Type: text/html' );\n\t\t\n\t\t$subject = apply_filters( 'nbcs-moderation-queue-subject', $subject, $comment_count['awaiting_moderation'] );\n\t\t$message = apply_filters( 'nbcs-moderation-queue-message', $message, $comment_count['awaiting_moderation'] );\n\t\t\n\t\twp_mail( $options['email'], $subject, $message, $headers );\n\t}\n}", "private function loadQueueStatus() {\n $this->queue_position = $this->core->getGradingQueue()->getQueueStatusAGV($this);\n }", "function user_active($user){\n global $ini;\n $MSGKEY = $ini[$user]['queue_id'];\n if (msg_queue_exists($MSGKEY)){\n $queue = msg_get_queue($MSGKEY); \n $queue_status = msg_stat_queue($queue);\n if((time() - $queue_status['msg_ctime']) <= 2)return TRUE;\n }\n return FALSE;\n}", "public function isQueued(): bool\n {\n $criteria = Criteria::create()\n ->where(\n new Comparison(\n 'status',\n Comparison::IN,\n array(\n File::FILE_IN_QUEUE\n )\n )\n );\n\n return count($this->files->matching($criteria)) > 0;\n }", "function process_mail_queue()\n\t{\n\t\t//-----------------------------------------\n\t\t// SET UP\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->vars['mail_queue_per_blob'] = isset($this->vars['mail_queue_per_blob']) ? $this->vars['mail_queue_per_blob'] : 5;\n\t\t\n\t\t$this->cache['systemvars']['mail_queue'] = isset( $this->cache['systemvars']['mail_queue'] ) ? intval( $this->cache['systemvars']['mail_queue'] ) : 0;\n\t\t\n\t\t$sent_ids = array();\n\t\t\n\t\tif ( $this->cache['systemvars']['mail_queue'] > 0 )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Require the emailer...\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\trequire_once( ROOT_PATH . 'sources/classes/class_email.php' );\n\t\t\t$emailer = new emailer(ROOT_PATH);\n\t\t\t$emailer->ipsclass =& $this;\n\t\t\t$emailer->email_init();\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Get the mail stuck in the queue\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->DB->simple_construct( array( 'select' => '*', 'from' => 'mail_queue', 'order' => 'mail_id', 'limit' => array( 0, $this->vars['mail_queue_per_blob'] ) ) );\n\t\t\t$this->DB->simple_exec();\n\t\t\t\n\t\t\twhile ( $r = $this->DB->fetch_row() )\n\t\t\t{\n\t\t\t\t$data[] = $r;\n\t\t\t\t$sent_ids[] = $r['mail_id'];\n\t\t\t}\n\t\t\t\n\t\t\tif ( count($sent_ids) )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Delete sent mails and update count\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$this->cache['systemvars']['mail_queue'] = $this->cache['systemvars']['mail_queue'] - count($sent_ids);\n\t\t\t\t\n\t\t\t\t$this->DB->simple_exec_query( array( 'delete' => 'mail_queue', 'where' => 'mail_id IN ('.implode(\",\", $sent_ids).')' ) );\n\t\t\t\n\t\t\t\tforeach( $data as $mail )\n\t\t\t\t{\n\t\t\t\t\tif ( $mail['mail_to'] and $mail['mail_subject'] and $mail['mail_content'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$emailer->to = $mail['mail_to'];\n\t\t\t\t\t\t$emailer->from = $mail['mail_from'] ? $mail['mail_from'] : $this->vars['email_out'];\n\t\t\t\t\t\t$emailer->subject = $mail['mail_subject'];\n\t\t\t\t\t\t$emailer->message = $mail['mail_content'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $mail['mail_html_on'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$emailer->html_email = 1;\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$emailer->html_email = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$emailer->send_mail();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// No mail after all?\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$this->cache['systemvars']['mail_queue'] = 0;\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Update cache with remaning email count\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->update_cache( array( 'array' => 1, 'name' => 'systemvars', 'donow' => 1, 'deletefirst' => 0 ) );\n\t\t}\n\t}", "private function _is_queue_empty() {\n\t\tglobal $wpdb;\n\t\t$wpdb->hide_errors();\n\t\t$sql = sprintf( 'SELECT COUNT(*) FROM %s', $wpdb->base_prefix . W3TC_CDN_TABLE_QUEUE );\n\t\t$result = $wpdb->get_var( $sql );\n\t\tif ( ( $error = $wpdb->last_error ) ) {\n\t\t\tif ( strpos( $error, \"doesn't exist\" ) !== false ) {\n\t\t\t\t$url = is_network_admin() ? network_admin_url( 'admin.php?page=w3tc_install' ) : admin_url( 'admin.php?page=w3tc_install' );\n\t\t\t\tthrow new \\Exception( sprintf(\n\t\t\t\t\t\t__( 'Encountered issue with CDN: %s. See %s for instructions of creating correct table.', 'w3-total-cache' ),\n\t\t\t\t\t\t$wpdb->last_error,\n\t\t\t\t\t\t'<a href=\"' . $url . '\">' . __( 'Install page', 'w3-total-cache' ) . '</a>' ) );\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new \\Exception( sprintf( __( 'Encountered issue with CDN: %s.', 'w3-total-cache' ), $wpdb->last_error ) );\n\t\t}\n\t\treturn $result == 0;\n\t}", "public static function rac_change_cart_list_mailstatus() {\n check_ajax_referer('mailstatus-cartlist', 'rac_security');\n\n if (isset($_POST['row_id']) && isset($_POST['status'])) {\n $status = $_POST['status'];\n update_post_meta($_POST['row_id'], 'rac_cart_sending_status', $status);\n echo '1';\n }\n exit();\n }", "public function CheckPMTAStatus()\n {\n if (!file_exists($this->StatsDir)) {\n $this->ALERTS[] = FAIL.\" pmtaQueues.xml is missing!\";\n return false;\n } else {\n $status = file_get_contents($this->StatsDir);\n if (stristr($status, 'NOT RUNNING')) {\n $this->ALERTS[] = FAIL.\" PMTA is off!\";\n return false;\n }\n }\n return true;\n }", "private function isThereWorkToBeDone()\r\n {\r\n if($this->dbCon->count($this->dbTableName, [\"isDelivered\" => 0]) < 1)\r\n {\r\n generic::successEncDisplay(\"There is no email for posting\");\r\n\r\n // add the return to follow the PHP principles and manual, however, it will terminate from the above!\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "public function emailQueue() {\n\t\t$this->EmailQueue->processQueue(); exit;\n\t}", "private function check()\n {\n foreach ($this->scheduler->getQueuedJobs() as $job) {\n if ($job->isDue(new DateTime()) === true) {\n\n $this->executeIfNotOverlapped($job);\n }\n }\n }", "private function manageStatus()\n {\n $this->updateStatus();\n $this->checkStatus();\n }", "public function isQueued()\n {\n return $this->instance->isQueued();\n }", "function check(){\n\techo \"Looking for jobs and adding to queue\\n\";\n\t\n\t$times = date('d-M-Y');\n\tif(DEBUG) $qlog = new snowytech\\stphplogger\\logWriter('../logs/check-queue-' . $times . '.txt');\n\t$check = new snowytech\\stphpschedule\\schedule();\n\t//Goes through whole Jobs table and checks interval!\t\n\t$db = db::getInstance();\n\t$sql = \"SELECT * FROM JOBS\";\n\t$stmt = $db->getData($sql);\n\n\t//Count the rows and send console message there are no jobs configured.\n\tif ( count($stmt) > 0) {\n\t\tforeach($stmt as $row){\n\t\t\t$id = $row['id'];\n\t\t\t$job_name = $row['name'];\n\t\t\t$path = $row['path'];\n\t\t\t$in_queue = $row['status_int'];\n\t\t\t$lastrun = $row['last_run'];\n\t\t\t$interval = $row['interval'];\n\t\t\t$global_hold = $row['global_hold'];\n\t\t\t\n\t\t\t$r = $check->interval($lastrun, $interval);\n\t\t\t\n\t\t\t//Dont run if global hold is set to 1\n\t\t\tif($global_hold !=1){\n\t\t\t\t//Dont run if $in_queue = 0 ( already in queue )\n\t\t\t\tif($in_queue != 0){\n\t\t\t\t\tif( $r ) {\n\t\t\t\t\t\techo \"Job hit the queue: \" . $job_name . \"\\n\";\n\t\t\t\t\t\t$count = time();\n\t\t\t\t\t\techo $count . \"\\n\";\n\t\t\t\t\t\tif(DEBUG) $qlog->info('Job hit the queue: ' . $job_name . \" : time: \" . $count);\n\t\t\t\t\t\t \n\t\t\t\t\t\t//Now last update is updating in table. Need to add an entry to the QUE and update last run from there.\t\t\t\t\n\t\t\t\t\t\t$data = array(':jid' => $id, ':path' => $path, ':hold' => '1', ':time' => $count);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add into QUEUE\n\t\t\t\t\t\t$sql= 'INSERT INTO QUEUE (job_id, path, hold, in_que_time) VALUES (:jid,:path,:hold,:time)';\n\t\t\t\t\t\t$db->execQuery($sql, $data);\n\n\t\t\t\t\t\t//update status_int, prevents multiple entries into queue\n\t\t\t\t\t\t$sql= \"UPDATE JOBS SET status_int = 0 WHERE id = '$id'\";\n\t\t\t\t\t\t$db->updateData($sql);\n\t\t\t\t\t}else{ \n\t\t\t\t\t\techo \"NOT ready to run - \" . $job_name . \"\\n\"; \n\t\t\t\t\t\t//Log that its intervnal is not ready\n\t\t\t\t\t\tif(DEBUG) $qlog->info('NOT RUN - interval is ' . $interval . \" minutes on JOB: \" . $job_name . \"\\n\");\n\t\t\t\t\t}\n\t\t\t\t} else { \n\t\t\t\t\techo \"JOB \" . $job_name . \" - already in QUEUE!\\n\"; \n\t\t\t\t\tif(DEBUG) $qlog->info('JOB ' . $job_name . \" - already in QUEUE!\");\n\t\t\t\t}\n\t\t\t} else { \n\t\t\t\techo \"JOB \" . $job_name . \" is HELD globally!\\n\";\n\t\t\t\tif(DEBUG) $qlog->info(\"JOB \" . $job_name . \" is HELD globally!\\n\");\n\t\t\t}\n\t\t}\n\t} else { echo \"There are no JOBS configured!\"; }\n\t$db->closeDB();\n}", "function edd_pup_check_queue( $email_id = null ) {\r\n\r\n\tif ( ! empty( $email_id ) ){\r\n\t\tglobal $wpdb;\r\n\r\n\t\t$query =\r\n\t\t\"SELECT\r\n\t\t COUNT(*) total,\r\n\t\t SUM(case when sent = 0 then 1 else 0 end) queue,\r\n\t\t SUM(case when sent = 1 then 1 else 0 end) sent,\r\n\t\t MAX(sent_date) date\r\n\t\t FROM $wpdb->edd_pup_queue\r\n\t\t WHERE email_id = $email_id\";\r\n\r\n\t\t$totals = $wpdb->get_results( $query, ARRAY_A );\r\n\r\n\t\treturn $totals[0];\r\n\r\n\t} else {\r\n\r\n\treturn false;\r\n\r\n\t}\r\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 updateSubmissionStatus() {\n\n $updateStatus = Usersubmissionstatus::where('user_id', Auth::user()->id)\n ->where('quarter_id', Quarter::getRunningQuarter()->id)\n ->update(['status_id' => config('constant.status.L1_APPROVAL_PENDING')]);\n // Let's notify user and L1 about user submission status.\n return $this->sendMail(config('constant.email_status.INFORM_APPRAISEE'));\n }", "public function MailboxStatus($mailbox, $actionId);", "public function get_queued_status() {\n\t\treturn '';\n\t}", "public function checkQuickReplyStatus() {\n global $fid, $forum, $forumpermissions, $mybb, $thread;\n \n if ($forumpermissions['canpostreplys'] != 0 \n && $mybb->user['suspendposting'] != 1 \n && ($thread['closed'] != 1 || is_moderator($fid)) \n && $mybb->settings['quickreply'] != 0 \n && $mybb->user['showquickreply'] != '0' \n && $forum['open'] != 0\n ) {\n self::$quick_reply_status = true;\n }\n }", "protected function isUsingQueue(): bool\n {\n // It impossible to get either the email is sent out straight away\n // when the mailer is only push to queue, in this case we should\n // assume that sending is successful when using queue.\n\n $queue = false;\n $driver = 'mail';\n\n if ($this->memory instanceof Provider) {\n $queue = $this->memory->get('email.queue', false);\n $driver = $this->memory->get('email.driver');\n }\n\n return $queue || \\in_array($driver, ['mailgun', 'log']);\n }", "public function checkScheduledTasks() {\n if (count($this->defaultTasks)) {\n $now = DBDatetime::now()->Format(DBDatetime::ISO_DATETIME);\n\n foreach ($this->defaultTasks as $task => $method) {\n $state = SqsQueueState::get()->filter('Title', $task)->first();\n\n $new = false;\n if (!$state) {\n $state = SqsQueueState::create(array(\n 'Title' => $task\n ));\n $new = true;\n $state->write();\n }\n\n // let's see if the dates are okay.\n $lastQueueRun = strtotime($state->WorkerRun);\n $lastScheduleRun = strtotime($state->LastScheduledStart);\n $lastAdded = strtotime($state->LastAddedScheduleJob);\n\n $a = $state->WorkerRun;\n $b = $state->LastScheduledStart;\n\n // if the last time it was added is more than 10 minutes ago, AND\n // the last run is more than 10 minutes since it was last started OR it's new OR it was last run more than 15 minutes ago\n if ((time() - $lastAdded > 600) && ((($lastQueueRun - $lastScheduleRun) > 600) || $new || (time() - $lastQueueRun > 900))) {\n $state->LastAddedScheduleJob = $now;\n $state->write();\n $this->sendSqsMessage($task, $method);\n }\n }\n }\n }", "public function isPending()\r\n {\r\n return $this->status >= 0 && $this->status < 100;\r\n }", "protected function _balanceQueues(){\n// $this->RUNNING = false;\n }", "function health_check()\n {\n $zombies = $this->scheduled_task_model->get_zombies();\n\n if ( $zombies )\n {\n foreach ( $zombies as $zombie )\n {\n $data = array(\n 'type' => config( 'emergency_types' )->scheduled_task,\n 'info' => \"Task: \". $zombie->name,\n 'message' => \"Scheduled task has been running for too long. Check the server \".\n \"and cron log for any errors. It's been moved to active for now.\" );\n\n log_message(\n 'error',\n \"Health Check Failed: \". print_r( $data, TRUE ) );\n\n $data = array(\n 'state' => 'active' );\n\n $this->scheduled_task_model->save( $data, $zombie->id );\n }\n }\n\n return TRUE;\n }", "public function isPending(): bool;", "function exec_queue()\n\t{\n\t\t$vbulletin =& $this->registry;\n\n\t\tif ($vbulletin->options['usemailqueue'] == 2)\n\t\t{\n\t\t\t// Lock mailqueue table so that only one process can\n\t\t\t// send a batch of emails and then delete them\n\t\t\t$vbulletin->db->lock_tables(array('mailqueue' => 'WRITE'));\n\t\t}\n\n\t\t$emails = $vbulletin->db->query_read(\"\n\t\t\tSELECT *\n\t\t\tFROM \" . TABLE_PREFIX . \"mailqueue\n\t\t\tORDER BY mailqueueid\n\t\t\tLIMIT \" . intval($vbulletin->options['emailsendnum'])\n\t\t);\n\n\t\t$mailqueueids = '';\n\t\t$newmail = 0;\n\t\t$emailarray = array();\n\t\twhile ($email = $vbulletin->db->fetch_array($emails))\n\t\t{\n\t\t\t// count up number of mails about to send\n\t\t\t$mailqueueids .= ',' . $email['mailqueueid'];\n\t\t\t$newmail++;\n\t\t\t$emailarray[] = $email;\n\t\t}\n\t\tif (!empty($mailqueueids))\n\t\t{\n\t\t\t// remove mails from queue - to stop duplicates being sent\n\t\t\t$vbulletin->db->query_write(\"\n\t\t\t\tDELETE FROM \" . TABLE_PREFIX . \"mailqueue\n\t\t\t\tWHERE mailqueueid IN (0 $mailqueueids)\n\t\t\t\");\n\n\t\t\tif ($vbulletin->options['usemailqueue'] == 2)\n\t\t\t{\n\t\t\t\t$vbulletin->db->unlock_tables();\n\t\t\t}\n\n\t\t\tif ($vbulletin->options['use_smtp'])\n\t\t\t{\n\t\t\t\t$prototype =& new vB_SmtpMail($vbulletin);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$prototype =& new vB_Mail($vbulletin);\n\t\t\t}\n\n\t\t\tforeach ($emailarray AS $index => $email)\n\t\t\t{\n\t\t\t\t// send those mails\n\t\t\t\t$mail = (phpversion() < '5' ? $prototype : clone($prototype)); // avoid ctor overhead\n\t\t\t\t$mail->quick_set($email['toemail'], $email['subject'], $email['message'], $email['header'], $email['fromemail']);\n\t\t\t\t$mail->send();\n\t\t\t}\n\n\t\t\t$newmail = 'data - ' . intval($newmail);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($vbulletin->options['usemailqueue'] == 2)\n\t\t\t{\n\t\t\t\t$vbulletin->db->unlock_tables();\n\t\t\t}\n\n\t\t\t$newmail = 0;\n\t\t}\n\n\t\t// update number of mails remaining\n\t\t$vbulletin->db->query_write(\"\n\t\t\tUPDATE \" . TABLE_PREFIX . \"datastore SET\n\t\t\t\tdata = \" . $newmail . \",\n\t\t\t\tdata = IF(data < 0, 0, data)\n\t\t\tWHERE title = 'mailqueue'\n\t\t\");\n\n\t\t// if we're using a alternate datastore, we need to give it an integer value\n\t\t// this may not be atomic\n\t\tif (method_exists($vbulletin->datastore, 'build'))\n\t\t{\n\t\t\t$mailqueue_db = $vbulletin->db->query_first(\"\n\t\t\t\tSELECT data\n\t\t\t\tFROM \" . TABLE_PREFIX . \"datastore\n\t\t\t\tWHERE title = 'mailqueue'\n\t\t\t\");\n\t\t\t$vbulletin->datastore->build('mailqueue', intval($mailqueue_db['data']));\n\t\t}\n\t}", "function statusMessagesOn()\n\t{\n\t\t$this->bStatusMessages = true;\n\t}", "public function isQueued() {\n if ($this->queue_position === null) {\n $this->loadQueueStatus();\n }\n return $this->queue_position > GradingQueue::GRADING;\n }", "protected function checkOrderStatus()\n {\n $orderItem = $this->getOrderItemObjectByIdOrUuid($this->getRequestParameter('order_item_id'));\n \n if ($orderItem->getStatusId() != OrderStatusPeer::STATUS_PENDING) {\n $this->redirect('@order_checkoutFinished');\n }\n }", "public function queue($validate = true, $queueEvenCompleted = false)\n {\n $currentStatus = $this->getStatus();\n\n if($currentStatus == self::STATUS_WAITING) {\n return false;\n }\n if($currentStatus == self::STATUS_RUNNING) {\n return false;\n }\n if($currentStatus == self::STATUS_COMPLETE) {\n if(!$queueEvenCompleted) return false;\n }\n\n if (Event::fire(Event::JOB_QUEUE, $this) === false) {\n return false;\n }\n\n if($validate && !$this->ensureUniqueness(false)) return false;\n\n if($currentStatus != self::STATUS_DELAYED) {\n $this->redis->hdel(self::redisKey($this), ['override_status']);\n }\n\n if(stripos($this->queue, \"@\") === false)\n $this->redis->sadd(Queue::redisKey(), $this->queue);\n\n $status = $this->redis->lpush(Queue::redisKey($this->queue), $this->payload);\n\n if ($status < 1) {\n return false;\n }\n\n $this->setStatus(self::STATUS_WAITING);\n\n if($currentStatus == self::STATUS_CANCELLED) {\n $this->redis->zrem(Queue::redisKey($this->queue, 'cancelled'), $this->payload);\n } else if ($currentStatus == self::STATUS_FAILED) {\n $this->redis->zrem(Queue::redisKey($this->queue, 'failed'), $this->payload);\n } else if ($currentStatus == self::STATUS_COMPLETE) {\n $this->redis->zrem(Queue::redisKey($this->queue, 'processed'), $this->payload);\n }\n\n Stats::incr('queued', 1);\n Stats::incr('queued', 1, Queue::redisKey($this->queue, 'stats'));\n Event::fire(Event::JOB_QUEUED, $this);\n\n return true;\n }", "protected function PollJobs() {\n\n\t\tforeach($this->_running_queue as $i=>$rjob) {\n\t\t\techo (\"Index is $i<br/>\");\n\t\t\t//job finished?\n\t\t\t$status = $this->JobPollAsync($rjob);\n\t\t\tif ($status === false) {\n\t\t\t\t$this->LogEntry(\"Status is false for job $i and slots are \" . $this->_slots .\"<br/>\");\n\t\t\t\tunset($this->_running_queue[$i]);\n\t\t\t\t$this->_finished_count++;\n\t\t\t\tif (count($this->_waiting_queue)) {\n\t\t\t\t\t$this->LogEntry(\"Adding a job because finish count is \" . $this->_finished_count . \" and job count is \" . $this->_job_count . \" so slot count becomes \" . $this->_slots +1 . \"<br/>\");\n\t\t\t\t\t$this->_slots++;\n\t\t\t\t} else {\n\t\t\t\t\t$this->LogEntry(\"Finish count is ! < job count and slots are \" . $this->_slots. \"<br/>\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->LogEntry(\"Status of job $i is $status\\n\");\n\t\t\t}\n\t\t}\n\t}", "public function execute()\n {\n trigger_error(\n 'will be removed in TYPO3 v12.0. Use AnalyzeBounceMailCommand instead.',\n E_USER_DEPRECATED\n );\n // try connect to mail server\n $mailServer = $this->connectMailServer();\n if ($mailServer instanceof Server) {\n // we are connected to mail server\n // get unread mails\n $messages = $mailServer->search('UNSEEN', $this->maxProcessed);\n /** @var Message $message The message object */\n foreach ($messages as $message) {\n // process the mail\n if ($this->processBounceMail($message)) {\n // set delete\n $message->delete();\n } else {\n $message->setFlag('SEEN');\n }\n }\n\n // expunge to delete permanently\n $mailServer->expunge();\n imap_close($mailServer->getImapStream());\n return true;\n }\n return false;\n }", "public function isProjectStatusCompleted ($projectId){\n $email_deactivate = $this->getProjectSetting(\"email-deactivate\",$projectId);\n $project = new \\Project($projectId);\n #If project completed and there are active alerts\n if($project->project['completed_time'] != \"\" && in_array('0', $email_deactivate, 0)){\n foreach ($email_deactivate as $index=>$deamil){\n $email_deactivate[$index] = \"1\";\n #Deactivate queued alerts\n $email_queue = $this->getProjectSetting('email-queue',$projectId);\n if(!empty($email_queue)){\n $scheduled_records_changed = \"\";\n $queue = $email_queue;\n foreach ($email_queue as $id=>$email){\n if($email['project_id'] == $projectId && $email['alert']==$index){\n $queue[$id]['deactivated'] = 1;\n $scheduled_records_changed .= $email['record'].\",\";\n }\n }\n $this->setProjectSetting('email-queue', $queue, $projectId);\n\n #Add logs\n $action_description = \"Deactivated Scheduled Alert \".$index;\n $changes_made = \"Record IDs deactivated: \".rtrim($scheduled_records_changed,\",\");\n \\REDCap::logEvent($action_description,$changes_made,null,null,null,$projectId);\n }\n }\n $this->setProjectSetting('email-deactivate', $email_deactivate,$projectId);\n $this->log(\"scheduledemails PID: \" . $projectId . \" - Project Completed. All alerts have been deactivated\");\n\n return true;\n }\n return false;\n }", "private function status()\n {\n $this->botman->hears('status', function(BotMan $bot) {\n\n $status = 'subscribed';\n $user = Subscriber::where('telegram_user_id', $bot->getUser()->getId())->first();\n\n if(is_null($user))\n {\n $status = 'unsubscribed';\n }\n\n $bot->reply('status: '. $status);\n });\n }", "protected function isNotQueued()\n {\n if (! isset($this->memory)) {\n return true;\n }\n\n return (! $this->memory->get('email.queue', false));\n }", "public function flushNotificationQueue() {\r\n\t\t// Logfile entries\r\n\t\tforeach ($this->notificationQueue as $key => $message) {\r\n\t\t\t// Log the message\r\n\t\t\t$this->log($message);\r\n\t\t}\r\n\t\t$sendNotifications = Configure::read('Alert.send');\r\n\t\tif (!$sendNotifications) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// Email notifications\r\n\t\tforeach ($this->notificationQueue as $key => $message) {\r\n\r\n\t\t\t$this->sendAlertEmail($message);\r\n\r\n\r\n\t\t\t// Limit the amount of messages we're going to send out in a period of time...\r\n\t\t\t// 1/4 of a second is enough here.\r\n\t\t\tusleep(250000);\r\n\t\t}\r\n\r\n\t\t// Pushover Notifications\r\n\t\tforeach ($this->notificationQueue as $key => $message) {\r\n\t\t\t// Send out notifications through Pushover\r\n\r\n\t\t\t$this->sendPushoverAlert($message);\r\n\r\n\t\t\t// Limit the amount of messages we're going to send out in a period of time...\r\n\t\t\t// We don't want to get ourselves banned from Pushover...\r\n\t\t\t// 1/4 of a second should suffice\r\n\t\t\tusleep(250000);\r\n\t\t}\r\n\r\n\r\n\t}", "private function checkStatus()\n {\n $res = $this->parseBoolean(\n json_encode($this->getStatus()[\"timed_out\"])\n );\n\n if ($this->getStatus() == null)\n $this->setOnline(false);\n else if ($res)\n $this->setOnline(false);\n else\n $this->setOnline(true);\n }", "public function hasQueueExpired($queue,$index,$projectId){\n $cron_queue_expiration_date = $this->getProjectSetting(\n 'cron-queue-expiration-date',\n $projectId\n )[$queue['alert']];\n $cron_queue_expiration_date_field = htmlspecialchars_decode(\n $this->getProjectSetting('cron-queue-expiration-date-field',$projectId)[$queue['alert']]\n );\n $cron_repeat_for = $this->getProjectSetting('cron-repeat-for',$projectId)[$queue['alert']];\n\n #If the repeat is 0 we delete regardless of the expiration option\n if(($cron_repeat_for == \"\" || $cron_repeat_for == \"0\") && $queue['last_sent'] != \"\"){\n $this->log(\n \"scheduledemails PID: \" .\n $projectId .\n \" - Alert # \".\n $queue['alert'].\n \" Queue #\".\n $index.\n \" expired. Delete.\",\n ['scheduledemails' => 1]\n );\n $this->deleteQueuedEmail($index, $projectId);\n return true;\n }\n\n if($cron_queue_expiration_date_field != \"\" && $cron_queue_expiration_date != '' && $cron_queue_expiration_date != 'never') {\n $evaluateLogic = \\REDCap::evaluateLogic(\n $cron_queue_expiration_date_field,\n $projectId,\n $queue['record'],\n $queue['event_id']\n );\n if ($queue['isRepeatInstrument']) {\n $evaluateLogic = \\REDCap::evaluateLogic(\n $cron_queue_expiration_date_field,\n $projectId,\n $queue['record'],\n $queue['event_id'],\n $queue['instance'],\n $queue['instrument']\n );\n }\n\n if ($cron_queue_expiration_date == 'date' && $cron_queue_expiration_date_field != \"\") {\n if (strtotime($cron_queue_expiration_date_field) <= strtotime(date('Y-m-d'))) {\n $this->log(\n \"scheduledemails PID: \" .\n $projectId .\n \" - Alert # \".\n $queue['alert'].\n \" Queue #\".\n $index.\n \" expired date. Delete.\",\n ['scheduledemails' => 1]\n );\n $this->deleteQueuedEmail($index, $projectId);\n return true;\n }\n }else if ($cron_queue_expiration_date == 'cond' && $cron_queue_expiration_date_field != \"\") {\n if ($evaluateLogic) {\n $this->log(\n \"scheduledemails PID: \" .\n $projectId .\n \" - Alert # \".\n $queue['alert'].\n \" Queue #\".\n $index.\n \" expired condition. Delete.\",\n ['scheduledemails' => 1]\n );\n $this->deleteQueuedEmail($index, $projectId);\n return true;\n }\n }\n }else if($cron_queue_expiration_date == 'never'){\n return false;\n }\n return false;\n }", "public function isPending(): bool\n {\n return $this->status == 'pending';\n }", "public function isReady()\n {\n return $this->status === 'message_ok';\n }", "public function ReconcileQueues()\n {\n $xml = file_get_contents($this->StatsDir);\n $XML = simplexml_load_string($xml);\n foreach ($XML->data->queue as $i => $q) {\n $NAME = (string) $q->name[0];\n list($DOMAIN, $VMTA) = explode('/', $NAME);\n $LONGIP = ip2long(trim($VMTA));\n if (isset($this->TDOMS[$DOMAIN]) && ($DOMAIN!=='*') && ($VMTA!=='*'))\n if (!isset($this->PoolIPs[$LONGIP]))\n $this->ALERTS[] = FAIL.\" No Queued Jobs for \".$DOMAIN.' on VMTA: '.$VMTA.WHT;\n else {\n $POOL = $this->PoolIPs[$LONGIP];\n $TARGET = $this->TDOMS[$DOMAIN];\n $SIZE = (string) $q->rcp[0];\n $MODE = (string) $q->mode[0];\n $PAUSED = (string) $q->paused[0];\n $RETRY = empty($q->retryTime)?'00:00:00':(string) $q->retryTime[0];\n $ER = [];\n foreach ($q->event as $event)\n $ER[] = (string) $event->text[0];\n if ($SIZE >= $this->Low) \n unset($this->Pools[$POOL]['ips'][$LONGIP][$TARGET]);\n }\n }\n if (empty($this->Pools)) {\n $this->ALERTS[] = FAIL.\" No low Queues Found\";\n return false;\n }\n return $this->CompileJobs();\n }", "public function isPending()\n {\n if ($this->status == 0) {\n return true;\n } else {\n return false;\n }\n }", "public function checkStatus()\n {\n echo 'All Branch of Bank is Opened at 9:30 AM<br>';\n }", "public function process()\r\n {\r\n $success = true;\r\n\r\n $items = Queue::find()\r\n ->where(['and', ['sent_time' => null], ['<', 'attempts', $this->maxAttempts]])\r\n ->orderBy(['created_at' => SORT_ASC])\r\n ->limit($this->mailsPerRound)\r\n ->all();\r\n\r\n if (!empty($items)) {\r\n $attributes = ['attempts', 'last_attempt_time'];\r\n foreach ($items as $item) {\r\n try{\r\n /** @var \\app\\models\\Queue $item */\r\n if ($message = $item->toMessage()) {\r\n if ($this->sendMessage($message)) {\r\n $item->delete();\r\n } else {\r\n throw new Exception('An error occurred while sending the message');\r\n }\r\n }\r\n } catch (Exception $e) {\r\n $success = false;\r\n $item->attempts++;\r\n $item->last_attempt_time = new Expression('NOW()');\r\n $item->updateAttributes($attributes);\r\n }\r\n }\r\n }\r\n\r\n return $success;\r\n }", "protected static function getQueueStatus()\n {\n $result = [];\n\n try {\n $repository = RepositoryRegistry::getQueueItemRepository();\n\n $query = new QueryFilter();\n $query->where('status', Operators::NOT_EQUALS, QueueItem::COMPLETED);\n\n $result = $repository->select($query);\n } catch (RepositoryNotRegisteredException $e) {\n } catch (QueryFilterInvalidParamException $e) {\n } catch (RepositoryClassException $e) {\n }\n\n return static::formatJsonOutput($result);\n }", "function countPending() {\n return IncomingMails::count(array('state > 0'));\n }", "public function check() {\n\t\t$where = array(\n\t\t\t[\"recipient\", \"==\", $this->activeUser],\n\t\t);\n\n\t\t$results = $this->db->select($where);\n\t\t$senders = array();\n\n\t\tif (empty($results)) Common::send(\"notice\", \"No new messages\");\n\n\t\tforeach ($results as $message) {\n\t\t\t$sender = $message[\"sender\"];\n\t\t\t$unread = $message[\"unread\"];\n\t\t\t$senders[$sender] = isset($senders[$sender]) ? $senders[$sender] + $unread : 0;\n\t\t}\n\n\t\t//Prepare the return data.\n\t\tCommon::send(\"success\", $senders);\n\t}", "public function hasPendingActions()\r\n {\r\n }", "public function isQmail()\n {\n }", "public function status(){\n\t\t$pidForm = sprintf(\"%7s\",$this->pid);\n\t\t$command = QSTAT.' -u '.$this->username.' | grep \"^'.$pidForm.'\"';\n\t\texec($command,$op);\n\n\t\tif (!isset($op[0]))return false;\n\t\telse return true;\n\t}", "protected function checkPendingBill()\n {\n // $pendingIds = [];\n // foreach ($pendingStatusIDs as $one) {\n // $pendingIds[] = $one->id;\n // }\n // $this->billing = \\OlaHub\\UserPortal\\Models\\UserBill::where('temp_cart_id', $this->cart->id)->where('country_id', $this->cart->country_id)->where('pay_for', 0)->whereIn('pay_status', $pendingIds)->first();\n \\OlaHub\\UserPortal\\Models\\UserBill::where('temp_cart_id', $this->cart->id)->where('user_id', app('session')->get('tempID'))->delete();\n }", "public function queueManagement(int $mid){\n\t\t// \n\t\t// A queue number is added in mailbox table for getting the last queue number of the user, the queue number should not be used for sent folder because they are the emails which are send by us not came from them.\n\t\t// \n\t\t// Initially the folder should take the emails in send but when the project starts the send emails are not necessarily be taken from the email box of gmail etc or it can be taken into consideration but they will create a confustion as, to whom the reply will be associated.\n\t}", "public function _transaction_status_check()\n {\n if (!$this->_transaction_in_progress) {\n return;\n }\n $this->rollback();\n }", "public function isInstallQueueEmpty() {}", "public function check() {\n $now = time();\n\n $count = $this->db->count_records_select('forum_posts', '\n mailed = 0 AND\n ((mailnow = 1 AND created < ?) OR (mailnow = 0 AND created < ?))\n ', [\n $now - $this->timepadding,\n $now - $this->timepadding - $this->editdelay,\n ]);\n\n return $count > 0;\n }", "public function isWaiting();", "public function valid()\n {\n return count($this->result_queue) !== 0;\n }", "public function isDone(): bool\n {\n $criteria = Criteria::create()\n ->where(\n new Comparison(\n 'status',\n Comparison::IN,\n array(\n File::FILE_NEW,\n File::FILE_IN_QUEUE\n )\n )\n );\n\n return count($this->files->matching($criteria)) === 0;\n }", "protected function in_progress() {\n\t\treturn 'in_progress' === get_option( 'ratesync_sync_status' );\n\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 updateQueue()\n {\n $count = Sales::shouldBeVisible()->count();\n if($count) {\n DB::beginTransaction();\n\n try {\n Sales::shouldBeVisible()->update(['is_visible' => 1]);\n $this->alertUsers();\n\n return $this->commitReturn(true);\n } catch(\\Exception $e) {\n $this->setError('error', $e->getMessage());\n }\n return $this->rollbackReturn(false);\n }\n }", "public function getStats() {\n if ( empty($this->_queue) ) {\n return false;\n }\n return msg_stat_queue($this->_queue);\n }", "public function status() {\n\t\t$output = array(\n\t\t\tarray('CURRENT', ''),\n\t\t array('Queue', 'Size'),\n\t\t array('----', '---'),\n\t\t);\n\n\t\tforeach($this->queues as $queue) {\n\t\t $output[] = array( $queue, ResqueProxy::size( $queue ) );\n\t\t}\n\n\t\t$output[] = array( 'failed', ResqueProxy::redis()->llen('failed') );\n\n\n\t\t$output[] = array('----', '---');\n\t\t$output[] = array('TOTALS', '');\n\t\t$output[] = array( 'processed', ResqueProxy::redis()->get('resque:stat:processed') );\n\t\t$output[] = array( 'failed', ResqueProxy::redis()->get('resque:stat:failed') );\n\n\t\t$this->columns($output);\n\t}", "public function isPending()\n {\n return true;\n }", "public function isCompleted()\r\n {\r\n return $this->status >= 100 || $this->status == 2;\r\n }", "function form_action()\r\n {\r\n $success = true ;\r\n\r\n $sdifqueue = new SDIFResultsQueue() ;\r\n $cnt = $sdifqueue->ProcessQueue() ;\r\n\r\n $c = container() ;\r\n $msgs = $sdifqueue->get_status_message() ;\r\n\r\n foreach ($msgs as $msg)\r\n $c->add(html_div(sprintf('ft-%s-msg', $msg['severity']), $msg['msg'])) ;\r\n $c->add(html_div('ft-note-msg',\r\n sprintf(\"%d record%s processed from SDIF Queue.\",\r\n $cnt, $cnt == 1 ? \"\" : \"s\"))) ;\r\n\r\n $this->set_action_message($c) ;\r\n\r\n unset($sdifqueue) ;\r\n\r\n return $success ;\r\n }", "private function isPendingInFlow($status){\r\n return $status == 1;\r\n }", "public function isSent(): bool\n {\n return $this->status === static::STATUS_QUEUED || $this->status === static::STATUS_COMPLETE;\n }", "public static function OrderProcessHasBeenMarkedAsCompleted()\n {\n return array_key_exists(self::SESSION_KEY_NAME_ORDER_SUCCESS, $_SESSION) && true == $_SESSION[self::SESSION_KEY_NAME_ORDER_SUCCESS];\n }", "function edd_pup_is_ajax_restart( $emailid = null ) {\n\n\tif ( empty( $emailid ) ) {\n\t\treturn;\n\t}\n\n\t$queue = edd_pup_check_queue( $emailid );\n\n\tif ( $queue['queue'] > 0 ) {\n\t\treturn $queue;\n\t} else {\n\t\treturn false;\n\t}\n}", "function check_mailbox ($domain)\n{\n $limit = get_domain_properties ($domain);\n if ($limit['mailboxes'] >= 0)\n {\n if ($limit['mailbox_count'] >= $limit['mailboxes'])\n {\n return false;\n }\n }\n return true;\n}", "public function hasQueueingCookie(): bool;", "public function getIncomingMailServerActiveStatus() {\n\t\treturn $this->ic_mail_server_active;\n\t}", "function edd_pup_is_processing( $emailid = null ) {\r\n\tif ( empty( $emailid ) ) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t$email_list = edd_pup_emails_processing();\r\n\r\n\tif ( is_array( $email_list['processing'] ) && in_array( $emailid, $email_list['processing'] ) ) {\r\n\r\n\t\t$totals = edd_pup_check_queue( $emailid );\r\n\r\n\t\tif ( $totals['queue'] > 0 ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t} else {\r\n\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n}", "function run_activity_completed_pos()\n\t\t{\n\t\t\t//this will send an email only if the configuration says to do so\n\t\t\tif (!($this->bo_agent->send_completed()))\n\t\t\t{\n\t\t\t\t$this->error[] = lang('Smtp Agent has detected some errors when sending email after completion of the activity');\n\t\t\t\t$ok = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$ok = true;\n\t\t\t}\n\t\t\t$this->error[] = $this->bo_agent->get_error();\n\t\t\tif ($this->bo_agent->debugmode) echo '<br />COMPLETED: Mail agent in DEBUG mode:'.implode('<br />',$this->error);\n\t\t\treturn $ok;\n\t\t}", "function mailqueue_cleanup() {\nglobal $db, $jconf;\n\n\t$date_month_ago = date(\"Y-m-d H:i:s\", strtotime(' -1 month'));\n\t$date_year_ago = date(\"Y-m-d H:i:s\", strtotime(' -1 year'));\n\n\t$query = \"\n\t\tDELETE FROM\n\t\t\tmailqueue\n\t\tWHERE\n\t\t\t( status = 'sent' AND timestamp < '\" . $date_month_ago . \"' ) OR\n timestamp < '\" . $date_year_ago . \"'\";\n \n\ttry {\n\t\t$rs = $db->Execute($query);\n\t} catch (exception $err) {\n\t\t$debug->log($jconf['log_dir'], $jconf['jobid_maintenance'] . \".log\", \"[ERROR] SQL query failed. Query:\\n\\n\" . trim($query), $sendmail = true);\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "private function isPendingInStore($orderStatus){\r\n return $orderStatus == 'pending';\r\n }", "public function QueueStatus($actionId);", "public function check_connection() {\n return $this->dbmail->is_connected();\n }", "public function checkQueuedEditsAction()\n {\n $reqIds = $this->_getParam(\"req_ids\");\n $this->_helper->json($this->checkQueuedEdits($reqIds));\n }", "function getStatus(){\n $this->status = 'Unknown';\n if($this->finAid == 1 && $this->totalOwed != 0){\n if($this->finaidQuestion[1] == ''){\n $this->status = 'Waiting for finaid application';\n return;\n }else{\n $this->status = 'Waiting for finaid decision';\n return;\n }\n }\n if($this->schoolFeeOwed != 0){\n $this->status = 'Waiting for school fee payment';\n return;\n }\n if($this->countryId[1] == 0){\n $this->status = 'Waiting for country preferences';\n return;\n }\n if($this->countryId[1] != 0 && $this->countryConfirm != 1){\n $this->status = 'Waiting for country assignments';\n return;\n }\n if($this->delegateFeeOwed != 0){\n $this->status = 'Waiting for delegate fee payment';\n return;\n }\n if(sizeof($this->attendees) == 0){\n $this->status = 'Waiting for attendee info';\n return;\n }\n if($this->totalOwed < 0){\n $this->status = 'Need Refund';\n return;\n }\n if(sizeof($this->attendees) == $this->totalAttendees && $this->totalOwed == 0){\n $this->status = 'Ready';\n return;\n }\n }", "function getStatus() \r\n\t{\r\n\t\treturn $this->reply;\r\n\t}", "public function getMessagesCurrentCountOnQueue($queue)\n {\n try {\n return $this->queue->statsTube($queue)['current-jobs-ready'];\n } catch (ConnectionException $e) {\n \\PHPUnit_Framework_Assert::fail(\"queue [$queue] not found\");\n }\n }", "public function check_activation_status () {\n $licenses_link = get_option( $this->token . '-url', '' );\n //echo \"<pre>\"; print_r( $this ); echo \"</pre>\"; die();\n $products = $this->get_detected_products();\n //echo \"<pre>\"; print_r( $products ); echo \"</pre>\"; die();\n $messages = array();\n if ( 0 < count( $products ) ) {\n foreach ( $products as $k => $v ) {\n if ( isset( $v['product_status'] ) && 'inactive' == $v['product_status'] ) {\n if( !empty( $licenses_link ) ) {\n $message = sprintf( __( '%s License is not active. To get started, activate it <a href=\"%s\">here</a>.', $this->domain ), $v['product_name'], $licenses_link );\n } else {\n $message = sprintf( __( '%s License is not active.', $this->domain ), $v['product_name'] );\n }\n if( !empty( $v[ 'errors_callback' ] ) && is_callable( $v[ 'errors_callback' ] ) ) {\n call_user_func_array( $v[ 'errors_callback' ], array( $message, 'warning' ) );\n } else {\n $messages[] = $message;\n }\n }\n }\n }\n if( !empty( $messages ) ) {\n $this->messages = $messages;\n }\n\n /**\n * We also ping UD server once per 24h\n * for getting any specific information.\n */\n $this->maybe_ping_ud();\n }", "function ihc_run_check_verify_email_status(){\n\t$time_limit = (int)get_option('ihc_double_email_delete_user_not_verified');\n\tif ($time_limit>-1){\n\t\t$time_limit = $time_limit * 24 * 60 * 60;\n\t\tglobal $wpdb;\n\t\t$data = $wpdb->get_results(\"SELECT user_id FROM \" . $wpdb->prefix . \"usermeta\n\t\t\t\t\t\t\t\t\t\tWHERE meta_key='ihc_verification_status'\n\t\t\t\t\t\t\t\t\t\tAND meta_value='-1';\");\n\t\tif (!empty($data)){\n\n\t\t\tif (!function_exists('wp_delete_user')){\n\t\t\t\trequire_once ABSPATH . 'wp-admin/includes/user.php';\n\t\t\t}\n\n\t\t\tforeach ($data as $k=>$v){\n\t\t\t\tif (!empty($v->user_id)){\n\t\t\t\t\t$time_data = $wpdb->get_row(\"SELECT user_registered FROM \" . $wpdb->prefix . \"users\n\t\t\t\t\t\t\tWHERE ID='\" . $v->user_id . \"';\");\n\t\t\t\t\tif (!empty($time_data->user_registered)){\n\t\t\t\t\t\t$time_to_delete = strtotime($time_data->user_registered)+$time_limit;\n\t\t\t\t\t\tif ( $time_to_delete < time() ){\n\t\t\t\t\t\t\t//delete user\n\t\t\t\t\t\t\twp_delete_user( $v->user_id );\n\t\t\t\t\t\t\t$wpdb->query(\"DELETE FROM \" . $wpdb->prefix . \"ihc_user_levels WHERE user_id='\" . $v->user_id . \"';\");\n\t\t\t\t\t\t\t//send notification\n\t\t\t\t\t\t\tihc_send_user_notifications($v->user_id, 'delete_account');\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}", "public function returnImapMailBoxStatus($folder_index=0)\n { \n $folders = (imap_list($this->stream, \"{\".$this->host.\":\".$this->port.\"}\", \"*\")); \n return imap_status($this->stream, $folders[$folder_index], SA_ALL);\n }", "public function getQueuedAttribute(): bool\n {\n return $this->status_id === CampaignStatus::STATUS_QUEUED;\n }", "protected function _checkSendEmail()\n {\n // get the last shipment time\n $shipment = Mage::getResourceModel('sales/order_shipment_collection')\n ->addAttributeToSelect('created_at')\n ->addAttributeToFilter('store_id', $this->_storeId)\n ->setOrder('created_at', 'DESC')\n ->setPageSize(1)\n ->setCurPage(1);\n\n if ($shipment->count() != 0) {\n $lastShipment = $shipment->getFirstItem();\n $shipmentTime = $lastShipment->getCreatedAt();\n\n if ($shipmentTime) {\n return $this->_helper->checkAddAlert(\n $shipmentTime,\n $this->_helper->getConfig(\n NoShipmentsAlert_Helper_Data::PATH_ALERT_TIME,\n $this->_storeId\n ),\n NoShipmentsAlert_Helper_Data::ALERT_TYPE,\n $this->_storeId\n );\n }\n } else {\n // no records exist check monitor start date in config\n // to determine if an alert should be sent\n $startDate = $this->_helper->getConfig(\n NoShipmentsAlert_Helper_Data::PATH_START_DATE,\n $this->_storeId\n );\n if ($startDate) {\n return $this->_helper->checkAddAlert(\n $startDate,\n $this->_helper->getConfig(\n NoShipmentsAlert_Helper_Data::PATH_ALERT_TIME,\n $this->_storeId\n ),\n NoShipmentsAlert_Helper_Data::ALERT_TYPE,\n $this->_storeId\n );\n }\n }\n\n return false;\n }", "public static function poll( ) {\n\t\t\t\t\n\t\tforeach(Config::get('nagios:status') as $chrURL){\n\t\t\t\n\t\t\t$objStatus = new NagiosStatus($chrURL);\n\n\t\t}\n\t\t\n\t\tdisplay(\"Total of \" . DB::count() . \" database queries executed\");\n\t\t\t\n\t\treturn true;\n\t\t\t\n\t}", "public function refreshTaskStatus(){\n\n $webCronResult = $this->webCronResults()->orderBy('code', 'desc')->first();\n\n if ($webCronResult) {\n\n if ($webCronResult->code >= 300) {\n // bad status\n $this->status = 0 ;\n }else{\n // good status\n $this->status = 2 ;\n };\n\n $this->save();\n\n };\n\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 }", "public function reportStatus()\n {\n if ( ! $this->isRequiredConfigPresent()) {\n $this->reportError('Config problem', 1485984755);\n }\n\n if ( ! $this->isDatabaseOkay()) {\n $this->reportError('Database problem', 1485284407);\n }\n\n echo 'OK';\n }", "private function _checkMessageFor()\n {\n return;\n \n $dbh = $this->_connectToDb();\n \n $stmt = $dbh->query(\"SELECT message, when, from FROM messages WHERE LOWER(nick) = '\". strtolower(trim($this->_data->nick)) .\"' AND seen = 0 ORDER BY id DESC LIMIT 1\");\n \n $row = $stmt->fetch(PDO::FETCH_OBJ);\n\n if (isset($row->when)) {\n\n $this->_privmessage(\n 'I have a message for you from '. $row->from,\n $this->_data->nick\n );\n $this->_privmessage(\n 'Message begin: '. $row->message .' :: Message End',\n $this->_data->nick\n );\n $this->_privmessage(\n 'Send: '. $row->when,\n $this->_data->nick\n );\n }\n }" ]
[ "0.75074786", "0.64759314", "0.6268933", "0.62673074", "0.6235321", "0.6205305", "0.6134021", "0.6037973", "0.6011117", "0.5996511", "0.5968188", "0.5931188", "0.5930255", "0.59029675", "0.5854616", "0.58477783", "0.5825312", "0.5803333", "0.57532495", "0.57344973", "0.57147497", "0.5698095", "0.5674587", "0.5659514", "0.5646958", "0.56414837", "0.5623295", "0.5615676", "0.56056505", "0.56051105", "0.5584088", "0.55696696", "0.55579275", "0.5550481", "0.5547719", "0.5535193", "0.5532132", "0.5529711", "0.5482848", "0.5476514", "0.5461141", "0.5459311", "0.54467505", "0.54447687", "0.54108936", "0.5404826", "0.5388067", "0.53847116", "0.53833264", "0.5382454", "0.5381622", "0.53745794", "0.5369009", "0.5368381", "0.536167", "0.53615886", "0.53553385", "0.53521913", "0.5341653", "0.5336665", "0.5334155", "0.53333503", "0.53285754", "0.5314782", "0.5314294", "0.53095317", "0.53045815", "0.5301396", "0.52893156", "0.5288237", "0.5284434", "0.52835363", "0.5279997", "0.52733845", "0.5271962", "0.52686155", "0.5266593", "0.52639455", "0.5260115", "0.52454656", "0.52441823", "0.52424717", "0.5240195", "0.52384585", "0.5238347", "0.5236992", "0.5230864", "0.52293926", "0.5226211", "0.52215165", "0.521648", "0.52112824", "0.52089226", "0.5195688", "0.5190692", "0.518596", "0.5177394", "0.5173215", "0.5166817", "0.5163483" ]
0.72175175
1
Constructor method for TravelerInfoType
public function __construct(array $airTraveler = array(), array $specialReqDetails = array()) { $this ->setAirTraveler($airTraveler) ->setSpecialReqDetails($specialReqDetails); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct( $info ) {\n\t\t$this->info = $info;\n\t}", "public function __construct(array $info = array())\n {\n $this->info = $info;\n //\n }", "public function __construct(array &$info = array())\n {\n $this->_data =& $info;\n }", "function __construct() {\n $this->get_info();\n }", "public function __construct($info,$typeId,$source,$section,$id)\n {\n \t$this->_info = $info;\n \t$this->_typeId = $typeId;\n \t$this->_source = $source;\n \t$this->_section = $section;\n \t$this->_id = $id;\n \t\n \treturn;\n }", "public function __construct(array $info = [])\n {\n parent::__construct($info);\n }", "public function __construct($data){\n\t\t$this->id = $data->id;\n\t\t$this->name = (string)$data->name;\n\t\t$this->date = (string)$data->date;\n\t\t$this->time = (string)$data->time;\n\t\t$this->information = (string)$data->information;\n\t\t$this->dailycomment = (string)$data->dailycomment;\n\t\t\n\t\t$this->status['code'] = (string)$data->status->code;\n\t\t$this->status['openingdate'] = (string)$data->status->openingdate;\n\t\t$this->status['updatetime'] = (string)$data->status->updatetime;\n\t\t\n\t\t$this->snow['base'] = (string)$data->snow->mindepth; //min\n\t\t$this->snow['upperbase'] = (string)$data->snow->base; //max\n\t\t$this->snow['latestfall'] = (string)$data->snow->latestfall;\n\t\t$this->snow['latestfalldate'] = (string)$data->snow->latestfalldate;\n\t\t$this->snow['detail'] = (string)$data->snow->detail;\n\t\t\n\t\t$this->road['code'] = (string)$data->road->code;\n\t\t$this->road['brief'] = (string)$data->road->brief;\n\t\t$this->road['detail'] = (string)$data->road->detail;\n\t\t\n\t\t$this->weather['detail'] = (string)$data->weather->detail;\n\t\t$this->weather['brief'] = (string)$data->weather->brief;\n\t\t$this->weather['temperature'] = (string)$data->weather->temperature;\n\t\t\n\t\t$this->facilityTypes = new ArrayList();\n\t\tforeach($data->facilities->facilitytype as $type) {\n\t\t\t$t = FacilityType::createFromXMLElement($type);//mostly just to get this viewable in template, and display it's name\n\t\t\t$t->facilities = new ArrayList();\n\t\t\tforeach($type as $name=>$facility){\n\t\t\t\tif ($name === 'facility'){//avoid the facility type's name and ID\n\t\t\t\t\t$f = Facility::createFromXMLElement($facility);\n\t\t\t\t\t$t->facilities->push($f);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->facilityTypes->push($t);\n\t\t}\n\t}", "public function __construct($location, $name, $type);", "function __construct() {\n\t\tparent::__construct(\n\t\t\t'upcoming_tours', // Base ID\n\t\t\t__( 'Upcoming Tours', 'text_domain' ), // Name\n\t\t\tarray( 'description' => __( 'Show 2 Upcoming Tours', 'text_domain' ), ) // Args\n\t\t);\n\t}", "public function __construct($userinfo)\n\t\t{\n\t\t\t$this->_userinfo = $userinfo;\n\t\t}", "public function __construct($userinfo)\n\t\t{\n\t\t\t$this->_userinfo = $userinfo;\n\t\t}", "public function __construct()\n {\n $this->types = array(self::TYPE_EMISSION, self::TYPE_TRANSFER);\n }", "public function __construct($info) {\n $this->info = $info;\n $this->info['path'] = GSPLUGINPATH . '/' . $this->id() . '/'; \n $this->i18nMerge();\n }", "function __construct(){\n\t\t$this->key = TRELLO_DEV_KEY;\n\t\t$this->token = TRELLO_USER_TOKEN;\n\n\t\t$this->curl = new Curl();\n\t}", "public function __construct() {\n\n parent::__construct();\n $this->allowedTypes = array(\n CultureFeed_Activity::CONTENT_TYPE_EVENT,\n CultureFeed_Activity::CONTENT_TYPE_PRODUCTION,\n CultureFeed_Activity::CONTENT_TYPE_ACTOR,\n CultureFeed_Activity::CONTENT_TYPE_ACTIVITY,\n CultureFeed_Activity::CONTENT_TYPE_BOOK,\n CultureFeed_Activity::CONTENT_TYPE_NODE,\n CultureFeed_Activity::CONTENT_TYPE_CULTUREFEED_PAGE,\n );\n\n $this->subject = t('More info requested by');\n $this->viewPrefix = t('has requested more info on');\n $this->viewSuffix = t('');\n $this->label = t('More info requested');\n\n }", "function __construct()\n\t{\n\t\t// $this->cust_code = $cust_code;\n\t\t// $this->fecha_interaccion = $fecha_interaccion;\n\t\t// $this->tipo_interaccion = $tipo_interaccion;\n\t\t// $this->time_stamp = $time_stamp;\n }", "function _construct($num,$categorie,$stationDepart,$line)\n {\n $this->num=$num;\n $this->categorie=$categorie;\n $this->nomStationArriveeationpeage=$stationDepart;\n\n $this->nomLigne =$line;\n }", "public function __construct()\n {\n \n $this->entityName = MapMarker::MAPMARKER_ENTITY_NAME;\n $this->modelClass = \"\\MapMarkers\\Model\\MapMarker\";\n $this->dataItem = MapMarker::MAPMARKER_DATA_ENTITY;\n }", "public function __construct($tableinfo) {\n\t\t\tparent::__construct( $tableinfo ); }", "public function __construct($data)\n {\n //\n $this->franchisee = $data['franchiseename'];\n $this->notes = $data['notes'];\n //print_r($this);die;\n }", "public function __construct() {\n parent::__construct(\"tr_125t_detail\");\n $this->primary_key = \"id_f125t_detail\";\n\n $this->attribute_labels = array_merge_recursive($this->_continuously_attribute_label, $this->attribute_labels);\n $this->rules = array_merge_recursive($this->_continuously_rules, $this->rules);\n }", "private function __construct() {\n \n trace('***** Creating new '.__CLASS__.' object. *****');\n \n }", "public function __construct()\n {\n $this->setActive( TRUE );\n $this->setAllowGif( FALSE );\n $this->setAllowPng( FALSE );\n $this->setApplyWatermark( TRUE );\n $this->setCreatedAt( new \\DateTime() );\n $this->setFilename( NULL );\n $this->setGif( FALSE );\n $this->setPng( FALSE );\n $this->setPosition( 0 );\n $this->setRating( 3 );\n $this->setRatingsCount( 1 );\n $this->setTitle( NULL );\n $this->setType( 'pin' );\n $this->setViews( 0 );\n }", "public function __construct(Array $sentInfo)\n {\n $this->sentInfo = $sentInfo;\n }", "public function test__construct() {\n\n $obj = new PointBonTrav();\n\n $this->assertNull($obj->getAvenantSigne());\n $this->assertNull($obj->getCodeEmploye());\n $this->assertNull($obj->getCodeEquipe());\n $this->assertNull($obj->getCodeTacheType());\n $this->assertNull($obj->getDatePassage());\n $this->assertNull($obj->getDateRefBt());\n $this->assertNull($obj->getEtat());\n $this->assertNull($obj->getFromGenBt());\n $this->assertNull($obj->getHeureDeb());\n $this->assertNull($obj->getHeureDebMob());\n $this->assertNull($obj->getHeureFinMob());\n $this->assertNull($obj->getHeuresJour());\n $this->assertNull($obj->getHeuresNuit());\n $this->assertNull($obj->getMontant());\n $this->assertNull($obj->getNomPrenom());\n $this->assertNull($obj->getNumBt());\n $this->assertNull($obj->getNumChrono());\n $this->assertNull($obj->getNumeroAvenant());\n $this->assertNull($obj->getPaniers());\n $this->assertNull($obj->getPrime1());\n $this->assertNull($obj->getPrime2());\n $this->assertNull($obj->getPrime3());\n $this->assertNull($obj->getQualification());\n $this->assertNull($obj->getTransfertPaie());\n $this->assertNull($obj->getUniqId());\n $this->assertNull($obj->getValideMob());\n }", "public function _construct()\n {\n $this->_init('wsu_taxtra/taxtrareports');\n }", "function __construct() {\n parent::__construct(\n 'flare_component_overview', // Base ID\n __('Flare Component Overview', 'flare_twentysixteen'), // Name\n array('description' => __('Lists Component stats', 'flare_twentysixteen'),) // Args\n );\n }", "function __construct($departureLocation, $arrivalLocation, $seat, $train)\n {\n /*\n * This is the step that creates the inheritance chain,\n * so TrainBaseBoardingCard inherits from BoardingCards.\n */\n\n parent::__construct($departureLocation, $arrivalLocation, $seat);\n\n $this->train = $train;\n }", "public function __construct() {\n\t\tforeach ($this as $key => $value) \n\t\t\t$this->$key = '';\n\t\t$this->log_date = $this->seller_PP_ProfileStartDate = $this->timestmp = '0000-00-00 00:00:00';\n\t\t$this->vendor_id = 0;\n\t}", "public function __construct()\n {\n // Metres, Centimetres, Millimetres, Yards, Foot, Inches\n $conversions = array(\n 'Weight' => array(\n 'base' => 'kg',\n 'conv' => array(\n 'g' => 1000,\n 'mg' => 1000000,\n 't' => 0.001,\n 'oz' => 35.274,\n 'lb' => 2.2046,\n )\n ),\n 'Distance' => array(\n 'base' => 'km',\n 'conv' => array(\n 'm' => 1000,\n 'cm' => 100000,\n 'mm' => 1000000,\n 'in' => 39370,\n 'ft' => 3280.8,\n 'yd' => 1093.6\n )\n )\n );\n\n foreach ($conversions as $val) {\n $this->addConversion($val['base'], $val['conv']);\n }\n }", "public function __construct($type)\n {\n }", "public function __construct()\n\t{\n\t $this->entity = new TiposContacto;\n\t}", "public function __construct($Warna) //base class\r\n {\r\n $this->Warna=$Warna;\r\n }", "function __construct () {\n parent::__construct();\n\n $temp = json_decode ($this -> planes -> all (), true);\n \n $ap = -1;\n \n // Iterate through each record in associate array and check if type matches plane in fleet\n // assigns a plane to the fleet if it's name matches the selected planes\n foreach ($temp as $key => $record) {\n $check = false;\n if (!empty ($record[\"id\"])) {\n $check = true;\n switch ($record[\"id\"]) {\n case \"avanti\" :\n break;\n case \"caravan\" :\n break;\n default :\n $check = false;\n }\n if ($check) {\n ++$ap;\n $this -> data[\"a$ap\"] = $record;\n }\n }\n }\n \n\n }", "final private function __construct() {\n\t\t\t}", "public function __construct() {\r\n\t\t$this->_data = array(\r\n\t\t\t'Steve' => array(\r\n\t\t\t\t'id' => 1,\r\n\t\t\t\t'userid' => 'Steve',\r\n\t\t\t\t'passwd' => 'lollypop',\r\n\t\t\t\t'inactive' => 'N',\r\n\t\t\t\t'dept_field' => 'North',\r\n\t\t),\r\n\t\t\t'Sally' => array(\r\n\t\t\t\t'id' => 2,\r\n\t\t\t\t'userid' => 'Sally',\r\n\t\t\t\t'passwd' => 'sallybop',\r\n\t\t\t\t'inactive' => 'N',\r\n\t\t\t\t'dept_field' => 'East',\r\n\t\t),\r\n\t\t\t'Sam' => array(\r\n\t\t\t\t'id' => 3,\r\n\t\t\t\t'userid' => 'Sam',\r\n\t\t\t\t'passwd' => 'sammydop',\r\n\t\t\t\t'inactive' => 'Y',\r\n\t\t\t\t'dept_field' => 'West',\r\n\t\t),\r\n\t\t\t);\r\n\r\n\t}", "public function __construct()\n\t{\n\t\t// Initialize reflectionClass with information about the target class\n\t\t$this->reflectionClass = new \\ReflectionClass($this);\n\t}", "public function __construct()\n {\n parent::__construct(new Tv());\n }", "public function __construct($info = array()) {\n\t\t$this->usr = $info['usr'];\n\t\t$this->nombre = $info['nombre'];\n\t\t$this->ap_paterno = $info['ap_paterno'];\n\t\t$this->ap_materno = $info['ap_materno'];\n\t\t$this->sucursal = $info['sucursal'];\n\t\t$this->$seguridad = new Permisos($info['tipo_usuario'];\n\t}", "public function __construct($location, $name, $type)\n {\n }", "public function __construct($location, $name, $type)\n {\n }", "public function __construct($location, $name, $type)\n {\n }", "public function __construct()\n {\n $this->lanes = Airport::firstOrFail()->lanes;\n $this->take_off_time = Airport::firstOrFail()->take_off_time;\n }", "public function __construct($location, $name, $type)\n {\n }", "function __construct($type) {\n\t$this->type = $type;\n\t}", "public function __construct() {\n $this->Types;\n }", "public function __construct()\n {\n // doImage is 10, add image url just before\n $this->span_gamut['doImageURL'] = 9;\n\n // doLink is 20, add base url just before\n $this->span_gamut['doBaseURL'] = 19;\n\n // Add API links\n $this->span_gamut['doAPI'] = 90;\n\n // Add note spans last\n $this->span_gamut['doNotes'] = 100;\n\n // PHP4 makes me sad.\n parent::__construct();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->stats[] = [\n 'label' => 'Status',\n 'showTitle' => true,\n 'showEmpty' => false,\n 'items' => [\n new Nodes(),\n new Pods('api'),\n new Pods('dashboard'),\n new Pods('sensorparser'),\n new Pods('frontend'),\n ],\n ];\n }", "public function __construct(){\n parent::__construct(new ExporterItemInfo());\n }", "public function __construct()\n\t\t{\n\t\t\t$this->_db_table = new Application_Model_DbTable_TourType();\n\t\t}", "function __construct($player) {\n\t\t\t$this->name = $player['Name'];\n\t\t\t$this->team = $player['Team'];\n\t\t\t$this->gp = $player['GP'];\n\t\t\t$this->min = $player['Min'];\n\t\t\t$this->fg = $player['Pct-FG'];\n\t\t\t$this->pt = $player['Pct-3PT'];\n\t\t\t$this->ft = $player['Pct-FT'];\n\t\t\t$this->rebound = $player['Tot-Rb'];\n\t\t\t$this->ppg = $player['PPG'];\n\t\t\t$this->ast = $player['Ast'];\n\t\t}", "public function __construct() {\n\t\t$engagementType = 'unknown';\n\t}", "public function __construct() {\n parent::__construct();\n $this->load->model(\"m_dumping_location\");\n $this->APICONTROLLERID = 3;\n }", "public function __construct ()\n {\n parent::__construct(NULL);\n $this->name_tuples = [];\n // use name attributes must conform to: AS 5017-2006: Health Care Client Name Usage\n $this->acceptable_use_attributes = UseAttributeInterface::NameValues;\n }", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct()\n {\n $map = [\n 'changeKind' => 'change_kind',\n 'changeTime' => 'change_time',\n 'defaultHighlightColor' => 'default_highlight_color',\n 'highlightColor' => 'highlight_color',\n 'highlightMode' => 'highlight_mode',\n 'id' => 'id',\n 'length' => 'length',\n 'start' => 'start',\n 'text' => 'text',\n 'userName' => 'username',\n ];\n\n $this->setMap($map);\n }", "public function __construct($input)\n {\n $this->info = $input;\n }", "public function __construct()\n {\n $fullClassName = explode('\\\\', get_class($this));\n $this->type = (string)array_pop($fullClassName);\n }", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "private function __construct() {\r\n\t\r\n\t}", "public function __construct($tea_list,$template_id,$data,$url)\n {\n $this->wx_info=[\n \"template_id\" => $template_id,\n \"data\" => $data,\n \"tea_list\" => $tea_list,\n \"url\" => $url,\n ];\n }", "public function __construct()\n {\n $this->city = new City;\n $this->country = new Country;\n $this->event = new Event;\n $this->experience = new Experience;\n $this->place = new Place;\n $this->type = new Type;\n $this->subcategory = new Subcategory;\n }", "private function __construct() {\n\t\t}", "public function __construct()\n\t{\n\t\t$this->_url \t= \"https://focus.freshtrak.com/api/v1/\";\n\t}", "public function __construct($flags = null) {}", "public function __construct($flags = null) {}", "private function __construct( )\n {\n\t}", "public function __construct()\n {\n // Setup internal data arrays\n self::internals();\n }", "public function __construct( )\r\n\t{\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct(array $data)\n {\n $this->accessKey = $data['accessKey'];\n $this->customerId = $data['customerId'];\n $this->storeId = $data['storeId'];\n $this->loanTypeId = $data['loanTypeId'];\n $this->fundingType = $data['loanApplication']['FundingType'];\n $this->fundingType = money_format('%i', $data['loanApplication']['Amount']);\n $this->fundingType = $data['loanApplication']['PromotionalCode'];\n }", "function __construct()\n\t{\n\t\tparent :: __construct();\n\t\t$this -> load -> model('getinfo','m');\n\t}", "public function __construct() {\n\n\t\tif ( defined( 'SERVICE_TRACKER_VERSION' ) ) {\n\t\t\t$this->version = SERVICE_TRACKER_VERSION;\n\t\t} else {\n\t\t\t$this->version = '1.0.0';\n\t\t}\n\t\t$this->plugin_name = 'service-tracker';\n\n\t\tif ( ! class_exists( 'WooCommerce' ) ) {\n\t\t\t$this->add_client_role();\n\t\t}\n\n\t\t$this->load_dependencies();\n\t\t$this->set_locale();\n\t\t$this->define_admin_hooks();\n\t\t$this->api();\n\t\t$this->define_public_hooks();\n\t\t$this->public_user_content();\n\t}", "private function __construct()\t{}", "public function __construct(array $data = [])\n\t{\n\t\t$this->id = isset($data['id']) ? $data['id'] : $this->generateRequestId();\n\t\t$this->time = microtime(true);\n\t\t$this->updateToken = isset($data['updateToken']) ? $data['updateToken'] : $this->generateUpdateToken();\n\n\t\tforeach ($data as $key => $val) $this->$key = $val;\n\n\t\t$this->currentLog = new Log($this->log);\n\t\t$this->currentTimeline = new Timeline\\Timeline($this->timelineData);\n\t}", "public function __construct($id, $type, $path, $name){\n\n\t\t\t//output function name\n\t\t\tnc__util__func('class', 'nc__class__flocation');\n\n\t\t\t//assign data fields\n\t\t\t$this->_id = $id;\n\t\t\t$this->_type = $type;\n\t\t\t$this->_path = $path;\n\t\t\t$this->_name = $name;\n\n\t\t}", "public function __construct()\n {\n $this->getBiomes();\n $this->getHeights();\n $this->getRainfall();\n $this->getTemperature();\n $this->getHasRiver();\n }", "public function __construct(){\n\t\t\tparent::__construct(); \n\t\t\t$p = '{\"rid\":\"n\",\"rfc\":\"t\",\"ayr\":\"n\",\"com\":\"t\",\"cps\":\"t\",\"dsi\":\"n\",\"dsn\":\"t\",\"rei\":\"n\",\"ren\":\"t\",\"rsc\":\"t\",\"twn\":\"t\"'.\n\t\t\t\t ',\"lmk\":\"t\",\"asi\":\"n\",\"asn\":\"t\",\"sfi\":\"n\",\"sfn\":\"t\",\"nam\":\"t\",\"ixn\":\"t\",\"sno\":\"t\",\"xno\":\"t\",\"sex\":\"n\"'.\n\t\t\t\t ',\"pid\":\"n\",\"pnm\":\"t\",\"dpi\":\"n\",\"pti\":\"n\",\"cid\":\"n\",\"cml\":\"t\",\"ad1\":\"t\",\"ad2\":\"t\",\"ad3\":\"t\"'.\n\t\t\t\t ',\"det\":\"t\",\"sti\":\"n\",\"pyr\":\"n\",\"eyr\":\"n\",\"xyr\":\"n\",\"ryr\":\"n\",\"rsm\":\"n\",\"pti\":\"n\",\"dur\":\"n\",\"psm\":\"n\"'.\n\t\t\t\t ',\"sem\":\"n\",\"ssi\":\"n\",\"ssn\":\"t\",\"gpi\":\"n\",\"rgi\":\"n\",\"rgs\":\"n\",\"rgn\":\"t\",\"stc\":\"t\",\"stn\":\"t\",\"sid\":\"n\",\"dcd\":\"t\"'.\n\t\t\t\t ',\"pos\":\"n\",\"plm\":\"n\",\"sts\":\"n\",\"ast\":\"n\",\"stp\":\"t\"}';\n\t\t\t$this->props = json_decode($p,true);\n\t\t}", "public function __construct() {\t\t\n\t\t$this->apikey='uYXMOYkzh1bJwKLk8SFb00EiYydmLDvoqskEOtqlk4hSE9NAM9RRV08C';\n\t\t$this->apisec='9FsUJswhQX13nGdahA6YDgkfZdYd05/SPObJKD12GAP5LKq1smT0FAVuMc26PH0fvuYPVlPVECBYXvu8Aqy92Q==';\n\t\t$this->url = 'https://api.kraken.com';\n }", "function __construct($nameU,$tlf) {\r\n\t\t\t$this->nombreUnidad = $nameU;\r\n\t\t\t$this->telefono = $tlf;\r\n }", "public function __construct()\n {\n $classname = $this->getBankName();\n\n $info = ExchangeRateGrabberInfo::find()->where(['name' => $classname])->one();\n\n if (empty($info)) {\n throw new \\Exception(\"broken class: metadata for $classname not found\");\n }\n\n $this->info = $info->attributes;\n }", "public function __construct()\n {\n if (17 == func_num_args()) {\n $this->id = func_get_arg(0);\n $this->number = func_get_arg(1);\n $this->name = func_get_arg(2);\n $this->balance = func_get_arg(3);\n $this->type = func_get_arg(4);\n $this->aggregationStatusCode = func_get_arg(5);\n $this->status = func_get_arg(6);\n $this->customerId = func_get_arg(7);\n $this->institutionId = func_get_arg(8);\n $this->balanceDate = func_get_arg(9);\n $this->aggregationSuccessDate = func_get_arg(10);\n $this->aggregationAttemptDate = func_get_arg(11);\n $this->createdDate = func_get_arg(12);\n $this->currency = func_get_arg(13);\n $this->lastTransactionDate = func_get_arg(14);\n $this->institutionLoginId = func_get_arg(15);\n $this->displayPosition = func_get_arg(16);\n }\n }", "public function __construct () \n {\n parent::__construct ();\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_URL, 'https://wacky.jlparry.com/info/airlines');\n $result = curl_exec($ch);\n curl_close($ch);\n $this -> data = json_decode($result, true);\n }", "public function __construct()\n {\n if (10 == func_num_args()) {\n $this->productTypeUuid = func_get_arg(0);\n $this->customer = func_get_arg(1);\n $this->adults = func_get_arg(2);\n $this->children = func_get_arg(3);\n $this->seniors = func_get_arg(4);\n $this->arrivalDate = func_get_arg(5);\n $this->partnerReference = func_get_arg(6);\n $this->options = func_get_arg(7);\n $this->message = func_get_arg(8);\n $this->timeSlotUuid = func_get_arg(9);\n }\n }", "public function __construct(System $system, Client $client, $ttr = 3600) {\n $this->system = $system;\n\n parent::__construct($client, $ttr);\n }", "public function __construct() {\n parent::__construct(new FarmerUserOrganicStandardInfo());\n }", "public function _construct()\n\t{\n\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function __construct()\n {\n $this->dev = config('novaposhta.dev');\n $this->getApi();\n $this->url = config('novaposhta.base_uri').config('novaposhta.point');\n\n $this->return = [\n 'success' => false,\n 'result' => null,\n 'info' => [],\n ];\n }", "function __construct()\n {\n $this->setNumber(42);\n $this->setStatus(0);\n }", "public function __construct()\n\t{\t\t\n\t\terror_reporting(E_ALL);\n\t\t$this->api = new ApiDirect('data');\n\t}", "public function __construct()\n {\n parent::__construct();\n\n // Set data types\n $this->data_types = array(\n 'title' => 'string',\n 'url' => 'url',\n 'url_key' => 'md5',\n 'embed' => 'string',\n 'created_on' => 'datetime'\n );\n\n }", "public function __construct(TravelStrategy $strat)\n {\n $this->travelStrategy = $strat;\n }", "public function __construct($aviLoan,$type)\n {\n $this->client = new OpenapiClient();\n $this->aviList = $aviLoan;\n $this->cache = new Predis\\Client();\n $this->type = $type;\n }" ]
[ "0.6601762", "0.61173695", "0.59744793", "0.59528565", "0.5923678", "0.57771635", "0.56732047", "0.567051", "0.56564504", "0.5640343", "0.5640343", "0.5639698", "0.5628245", "0.5622265", "0.561935", "0.55848974", "0.55779254", "0.557342", "0.5572449", "0.55553937", "0.55140615", "0.55138063", "0.5489766", "0.5479343", "0.5477419", "0.5450405", "0.54494685", "0.54480547", "0.54479384", "0.54378235", "0.543686", "0.5436716", "0.5435125", "0.5433106", "0.54301924", "0.54294753", "0.54197603", "0.54154986", "0.5414894", "0.5414005", "0.54130554", "0.54130554", "0.5412439", "0.54121387", "0.5403273", "0.5387589", "0.5385439", "0.5382534", "0.53813344", "0.5378115", "0.53777903", "0.53740287", "0.5373891", "0.5370117", "0.5367397", "0.5367397", "0.5367397", "0.5367397", "0.5367397", "0.5367397", "0.5367397", "0.5366287", "0.5362465", "0.53604776", "0.5357945", "0.5357945", "0.5357945", "0.53576547", "0.5353801", "0.53534406", "0.53524333", "0.534995", "0.534918", "0.534918", "0.534618", "0.53457695", "0.534409", "0.5343533", "0.5335796", "0.53331286", "0.5331355", "0.53309387", "0.53226805", "0.53201175", "0.53196985", "0.5317859", "0.5315761", "0.530404", "0.53012794", "0.5296228", "0.5296123", "0.5296072", "0.52948236", "0.5294292", "0.52938306", "0.52901924", "0.52899474", "0.5289597", "0.52895325", "0.5288698", "0.528681" ]
0.0
-1
Add item to AirTraveler value
public function addToAirTraveler(\Devlabs91\GenericOtaHotelApiService\StructType\AirTraveler $item) { // validation for constraint: itemType if (!$item instanceof \Devlabs91\GenericOtaHotelApiService\StructType\AirTraveler) { throw new \InvalidArgumentException(sprintf('The AirTraveler property can only contain items of \Devlabs91\GenericOtaHotelApiService\StructType\AirTraveler, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); } $this->AirTraveler[] = $item; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function add_item();", "public function insertItem($item){\n\t\t$hour = date ( 'H', strtotime ( $item->list_time ) );\n\t\t$this->hours[$hour][DayShelfStrategy::HOUR_FIELD_ITEMLIST][] = $item;\n\t}", "public function add($item);", "public function add($item);", "public function addToRelatedTravelerPref($item)\n {\n // validation for constraint: itemType\n if (!false) {\n throw new \\InvalidArgumentException(sprintf('The RelatedTravelerPref property can only contain items of anyType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->RelatedTravelerPref[] = $item;\n return $this;\n }", "function add($item);", "public function appendEquipmentingItem($value)\n {\n return $this->append(self::EQUIPMENTING_ITEM, $value);\n }", "public function append($item)\n {\n array_push($this->activeValue, $item);\n }", "function addItem(SitemapItem $item){\r\n $this->items[] = $item;\r\n }", "public function add(Path $item): void\n {\n $path = $item->getPath();\n $value = $item->getValue();\n $index = array_pop($path);\n $array = [];\n\n if (count($path) > 0) {\n if (false === is_int($index) && false === is_string($index)) {\n $index = (string) $index;\n }\n\n $this->insertIntoArray($array, $path, [$index => $value]);\n } elseif (null === $index) {\n $array = [$value];\n } else {\n $array = [$index => $value];\n }\n\n $this->data = array_replace_recursive($this->data, $array);\n }", "public function add_item($zajlib_feed_item){\n\t\t$this->items[] = $zajlib_feed_item; \n\t}", "function addItemForUpdate($item) {\n $this->_update[$item->getId()] = $item;\n }", "public function addItem($item){\n $this->items[] = $item;\n }", "public function add($item) {\n $this->items[$item->id()] = $item;\n }", "public function addItem($key, $value);", "public function add($item)\n {\n $this->manuallyAddedData[] = $item;\n }", "public function append($value)\n {\n $this->items[] = $value;\n }", "function addLocatorItems()\n\t{\n\t\tglobal $ilLocator;\n\t\t\n\t\tif (is_object($this->object))\n\t\t{\n\t\t\t$ilLocator->addItem($this->object->getTitle(),\n\t\t\t\t$this->getGotoLink($this->object->getRefId()), \"\", $_GET[\"ref_id\"]);\n\t\t}\n\t}", "protected function addItemDetails(&$item) \r\n\t{\r\n\t\t//$item->totals = KTBTrackerHelper::getUserTotals($item);\r\n\t\t$this->getUserInfo($item);\r\n\t}", "function addItem(SitemapItem $item)\r\n {\r\n $this->items[] = $item;\r\n }", "protected function addLocation($remote_id, $item)\n {\n if(!empty($item['latitude']) && !empty($item['longitude']) && !empty($item['address']))\n {\n $pointObj = new Point($item['latitude'], $item['longitude']);\n $point = [\n 'location' => DB::raw(sprintf(\"ST_GeogFromText('%s')\", $pointObj->toWKT())),\n 'address' => $item['address'],\n ];\n $this->locations[$remote_id] = $point;\n }\n }", "function add_airline() {\n global $ydb;\n\n $al_name = ( isset( $_REQUEST['al_name'] ) ? $_REQUEST['al_name'] : '' );\n $al_code = ( isset( $_REQUEST['al_code'] ) ? $_REQUEST['al_code'] : '' );\n $al_url = ( isset( $_REQUEST['al_url'] ) ? $_REQUEST['al_url'] : '' );\n\n //TODO: human errors.\n if( $al_name == '' || $al_code == '' || $al_url == '')\n {\n $return['status'] = 'Error: all fields must be filled in!';\n }\n else\n {\n $sql = \"INSERT INTO airlines (name, code, url) VALUES ('\".$al_name.\"', '\".$al_code.\"', '\".$al_url.\"')\";\n\n if( $ydb->query($sql) )\n {\n $return['status'] = $al_name . ' Airline Added.';\n }\n else\n {\n $return['status'] = $ydb->error;\n }\n }\n\n return $return;\n}", "public function addItem(Array $item)\n {\n $this->item[] = $item;\n }", "public function addLineItem(LineItemInterface $line_item);", "public function addToSkiOpportunitiesAttribute($item)\n {\n // validation for constraint: enumeration\n if (!\\EnumType\\HotelReviewSkiOpportunitiesAttribute::valueIsValid($item)) {\n throw new \\InvalidArgumentException(sprintf('Value \"%s\" is invalid, please use one of: %s', $item, implode(', ', \\EnumType\\HotelReviewSkiOpportunitiesAttribute::getValidValues())), __LINE__);\n }\n $this->SkiOpportunitiesAttribute[] = $item;\n return $this;\n }", "function wpcp_add_custom_data_to_order($item, $cart_item_key, $values, $order)\n{\n foreach ($item as $cart_item_key => $values) {\n if (isset($values['wpcp_location'])) {\n $item->add_meta_data(__('wpcp_location', 'wpcp'), $values['wpcp_location'], true);\n }\n }\n}", "public function addToAddress($item)\n {\n // validation for constraint: itemType\n if (!false) {\n throw new \\InvalidArgumentException(sprintf('The Address property can only contain items of anyType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->Address[] = $item;\n return $this;\n }", "protected function addAmenities($remote_id, $item)\n {\n if(!empty($item['amenities']))\n {\n $amenities = array_filter(explode(',', $item['amenities']));\n foreach($amenities as $amenity)\n {\n $body = trim($amenity);\n $this->amenities[$remote_id][] = [\n 'item' => $body,\n 'created_at' => $this->date,\n 'updated_at' => $this->date\n ];\n }\n }\n }", "public function addValue($value);", "public function add(...$items);", "function addVako($object) {\n /* you can itentify the article with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedVakoIdOnMarketplace_'.rand(1000, 9999); \n}", "public function add_tentative($item)\n\t\t{\n\t\t\tparent::add_item($item,'tentative_items');\n\t\t}", "public function addItem($item)\n {\n // Push item into list of array\n array_push($this->items, $item);\n }", "function add_unit_to_army($unit_id, $army_id)\n\t{\n\t\t$result = pg_prepare(\"point_query\", \"SELECT init_point_cost FROM warhammer.unit_list WHERE unit_id=$1\");\n\t\t$result = pg_execute(\"point_query\", array($unit_id));\n\t\t$result_a = pg_fetch_array($result,0,PGSQL_ASSOC);\n\t\t$points = $result_a[\"init_point_cost\"];\n\t\t$result = pg_prepare(\"add_query\", \"INSERT INTO warhammer.user_army VALUES (DEFAULT,$1,null,$2)\");\n\t\t$result = pg_execute(\"add_query\", array($unit_id,$points));\n\t\tpg_free_result($result);\n\t}", "public function add (Item $item): void\n {\n $this->equippedItems[] = $item;\n }", "public function addItems(\\RO\\Cmd\\AchieveDBItem $value){\n return $this->_add(4, $value);\n }", "public function addItem(ItemInterface $item);", "public function addItem(ItemInterface $item);", "public function additem()\r\n {\r\n $shipping = array( 'ShippingServiceOptions' => array(\r\n\r\n 'ShippingService' => 'UPSGround',\r\n 'ShippingServiceCost' => 0.0,\r\n 'ShippingServiceAdditionalCost' => 0.0,\r\n 'ShippingServicePriority' => 1,\r\n 'ExpeditedService' => false,\r\n\r\n\r\n ),\r\n 'ShippingType' => 'Flat',\r\n );\r\n\r\n $returnPolicy = array(\r\n 'ReturnsAcceptedOption' => 'ReturnsAccepted',\r\n 'RefundOption' => 'MoneyBack',\r\n 'ReturnsWithinOption' => 'Days_30',\r\n 'Description ' =>'If you are not satisfied, return the item for refund.',\r\n 'ShippingCostPaidByOption' => 'Buyer',\r\n );\r\n\r\n $item = array(\r\n 'PrimaryCategory' => array('CategoryID' => 111422), // ok\r\n 'Title' => 'Miechu nowy',\r\n 'Description' => 'Testowy opis',\r\n 'StartPrice' => 100, //\r\n 'BuyItNowPrice' => 500,//\r\n 'ReservePrice' => 400,//\r\n 'Country' => 'US',//\r\n 'Currency' => 'USD',//\r\n 'ListingDuration' => 'Days_7',//\r\n 'PictureDetails' => 'dummy',//\r\n 'Site' => 'US',//\r\n 'Location' => 'San Jose',//\r\n 'PaymentMethods' => 'PayPal',//\r\n 'PayPalEmailAddress' => '[email protected]',//\r\n 'ShippingDetails' => $shipping,//\r\n 'DispatchTimeMax' => 3,//\r\n 'ConditionID' => 1000,//\r\n 'ReturnPolicy' => $returnPolicy,//\r\n\r\n );\r\n\r\n $params = array(\r\n 'Version' => 831,\r\n 'Item' => $item\r\n\r\n\r\n\r\n\r\n\r\n );\r\n $method = 'addItem';\r\n\r\n try{\r\n\r\n $resp = debay::sendRequest($method,$params);\r\n\r\n $this->load->model('ebay/debay');\r\n\r\n\r\n }\r\n catch(Exception $e)\r\n {\r\n echo $e->getMessage();\r\n }\r\n }", "function rec($log_item)\n\t{\n\t\t$this->items[] = $log_item;\n\t}", "public function getAirItinerary()\n {\n return $this->airItinerary;\n }", "function buyItem($store_id, $journey_id, $character_id, $player_id, $item_id) {\n\t\n\t\taddToDebugLog(\"buyItem(), Function Entry - Store ID: \" . $store_id . \", Journey ID: \" . $journey_id . \"; Character ID: \" . $character_id . \"; Player ID: \" . $player_id . \"; Item ID: \" . $item_id . \", INFO\");\n\t\n\t\t// Get item details from the store\n\t\t$sql = \"SELECT * FROM hackcess.store_contents WHERE contents_id = \" . $item_id . \";\";\n\t\t$result = search($sql);\n\t\t$name = $result[0][2];\n\t\t$final_name = $result[0][2]; \n\t\t$ac_boost = $result[0][3];\n\t\t$atk_boost = $result[0][4];\n\t\t$weight = $result[0][5];\n\t\t$slot = $result[0][6];\n\t\t$cost = $result[0][7];\n\t\n\t\t// Remove gold from player\n\t\t$dml = \"UPDATE hackcess.character_details SET gold = gold - \" . $cost . \" WHERE character_id = \" . $character_id . \";\";\n\t\t$result = insert($dml);\n\t\tif ($result == TRUE) {\n\t\t\taddToDebugLog(\"buyItem(), Character record updated, INFO\");\n\t\t} else {\n\t\t\taddToDebugLog(\"buyItem(), Character record not updated, ERROR\");\n\t\t}\n\t\t\n\t\t// If the item is a pet, determine the Level and attach to the name\n\t\tif (substr($slot, 0, 3) == \"pet\") {\n\t\t\t$level = ($cost - 5000) / 500;\n\t\t\t$final_name = $name . \",\" . $level;\n\t\t}\n\t\n\t\t// Add item to player equipment\n\t\t$dml = \"INSERT INTO hackcess.character_equipment (name, ac_boost, attack_boost, weight, slot, character_id) VALUES ('\" . $final_name . \"', \" . $ac_boost . \", \" . $atk_boost . \", \" . $weight . \", '\" . $slot . \"', \" . $character_id . \");\";\n\t\t$result = insert($dml);\n\t\tif ($result == TRUE) {\n\t\t\taddToDebugLog(\"buyItem(), Item added to player inventory, INFO\");\n\t\t\t\n\t\t\t// Determine pet id\n\t\t\t$sql = \"SELECT pet_id FROM hackcess.pets WHERE pet_name LIKE '\" . $name . \"%';\";\n\t\t\t$result = search($sql);\n\t\t\t$pet_id = $result[0][0]; \n\t\t\t\n\t\t\t// Assign pet to character\n\t\t\t$dml = \"UPDATE hackcess.pets SET character_id = \" . $character_id . \" WHERE pet_id = \" . $pet_id . \";\";\n\t\t\t$result = insert($dml);\n\t\t\tif ($result == TRUE) {\n\t\t\t\taddToDebugLog(\"buyItem(), Character record updated, INFO\");\n\t\t\t} else {\n\t\t\t\taddToDebugLog(\"buyItem(), Character record not updated, ERROR\");\n\t\t\t}\t\t\t\n\t\t\t\t\n\t\t\t// Remove item from store\n\t\t\t$dml = \"DELETE FROM hackcess.store_contents WHERE contents_id = \" . $item_id . \";\";\n\t\t\t$result = delete($dml);\n\t\t\tif ($result == TRUE) {\n\t\t\t\taddToDebugLog(\"buyItem(), Item deleted from store, INFO\");\n\t\t\t} else {\n\t\t\t\taddToDebugLog(\"buyItem(), Item not deleted from store, ERROR\");\n\t\t\t}\n\t\t\t\t\n\t\t} else {\n\t\t\taddToDebugLog(\"buyItem(), Item not added to player inventory, ERROR\");\n\t\t}\n\t\n\t\toutputDebugLog();\n\t\t\n\t\t// Redirect back to store page\n\t\techo \"<script>window.location.href = 'store.php?player_id=\" . $player_id . \"&character_id=\" . $character_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"'</script>\";\n\t\n\t}", "private function getLocationValues($item) {\n $type = false;\n\n if(!is_object($item))\n return false;\n\n $type = reset($item->types);\n\n if($type === 'political')\n $type = end($item->types);\n\n $this->locationValues->$type = $item->long_name;\n }", "public function add_to_route($title,$item) {\n\t\tif (is_string($item)) $item = array('url' => $item);\n\t\t$this->route_extra[] = array($title,$item);\n\t}", "public function add(string $key, mixed $item): self;", "public function addItem($value) {\n return $this->add('items', func_get_args());\n }", "public function addItem($value) {\n return $this->add('items', func_get_args());\n }", "public function addItem($value) {\n return $this->add('items', func_get_args());\n }", "public function addItem($value) {\n return $this->add('items', func_get_args());\n }", "public function add($value);", "public function add($value);", "public function airlines(){}", "public function addItem(My_ShoppingCart_Item_Interface $item)\n {\n $this->_order->Orderdetail[] = $item;\n }", "public function writeItem($item)\n {\n $this->data[] = $item;\n }", "function register($item)\n {\n if (is_a($item, 'DVD') || is_a($item, 'Magazine') || is_a($item, 'Book')) {\n $item->setID(sizeof($this->collection) + 1);\n array_push($this->collection, $item);\n }\n }", "public function addElement($item)\n {\n $this->items[$this->itemsCount] = $item;\n $this->itemsCount++;\n }", "public function add($value)\n {\n $value = (string) $value;\n if (!in_array($value, $this->items)) {\n $this->items[] = $value;\n }\n }", "function add_tour($type,$item,$name,$desc,$price,$currency,$route,$program,$duration,$place,$date){\n\tif($type == 'belarus'){\n\t\t$patch = '../../jsdb/JSON/tours/belarus.json';\n\t\t$fold = 'belarus';\n\t}\n\tif($type == 'belarus_pref'){\n\t\t$patch = '../../jsdb/JSON/tours/belarus_pref.json';\n\t\t$fold = 'belarus_pref';\n\t}\n\tif($type == 'foreigners'){\n\t\t$patch = '../../jsdb/JSON/tours/foreigners.json';\n\t\t$fold = 'foreigners';\n\t}\n\tif($type == 'foreigners_pref'){\n\t\t$patch = '../../jsdb/JSON/tours/foreigners_pref.json';\n\t\t$fold = 'foreigners_pref';\n\t}\n\tcreate_path('../../img/tours/'.$fold.'/'.$item.'/');\n\tdo {\n\t\t$folder = randomName(7);\n\t} while(file_exists('../../img/tours/'.$fold.'/'.$item.'/'.$folder));\n\t$object = json_decode(file_get_contents($patch));\n\n\t$object_item = new stdClass();\n\t$object_item->name = $name;\n\t$object_item->desc = $desc;\n\t$object_item->price = $price;\n\t$object_item->currency = $currency;\n\t$object_item->route = $route;\n\t$object_item->program = $program;\n\t$object_item->duration = $duration;\n\t$object_item->place = $place;\n\tif($date !== false){\n\t\t$object_item->date = $date;\n\t}\n\tcreate_path('../../img/tours/'.$fold.'/'.$item.'/'.$folder);\n\t$object_item->img = 'img/tours/'.$fold.'/'.$item.'/'.$folder;\n\t// mkdir('../../img/tours/'.$fold.'/'.$item.'/'.$folder, 0777);\n\tarray_push($object[0]->$item,$object_item);\n\t$fp = fopen($patch,'w');\n\tfwrite($fp,json_encode($object));\n\tfclose($fp);\n\treturn true;\n}", "protected function trackAdd($item, $key) {\n\t\t/** @var RepeaterPage $item */\n\t\t$item->traversalPages($this);\n\t\tparent::trackAdd($item, $key);\n\t}", "public function addItem($item)\n\t{\n\t\t$this->_items[] = $item;\n\t}", "public function addAt() {\n\t\t$at = json_decode(Flight::request()->query['at'],true);\n\t\t$date = date('H:i Y-m-d', $at['d']);\n\t\tswitch ($at['t']) {\n\t\t\tcase 'on': exec('at '.$date.' -q A -f /srv/www/home.fr/public/conf/aton.txt'); break;\n\t\t\tcase 'off': exec('at '.$date.' -q B -f /srv/www/home.fr/public/conf/atoff.txt'); break;\n\t\t\tcase 'tts': exec('at '.$date.' -q C -f /srv/www/home.fr/public/conf/attts.txt'); break;\n\t\t}\n\t\tFlight::json(array('Status' => 'OK','At' => $date, 'Type' => $at['t']));\n\t}", "public function add($item, $id = null);", "public function add($_item)\n\t{\n\t\treturn BingTypeSourceType::valueIsValid($_item)?parent::add($_item):false;\n\t}", "function sellItem($store_id, $journey_id, $character_id, $player_id, $item_id) {\n\t\t\n\t\taddToDebugLog(\"sellItem(), Function Entry - Store ID: \" . $store_id . \", Journey ID: \" . $journey_id . \"; Character ID: \" . $character_id . \"; Player ID: \" . $player_id . \"; Item ID: \" . $item_id . \", INFO\");\n\t\t\n\t\t// Get item details from the character\n\t\t$sql = \"SELECT * FROM hackcess.character_equipment WHERE equipment_id = \" . $item_id . \";\";\n\t\taddToDebugLog(\"sellItem(), Constructed query: \" . $sql . \", INFO\");\n\t\t$result = search($sql);\n\t\t$name = $result[0][1];\n\t\t$ac_boost = $result[0][2];\n\t\t$attack_boost = $result[0][3];\n\t\t$weight = $result[0][4];\n\t\t$slot = $result[0][5];\n\t\tif (substr($result[0][5], 0, 6) == 'potion') {\n\t\t\t$name_elements = explode(' ', $name);\n\t\t\t$final_name = $name_elements[0];\n\t\t\t$cost = 100 * $name_elements[3];\n\t\t} elseif (substr($result[0][5], 0, 3) == 'pet') {\n\t\t\t$name_elements = explode(',', $name);\n\t\t\t$final_name = $name_elements[0];\n\t\t\t$cost = ($name_elements[1] * 500) + 5000;\n\t\t} else {\n\t\t\t$cost = 50 * ($ac_boost + $attack_boost);\n\t\t\t$final_name = $name;\n\t\t}\n\t\t\n\t\t// Add value to player gold\n\t\t$dml = \"UPDATE hackcess.character_details SET gold = gold + \" . $cost . \" WHERE character_id = \" . $character_id . \";\";\n\t\t$result = insert($dml);\n\t\tif ($result == TRUE) {\n\t\t\taddToDebugLog(\"sellItem(), Character record updated, INFO\");\n\t\t} else {\n\t\t\taddToDebugLog(\"sellItem(), Character record not updated, ERROR\");\n\t\t}\t\t\n\t\t\n\t\t// Add item to store\n\t\t$dml = \"INSERT INTO hackcess.store_contents (store_id, item_name, item_ac_boost, item_attack_boost, item_weight, item_slot, item_cost) VALUES (\" . $store_id . \", '\" . $final_name . \"', \" . $ac_boost . \", \" . $attack_boost . \", \" . $weight . \", '\" . $slot . \"', \" . $cost . \");\";\n\t\t$result = insert($dml);\t\t\n\t\tif ($result == TRUE) {\n\t\t\taddToDebugLog(\"sellItem(), Item added to store, INFO\");\n\n\t\t\t// Determine pet id\n\t\t\t$sql = \"SELECT pet_id FROM hackcess.pets WHERE pet_name = '\" . $name_elements[0] . \"';\";\n\t\t\t$result = search($sql);\n\t\t\t$pet_id = $result[0][0];\n\t\t\t\t\n\t\t\t// Unassign pet from character\n\t\t\t$dml = \"UPDATE hackcess.pets SET character_id = 0 WHERE pet_id = \" . $pet_id . \";\";\n\t\t\t$result = insert($dml);\n\t\t\tif ($result == TRUE) {\n\t\t\t\taddToDebugLog(\"buyItem(), Character record updated, INFO\");\n\t\t\t} else {\n\t\t\t\taddToDebugLog(\"buyItem(), Character record not updated, ERROR\");\n\t\t\t}\n\t\t\t\n\t\t\t// Remove item from store\n\t\t\t$dml = \"DELETE FROM hackcess.character_equipment WHERE equipment_id = \" . $item_id . \";\";\n\t\t\t$result = delete($dml);\n\t\t\tif ($result == TRUE) {\n\t\t\t\taddToDebugLog(\"sellItem(), Item deleted from character equipment, INFO\");\n\t\t\t} else {\n\t\t\t\taddToDebugLog(\"sellItem(), Item not deleted from character equipment, ERROR\");\n\t\t\t}\n\t\t\t\t\n\t\t} else {\n\t\t\taddToDebugLog(\"sellItem(), Item not added to store, ERROR\");\n\t\t}\n\t\t\n\t\toutputDebugLog();\n\t\t\n\t\t// Redirect back to store page\n\t\techo \"<script>window.location.href = 'store.php?player_id=\" . $player_id . \"&character_id=\" . $character_id . \"&journey_id=\" . $journey_id . \"&store_id=\" . $store_id . \"'</script>\";\n\t\t\n\t}", "public function addBed($item, $id){\n\n $storedItem = ['qty' => 0, 'productPrice' => $item->productPrice, 'item' => $item];\n if($this->items){\n if(array_key_exists($id, $this->items)){\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['productPrice'] = $item->productPrice * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->productPrice;\n }", "function addTripAccommodation($accommodationData,$trip_id)\n\t{\n\t\t$itineraries = $this->getItineraries($trip_id);\n\t\tif(!$itineraries || count($accommodationData) == 0)\n\t\t\treturn false;\n\n\t\t$accommodationData['user_id'] = $this->session->userdata('id');\n\t\t$accommodationData['organisation_id'] = $this->session->userdata('organisation_id');\n\n\t\t$insertData = array();$i = 0;\n\t\tforeach($itineraries as $itinerary){\n\t\t\t$insertData[$i] = $accommodationData;\n\t\t\t$insertData[$i]['itinerary_id'] = $itinerary['id'];\n\t\t\t$i++;\n\t\t}\n\n\t\tif($insertData){\n\t\t\t$this->db->insert_batch('trip_accommodation', $insertData);\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function addItem($value, $text, $bstore=false){\n\t\t\t\tif($bstore){\n\t\t\t\t\t$this->items[] = array($value => $text);\n\t\t\t\t}else{\n\t\t\t\t\t$this->item = array($value => $text);\n\t\t\t\t}\n\n\t\t\t\treturn $this->item;\n\t\t\t}", "public function addToAddressPref($item)\n {\n // validation for constraint: itemType\n if (!false) {\n throw new \\InvalidArgumentException(sprintf('The AddressPref property can only contain items of anyType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->AddressPref[] = $item;\n return $this;\n }", "function add_itinerary() {\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 = \"INSERT INTO itinerary (trip_id,region_id,price_include,price_exclude,equipment,itinerary_detail,faqs,highlight,video_link) VALUES ('$i_trip_name','$i_region_name','$i_price_include','$i_price_exclude','$i_equipment','$i_itinerary_detail','$i_faqs','$i_highlight','$i_video_link')\";\n $this->mysqli->query($sql);\n if ($this->mysqli->error) {\n echo $this->mysqli->error;\n } else {\n echo '<img src=\"../admin/css/success.gif\">';\n }\n }", "public function append(mixed $value) {\n $this->items[] = $value;\n return $this;\n }", "public function additionAirport()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `airport`(`nameaira`, `nameaire`, `deletair`)VALUES('$this->nameaira' ,'$this->nameaire' ,'$this->deletair')\");\n $result = $sql->execute();\n $idair = $dbh->lastInsertId();\n return array ($result,$idair);\n }", "public function addAirPricePoint(AirPricePoint $airPricePoint = NULL)\n\t{\n\t\t$airPricePoint = $airPricePoint ?: new AirPricePoint();\n\t\t$this->airPricePoint[] = $airPricePoint;\n\t\treturn $airPricePoint;\n\t}", "function addItem(&$item) {\n\t\tglobal $CONF ; \n\t\t$this->items [$item->alias] = $item;\n\t\t$item->menu = $this ;\n\t}", "public function add($item, $id){\n $storedItem = ['qty' => 0,\n 'price'=>$item->price,\n 'item' => $item]; //servirá para os grupos, para nao tar a adicionar 2 da mesma coisa\n\n if($this->items){ //verificar se ja ha items no array\n if (array_key_exists($id, $this->items)){ //verificar se ja existe o item que eu quero adicionar\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['price'] = $item->price * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->price;\n\n }", "public function addToRepairVatRates($item)\n {\n // validation for constraint: itemType\n if (!(is_int($item) || ctype_digit($item))) {\n throw new \\InvalidArgumentException(sprintf('The repairVatRates property can only contain items of type int, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->repairVatRates[] = $item;\n return $this;\n }", "public function add( $item )\n\t\t{\n\t\t\tarray_push( $this->items, $item );\n\t\t}", "public function add($fruit) {\r\n \r\n // We get the number of $fruit in the basket\r\n // +1 to qty\r\n // Update value in basket\r\n\r\n $qty = $this->get($fruit);\r\n $this->itemQtyArr[$fruit] = $qty + 1;\r\n }", "public function addToRepairLabourRates($item)\n {\n // validation for constraint: itemType\n if (!(is_int($item) || ctype_digit($item))) {\n throw new \\InvalidArgumentException(sprintf('The repairLabourRates property can only contain items of type long, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->repairLabourRates[] = $item;\n return $this;\n }", "public function addToPetInfoPref($item)\n {\n // validation for constraint: itemType\n if (!false) {\n throw new \\InvalidArgumentException(sprintf('The PetInfoPref property can only contain items of anyType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->PetInfoPref[] = $item;\n return $this;\n }", "public function addItem(NostoOrderItemInterface $item)\n {\n $this->items[] = $item;\n }", "public function AddItem($item)\n {\n $this->_items[] = $item;\n }", "final public function addItemTechnicianInCharge() {\n $this->addUserByField('users_id_tech', true);\n }", "public function add_item()\n {\n $request = new Types\\AddItemRequestType();\n\n // An user token is required when using the Trading service.\n $request->RequesterCredentials = new Types\\CustomSecurityHeaderType();\n $request->RequesterCredentials->eBayAuthToken = $this->config->item('authToken');\n\n\n // Begin creating the auction item.\n $item = new Types\\ItemType();\n\n $item->DispatchTimeMax = 3;\n /**\n * We want a single quantity auction.\n * Otherwise known as a Chinese auction.\n */\n $item->ListingType = Enums\\ListingTypeCodeType::C_CHINESE;\n $item->Quantity = 1;\n\n $item->ProductListingDetails = new Types\\ProductListingDetailsType();\n $item->ProductListingDetails->ISBN = $ISBN;\n $item->ProductListingDetails->UPC = $UPC;\n $item->ProductListingDetails->EAN = $EAN;\n\n $item->ProductListingDetails->BrandMPN = new DTS\\eBaySDK\\Trading\\Types\\BrandMPNType();\n $item->ProductListingDetails->BrandMPN->Brand = '';\n $item->ProductListingDetails->BrandMPN->MPN = '';\n\n $item->ListingDuration = Enums\\ListingDurationCodeType::C_DAYS_7;\n\n }", "public function addBedOffer($item, $id){\n\n $storedItem = ['qty' => 0, 'productPrice' => $item->productPrice, 'item' => $item];\n if($this->items){\n if(array_key_exists($id, $this->items)){\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['productPrice'] = $item->productPrice * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->productPrice;\n }", "function add($item) {\n\t\t\tif(!$this->contains($items)) {\n\t\t\t\tarray_push($this->items, $item);\n\t\t\t}\n\t\t}", "function addItemAtBeginOf(&$target, $item){\n\t\t\t\t\n\t\t\t\tif($target != \"\" && (is_array($item) || $item !== \"\")){\n\t\t\t\t $target = arrayMerge($item, $target);\n\t\t\t\t}\n\t\t\t}", "public function addItems(array $items);", "public function addItem($value)\n {\n return $this->add('items', func_get_args());\n }", "protected function push($value)\n {\n $this->items[] = $this->set($value);\n }", "public function addItem($item)\n {\n if ($item instanceof \\Fastbill\\Item\\Item)\n {\n $this['ITEMS'][] = $item;\n }\n else\n {\n $itemObj = new \\Fastbill\\Item\\Item();\n $itemObj->fillFromArray($item);\n $this['ITEMS'];\n }\n\n }", "private function addItemToCollection()\n {\n $this->collection->items[$this->cart_hash] = $this;\n\n }", "public function add()\n {\n $item = new stdClass();\n $item->item_id = null;\n $item->barcode = null;\n $item->price = null;\n $item->stock = null;\n $item->name = null;\n $item->category_id = null;\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'add',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => null\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n }", "public function addItem($name, $value)\n {\n $this->elements[] = ['name' => $name, 'value' => $value];\n }", "public function add($_item)\n\t{\n\t\treturn BingTypeSearchOption::valueIsValid($_item)?parent::add($_item):false;\n\t}", "public function addItem($params){\n $sql = \"insert into fruit_table (name) values (:name)\";\n $sth = $this->parent->db->prepare($sql);\n // Key = value pair\n $sth->execute(array(\":name\"=>$params[\"name\"]));\n }", "function add_cart_item( $cart_item ) {\n\t\t\t\tif (isset($cart_item['addons'])) :\n\t\t\t\t\t\n\t\t\t\t\t$extra_cost = 0;\n\t\t\t\t\t\n\t\t\t\t\tforeach ($cart_item['addons'] as $addon) :\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($addon['price']>0) $extra_cost += $addon['price'];\n\t\t\t\t\t\t\n\t\t\t\t\tendforeach;\n\t\t\t\t\t\n\t\t\t\t\t$cart_item['data']->adjust_price( $extra_cost );\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\treturn $cart_item;\n\t\t\t\t\n\t\t\t}", "public function addToAdresser(\\ItkDev\\Serviceplatformen\\SF1500\\Organisation\\StructType\\AdresseFlerRelationType $item): self\n {\n // validation for constraint: itemType\n if (!$item instanceof \\ItkDev\\Serviceplatformen\\SF1500\\Organisation\\StructType\\AdresseFlerRelationType) {\n throw new InvalidArgumentException(sprintf('The Adresser property can only contain items of type \\ItkDev\\Serviceplatformen\\SF1500\\Organisation\\StructType\\AdresseFlerRelationType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Adresser[] = $item;\n \n return $this;\n }", "public function populateLineItem(Commerce_LineItemModel $lineItem);", "public function addToLoyaltyPref($item)\n {\n // validation for constraint: itemType\n if (!false) {\n throw new \\InvalidArgumentException(sprintf('The LoyaltyPref property can only contain items of anyType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->LoyaltyPref[] = $item;\n return $this;\n }", "public function addItem(array $graph_item) {\n\t\tif ($this->type == GRAPH_TYPE_STACKED) {\n\t\t\t$graph_item['drawtype'] = GRAPH_ITEM_DRAWTYPE_FILLED_REGION;\n\t\t}\n\t\t$update_interval_parser = new CUpdateIntervalParser(['usermacros' => true]);\n\n\t\tif ($update_interval_parser->parse($graph_item['delay']) != CParser::PARSE_SUCCESS) {\n\t\t\tshow_error_message(_s('Incorrect value for field \"%1$s\": %2$s.', 'delay', _('invalid delay')));\n\t\t\texit;\n\t\t}\n\n\t\t// Set graph item safe default values.\n\t\t$graph_item += [\n\t\t\t'color' => 'Dark Green',\n\t\t\t'drawtype' => GRAPH_ITEM_DRAWTYPE_LINE,\n\t\t\t'yaxisside' => GRAPH_YAXIS_SIDE_DEFAULT,\n\t\t\t'calc_fnc' => CALC_FNC_AVG,\n\t\t\t'calc_type' => GRAPH_ITEM_SIMPLE\n\t\t];\n\t\t$this->items[$this->num] = $graph_item;\n\n\t\t$this->yaxis[$graph_item['yaxisside']] = true;\n\n\t\t$this->num++;\n\t}" ]
[ "0.58136964", "0.57763314", "0.5612819", "0.5612819", "0.5572279", "0.55448747", "0.5531788", "0.5530503", "0.5459225", "0.5439875", "0.5415185", "0.53940356", "0.5376895", "0.53649193", "0.53294164", "0.52387327", "0.5221672", "0.5210484", "0.5189986", "0.5168357", "0.515185", "0.5142459", "0.51412666", "0.5140449", "0.51322705", "0.51255476", "0.51173675", "0.5113168", "0.5110939", "0.5102912", "0.5086285", "0.5081101", "0.50722545", "0.5057556", "0.5056958", "0.5055139", "0.5036901", "0.5036901", "0.49976242", "0.49908435", "0.49865705", "0.4982726", "0.4976669", "0.49746194", "0.49394935", "0.49313334", "0.49313334", "0.49313334", "0.49313334", "0.49296522", "0.49296522", "0.49295273", "0.49214908", "0.49179813", "0.49026108", "0.48973542", "0.48924652", "0.48904455", "0.48897532", "0.4877277", "0.48688656", "0.4865898", "0.4861433", "0.48597288", "0.48582107", "0.48544425", "0.48540193", "0.48521376", "0.48500976", "0.48487595", "0.48436767", "0.48435956", "0.48383698", "0.4836515", "0.4835071", "0.48249054", "0.4824684", "0.48151731", "0.48150536", "0.48109737", "0.48061925", "0.4805452", "0.4805316", "0.47994694", "0.4791966", "0.4791356", "0.4786586", "0.47855034", "0.47829947", "0.47818062", "0.4780073", "0.4778753", "0.47751895", "0.47707736", "0.4769126", "0.4766796", "0.47635093", "0.47592545", "0.47557616", "0.47551176" ]
0.6691463
0
Add item to SpecialReqDetails value
public function addToSpecialReqDetails($item) { // validation for constraint: itemType if (!false) { throw new \InvalidArgumentException(sprintf('The SpecialReqDetails property can only contain items of anyType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); } $this->SpecialReqDetails[] = $item; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addItemsDetails($description,$price,$quantity,$reference){\r\n\t\tif ( $this->_requestDetails==null )\r\n\t\t\t$this->_requestDetails = array();\r\n\t\t$nItem = count($this->_requestDetails);\r\n\t\tarray_push($this->_requestDetails, array(\"L_PAYMENTREQUEST_0_NAME\".$nItem=>$description,\"L_PAYMENTREQUEST_0_AMT\".$nItem=>$price,\"L_PAYMENTREQUEST_0_QTY\".$nItem=>$quantity,\"L_PAYMENTREQUEST_0_NUMBER\".$nItem=>$reference ));\r\n\t}", "protected function addItemDetails(&$item) \r\n\t{\r\n\t\t//$item->totals = KTBTrackerHelper::getUserTotals($item);\r\n\t\t$this->getUserInfo($item);\r\n\t}", "public function addToSpecialNeed(\\Devlabs91\\GenericOtaHotelApiService\\StructType\\SpecialNeed $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Devlabs91\\GenericOtaHotelApiService\\StructType\\SpecialNeed) {\n throw new \\InvalidArgumentException(sprintf('The SpecialNeed property can only contain items of \\Devlabs91\\GenericOtaHotelApiService\\StructType\\SpecialNeed, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->SpecialNeed[] = $item;\n return $this;\n }", "public function addToAdditionalDetail(\\Sabre\\UpdateReservation\\StructType\\AdditionalDetailType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Sabre\\UpdateReservation\\StructType\\AdditionalDetailType) {\n throw new \\InvalidArgumentException(sprintf('The AdditionalDetail property can only contain items of \\Sabre\\UpdateReservation\\StructType\\AdditionalDetailType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->AdditionalDetail[] = $item;\n return $this;\n }", "abstract public function add_item();", "public function addToSpecialReqPref(\\Devlabs91\\TravelgateNotify\\Models\\Ota\\VehicleSpecialReqPrefType $specialReqPref)\n {\n $this->specialReqPref[] = $specialReqPref;\n return $this;\n }", "public function addToSpecialReqPref(\\Devlabs91\\TravelgateNotify\\Models\\Ota\\VehicleSpecialReqPrefType $specialReqPref)\n {\n $this->specialReqPref[] = $specialReqPref;\n return $this;\n }", "protected function _addGeneralInfo($object) {\n\t\t$storeId = $object->getStoreId();\n\t\t$this->_setCompanyCode($storeId);\n $this->_request->setDetailLevel(DetailLevel::$Document);\n $this->_request->setDocDate(date('Y-m-d'));\n $this->_request->setExemptionNo('');\n \t$this->_request->setDiscount(0.00); //cannot be used in Magento\n \t$this->_request->setSalespersonCode(Mage::helper('avatax')->getSalesPersonCode($storeId));\n \t$this->_request->setLocationCode(Mage::helper('avatax')->getLocationCode($storeId));\n\t\t$this->_request->setCountry(Mage::getStoreConfig('shipping/origin/country_id', $storeId));\n\t\t$this->_request->setCurrencyCode(Mage::app()->getStore()->getBaseCurrencyCode());\n\t\t$this->_addCustomer($object);\n\t\tif($object instanceof Mage_Sales_Model_Order && $object->getIncrementId()) {\n\t\t\t$this->_request->setReferenceCode('Magento Order #' . $object->getIncrementId());\n\t\t}\n\t}", "function add_additional_field($details) {\r\n\t\t$sql = \"INSERT INTO sys_man_additional_fields (field_name, field_type, field_placement, group_id) VALUES (?, ?, ?, ?)\";\r\n\t\t$data=array(\"$details->field_name\", \"$details->field_type\", \"$details->field_placement\", \"$details->group_id\");\r\n\t\t$query = $this->db->query($sql, $data);\r\n\t\treturn;\r\n\t}", "public function setAdditionalInformation($val)\n {\n $this->_propDict[\"additionalInformation\"] = $val;\n return $this;\n }", "function fill_in_additional_list_fields()\r\n\t{\r\n\t}", "function Add_Specialities(){\n\t\t\n\t\tif(isset($_POST['spadd'])){\n\t\t\t\n\t\t\t$values = \"'\".$_POST['sp'].\"'\";\n\t\t\t\n\t\t\t$this->Add('specialities',$values,'Specialities?m');\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}", "public function addToSpecRequestPref($item)\n {\n // validation for constraint: itemType\n if (!false) {\n throw new \\InvalidArgumentException(sprintf('The SpecRequestPref property can only contain items of anyType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->SpecRequestPref[] = $item;\n return $this;\n }", "public function addSimpleItem($item){\t\t\r\n if( //Check the quantity and the name\r\n !empty($item['quantity']) \r\n && is_numeric($item['quantity']) \r\n && $item['quantity']>0 \r\n && !empty($item['name'])\r\n ){ //And add the item to the cart if it is correct\r\n $items = $this->items;\r\n $items[] = $item;\r\n $this->items = $items;\r\n }\r\n }", "protected function add_additional_fields_to_object($response_data, $request)\n {\n }", "public function add_item()\n {\n $request = new Types\\AddItemRequestType();\n\n // An user token is required when using the Trading service.\n $request->RequesterCredentials = new Types\\CustomSecurityHeaderType();\n $request->RequesterCredentials->eBayAuthToken = $this->config->item('authToken');\n\n\n // Begin creating the auction item.\n $item = new Types\\ItemType();\n\n $item->DispatchTimeMax = 3;\n /**\n * We want a single quantity auction.\n * Otherwise known as a Chinese auction.\n */\n $item->ListingType = Enums\\ListingTypeCodeType::C_CHINESE;\n $item->Quantity = 1;\n\n $item->ProductListingDetails = new Types\\ProductListingDetailsType();\n $item->ProductListingDetails->ISBN = $ISBN;\n $item->ProductListingDetails->UPC = $UPC;\n $item->ProductListingDetails->EAN = $EAN;\n\n $item->ProductListingDetails->BrandMPN = new DTS\\eBaySDK\\Trading\\Types\\BrandMPNType();\n $item->ProductListingDetails->BrandMPN->Brand = '';\n $item->ProductListingDetails->BrandMPN->MPN = '';\n\n $item->ListingDuration = Enums\\ListingDurationCodeType::C_DAYS_7;\n\n }", "public function add()\n {\n $item = new stdClass();\n $item->item_id = null;\n $item->barcode = null;\n $item->price = null;\n $item->stock = null;\n $item->name = null;\n $item->category_id = null;\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'add',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => null\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n }", "public function addExtraRequestDataSet($debugNote = null);", "private function prepareMethodDetails($item)\n\t{\n\t\tif(! array_key_exists('authentication_required', $item)) {\n\t\t\t$item['authentication_required'] = $this->authenticationRequired;\n\t\t}\n\t\treturn $item;\n\t}", "public function addAdditionalInfos(\\AgentSIB\\Diadoc\\Api\\Proto\\Invoicing\\AdditionalInfo $value)\n {\n if ($this->AdditionalInfos === null) {\n $this->AdditionalInfos = new \\Protobuf\\MessageCollection();\n }\n\n $this->AdditionalInfos->add($value);\n }", "abstract protected function onBeforeAdd($oItem);", "public function set_request($req)\n\t{\n\t\tforeach ($req as $data)\n\t\t{\n\t\t\t$this->db->insert('requests', $data);\n\t\t}\n\t}", "public function whmcs_add_billable_item($params = array()) {\n\t\t$params['action'] = 'AddBillableItem';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "public function addGhostItem(Request $request, $item);", "public function aroundAddProduct($subject,\\Closure $proceed, $productInfo, $requestInfo = null)\n {\n $con=false;\n $mainid=\"\";\n $subid=\"\";\n $opstr=\"\";\n \n \n \n \n /**@var $subject \\Magento\\Checkout\\Model\\Cart */\n \n \n \n if(!$this->helper->getCustomerId()){\n \n throw new LocalizedException(__('Not logged in.'));\n }\n \n try{\n \n $productInfo=$this->_getProduct($productInfo);\n \n \n if(!in_array($productInfo->getTypeId(),[AccessoryType::TYPE_CODE,ClothType::TYPE_CODE])){\n $this->helper->log(\"\\n not multiv:added \\n\");\n return $proceed($productInfo,$requestInfo);\n \n }\n $items=$subject->getItems();\n \n foreach($items as $it){\n // $this->helper->log(\"current product \".$it->getId().\"\\n\");\n $pr=$it->getProduct();\n $this->helper->log(\"sku \".$pr->getSku().\"\\n\");\n if(strpos($pr->getSku() ,'res-')===0){\n $this->helper->log(\"\\n already :added \\n\");\n $this->_check($pr->getSku(), $requestInfo);\n// \n // return $proceed($productInfo,$requestInfo);\n/// throw new LocalizedException(__(\"Only One rental item can be added.\"));\n \n }\n \n }\n \n \n if(is_object($requestInfo)){\n $opts=$requestInfo->getData('rental_option');\n $opstr=$opts;\n $subject->getQuote()->getExtensionAttributes()->getRentalData()->setRentalDates($opstr);\n \n $depo=$productInfo->getData('deposit')??11;\n list(,,,$dd)=explode('-',$opstr);\n $rental=$dd!=8?$productInfo->getData('rent4'):$productInfo->getData('rent8');\n\n $vipdisc=$dd!=8?$productInfo->getData('vip_discount'):$productInfo->getData('vip_discount8');\n\n \n \n $sub=$requestInfo->getData('multiv_sub');\n }else if(is_array($requestInfo)){\n \n $rr=print_r($requestInfo,1);\n $this->helper->log(\"\\nmultiv:\".$rr.\"\\n\");\n if(!isset($requestInfo['rental_option'])){\n throw new LocalizedException(\"Invalid options\");\n \n }\n \n \n $opstr=$opts=$requestInfo['rental_option'];\n list(,,,$dd)=explode('-',$opstr);\n $rental=$dd!=8?$productInfo->getData('rent4'):$productInfo->getData('rent8');\n\n $vipdisc=$dd!=8?$productInfo->getData('vip_discount'):$productInfo->getData('vip_discount8');\n $depo=$productInfo->getData('deposit')??11;\n $owner=$productInfo->getData('uid');\n $cid=$this->helper->getCustomerId();\n \n $sub=isset($requestInfo['multiv_sub'])?$requestInfo['multiv_sub']:'';\n if(!$opts) throw new LocalizedException(\"Invalid options\");\n $qid=$subject->getQuote()->getId();\n $qid2=$this->cart->getQuoteId();\n $s= true;\n if(!$qid){\n $this->helper->log(\"createquote: cannot add qid2 $qid2 qid $qid\");\n throw new LocalizedException(__('Cannot add'));\n }\n \n $wash=(int)$productInfo->getData('wash');\n $this->helper->log(\"createquote: rental $rental depo $depo qid $qid qid2 $qid2 vip $vipdisc\");\n $con=$this->helper->reserve($opts,$productInfo->getId(),$qid,$owner,$cid,$rental,$depo,$wash,$vipdisc);\n if(!$con){\n \n throw new LocalizedException(__(\"Cannot be added again.\"));\n \n }\n \n }else{\n throw new LocalizedException(__(\"Invalid options\"));\n }\n \n $mainid=$productInfo->getId();\n $this->helper->log(\"mainid $mainid\");\n $this->helper->saveSession('rental', $rental);\n $this->helper->saveSession('depo', $depo);\n // $this->helper->addStock($productInfo);\n $prdd=$this->productRepo->get('deposit');\n \n $subid=$prdd->getId();\n // $this->helper->addStock($prdd);\n $this->helper->log(\"create:creating bundle mainid $mainid subid $subid rental $rental depo $depo\");\n\n if($subject->getQuote()->getExtensionAttributes()==null){\n $cartExtension = $this->cartExtensionFactory->create();\n $subject->getQuote()->setExtensionAttributes($cartExtension);\n// file_put_contents('lastq.txt','lastset');\n $subject->getQuote()->getExtensionAttributes()->setRentalData($this->qo);\n\n }\n\n $rental=$rental;///1.21;\n $depo=$depo;///1.21;\n\n\n\n\n\n $subject->getQuote()->getExtensionAttributes()->getRentalData()->setLastRequest($dd,$rental,$depo);\n $subject->getQuote()->getExtensionAttributes()->getRentalData()->setRentalDates($opstr);\n $_product=$this->createBundle($productInfo, $prdd,$opstr,$rental,$depo);\n/// $this->helper->updateProductStock($_product); \n $bundleid=$_product->getId();\n $this->helper->log(\"created $bundleid\");\n // get selection option in a bundle product\n $selectionCollection = $_product->getTypeInstance(true)\n ->getSelectionsCollection(\n $_product->getTypeInstance(true)->getOptionsIds($_product),$_product);\n \n // create bundle option\n $cont = 0;\n $selectionArray = [];\n foreach ($selectionCollection as $proselection){\n $this->helper->log(\" selection \".get_class($proselection).\"\\n\");\n $selectionArray[$cont] = $proselection->getSelectionId();\n $cont++;\n }\n // get options ids\n $optionsCollection = $_product->getTypeInstance(true)\n ->getOptionsCollection($_product);\n $bos=[]; \n foreach ($optionsCollection as $options) {\n /**@var $options \\Magento\\Bundle\\Api\\D/ata\\BundleOptionInterface */\n \n/// $links=$options->getProductLinks();\n //// $lnks=print_r($links,1);\n $id_option = $options->getId();\n \n $sel=$this->helper->getSel($id_option);\n \n \n \n $bos[$id_option]=[$sel];\n $this->helper->log(\"create: id $id_option sel $sel\");\n \n \n }\n \n \n $params = [\n 'product' => $_product->getId(),\n 'bundle_option' => $bos,\n 'qty' => 1\n ]; \n \n $parentid=$_product->getId();\n \n $requestInfo['product']=$_product->getId();\n $requestInfo['bundle_option']=$bos;\n $requestInfo['qty']=1;\n $bss=print_r($bos,1);\n $this->helper->log(\"create: adding to caert bos: $bss \");\n /**@var $result \\Magento\\Checkout\\Model\\Cart */\n ///$cart->addProduct($productInfo);\n \n /**@var $item \\Magento\\Quote\\Model\\Quote\\Item */\n \n \n $result=$proceed($_product,$requestInfo);\n $this->helper->log(\"addeds\");\n \n \n \n foreach($result->getItems() as $item ){\n \n if($item->getProductId()==$bundleid){\n\n \n $options = $item->getOptions();\n foreach ($options as $option)\n {\n if ($option->getCode() == 'bundle_selection_attributes')\n {\n $oo=$option->getValue();\n $this->helper->log(\"created: option bundle $oo\");\n \n /// $unserialized = unserialize($option->getValue());\n //$unserialized['price'] = number_format($rental+$depo, 2, '.', ',');\n /// $option->setValue(serialize($unserialized));\n }\n }\n try\n {\n/// $item->setOptions($options)->save();\n }\n catch (\\Exception $e)\n {}\n \n $item->setCustomPrice($rental+$depo);\n $item->setOriginalCustomPrice($rental+$depo);\n $this->helper->log(\"create:save bundle $rental dep $depo\");\n\n foreach($item->getChildren() as $it){\n \n $it->setIsSuperMode(true);\n if($it->getProduct()->getId()===$mainid){\n $it->setCustomPrice($rental);\n $it->setDiscountCalculationPrice($rental);\n \n $it->setOriginalCustomPrice($rental);\n $it->getProduct()->setIsSuperMode(true);\n $it->setFinalPrice($rental);\n $this->helper->log(\"create:set price \".$it->getId().\" price parentid \".$item->getId().\" paritid \".$item->getItemId());\n\n\n $options = $it->getOptions();\n foreach ($options as &$option)\n {\n if ($option->getCode() == 'bundle_selection_attributes')\n {\n $oo=$option->getValue(); \n $this->helper->log(\"created: $mainid rental $oo\");\n \n $unserialized = json_decode($option->getValue(),true);\n $unserialized['price'] = number_format($rental, 2, '.', ',');\n $option->setValue(json_encode($unserialized));\n \n }\n }\n try\n {\n $it->setOptions($options);\n /// $item->setOptions($options)->save();\n }catch(\\Exception $e){\n \n }\n \n \n }\n\n else if($it->getProduct()->getId()==$subid){\n $it->setCustomPrice($depo);\n $it->setDiscountCalculationPrice(0);\n $it->setOriginalCustomPrice($depo);\n $it->getProduct()->setIsSuperMode(true);\n $this->helper->log(\"create:set price \".$it->getId().\" price parentid \".$item->getId().\" paritid \".$item->getItemId());\n \n $options = $it->getOptions();\n $it->setFinalPrice($depo);\n foreach ($options as &$option)\n {\n if ($option->getCode() == 'bundle_selection_attributes')\n {\n $oo=$option->getValue();\n $this->helper->log(\"created: $subid deposi9teopt $oo\");\n\n $unserialized = json_decode($option->getValue(),true);\n $unserialized['price'] = number_format($depo, 2, '.', ',');\n $option->setValue(json_encode($unserialized));\n \n }\n }\n try\n {\n $it->setOptions($options);\n /// $item->setOptions($options)->save();\n }\n catch (\\Exception $e)\n {}\n \n }\n \n }\n \n \n }\n }\n \n \n \n /*\n foreach($result->getItems() as $item ){\n \n \n $b=$item->getData('info_buyRequest');\n $co=$item->getCustomOption();\n $bo=$item->getBuyRequest();\n $bor=\"\";\n $this->helper->log(\"adding item\");\n \n if($bo){\n // $bo=get_class($bo);\n \n $bor=$bo->getData('rental_option');\n \n }\n $parid=$item->getParentItemId();\n $ppid=\"\";\n $bsku='';\n $itsku=$item->getProduct()->getSku();\n $itid=$item->getId();\n \n if($parid){\n $ppid=$item->getParentItem()->getId();\n $bsku=$item->getParentItem()->getProduct()->getSku();\n }\n \n file_put_contents('around.txt', \"item $itid parient $parid ppid $ppid bundle $bundleid mainid $mainid itemsku $itsku busku $bsku \\n \",FILE_APPEND);\n if($item->getProductId()==$mainid&&$bor==$opstr){\n \n \n if($item->getParentItem()&& $item->getParentItem()->getProduct()->getId()==$bundleid){\n \n $item->setCustomPrice($rental);\n $item->setOriginalCustomPrice($rental);\n $skux=$item->getProduct()->getSku();\n file_put_contents('around.txt', \"setting price of $mainid $skux parid $parid \\n \",FILE_APPEND);\n $item->getProduct()->setIsSuperMode(true);\n }\n \n }\n if($item->getProductId()==$subid&&$bor==$opstr){\n // $parid=$item->getParentItemId();\n if($item->getParentItem()&& $item->getParentItem()->getProduct()->getId()==$bundleid){\n $item->setCustomPrice($depo);\n $item->setOriginalCustomPrice($depo);\n $item->getProduct()->setIsSuperMode(true);\n }\n \n }else if($item->getProductId()==$bundleid){\n/// $this->helper->log(\"dditem $dd rental $rental depo $depo bor $bor itemid \".$item->getProductId().\" opstr $opstr\");\n /// $item->setCustomPrice($depo+$rental);\n /// $item->setOriginalCustomPrice($depo+$rental);\n /// $item->getProduct()->setIsSuperMode(true);\n $item->setIsSuperMode(true);\n }\n \n \n }\n */\n $this->helper->log(\"committing\");\n \n $con->commit();\n $this->helper->log(\"added to cart\");\n $con=false;\n }catch(LocalizedException $e){\n $this->helper->log(\"error in adding\");\n $this->helper->log($e->getMessage());\n $this->helper->log($e->getTraceAsString());\n $this->msgmgr->addErrorMessage($e->getMessage()) ;\n/// throw $e;\n }\n catch(\\Exception $e){\n $this->helper->log(\"error in adding:main exception\");\n $this->helper->log($e->getMessage());\n $this->msgmgr->addErrorMessage((string)__('Cannot add.')) ; \n/// throw $e; \n }\n finally {\n if($con){\n $con->rollBack();\n }\n }\n \n return $result??''; \n \n }", "public function update(Request $request, ExtraItem $extraItem)\n {\n //\n }", "public function addToDetail($item)\n {\n // validation for constraint: itemType\n if (!is_string($item)) {\n throw new \\InvalidArgumentException(sprintf('The Detail property can only contain items of string, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->Detail[] = $item;\n return $this;\n }", "public function add_requirement( sn\\base\\requirement\\I_Requirement $requirement );", "function addItemForUpdate($item) {\n $this->_update[$item->getId()] = $item;\n }", "public function field_additional_items() {\n\t\t$addtl_items = array(\n\t\t\t\t'log_404s' => __( 'Log 404 errors as events', 'wp-google-analytics' ),\n\t\t\t\t'log_searches' => sprintf( __( 'Log searches as /search/{search}?referrer={referrer} (<a href=\"%s\">deprecated</a>)', 'wp-google-analytics' ), 'http://wordpress.org/extend/plugins/wp-google-analytics/faq/' ),\n\t\t\t\t'log_outgoing' => __( 'Log outgoing links as events', 'wp-google-analytics' ),\n\t\t\t);\n\t\tforeach( $addtl_items as $id => $label ) {\n\t\t\techo '<label for=\"wga_' . $id . '\">';\n\t\t\techo '<input id=\"wga_' . $id . '\" type=\"checkbox\" name=\"wga[' . $id . ']\" value=\"true\" ' . checked( 'true', $this->_get_options( $id ), false ) . ' />';\n\t\t\techo '&nbsp;&nbsp;' . $label;\n\t\t\techo '</label><br />';\n\t\t}\n\t}", "function add($record)\n {\n $data = get_object_vars($record);\n $this->rest->initialize(array('server' => REST_SERVER));\n $this->rest->option(CURLOPT_PORT, REST_PORT);\n $retrieved = $this->rest->post('recipe/maintenance/item/id/' . $record->menu_id.'-'.$record->inventory_id, $data);\n }", "public function klAddedToCartItemData($quote, $addedItem)\n {\n $addedProduct = $addedItem->getProduct();\n $addedItemData = [\n 'AddedItemCategories' => (array) $addedProduct->getCategoryIds(),\n 'AddedItemImageUrlKey' => (string) is_null($addedProduct->getData('small_image')) ? \"\" : stripslashes($addedProduct->getData('small_image')),\n 'AddedItemPrice' => (float) $addedProduct->getFinalPrice(),\n 'AddedItemQuantity' => (int) $addedItem->getQty(),\n 'AddedItemProductID' => (int) $addedProduct->getId(),\n 'AddedItemProductName' => (string) $addedProduct->getName(),\n 'AddedItemSku' => (string) $addedProduct->getSku(),\n 'AddedItemUrl' => (string) is_null($addedProduct->getProductUrl()) ? \"\" : stripslashes($addedProduct->getProductUrl()),\n ];\n\n $klAddedToCartPayload = array_merge(\n $this->klBuildCartData($quote, $addedItem),\n $addedItemData\n );\n\n if ($addedItem->getProductType() == 'bundle') {\n $klAddedToCartPayload = array_merge(\n $klAddedToCartPayload,\n ['AddedItemBundleOptions' => $this->getBundleProductOptions($addedItem)]\n );\n }\n\n // Storing payload in the DataHelper object for SalesQuoteSaveAfter Observer since quoteId is not set at this point for guest checkouts\n $this->_dataHelper->setObserverAtcPayload($klAddedToCartPayload);\n }", "private function get_additional_entry_item( $addon_meta_data ) {\n\n\t\tif ( ! isset( $addon_meta_data['value'] ) || ! is_array( $addon_meta_data['value'] ) ) {\n\t\t\treturn array();\n\t\t}\n\t\t$status = $addon_meta_data['value'];\n\t\t$additional_entry_item = array(\n\t\t\t'label' => __( 'Google Sheets Integration', Forminator::DOMAIN ),\n\t\t\t'value' => '',\n\t\t);\n\n\n\t\t$sub_entries = array();\n\t\tif ( isset( $status['connection_name'] ) ) {\n\t\t\t$sub_entries[] = array(\n\t\t\t\t'label' => __( 'Integration Name', Forminator::DOMAIN ),\n\t\t\t\t'value' => $status['connection_name'],\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $status['is_sent'] ) ) {\n\t\t\t$is_sent = true === $status['is_sent'] ? __( 'Yes', Forminator::DOMAIN ) : __( 'No', Forminator::DOMAIN );\n\t\t\t$sub_entries[] = array(\n\t\t\t\t'label' => __( 'Sent To Google Sheets', Forminator::DOMAIN ),\n\t\t\t\t'value' => $is_sent,\n\t\t\t);\n\t\t}\n\n\t\tif ( isset( $status['description'] ) ) {\n\t\t\t$sub_entries[] = array(\n\t\t\t\t'label' => __( 'Info', Forminator::DOMAIN ),\n\t\t\t\t'value' => $status['description'],\n\t\t\t);\n\t\t}\n\n\t\t$additional_entry_item['sub_entries'] = $sub_entries;\n\n\t\t// return single array\n\t\treturn $additional_entry_item;\n\t}", "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 addSpecial(string $key, $value): void {\n\t\t$this->m_specials[$key] = $value;\n\t}", "public function insertOrderDetails($value,$line_item, $mainOrderId)\n {\n //main order\n $order_list_arr['name'] = $value->name;\n $order_list_arr['shpoify_order_id'] = $value->id;\n $order_list_arr['line_item_id'] = $line_item->id;\n $order_list_arr['order_number'] = $value->order_number;\n $order_list_arr['customer_name'] = $value->billing_address->name;\n $order_list_arr['app_id'] = $value->app_id;\n $order_list_arr['checkout_id'] = $value->checkout_id;\n $order_list_arr['token'] = $value->token;\n $order_list_arr['gateway'] = $value->gateway;\n $order_list_arr['total_price'] = $value->total_price;\n $order_list_arr['subtotal_price'] = $value->subtotal_price;\n $order_list_arr['currency'] = $value->currency;\n $order_list_arr['cart_token'] = $value->cart_token;\n $order_list_arr['checkout_token'] = $value->checkout_token;\n $order_list_arr['order_status_url'] = $value->order_status_url;\n\n return OrderDetails::insertGetId($order_list_arr);\n\n }", "function on_add_extra()\r\n\t{\r\n\t}", "public function addItem(My_ShoppingCart_Item_Interface $item)\n {\n $this->_order->Orderdetail[] = $item;\n }", "public function add($item)\n {\n $this->manuallyAddedData[] = $item;\n }", "public function store(Request $request, Purchaserequest $purchaserequest, Purchaserequestitem $purchaserequestitem)\n {\n\n $id = Purchaserequest::where('pr_req_comp_code', auth()->user()->company)\n ->first()->pr_req_no ?? date('Y') . 00000;\n $year = date('Y');\n $id_year = substr($id, 0, 4);\n $seq = $year <> $id_year ? 0 : +substr($id, -5);\n $new_id = sprintf(\"%0+4u%0+6u\", $year, $seq + 1);\n // $purchaserequest->pr_req_no = $new_id;\n\n\n $lastAccountForCurrentYear = Purchaserequest::where('pr_req_comp_code', auth()->user()->company)\n ->where('pr_req_no', 'like', date('Y') . '%') // filter for current year numbers\n ->orderByDesc('pr_req_no', 'desc') // the biggist one first\n ->first();\n\n $purchaserequest->pr_req_no = $lastAccountForCurrentYear\n ? ($lastAccountForCurrentYear->pr_req_no + 1) // just increase value to 1\n : (date('Y') . $digitRepresentingASerie . '00001');\n\n $new_id = $purchaserequest->pr_req_no;\n $purchaserequest->pr_req_no = $new_id;\n\n\n $purchaserequest->pr_req_uid = Auth::user()->id;\n $purchaserequest->pr_req_name = Auth::user()->name;\n $purchaserequest->pr_req_desi = Auth::user()->dept;\n $purchaserequest->pr_req_dept = Auth::user()->flex2;\n $purchaserequest->pr_req_mobile = Auth::user()->mobile;\n $purchaserequest->pr_req_email = Auth::user()->email;\n $purchaserequest->pr_req_brand_name = Auth::user()->brand_name;\n\n $date = Carbon::createFromFormat('d-m-Y', $request->pr_req_del_date);\n $purchaserequest->pr_req_del_date = $date;\n\n $purchaserequest->pr_req_status = 1;\n $purchaserequest->pr_req_remarks = $request->pr_req_remarks;\n\n\n\n $purchaserequest->pr_req_comp_code = Auth::user()->company;\n\n if ((Auth::user()->company) == 92) {\n\n $purchaserequest->pr_req_comp_name = 'TAMANI GLOBAL DEVELOPMENT & INVESTMENT L.L.C';\n } else if ((Auth::user()->company) == 34) {\n\n $purchaserequest->pr_req_comp_name = 'TAMANI TRADING AND ENTERTAINMENT L.L.C';\n } else {\n\n $purchaserequest->pr_req_comp_name = 'Al Jarwani';\n }\n\n\n\n\n\n foreach ($request->pri_qty as $key => $value) {\n\n if ($request->pri_qty[$key]) {\n $item = resolve(Purchaserequestitem::class);\n $purchaserequestitem->pri_item = $value['pri_item'];\n $purchaserequestitem->pri_qty = $value['pri_qty'];\n $purchaserequestitem->pri_price = $value['pri_price'];\n $purchaserequestitem->pri_amount = $value['pri_qty'] * $value['pri_price'];\n $purchaserequestitem->pri_flex1 = $new_id;\n $purchaserequestitem->save();\n // $account->item()->save($item);\n }\n }\n\n\n\n\n\n $purchaserequest->save();\n\n\n\n return redirect('purchase/purchaserequest')->with('success', 'Record Created Successfully.');\n }", "function fill_in_additional_detail_fields()\n {\n parent::fill_in_additional_detail_fields();\n $this->project_name = $this->_get_project_name($this->project_id);\n $this->resource_name = $this->getResourceName();\n }", "public function add($item);", "public function add($item);", "function add_field($field, $value) {\n // sent to paypal as POST variables. If the value is already in the \n // array, it will be overwritten.\n \n $this->fields[\"$field\"] = $value;\n }", "final public function addItemTechnicianInCharge() {\n $this->addUserByField('users_id_tech', true);\n }", "public function getAdditional();", "public function setSpecialReqPref(array $specialReqPref)\n {\n $this->specialReqPref = $specialReqPref;\n return $this;\n }", "public function setSpecialReqPref(array $specialReqPref)\n {\n $this->specialReqPref = $specialReqPref;\n return $this;\n }", "private function _setAdditionalRequestData(Array $additional_infos){\n \n // setting reference\n $this->_payment_request->setReference($additional_infos['id_order']);\n \n // setting redirect url\n $redirect_url = $this->_payment_request->getRedirectURL();\n if (Tools::isEmpty($redirect_url))\n $this->_payment_request->setRedirectURL($this->_generateRedirectUrl($additional_infos));\n }", "function add_field($field, $value) \n {\n // sent to paypal as POST variables. If the value is already in the \n // array, it will be overwritten.\n \n $this->fields[\"$field\"] = $value;\n }", "public function autoFill(Request $req)\n {\n $data=$req->id; //item is the get data from url\n //var_dump($data);\n $item_details=Item::where('id','=',$data)->get()->toArray();\n $hsn_row=HSN::where('hsn','=',$item_details[0]['hsn'])->pluck('gst_id','cess_id')->toArray();//returns an associative array with key as cess_id and value as gst_id of each row\n $gst_id=array_values($hsn_row);\n $cess_id=array_keys($hsn_row);\n $item_details[0]['gst']=$gst_id[0];\n $item_details[0]['cess']=$cess_id[0];\n\n\n //dd(json_encode($item_details[0]));\n\n return json_encode($item_details[0]);\n \n }", "protected function storeExtraInfo()\n\t{\n\t\t$input = $this->connection->getExtraInfo();\n\t\t\n\t\tif (!isset($input)) {\n\t\t\t$this->extrainfo[] = null;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (!is_string($input)) {\n\t\t\ttrigger_error(\"Metadata in other forms that a string is not yet supported\", E_USER_NOTICE);\n\t\t\treturn;\t\t\t\n\t\t}\n\t\t\n\t\t$info[] = (object)array('type'=>'_raw_', 'value'=>$input);\n\t\t\n\t\t$matches = null;\n\t\tif (preg_match_all('%<extraInfo>.*?</extraInfo>%is', $input, $matches, PREG_SET_ORDER)) {\n\t\t\tforeach ($matches[0] as $xml) {\n\t\t\t\t$sxml = new SimpleXMLElement($xml);\n\t\t\t\t$info[] = (object)array('type'=>(string)$sxml->type, 'value'=>(string)$sxml->value->string);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->extrainfo[] = $info;\n\t}", "function gift_membership_order_meta_handler( $item_id, $cart_item, $order_id ) {\r\n \r\n if( isset( $cart_item->legacy_values['gift_recipient_name'] ) ) {\r\n wc_add_order_item_meta( $item_id, 'Recipient Name', $cart_item->legacy_values['gift_recipient_name'] );\r\n }\r\n if( isset( $cart_item->legacy_values['gift_recipient_email'] ) ) {\r\n wc_add_order_item_meta( $item_id, 'Recipient Email', $cart_item->legacy_values['gift_recipient_email'] );\r\n }\r\n}", "private function addDetail()\n { \n $params = array();\n $params['db_link'] = $this->db;\n $params['ticket_id'] = $_REQUEST['ticket_id'];\n $Tickets = new Tickets($params);\n \n if($_REQUEST['changed_status'] != 0)\n {\n \n $Tickets->setStatus($_REQUEST['changed_status']);\n $Tickets->update();\n //save log \n $this->saveLog($_REQUEST['changed_status'], $_REQUEST['ticket_id'], null);\n }\n \n $data = array();\n $data['subject'] = stripslashes(trim($_REQUEST['subject']));\n $data['notes'] = stripslashes(trim($_REQUEST['notes']));\n $data['user_id'] = $_SESSION['LOGIN_USER']['userId'];\n \n //$Tickets = new Tickets($params);\n $details_id = $Tickets->addDetails($data);\n\n if($details_id)\n {\n $files = $this->getUploadedFiles();\n $this->saveAttachments($files, $_REQUEST['ticket_id'], $details_id);\n }\n \n //Send Email To resolvers, source, etc.\n $this->sendEmail($_REQUEST['ticket_id'], $data['subject']);\n \n \n \n echo '[{\"isError\":0, \"message\":\"Details added Successfully.\"}]';\n exit;\n }", "public function appendAdditionalInfos(\\Diadoc\\Api\\Proto\\Invoicing\\AdditionalInfo $value)\n {\n return $this->append(self::ADDITIONALINFOS, $value);\n }", "public function getAdditionalDetail($items) {\n\n $tmp_array = array();\n\n if (!empty($items)) {\n foreach ($items as $item) {\n $tmp_array[] = $this->getItemAdditionDetails($item);\n }\n }\n //print_r($tmp_array); exit;\n return $tmp_array;\n }", "public function add_only() {\n $this -> viewClass = 'Json';\n $res = array();\n $data = $this -> request -> data;\n if (isset($data['token'], $data['user_id'], $data['fields_in'], $data['value'], $data['model'], $data['fields_out'])) {\n\n //================\n $new_data = $this -> Format -> formatSaveData($data['model'], $data['fields_in'], $data['value']);\n $list_goods_id = $this -> Goods -> getCode($new_data[0]['Spec']['goods_id']);\n $conditions_max = array('Spec.customer_id' => $new_data[0]['Spec']['customer_id'], 'Spec.goods_id' => $list_goods_id);\n $fields_MAX = array('MAX(Spec.order_num)');\n $max_oder_num = $this -> Spec -> find('first', array('fields' => $fields_MAX, 'conditions' => $conditions_max, 'recursive' => 0));\n $new_data[0]['Spec']['order_num'] = $max_oder_num[0]['max'] + 1;\n $model = ClassRegistry::init($data['model']);\n if (!empty($new_data)) {\n if ($model -> saveAll($new_data)) {\n $res['status'] = STS_SUCCESS;\n $res['id'] = $model -> id;\n } else {\n $error = $model -> validationErrors;\n $this->log($error, LOG_DEBUG);\n $res['status'] = STS_DB_UPDATE_ERROR;\n }\n } else {\n $res['status'] = STS_ERROR_AUTH;\n }\n //=============================\n } else {\n $res['status'] = STS_ERROR_MISSINGDATA;\n }\n $this -> set(compact('res'));\n $this -> set('_serialize', array('res'));\n\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "public function prepare_item_for_response($item, $request)\n {\n }", "function add($item);", "static public function addAdditionalHeader($new_header) {\n\t\tif (is_array($new_header)) {\n\t\t\tself::$additional_headers = array_merge(self::$additional_headers, $new_header);\n\t\t} else {\n self::$additional_headers[] = (string)trim($new_header);\n }\n\t}", "function OnAddItem(){\n $this->_data = $this->Request->Form;\n $this->OnBeforeCreateEditControl();\n if (! $this->error) {\n \t$this->InitItemsEditControl();\n if ($this->disabled_add) {\n if (strlen($this->host_library_ID)) {\n $this->library_ID = $this->host_library_ID;\n }\n /**\n * @todo fix here (recursion)\n */\n $this->AfterSubmitRedirect(\"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"&MESSAGE[]=LIBRARY_DISABLED_ADD\" . \"&\" . $this->restore);\n }\n\n }\n }", "protected function addItems()\n {\n $origin = 'stock';\n $code = 'cataloginventory';\n $message = Data::ERROR_QTY;\n $additionalData = null;\n $mockItems = [];\n\n for ($i = 0; $i < 2; $i++) {\n $mockItems[] = [\n 'origin' => $origin . $i,\n 'code' => $code,\n 'message' => $message . $i,\n 'additionalData' => $additionalData,\n ];\n $this->listStatus->addItem($origin . $i, $code, $message . $i, $additionalData);\n }\n return $mockItems;\n }", "public function add(Request $req)\n {\n \t\n Cart::add(['id'=>$req->input('id'), 'name'=>$req->input('name'), 'qty'=>$req->input('qty'), 'price'=>$req->input('price'), 'options'=>['color'=>$req->input('color'), 'size'=>$req->input('size'), 'shipping_single_price'=> $req->input('shipping_single_price'), 'shipping'=>$req->input('shipping'), 'store_id'=>$req->input('store_id'), 'store_name'=>$req->input('store_name'), 'total_price'=>$req->input('total_price')] ])->associate('App\\Product');\n\n\n \treturn response ()->json ();\n }", "function record_request($vendor_id, $item_id, $phone, $notify) {\n $new = make_post_call(\"request_ID\", [\"vendor_id\" => $vendor_id, \"item_id\" => $item_id, \"phone\" => $phone, \"notify\" => $notify]);\n return $new;\n }", "public function setAdditionalInfo($value)\n {\n return $this->set(self::ADDITIONALINFO, $value);\n }", "public function getAdditional()\n {\n return $this->additional;\n }", "public function addExtra($extra_name, $extra_value)\n {\n\n }", "public function addSinglePurchaseDetails()\n\t{\n\t\t$singleProduct = [];\n\t\tforeach($this->orderParameters as $orders){\n\t\t\t$found = 0;\n\t\t\tforeach($this->aggregateProduct as $product){\n\t\t\t\tif($product[\"title\"] == $orders[\"title\"])\n\t\t\t\t\t$found++;\n\t\t\t}\n\t\t\t\n\t\t\tif($found == 0)\n\t\t\t $singleProduct[] = $orders;//add to single\n\t\t}\n\t\t\n\t\t$this->addPurchaseDetails($singleProduct);\n\t}", "private function addItemToCollection()\n {\n $this->collection->items[$this->cart_hash] = $this;\n\n }", "public function add_request($request='') {\n $request = JsonParser::decode($request);\n if (is_array($request) === false) {\n $request = array($request);\n }\n $this->__requests[] = $request;\n return (true);\n }", "public function add_info($info)\r\n { \r\n }", "public function getAdditionalData() {\n return $this->item->getAdditionalData();\n }", "public function add_bill_item($action, $bill_id, $particular, $qnt = NULL, $amt = NULL, $mrp = NULL, $item_id = NULL, $tax_amount = NULL,$tax_id = NULL) {\r\n\r\n\t\t$data['bill_id'] = $bill_id;\r\n\r\n\t\t$data['particular'] = $particular;\r\n\r\n\t\t$data['quantity'] = $qnt;\r\n\r\n\t\t$data['amount'] = $amt;\r\n\r\n\t\t$data['mrp'] = $mrp;\r\n\r\n\t\t$data['type'] = $action;\r\n\r\n\t\t$data['item_id'] = $item_id;\r\n\r\n\t\t$data['clinic_code'] = $this->session->userdata('clinic_code');\r\n\r\n\t\t$data['tax_amount'] = $tax_amount;\r\n\r\n\t\t$data['tax_id'] = $tax_id;\r\n\r\n\r\n\r\n\t\tif ($item_id != NULL){\r\n\r\n\t\t\t$query = $this->db->get_where('bill_detail', array('bill_id ' => $bill_id, 'item_id ' => $item_id));\r\n\r\n\t\t\tif ($query->num_rows() > 0){\r\n\r\n\t\t\t\t$bill_detail = $query->row_array();\r\n\r\n\t\t\t\t$data['quantity'] = $qnt + $bill_detail['quantity'];\r\n\r\n\t\t\t\t$data['amount'] = $amt + $bill_detail['amount'];\r\n\r\n\t\t\t\t$data['sync_status'] = 0;\r\n\r\n\t\t\t\t$this->db->update('bill_detail', $data,array('bill_id ' => $bill_id, 'item_id ' => $item_id));\r\n\r\n\t\t\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t$this->db->insert('bill_detail', $data);\r\n\r\n\t\t\t\t$bill_detail_id = $this->db->insert_id();\r\n\r\n\t\t\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$this->db->insert('bill_detail', $data);\r\n\r\n\t\t\t$bill_detail_id = $this->db->insert_id();\r\n\r\n\t\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\t\t}\r\n\r\n\t\tif($action == \"tax\"){\r\n\r\n\t\t\t$total_amount = 0;\r\n\r\n\t\t\t$tax_amount = $amt;\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$total_amount = $amt;\r\n\r\n\t\t}\r\n\r\n\r\n\r\n $sql = \"update \" . $this->db->dbprefix('bill') . \" set sync_status = 0,total_amount = total_amount + ? where bill_id = ?;\";\r\n\r\n $this->db->query($sql, array($total_amount, $bill_id));\r\n\r\n\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\r\n\r\n\t\t$total_tax_amount=$tax_amount;\r\n\r\n\t\t$sql = \"update \" . $this->db->dbprefix('bill') . \" set sync_status = 0,tax_amount = tax_amount + ? where bill_id = ?;\";\r\n\r\n $this->db->query($sql, array($total_tax_amount, $bill_id));\r\n\r\n\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\r\n\t\t//Due Amount \r\n\t\t/*$due_amount = $total_amount + $tax_amount;\r\n\r\n\t\t$sql = \"update \" . $this->db->dbprefix('bill') . \" set sync_status = 0,due_amount = due_amount + ? where bill_id = ?;\";\r\n\r\n $this->db->query($sql, array($due_amount, $bill_id));\r\n\r\n\t\t//echo $this->db->last_query().\"<br/>\";*/\r\n\t\treturn $bill_detail_id;\r\n\r\n }", "public function copyMemoInvoiceSpecialItem($special_item_id, $invoice_id) {\r\n\t\t$this->db->from('invoice_special_items');\r\n\t\t$this->db->where('special_item_id', $special_item_id);\r\n\t\t$item = array();\r\n\t\t$query = $this->db->get();\r\n\t\tif($query->num_rows() > 0) {\r\n\t\t\tforeach($query->result_array() as $row) {\r\n\t\t\t\t$item = $row; //get all data\r\n\t\t\t}\r\n\t\t\tunset($item['special_item_id']); //remove invoice_item_id, causes index expection\r\n\t\t\t$item['item_status'] = 0; //make status 0=normal\r\n\t\t\t$item['invoice_id'] = $invoice_id; //update invoice_id to reflect the new invoice id\r\n\t\t\t$this->db->insert('invoice_special_items', $item);\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "public function add_information() \r\n {}", "public function add_information() \r\n {}", "public function addItem(Collection $collection, ItemCreateStruct $itemCreateStruct): Item;", "final public function addItemGroupTechInCharge() {\n if (!empty($this->target_object)) {\n foreach ($this->target_object as $val) {\n if ($val->fields['groups_id_tech'] > 0) {\n $this->addForGroup(0, $val->fields['groups_id_tech']);\n }\n }\n }\n }", "public function addItem($item){\n $this->items[] = $item;\n }", "function add($itemInfo)\n {\n// if (isset($itemInfo['userid'])) {\n// $item = $this->getItemById($itemInfo['userid']);\n// } else {\n// $item = $this->getItemByNumber($itemInfo['email']);\n// }\n// if (count($item) > 0) {\n// $itemInfo['update_time'] = date(\"Y-m-d\");\n// $insert_id = $this->update($itemInfo, $item->userid);\n// } else {\n// $itemInfo['created_time'] = date(\"Y-m-d\");\n// $this->db->trans_start();\n// $this->db->insert('tbl_userinfo', $itemInfo);\n// $insert_id = $this->db->insert_id();\n// $this->db->trans_complete();\n// }\n\n $this->db->where('id', $itemInfo['id']);\n $insert_id = $this->db->update('tbl_userinfo', $itemInfo);\n\n return $insert_id;\n }", "public function add() {\n $insertData = $this->data;\n $keepNullFields = [\n 'estimator_id', 'date_requested', 'date_service', 'class_id',\n 'date_service', 'lat', 'lng'\n ];\n foreach ($keepNullFields as $field) {\n if (!$insertData[$field]) {\n $insertData[$field] = null;\n }\n }\n $model = new ReferralModel;\n $ref = $model->create();\n $ref->set($insertData);\n $ref->save();\n $this->renderJson([\n 'success' => true,\n 'message' => 'Job request created successfully',\n 'data' => $ref->asArray()\n ]);\n }" ]
[ "0.6257337", "0.6117926", "0.5709238", "0.5603667", "0.5565306", "0.54787046", "0.54787046", "0.5448962", "0.54175395", "0.5417266", "0.54095626", "0.5386296", "0.5352028", "0.53457475", "0.5344383", "0.53223836", "0.52587044", "0.52325076", "0.51924473", "0.5169509", "0.5165912", "0.5140794", "0.5110981", "0.51098406", "0.509986", "0.5093913", "0.5086702", "0.5068358", "0.5060309", "0.5058557", "0.5019621", "0.5013064", "0.50091124", "0.49885902", "0.4987355", "0.49842992", "0.49802464", "0.4973691", "0.4973282", "0.497296", "0.49640012", "0.49609888", "0.49609888", "0.4948265", "0.49454528", "0.49440655", "0.4935155", "0.4935155", "0.49330726", "0.4931665", "0.49164516", "0.49065766", "0.49058816", "0.48992607", "0.48969305", "0.48956543", "0.48901975", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48893937", "0.48890644", "0.4875741", "0.48741725", "0.4870634", "0.48682362", "0.48586908", "0.48574045", "0.48560622", "0.4852057", "0.48477638", "0.4841567", "0.48401073", "0.4839766", "0.48384175", "0.48348808", "0.48293668", "0.4820434", "0.4820434", "0.48179996", "0.4817079", "0.48120108", "0.4811491", "0.48083222" ]
0.78590995
0
Method called when an object has been exported with var_export() functions It allows to return an object instantiated with the values
public static function __set_state(array $array) { return parent::__set_state($array); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ExportObject() {\n // Init object\n $plugin = new stdClass();\n // Set values\n $plugin->Name = $this->Name;\n $plugin->Version = $this->Version;\n $plugin->Author = $this->Author;\n $plugin->About = $this->About;\n $plugin->Root = $this->Root;\n $plugin->Identifier = $this->Identifier;\n \n // Return result\n return $plugin;\n }", "protected function constructExportObject()\n\t{\n\t\t//default export is \"all public fields\"\n\t\treturn (object) Arrays::getPublicPropertiesOfObject($this);\n\t}", "function from_export($value) {\n return $value;\n }", "public function export(): mixed;", "public function ExportObject() {\n // Init object\n $col = new stdClass();\n \n // Set values\n $col->id = $this->Id;\n $col->type = $this->Type;\n $col->label = $this->Label;\n $col->p = $this->P;\n \n // Return values\n return $col;\n }", "public function exportData() {\n\t\treturn $this->constructExportObject();\n\t}", "public function toObject();", "function ctools_export_new_object($table, $set_defaults = TRUE) {\r\n $schema = ctools_export_get_schema($table);\r\n $export = $schema['export'];\r\n\r\n $object = new $export['object'];\r\n foreach ($schema['fields'] as $field => $info) {\r\n if (isset($info['object default'])) {\r\n $object->$field = $info['object default'];\r\n }\r\n else if (isset($info['default'])) {\r\n $object->$field = $info['default'];\r\n }\r\n else {\r\n $object->$field = NULL;\r\n }\r\n }\r\n\r\n if ($set_defaults) {\r\n // Set some defaults so this data always exists.\r\n // We don't set the export_type property here, as this object is not saved\r\n // yet. We do give it NULL so we don't generate notices trying to read it.\r\n $object->export_type = NULL;\r\n $object->{$export['export type string']} = t('Local');\r\n }\r\n return $object;\r\n}", "public function export();", "public function export();", "public function export();", "public function export();", "public function export();", "public function createExport();", "public function newInstance(): object;", "public static function createFromGlobals();", "public function export (){\n\n }", "public function getObj();", "function &object(object $value, string $namespace = 'default'): object\n{\n $var = new Variable\\ObjectVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "public static function toObject(){\r\n $args = func_get_args();\r\n \r\n if(count($args) >=2){\r\n $className = '\\\\'.str_replace('.', '\\\\', $args[0]);\r\n $refClass = new \\ReflectionClass($className);\r\n $toObjInstance = $refClass->newInstance();\r\n\r\n unset($args[0]);\r\n \r\n foreach($args as $arg){\r\n \r\n if(is_object($arg)){\r\n $arg = Obj::getProperties($arg);\r\n }\r\n \r\n if(is_array($arg)){\r\n foreach($arg as $propertyName=>$propertyValue){\r\n if($refClass->hasProperty($propertyName)){\r\n $property = $refClass->getProperty($propertyName);\r\n $property->setAccessible(true);\r\n $property->setValue($toObjInstance, $propertyValue);\r\n }\r\n }\r\n }\r\n }\r\n return $toObjInstance;\r\n }\r\n }", "public function export()\n {\n }", "function &stdClass(stdClass $value, string $namespace = 'default'): stdClass\n{\n $var = new Variable\\StdClassVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "public function getExportableValues() {\n\t\telgg_deprecated_notice(__METHOD__ . ' has been deprecated by toObject()', 1.9);\n\t\treturn array(\n\t\t\t'id',\n\t\t\t'entity_guid',\n\t\t\t'name',\n\t\t\t'value',\n\t\t\t'value_type',\n\t\t\t'owner_guid',\n\t\t\t'type',\n\t\t);\n\t}", "public function ExportObject() {\n // Init object\n $overviewChart = new stdClass();\n \n // Set values\n $overviewChart->Types = $this->Types;\n $overviewChart->Chart = $this->Chart->ExportObject();\n \n //return result\n return $overviewChart;\n }", "public function export()\n {\n \n }", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "public function getter () {\n return (object)[\n get_plugin_name => $this->plugin_name,\n get_plugin_version => $this->plugin_version,\n get_translation_slug => $this->translation_slug,\n get_admin_page_slug => $this->admin_page_slug,\n get_api_namespace => $this->api_namespace,\n get_options_name => $this->options_name\n ];\n }", "public function getObject() {}", "public function getObject() {}", "public function export()\n {\n //\n }", "function _instantiateExportDeployment($context) {\n\t\t$exportDeploymentClassName = $this->getExportDeploymentClassName();\n\t\t$this->import($exportDeploymentClassName);\n\t\t$exportDeployment = new $exportDeploymentClassName($context, $this);\n\t\treturn $exportDeployment;\n\t}", "function get_obj()\n {\n $object = new ApiRest;\n return $object;\n }", "public function __CONSTRUCT(){\n\t}", "public function newInstance();", "public function newInstance();", "public function getInstance(): object;", "public function exportedVars(): iterable;", "public static function fromGlobals() {}", "public function ExportObject() {\n // Init object\n $submission = new stdClass();\n \n // Set values\n $submission->Id = $this->Id;\n $submission->DateTime = $this->DateTime;\n $submission->GitHash = $this->GitHash;\n $submission->Categories = array();\n \n // Export each category\n foreach ($this->Categories as $category) {\n $submission->Categories[] = $category->ExportObject();\n }\n \n // return result\n return $submission;\n }", "public function getInstance(): object\n {\n }", "function ctools_get_default_object($table, $name) {\r\n $schema = ctools_export_get_schema($table);\r\n $export = $schema['export'];\r\n\r\n if (!$export['default hook']) {\r\n return;\r\n }\r\n\r\n // Try to load individually from cache if this cache is enabled.\r\n if (!empty($export['cache defaults'])) {\r\n $defaults = _ctools_export_get_some_defaults($table, $export, array($name));\r\n }\r\n else {\r\n $defaults = _ctools_export_get_defaults($table, $export);\r\n }\r\n\r\n $status = variable_get($export['status'], array());\r\n\r\n if (!isset($defaults[$name])) {\r\n return;\r\n }\r\n\r\n $object = $defaults[$name];\r\n\r\n // Determine if default object is enabled or disabled.\r\n if (isset($status[$object->{$export['key']}])) {\r\n $object->disabled = $status[$object->{$export['key']}];\r\n }\r\n\r\n $object->{$export['export type string']} = t('Default');\r\n $object->export_type = EXPORT_IN_CODE;\r\n $object->in_code_only = TRUE;\r\n\r\n return $object;\r\n}", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->number = $this->_number;\n $stdClass->internal = $this->_internal;\n return $stdClass;\n }", "public function getObject(): object;", "public function get_export_data()\n {\n\n $l_sql = \"SELECT isys_obj_type__id, isys_obj_type__title, isys_verinice_types__title, isys_verinice_types__const \" . \"FROM isys_obj_type \" . \"INNER JOIN isys_verinice_types ON isys_obj_type__isys_verinice_types__id = isys_verinice_types__id \";\n\n return $this->retrieve($l_sql);\n\n }", "public function dataProviderExport()\n {\n // Regular :\n $data = [\n [\n 'test string',\n var_export('test string', true),\n ],\n [\n 75,\n var_export(75, true),\n ],\n [\n 7.5,\n var_export(7.5, true),\n ],\n [\n null,\n 'null',\n ],\n [\n true,\n 'true',\n ],\n [\n false,\n 'false',\n ],\n [\n [],\n '[]',\n ],\n ];\n // Arrays :\n $var = [\n 'key1' => 'value1',\n 'key2' => 'value2',\n ];\n $expectedResult = <<<'RESULT'\n[\n 'key1' => 'value1',\n 'key2' => 'value2',\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n $var = [\n 'value1',\n 'value2',\n ];\n $expectedResult = <<<'RESULT'\n[\n 'value1',\n 'value2',\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n $var = [\n 'key1' => [\n 'subkey1' => 'value2',\n ],\n 'key2' => [\n 'subkey2' => 'value3',\n ],\n ];\n $expectedResult = <<<'RESULT'\n[\n 'key1' => [\n 'subkey1' => 'value2',\n ],\n 'key2' => [\n 'subkey2' => 'value3',\n ],\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n // Objects :\n $var = new \\StdClass();\n $var->testField = 'Test Value';\n $expectedResult = \"unserialize('\" . serialize($var) . \"')\";\n $data[] = [$var, $expectedResult];\n $var = function () {return 2;};\n $expectedResult = 'function () {return 2;}';\n $data[] = [$var, $expectedResult];\n return $data;\n }", "public static function export()\n {\n return null;\n }", "function create()\n\t{\n\t\t$names = $this->_fields;\n\t\t$object = new StdClass;\n\t\tforeach ($names as $name)\n\t\t\t$object->$name = \"\";\n\t\treturn $object;\n\t}", "public function construct()\n {\n return $this->object;\n }", "public function metaExport($object = false);", "public function getValuesObject()\n {\n $obj = new \\stdClass;\n\n foreach ( $this->keyValues as $key => $value )\n {\n $obj->$key = $value;\n }\n\n return $obj;\n }", "public function vars()\n {\n \n return new ArrayWrapper(get_object_vars($this->object));\n \n }", "public function getObject();", "public function getObject();", "function newDataObject() {\n\t\t$ofrPlugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);\n\t\t$ofrPlugin->import('classes.ObjectForReviewPerson');\n\t\treturn new ObjectForReviewPerson();\n\t}", "public function __construct(VariableExportInterface $variableExport)\n {\n $this->serialized = $variableExport->toSerialize();\n }", "public function as_object($class = TRUE, $arguments = array());", "function var_export($expression, $return = false)\n{\n}", "function getObject();", "function getObject();", "abstract public function object();", "abstract protected function createObject();", "public function __construct()\r\n {\r\n $this->_internalObject = new stdClass();\r\n\t\t$a=serialize($this->_internalObject);\r\n\t\t\"echo $a<br>\";\r\n }", "function &getInstance($module_srl)\n\t{\n\t\treturn new ExtraVar($module_srl);\n\t}", "abstract function exportData();", "function createProduct($name,$price,$qty,$id):stdClass\n{\n$product=new stdClass();\n$product->name=$name;\n$product->price=$price;\n$product->quantity= $qty;\n$product->id=$id;\n\nreturn $product;\n}", "abstract protected function exportFunctions();", "public static function factory()\n {\n $class = get_called_class();\n $object = new $class();\n foreach (static::getDefaults() as $field => $value) {\n $object->{$field} = $value;\n }\n return $object;\n }", "public function &__invoke()\r\n\t{\r\n\t\t$result = new stdClass();\r\n\t\tAdhoc::eachTrap('Registry',\r\n\t\t\tfunction ($trap) use (&$result)\r\n\t\t\t{\r\n\t\t\t\t$data =& $trap->GetList();\r\n\t\t\t\tforeach ($data as $k=>$v)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!isset($result->$k) and isset($v))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$result->$k = $v;\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\r\n\t\treturn $result;\r\n\t}", "public static function instantation($the_record){\n\n // can be used to retrieve a string with the name of the called class and static:: introduces its scope.\n $calling_class = get_called_class();\n\n $the_object = new $calling_class;\n\n\n // doing a loop to get all of the values in the object ]\n foreach($the_record as $key => $value) {\n\n if($the_object->has_the_key($key)){\n $the_object->$key = $value;\n \n }\n }\n\n return $the_object;\n }", "public static function get_object() {\n\t\treturn self::$object;\n\t}", "function adminer_object() {\r\n include_once \"./plugins/plugin.php\";\r\n \r\n // autoloader\r\n foreach (glob(\"plugins/*.php\") as $filename) {\r\n include_once \"./$filename\";\r\n }\r\n \r\n $plugins = array(\r\n // specify enabled plugins here\r\n // new AdminerDumpXml,\r\n // new AdminerTinymce,\r\n // new AdminerFileUpload(\"data/\"),\r\n // new AdminerSlugify,\r\n // new AdminerTranslation,\r\n // new AdminerForeignSystem,\r\n // new AdminerLoginPasswordLess(password_hash(\"\", PASSWORD_DEFAULT)),\r\n );\r\n \r\n /* It is possible to combine customization and plugins:\r\n class AdminerCustomization extends AdminerPlugin {\r\n }\r\n return new AdminerCustomization($plugins);\r\n */\r\n class AdminerCustomization extends AdminerPlugin {\r\n function login($login, $password) {\r\n // validate user submitted credentials\r\n return true;\r\n }\r\n }\r\n return new AdminerCustomization($plugins);\r\n \r\n // return new AdminerPlugin($plugins);\r\n}", "public function ExportItem() {\n // Init object\n $submission = new stdClass();\n \n // Set values\n $submission->Id = $this->Id;\n $submission->DateTime = $this->DateTime;\n $submission->ImportDateTime = $this->ImportDateTime;\n $submission->User = $this->User;\n $submission->Good = $this->Good;\n $submission->Bad = $this->Bad;\n $submission->Strange = $this->Strange;\n $submission->GitHash = $this->GitHash;\n $submission->SequenceNumber = $this->SequenceNumber;\n \n // Return result\n return $submission;\n }", "private static function _instantiateThisObject() {\r\n $className = get_called_class();\r\n return new $className();\r\n }", "function instance($obj) {\n\tif (is_string($obj)) {\n\t\t$obj = new $obj;\n\t}\n\treturn $obj;\n}", "public function getOutputObject()\n {\n $baseObject = parent::getOutputObject();\n $baseObject->name = $this->getName();\n\n return $baseObject;\n }", "function ctools_var_export($var, $prefix = '') {\r\n if (is_array($var)) {\r\n if (empty($var)) {\r\n $output = 'array()';\r\n }\r\n else {\r\n $output = \"array(\\n\";\r\n foreach ($var as $key => $value) {\r\n $output .= $prefix . \" \" . ctools_var_export($key) . \" => \" . ctools_var_export($value, $prefix . ' ') . \",\\n\";\r\n }\r\n $output .= $prefix . ')';\r\n }\r\n }\r\n else if (is_object($var) && get_class($var) === 'stdClass') {\r\n // var_export() will export stdClass objects using an undefined\r\n // magic method __set_state() leaving the export broken. This\r\n // workaround avoids this by casting the object as an array for\r\n // export and casting it back to an object when evaluated.\r\n $output = '(object) ' . ctools_var_export((array) $var, $prefix);\r\n }\r\n else if (is_bool($var)) {\r\n $output = $var ? 'TRUE' : 'FALSE';\r\n }\r\n else {\r\n $output = var_export($var, TRUE);\r\n }\r\n\r\n return $output;\r\n}", "public function init_objects() {\n $this->controller_oai = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Expose();\n $this->list_sets = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Sets();\n $this->list_metadata_formats = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Metadata_Formats();\n $this->list_records = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Records();\n $this->get_record = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Get_Record();\n $this->identify = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Identify();\n $this->identifiers = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Identifiers();\n }", "public function _construct(){\n\t\treturn $this->data;\n\t}", "public function _construct(){\n\t\treturn $this->data;\n\t}", "public function regularNew() {}", "function data2Object($data) { \n\t\t\t$class_object = new getData($data); \n\t\t\treturn $class_object; \n\t\t}", "public function newInstance()\n {\n return $this->newInstanceArgs(func_get_args());\n }", "function ctools_export_object($table, $object, $indent = '', $identifier = NULL, $additions = array(), $additions2 = array()) {\r\n $schema = ctools_export_get_schema($table);\r\n if (!isset($identifier)) {\r\n $identifier = $schema['export']['identifier'];\r\n }\r\n\r\n $output = $indent . '$' . $identifier . ' = new ' . get_class($object) . \"();\\n\";\r\n\r\n if ($schema['export']['can disable']) {\r\n $output .= $indent . '$' . $identifier . '->disabled = FALSE; /* Edit this to true to make a default ' . $identifier . ' disabled initially */' . \"\\n\";\r\n }\r\n if (!empty($schema['export']['api']['current_version'])) {\r\n $output .= $indent . '$' . $identifier . '->api_version = ' . $schema['export']['api']['current_version'] . \";\\n\";\r\n }\r\n\r\n // Put top additions here:\r\n foreach ($additions as $field => $value) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n\r\n $fields = $schema['fields'];\r\n if (!empty($schema['join'])) {\r\n foreach ($schema['join'] as $join) {\r\n if (!empty($join['load'])) {\r\n foreach ($join['load'] as $join_field) {\r\n $fields[$join_field] = $join['fields'][$join_field];\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Go through our schema and joined tables and build correlations.\r\n foreach ($fields as $field => $info) {\r\n if (!empty($info['no export'])) {\r\n continue;\r\n }\r\n if (!isset($object->$field)) {\r\n if (isset($info['default'])) {\r\n $object->$field = $info['default'];\r\n }\r\n else {\r\n $object->$field = '';\r\n }\r\n }\r\n\r\n // Note: This is the *field* export callback, not the table one!\r\n if (!empty($info['export callback']) && function_exists($info['export callback'])) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . $info['export callback']($object, $field, $object->$field, $indent) . \";\\n\";\r\n }\r\n else {\r\n $value = $object->$field;\r\n if ($info['type'] == 'int') {\r\n if (isset($info['size']) && $info['size'] == 'tiny') {\r\n $info['boolean'] = (!isset($info['boolean'])) ? $schema['export']['boolean'] : $info['boolean'];\r\n $value = ($info['boolean']) ? (bool) $value : (int) $value;\r\n }\r\n else {\r\n $value = (int) $value;\r\n }\r\n }\r\n\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n }\r\n\r\n // And bottom additions here\r\n foreach ($additions2 as $field => $value) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n\r\n return $output;\r\n}", "function _construct(){ }", "public function createValidObject() : object {\n\t\treturn (object) [\"tweetContent\" => bin2hex(random_bytes(12))];\n\t}", "public function _init_obj()\n {\n // dummy\n }", "protected function make_object( \\stdClass $data ) {\n\t\treturn new Purchase( $data );\n\t}", "public function as_object()\n {\n $this->return_as = 'object';\n return $this;\n }", "static public function fromObj($anObj) {\n\t\t$theClassName = get_called_class();\n\t\t$o = new $theClassName();\n\t\treturn $o->setDataFrom($anObj);\n\t}", "function adminer_object() {\n\t\tinclude_once \"plugins/plugin.php\";\n\t\t// autoloader\n\t\tforeach (glob(\"plugins/*.php\") as $filename) {\n\t\t\tinclude_once $filename;\n\t\t}\n\t\t$plugins = array(\n\t\t\t// specify enabled plugins here\n\t\t\tnew AdminerDatabaseHide(array('information_schema', 'mysql', 'performance_schema')),\n\t\t\t//new AdminerDumpJson,\n\t\t\t//new AdminerDumpBz2,\n\t\t\t//new AdminerDumpZip,\n\t\t\t//new AdminerDumpXml,\n\t\t\t//new AdminerDumpAlter,\n\t\t\t//~ new AdminerSqlLog(\"past-\" . rtrim(`git describe --tags --abbrev=0`) . \".sql\"),\n\t\t\t//new AdminerFileUpload(\"\"),\n\t\t\t//new AdminerJsonColumn,\n\t\t\t//new AdminerSlugify,\n\t\t\t//new AdminerTranslation,\n\t\t\t//new AdminerForeignSystem,\n\t\t\t//new AdminerEnumOption,\n\t\t\t//new AdminerTablesFilter,\n\t\t\t//new AdminerEditForeign,\n\t\t);\n\n\t\treturn new AdminerPlugin($plugins);\n\t}", "public function newCObj() {}", "private function PREPARE_OBJECT_VARIABLE_METHOD()\r\r {\r\r if($this->_type === 'POST')\r\r {\r\r foreach($this->_fields as $key=>$field)\r\r {\r\r $this->_object[$key]['VALUE'] = isset($_POST[$key])?$_POST[$key]:false;\r\r } \r\r } \r\r else if($this->_type === 'GET')\r\r {\r\r foreach($this->_fields as $key=>$field)\r\r {\r\r $this->_object[$key]['VALUE'] = isset($_GET[$key])?$_GET[$key]:false;\r\r } \r\r } \r\r }", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->billOfLading = $this->_billOfLading;\n $stdClass->secondaryPickingType = $this->_secondaryPickingType;\n return $stdClass;\n }", "public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->amountInsuranceBase = $this->_amountInsuranceBase;\n $stdClass->fragile = $this->_fragile;\n $stdClass->parcelsCount = $this->_parcelsCount;\n $stdClass->serviceTypeId = $this->_serviceTypeId;\n return $stdClass;\n }", "abstract public function prepare_new_object(array $args);", "protected function getRealScriptUserObj() {}", "public function export(bool $private = FALSE, bool $meta = FALSE) {\n\t\t$keys = [];\n\t\t$ret = [];\n\n\t\tif ($private) {\n\t\t\t$keys = static::$PRIVATE;\n\t\t} else {\n\t\t\t$keys = static::$PUBLIC;\n\t\t}\n\n\t\tif (!empty(array_intersect(EXP_RESERVED, $keys))) {\n\t\t\tthrow new ExportableException(\n\t\t\t\t\"Reserved key '\".EXP_CLASSNAME.\"' used in object.\"\n\t\t\t);\n\t\t}\n\n\t\tif ($meta) { // Add metadata.\n\t\t\t$ret[EXP_CLASSNAME] = get_class($this);\n\t\t\t$ret[EXP_VISIBILITY] = $private ? 'private' : 'public';\n\t\t}\n\n\t\tforeach ($keys as $k) {\n\t\t\t$current = $this->__exportable_get($k);\n\t\t\tswitch (gettype($current)) {\n\t\t\t\tcase 'object':\n\t\t\t\t\t$ret[$k] = $this->exp_obj(\n\t\t\t\t\t\t$current, $private, $meta\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'array':\n\t\t\t\t\t$ret[$k] = $this->exp_array(\n\t\t\t\t\t\t$current, $private, $meta\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$ret[$k] = $current;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "public static function & GetInstance ();", "public function getInstance(): mixed;", "function FetchObj() {}", "public function convertToUserIntObject() {}" ]
[ "0.69526446", "0.69239384", "0.6577118", "0.63774145", "0.6145065", "0.6124998", "0.6056139", "0.60397303", "0.5923542", "0.5923542", "0.5923542", "0.5923542", "0.5923542", "0.5859145", "0.5837572", "0.58124256", "0.5801868", "0.5717864", "0.5717454", "0.5713008", "0.56903183", "0.56595963", "0.5640697", "0.5604135", "0.55267465", "0.5511789", "0.54628545", "0.54086375", "0.54086375", "0.54042596", "0.5375921", "0.53738666", "0.53707314", "0.53703105", "0.53703105", "0.5344007", "0.53355634", "0.53164953", "0.5309701", "0.52991337", "0.5265085", "0.52605766", "0.52504134", "0.5245237", "0.52261037", "0.518888", "0.5179763", "0.5152134", "0.5142781", "0.51330644", "0.5132673", "0.51200175", "0.51200175", "0.5119075", "0.5110925", "0.5106938", "0.50975376", "0.50962144", "0.50962144", "0.50802773", "0.50401235", "0.5039725", "0.5032586", "0.50086755", "0.50064224", "0.5002839", "0.49986386", "0.4988594", "0.49868712", "0.4981146", "0.49759567", "0.49689853", "0.49582714", "0.4956578", "0.49523538", "0.49501282", "0.49435815", "0.49285138", "0.49285138", "0.49187168", "0.49173045", "0.4916127", "0.49090824", "0.49080235", "0.48963642", "0.48950428", "0.48897204", "0.4883851", "0.48825452", "0.48777586", "0.48762456", "0.48646253", "0.4862838", "0.48625112", "0.48482314", "0.48470807", "0.48409492", "0.48399913", "0.48397806", "0.48361802", "0.48351213" ]
0.0
-1
Method returning the class name
public function __toString() { return __CLASS__; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClassName();", "public function getClassName();", "public function getClassName() ;", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName()\n {\n return __CLASS__;;\n }", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}", "public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}", "public function getClassName() { return __CLASS__; }", "public static function getClassName() {\n\t\treturn get_called_class();\n\t}", "public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "public static function getClassName()\n {\n return get_called_class();\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public static function className() : string {\n return get_called_class();\n }", "public function getName()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "public function getClassName()\n {\n return $this->class_name;\n }", "public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}", "public function getName(): string\n {\n return __CLASS__;\n }", "public static function getClassName() {\n return get_called_class();\n }", "public function getClassname(){\n\t\treturn $this->classname;\n\t}", "public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}", "public function getClassName()\n {\n return $this->_sClass;\n }", "public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}", "protected function getClassName(): string\n {\n return $this->className;\n }", "public static function getClassName() {\n return self::$className;\n }", "public function getClassName(): string;", "public function getClassName() : string;", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function getClassName() : string\n {\n return $this->className;\n }", "public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }", "public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}", "public function getClassName() : string\n {\n\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public static function staticGetClassName()\n {\n return __CLASS__;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }", "public function getClassName() {\n\t\treturn $this->_className;\n\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }", "function getClassName()\n {\n // TODO: Implement getClassName() method.\n }", "public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }", "function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }", "public function getClass()\n {\n return $this->_className;\n }", "private function getClassName() {\n return (new \\ReflectionClass(static::class))->getShortName();\n }", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }", "public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }", "private function className () {\n $namespacedClass = explode(\"\\\\\", get_class($this));\n\n return end($namespacedClass);\n }", "public function getClass(): string\n {\n return $this->class;\n }", "public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }", "public function getClassName()\n\t{\n\t\tif (null === $this->_className) {\n\t\t\t$this->setClassName(get_class($this));\n\t\t}\n\t\t\n\t\treturn $this->_className;\n\t}", "public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }", "public static function className()\n\t{\n\t\treturn static::class;\n\t}", "public function toClassName(): string\n {\n return ClassName::full($this->name);\n }", "public function getName()\n {\n return static::CLASS;\n }", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "public function getClass(): string;", "function getName()\n {\n return get_class($this);\n }", "public function className(): string\n {\n return $this->taskClass->name();\n }", "public static function getClassName($class)\n {\n return static::splitClassName($class)[1];\n }", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function toString()\n {\n return __CLASS__;\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "public function getNamespacedName()\n {\n return get_class();\n }", "protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}", "protected function getClassName()\n {\n return ucwords(camel_case($this->getNameInput())) . 'TableSeeder';\n }", "function getClassName($name)\n{\n return str_replace('_', ' ', snake_case(class_basename($name)));\n}", "public function getClassName(): ?string {\n\t\treturn Hash::get($this->_config, 'className');\n\t}", "public function __toString() {\n\t\treturn $this->className();\n\t}", "public static function name()\n {\n return lcfirst(self::getClassShortName());\n }" ]
[ "0.87522393", "0.87522393", "0.8751158", "0.87397957", "0.87397957", "0.87397957", "0.87397957", "0.8731564", "0.8696754", "0.8673495", "0.8638432", "0.8615335", "0.8603119", "0.8566906", "0.8562364", "0.8555002", "0.85503733", "0.85503733", "0.85425884", "0.8533183", "0.8529981", "0.85237026", "0.8502733", "0.8493115", "0.8491238", "0.8488943", "0.8484194", "0.847459", "0.8441478", "0.8418852", "0.8399611", "0.83950585", "0.83949184", "0.83853173", "0.8378261", "0.837777", "0.8372544", "0.8355432", "0.8355432", "0.83479965", "0.8325877", "0.8325877", "0.8312873", "0.83027107", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.8272631", "0.82474744", "0.8242934", "0.8202995", "0.8185409", "0.8184752", "0.81829107", "0.81829107", "0.8176191", "0.81761754", "0.8162896", "0.8142928", "0.81323636", "0.8062757", "0.80528253", "0.8045769", "0.8033823", "0.8026215", "0.8001116", "0.79949147", "0.79779136", "0.79672754", "0.7957633", "0.790449", "0.78617185", "0.7860126", "0.7847096", "0.78195953", "0.7817044", "0.780094", "0.780094", "0.780094", "0.780094", "0.780094", "0.780094", "0.77821547", "0.7761565", "0.77588034", "0.7747239", "0.77409905", "0.77409905", "0.7710985", "0.76808393", "0.7670475", "0.76640886", "0.76514393", "0.76499707", "0.76323646", "0.76005036", "0.75937456" ]
0.0
-1
Get trade type config.
protected function getTradeType() { return 'MICROPAY'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPayloadConfig($type);", "abstract protected function getTradeType();", "public static function getConfig(string $type)\n\t{\n\t\tif (!isset(self::$config[$type])) {\n\t\t\tself::$config[$type] = Config::db($type) ?? Config::db('base');\n\t\t}\n\t\treturn self::$config[$type];\n\t}", "public function getTSConfig() {}", "public function getType(): string\n {\n return $this->config->get('type');\n }", "public function getTsConfig() {}", "protected function _getConfig($path, $type = 'payment') {\n if ($type == 'payment') {\n $configPath = $this->_paymentConfigPath . $path;\n } else {\n $configPath = $this->_generalConfigPath . $path;\n }\n\n return Mage::getStoreConfig($configPath, Mage::app()->getStore()->getId());\n }", "public function getConfig($type)\n\t{\n\t\t$sql = 'SELECT * FROM config WHERE type=:type ORDER BY value DESC';\n\t\t$query = $this->db->prepare($sql);\n\t\t$query->execute([':type' => $type]);\n\t\treturn $query->fetchAll(PDO::FETCH_OBJ);\n\t}", "public static function getConfig($type = 'sql', $options = array())\n\t{\n\t\tif (!isset(self::$config))\n\t\t{\n\t\t\tif ($type === 'sql')\n\t\t\t{\n\t\t\t\t$options['handler'] = (isset($options['handler'])) ? $options['handler'] : null;\n\n\t\t\t\tif (!isset($options['table']))\n\t\t\t\t{\n\t\t\t\t\t// Uses the default table name\n\t\t\t\t\t$options['table'] = '#__sh_config';\n\t\t\t\t}\n\n\t\t\t\t// Retrieve the platform config via cached SQL\n\t\t\t\t$cache = JFactory::getCache('shplatform', 'callback');\n\t\t\t\tself::$config = $cache->get(\n\t\t\t\t\tarray(__CLASS__, 'createDBConfig'),\n\t\t\t\t\tarray($options['handler'], $options['table']),\n\t\t\t\t\tnull\n\t\t\t\t);\n\t\t\t}\n\t\t\telseif ($type === 'file')\n\t\t\t{\n\t\t\t\tif (!isset($options['file']))\n\t\t\t\t{\n\t\t\t\t\t// Attempt to use a default file\n\t\t\t\t\t$options['file'] = JPATH_ROOT . '/sh_configuration.php';\n\t\t\t\t}\n\n\t\t\t\tif (!isset($options['namespace']))\n\t\t\t\t{\n\t\t\t\t\t// Attempt to use a default file\n\t\t\t\t\t$options['namespace'] = null;\n\t\t\t\t}\n\n\t\t\t\t// Retrieve the platform config via PHP file\n\t\t\t\tself::$config = self::createFileConfig($options['file'], $options['namespace']);\n\t\t\t}\n\t\t}\n\n\t\treturn self::$config;\n\t}", "public function getConfig() {\n return Mage::getSingleton('profileolabs_shoppingflux/config');\n }", "public function getPriceType()\n {\n return (int) $this->getConfig('extrafee/general/pricetype');\n }", "public function getStoreConfig(){\n return Mage::getStoreConfig('payment/vpayment/client');\n }", "private function getConfigModel()\n {\n return Mage::getSingleton('wallee_payment/system_config');\n }", "protected function _getConfig()\n {\n if (is_null($this->_config)) {\n $this->_config = Mage::getModel('cjcheckout/config', array($this->_paymentMethodCode, Mage::app()->getStore()->getId()));\n }\n return $this->_config;\n }", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getTemplate(string $type): ?string\n\t{\n\t\treturn 'config';\n\t}", "public function getConfig()\n {\n return [\n 'payment' => [\n EWallet::CODE => [\n 'redirectUrl' => $this->helperData->getEWalletRedirectUrl(),\n 'subtypes' => [\n [\n 'name' => 'pagseguro',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/pagseguro-logo.png')\n ],\n [\n 'name' => 'paypal',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/paypal-logo.png')\n ],\n ]\n ]\n ]\n ];\n }", "public function getConfig()\n {\n return Mage::getModel(\"postident/config\");\n }", "public function get_calendar_config($type){\n $sql= \"SELECT id, qty FROM {$this->table_config} WHERE `type`='{$type}';\";\n\n return $this->wpdb->get_results( $sql , OBJECT_K);\n }", "abstract public function getConfig();", "public function getType()\n {\n return $this->depositType;\n }", "public static function loadConfig()\n {\n\t\tstatic $configClass;\n\t\tif ($configClass == null)\n\t\t{\n\t\t\t$db = Jfactory::getDbo();\n\t\t\t$db->setQuery(\"Select * from #__osrs_configuration\");\n\t\t\t$configs = $db->loadObjectList();\n\t\t\t$configClass = array();\n\t\t\tforeach ($configs as $config) {\n\t\t\t\t$configClass[$config->fieldname] = $config->fieldvalue;\n\t\t\t}\n\n\t\t\t$curr = $configClass['general_currency_default'];\n\t\t\t$arrCode = array();\n\t\t\t$arrSymbol = array();\n\n\t\t\t$db->setQuery(\"Select * from #__osrs_currencies where id = '$curr'\");\n\t\t\t$currency = $db->loadObject();\n\t\t\t$symbol = $currency->currency_symbol;\n\t\t\t$index = -1;\n\t\t\tif ($symbol == \"\") {\n\t\t\t\t$symbol = '$';\n\t\t\t}\n\t\t\t$configClass['curr_symbol'] = $symbol;\n\t\t}\n return $configClass;\n }", "public function getCheckoutType($store = null)\n {\n return $this->getVersionConfig($store)->getType();\n }", "public function getConfig ()\n {\n $config = Mage::getModel('socnet/network')\n ->getConfigByNetworkKey($this->getNetworkKey());\n return $config;\n }", "public function getTransportMethod()\n {\n \t $transportMethod = Mage::getStoreConfig('actions/settings/transport_method');\n \t if (empty($transportMethod)) {\n \t \t $transportMethod = CartDefender_Actions_Model_System_Config_Source_Transport::CURL_PROCESS;\n \t \t Mage::getConfig()->saveConfig('actions/settings/transport_method', $transportMethod, 'default', 0);\n \t }\n return $transportMethod;\n }", "function getConf() {\n\t\treturn unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['mn_twitter_bootstrap']);\n\t}", "public function getConfig(): string\n {\n $checkoutConfig = $this->compositeConfigProvider->getConfig();\n $storeCode = $checkoutConfig['storeCode'];\n $checkoutConfig['payment']['restUrlPrefix'] = \"/rest/$storeCode/V1/\";\n\n $transport = new \\Magento\\Framework\\DataObject([\n 'checkoutConfig' => $checkoutConfig,\n 'output' => [\n 'storeCode' => $storeCode,\n 'payment' => $checkoutConfig['payment'],\n 'language' => $this->localeResolver->getLocale(),\n 'currency' => $this->currencyProvider->getConfig(),\n 'defaultCountryId' => $checkoutConfig['defaultCountryId'],\n ]\n ]);\n\n $this->eventManager->dispatch('hyva_react_checkout_config', ['transport' => $transport]);\n\n return $this->serializer->serialize($transport->getData('output'));\n }", "private function TypeConfigCourier(){\n $ConfigModel = new seller\\BaseCtrl;\n $TypeConfig = ($this->from_city == $this->to_city) ? 1 : 2;\n $City = $ConfigId = 0;\n if(in_array($this->from_city, [18,52])){\n $City = $this->from_city;\n }\n\n $ConfigTypeCourier = $ConfigModel->getConfigTypeCourier(false);\n foreach($ConfigTypeCourier as $val){\n if($val['type'] == $TypeConfig){\n if($TypeConfig == 2 || ($TypeConfig == 1 && $val['city_id'] == $City)){\n $ConfigId = (int)$val['id'];\n }\n }\n }\n\n return $ConfigId;\n }", "public function getConfigClass() {\n return FTPDatasourceConfig::class;\n }", "public function getProvider()\n {\n $config = $this->scopeConfig->getValue(\n 'payment/az2009_cielo_bank_slip/provider',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n\n return $config;\n }", "public function getConfig() {}", "function get_transaction_type()\n {\n return $this->platnosci_post_vars['txn_type']; \n }", "public function get_config()\n\t{\n\t\treturn $this->cfg;\n\t}", "public function getProductPriceType()\n {\n return Mage::getStoreConfig('splitprice/split_price_config/base_price');\n }", "public function getMerchantConfig()\n {\n return $this->config;\n }", "abstract protected function getConfig();", "public function GetConfigClass ();", "public function getConfig()\n {\n return Mage::helper(\"meanbee_osd/config\");\n }", "public function getCoinType()\n {\n return $this->coin_type;\n }", "public function getConfig() {\n if (is_null($this->getData(\"config\"))) {\n $this->setData(\"config\", Mage::getModel(\"cloudiq_callme/config\"));\n }\n\n return $this->getData(\"config\");\n }", "public function getCheckoutConfig()\n {\n return $this->_get('checkoutConfig');\n }", "private function get_config() {\n if (isset($this->config)) {\n return $this->config;\n }\n\n $this->config = get_config('tool_coursebank');\n\n return $this->config;\n }", "public static function config($config = null)\n { \n // ------------------------------------------------------------------\n // Get Loyalty Config by appid and access_token\n // ------------------------------------------------------------------\n // https://proxcrm.xgate.com/front/index.php/site/getTenantWechatConfig?tenantId=[tenantId]&appid=[appId]&accesstoken=[accessToken]\n // @method Get\n // @author Raymond NG\n // https://dev.xgate.com/issues/3568?tab=history_comments\n $wechat_configs = BaseWechat::config();\n $url = 'https://proxcrm.xgate.com/front/index.php/site/getTenantWechatConfig?tenantId=[tenantId]&appid=' . $wechat_configs['appid'] . '&accesstoken=' . $wechat_configs['access_token'];\n $re = BaseApi::get($url);\n $re = BaseApi::parseJSON($re);\n $loyalty_url = $re['loyalty_url'];\n $loyalty_accountid = $re['loyalty_accountid'];\n $loyalty_username = $re['loyalty_username'];\n $loyalty_password = $re['loyalty_password'];\n $tenant_id = $re['tenant_id'];\n $webform_url = $re['webform_url'];\n $subdomain = $re['subdomain'];\n\n // validate basic parameters\n// if (filter_var($loyalty_url, FILTER_VALIDATE_URL) === false) {\n// throw new ErrorException('Error: the loyalty api url [' . $loyalty_url . '] is not validate');\n// }\n//\n// if (empty($loyalty_accountid) || empty($loyalty_username) || empty($loyalty_password)) {\n// throw new ErrorException('Error: the loyalty api basic param is null');\n// }\n\n //正式 地址\n// $loyalty_url = 'http://202.177.204.24/';\n// $loyalty_accountid = 'JSelect';\n// $loyalty_username = '[email protected]';\n// $loyalty_password = '59jfl438fc';\n //海港城地址\n $loyalty_url = 'http://loyalty-uat.xgate.com:8080/index.php';\n $loyalty_accountid = 'demo';\n $loyalty_username = '[email protected]';\n $loyalty_password = 'xg1234';\n $configs = [\n 'loyalty_url' => $loyalty_url,\n 'authentication' => ['account_id' => $loyalty_accountid, 'username' => $loyalty_username, 'password' => $loyalty_password],\n 'tenant_id' => $tenant_id,\n 'webform_url' => $webform_url,\n 'subdomain' => $subdomain, \n ];\n\n return is_null($config) ? $configs : $configs[$config];\n }", "private function getTestsConfigurationFile($type)\n {\n $confFile = null;\n\n // locate conf file\n foreach ($this->getPossibleConfPaths($type) as $conf) {\n if (file_exists($conf)) {\n $confFile = $conf;\n break;\n }\n }\n\n return $confFile;\n }", "public static function getConfig()\n {\n return self::$config;\n }", "function get_config($conf, $type = 'site', $default = '')\n{\n $__configs__ = $GLOBALS[\"__CONFIG__{$type}__\"];\n return isset($__configs__[strtolower($conf)]) ? __replace_cfgs($__configs__[strtolower($conf)], 1, $type) : $default;\n}", "public function getConfig()\n {\n return [\n 'payment' => [\n self::CODE => [\n // get setting values using events.xml section/group/field ids for path\n 'apiKey' => $this->helper->getConfig('payment/payio/integration/api_key'),\n 'apiTransactionPath' => $this->helper->getApiTransactionPath(),\n 'apiSettingsPath' => $this->helper->getApiSettingPath(),\n 'gatewayPath' => $this->helper->getGatewayPath(),\n 'checkoutUrl' => $this->helper->getCheckoutUrl(),\n 'paymentSuccessUrl' => $this->helper->getPaymentSuccessUrl(),\n 'currency' => $this->helper->getCurrentCurrencyCode(),\n 'cartTax' => $this->helper->getUKTaxRate(),\n 'shippingMethods' => $this->helper->getActiveShippingMethods()\n ]\n ]\n ];\n }", "private function getSetting($type) {\n\t\tforeach (self::$SETTINGS as $setting) {\n\t\t\tif (strcasecmp($setting->getName(), $type) == 0) {\n\t\t\t\treturn $setting;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "static function getConfig() {\n\t\treturn self::getRegistry()->get(self::REGISTRY_CONFIG);\n\t}", "public function getWalletType()\n {\n return $this->wallet_type;\n }", "protected function _getConfig()\n {\n return $this->_paypalConfig;\n }", "protected function getConfig()\n {\n\n return $this->app['config']['manticore'];\n }", "public function getTxType()\n {\n return $this->tx_type;\n }", "public function getTcon()\n {\n return $this->hasOne(TipoConfiguracion::className(), ['tcon_id' => 'tcon_id']);\n }", "protected function getConfigName()\n {\n return 'realtime';\n }", "public function getConfig()\n {\n $config = [\n 'payment' => [\n 'ccform' => [\n 'availableTypes' => [\n self::CODE => $this->getCardTypes()\n ],\n 'months' => [\n self::CODE => $this->getMonths()\n ],\n 'years' => [\n self::CODE => $this->getYears()\n ],\n 'hasVerification' => [\n self::CODE => $this->config->getValue('enable_cvv') ? true : false\n ],\n 'cvvImageUrl' => [\n self::CODE => $this->getCvvImageUrl()\n ],\n 'testMode' => [\n self::CODE => $this->config->getValue('test')\n ],\n 'jsToken' => [\n self::CODE => $this->config->getValue('js_token')\n ]\n ]\n ]\n ];\n return $config;\n }", "public function getProductPriceType()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_config/base_price', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }", "public function getConfig() {\r\n\r\n\t}", "function getConfig()\n {\n return $this->_api->doRequest(\"GET\", \"{$this->getBaseApiPath()}/config\");\n }", "public function getConfig()\n {\n $config = [\n 'payment' => []\n ];\n // show logos turned on by default\n if ($this->_showLogos()) {\n $config['payment']['adyen']['showLogo'] = true;\n } else {\n $config['payment']['adyen']['showLogo'] = false;\n }\n\n\t\t$config['payment']['checkoutCardComponentSource'] = $this->_adyenHelper->getCheckoutCardComponentJs($this->storeManager->getStore()->getId());\n\n return $config;\n }", "protected function getStoreConfig () {\n\t\t$aConfig = array(\n\t\t\t'db_host'\t\t=> DB_HOST,\n\t\t\t'db_name'\t\t=> DB_NAME,\n\t\t\t'db_user'\t\t=> DB_USER,\n\t\t\t'db_pwd'\t\t=> DB_PASSWORD,\n\t\t\t'store_name'\t=> getWpPrefix() . 'pp_thesaurus',\n\t\t);\n\n\t\treturn $aConfig;\n\t}", "protected function getConfig()\n\t{\n\t\treturn $this->oConfig;\n\t}", "public function findCurrency($type){\n switch ($type) {\n case \"ach\":\n return \"USD\";\n case \"wechatpayqr\":\n case \"alipay\":\n return \"CNY\";\n case \"dotpay\":\n return \"PLN\";\n case \"boletobancario\":\n case \"boletobancario_santander\":\n return \"BRL\";\n default:\n return \"EUR\";\n }\n }", "public function getPriceType()\n {\n return $this->priceType;\n }", "public function getPriceType()\n {\n return $this->priceType;\n }", "public function _getConfigModel()\n {\n return Mage::getModel(self::CONFIG);\n }", "public function getConfig()\n {\n $storeId = $this->session->getStoreId();\n return [\n 'payment' => [\n self::CODE => [\n 'isActive' => $this->config->isActive($storeId),\n 'ccTypesMapper' => $this->config->getCcTypesMapper(),\n 'availableCardTypes' => $this->config->getAvailableCardTypes($storeId),\n 'useCvv' => $this->config->isCvvEnabled($storeId),\n 'environment' => $this->config->getEnvironment($storeId),\n 'environmentUrl' => $this->config->getEnvironmentUrl(),\n 'use_sandbox' => $this->config->useSandbox($storeId),\n 'profile_id' => $this->config->getProfileId($storeId),\n 'profile_key' => $this->config->getProfileKey($storeId),\n 'ccVaultCode' => self::CC_VAULT_CODE,\n ]\n ],\n ];\n }", "function templatic_get_currency_type()\r\n{\r\n\tglobal $wpdb;\r\n\t$option_value = get_option('currency_code');\r\n\tif($option_value)\r\n\t{\r\n\t\treturn stripslashes($option_value);\r\n\t}else\r\n\t{\r\n\t\treturn 'USD';\r\n\t}\r\n\t\r\n}", "function get_payment_type()\n {\n // echeck - payment funded with e-check\n // instant - payment was funded with platnosci balance, credit card, or instant transfer\n return $this->platnosci_post_vars['payment_type'];\n }", "public function getOrderDataType(): ?string {\n\t\treturn Hash::get($this->_config, 'orderDataType');\n\t}", "public static function getConfig()\n {\n }", "public function getConfig()\n {\n return $this->get('config');\n }", "protected function getConfig($name)\n {\n return $this->app['config'][\"option.stores.{$name}\"];\n }", "public static function getInstance() {\n return self::getConfig();\n }", "protected function getPlateformeConfig()\r\n {\r\n return $this->config;\r\n }", "protected function _getConfig()\n {\n if (null == $this->_yapitalConfig)\n {\n $this->_yapitalConfig = Mage::getSingleton('yapital/config');\n }\n\n return $this->_yapitalConfig;\n }", "public function getConfig() {\n \t\n \t// Return our configuration\n \treturn $this->aConfig;\n }", "protected function getExtbaseConfiguration() {}", "public function getConfig(){\n\t\t$request = $this->_sendPacketToController(self::GET_CONFIG);\n\t\tif ($request->getState() == self::STATE_OK) // If the packet is send sucefully\n\t\t\treturn $this->_getResponse(); // TODO mettre en forme la sortie\n\t\telse\n\t\t\treturn $request;\n\t}", "protected function getTransactionType()\n {\n return \\Genesis\\API\\Constants\\Transaction\\Types::ONLINE_BANKING_PAYIN;\n }", "public function getDepositType()\n {\n return $this->depositType;\n }", "public function getConfig(){\n\t\treturn $this->_config;\n\t}", "public function getConfig()\n {\n return $this['config'];\n }", "public function get_radioConfig(): string\n {\n // $res is a string;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::RADIOCONFIG_INVALID;\n }\n }\n $res = $this->_radioConfig;\n return $res;\n }", "public function getConfigClass() {\n return SVDatasetExporterConfiguration::class;\n }", "public function getConfig ()\n {\n return $this->web->getConfig();\n }", "public function getPriceType(): ?string\n {\n return $this->priceType;\n }", "public function getShopConfig()\n {\n $oReturn = new stdClass();\n $oReturn->language = $this->config->getShopLanguageConfig();\n $oReturn->currency = $this->config->getShopCurrencyConfig();\n $oReturn->condition = $this->config->getShopConditionConfig();\n\n return $oReturn;\n }", "public function getJsonConfig()\n {\n /* @var $product \\Magento\\Catalog\\Model\\Product */\n $product = $this->getProduct();\n\n if (!$this->hasOptions()) {\n $config = [\n 'productId' => $product->getId(),\n 'priceFormat' => $this->_localeFormat->getPriceFormat()\n ];\n return $this->_jsonEncoder->encode($config);\n }\n\n $tierPrices = [];\n $tierPricesList = $product->getPriceInfo()->getPrice('tier_price')->getTierPriceList();\n foreach ($tierPricesList as $tierPrice) {\n $tierPrices[] = $tierPrice['price']->getValue();\n }\n\n //qxd testing lo de los productos */\n\n $qxd_config = null;\n\n /*$writer = new \\Zend\\Log\\Writer\\Stream(BP . '/var/log/configurable.log');\n $logger = new \\Zend\\Log\\Logger();\n $logger->addWriter($writer);\n $logger->info(print_r($product->getTypeId(),true));\n $logger->info(print_r('nuevo',true));*/\n\n switch ($product->getTypeId()) {\n case 'bundle': \n //$bundle_block= $this->getLayout()->createBlock('Magento\\Bundle\\Block\\Catalog\\Product\\View\\Type\\Bundle');\n\n //$qxd_config = $bundle_block->getJsonConfig();\n break;\n\n case 'configurable':\n\n $qxd_config = $price_config = json_decode($product->getPriceRangeConfig(), true); \n /*$configurable_block= $this->getLayout()->createBlock('Magento\\ConfigurableProduct\\Block\\Product\\View\\Type\\Configurable');\n\n $configurable_config = $configurable_block->getJsonConfig();\n if($configurable_config){\n $configurable_config = json_decode($configurable_config, true);\n $options = $configurable_config[\"optionPrices\"];\n\n $first_option = reset($options);\n $higherRegular = $first_option[\"oldPrice\"]['amount'];\n $lowerRegular = $first_option[\"oldPrice\"]['amount'];\n $regularPrice = $first_option[\"oldPrice\"]['amount'];\n $specialPrices = [];\n\n $hasSameRegularPrice = true;\n $hasSameSpecialPrice = true;\n\n $hasSpecialPrice = false;\n foreach ($options as $price) {\n //regular\n\n //get higher\n if($price[\"oldPrice\"]['amount'] > $higherRegular)\n $higherRegular = $price[\"oldPrice\"]['amount'];\n\n //get lower\n if($price[\"oldPrice\"]['amount'] < $lowerRegular)\n $lowerRegular = $price[\"oldPrice\"]['amount'];\n\n if($price[\"oldPrice\"]['amount'] != $regularPrice)\n $hasSameRegularPrice = false;\n\n\n //special\n\n if($price[\"finalPrice\"]['amount'] < $price[\"oldPrice\"]['amount']){\n $hasSpecialPrice = true;\n $specialPrices[] = $price[\"finalPrice\"]['amount'];\n }\n }\n\n if(empty($specialPrices)){\n $qxd_config['hasSpecialPrice'] = false;\n }else{\n $qxd_config['hasSpecialPrice'] = true;\n sort($specialPrices);\n $hasSameSpecialPrice = count(array_unique($specialPrices)) == 1;\n $qxd_config['rangeSpecial'] = [\"lower\" => $specialPrices[0], \"higher\" => $specialPrices[count($specialPrices) - 1]];\n \n }\n\n $qxd_config['rangeRegular'] = [\"lower\" => $lowerRegular, \"higher\" => $higherRegular];\n $qxd_config['hasSameSpecialPrice'] = $hasSameSpecialPrice;\n $qxd_config['hasSameRegularPrice'] = $hasSameRegularPrice; \n\n\n }*/\n break;\n \n default:\n break;\n }\n\n $qxd_price = [\n 'amount' => 0,\n 'adjustments' => [],\n 'data' => $qxd_config\n ];\n\n $config = [\n 'productId' => $product->getId(),\n 'priceFormat' => $this->_localeFormat->getPriceFormat(),\n 'prices' => [\n 'oldPrice' => [\n 'amount' => $product->getPriceInfo()->getPrice('regular_price')->getAmount()->getValue(),\n 'adjustments' => []\n ],\n 'basePrice' => [\n 'amount' => $product->getPriceInfo()->getPrice('final_price')->getAmount()->getBaseAmount(),\n 'adjustments' => []\n ],\n 'finalPrice' => [\n 'amount' => $product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue(),\n 'adjustments' => []\n ]\n ],\n 'idSuffix' => '_clone',\n 'tierPrices' => $tierPrices,\n 'qxd_price' => $qxd_price\n ];\n\n $responseObject = new \\Magento\\Framework\\DataObject();\n $this->_eventManager->dispatch('catalog_product_view_config', ['response_object' => $responseObject]);\n if (is_array($responseObject->getAdditionalOptions())) {\n foreach ($responseObject->getAdditionalOptions() as $option => $value) {\n $config[$option] = $value;\n }\n }\n\n return $this->_jsonEncoder->encode($config);\n }", "private function getBaseConfig() {\n return \\Drupal::getContainer()->get('itkore_admin.itkore_config');\n }", "private function getConfig()\n {\n if (null === $this->config) {\n $this->config = $this->getObjectManager()->get(FixtureConfig::class);\n }\n return $this->config;\n }", "public function getSettings($type = null)\n {\n if(is_null($type))\n return $this->repository->get( $this->repoOptionString($this->settingsKey), array() );\n \n $typeSettings = $this->repository->get( $this->repoOptionString($this->settingsKey, $type) , array());\n $default = $this->defaultSettings();\n $settings = array();\n foreach ($default as $key => $value) \n {\n $settings[$key] = isset($typeSettings[$key]) ? $typeSettings[$key] : $value; \n }\n return $settings;\n }", "public function getConfig()\n {\n return $this->_config;\n }" ]
[ "0.6422", "0.638278", "0.63823605", "0.59242076", "0.59021795", "0.5893724", "0.583978", "0.58318454", "0.58126444", "0.5805928", "0.5707924", "0.56974876", "0.5642915", "0.5553107", "0.55371577", "0.55371577", "0.55371577", "0.55371577", "0.55371577", "0.55371577", "0.55371577", "0.55371577", "0.5488381", "0.5477877", "0.5469166", "0.5450932", "0.5412477", "0.54094505", "0.53999466", "0.53934944", "0.53876007", "0.5386113", "0.53793377", "0.5353657", "0.5338148", "0.5334001", "0.5308276", "0.5305761", "0.52946293", "0.52858025", "0.52788955", "0.5271741", "0.525077", "0.52393097", "0.5230233", "0.52240497", "0.522292", "0.5214135", "0.5201599", "0.51979464", "0.51977974", "0.5180979", "0.5179422", "0.51771164", "0.5165199", "0.51609075", "0.5155586", "0.51518834", "0.5145225", "0.5142876", "0.5142127", "0.51408845", "0.51284707", "0.5125767", "0.5123651", "0.5120336", "0.50987405", "0.5084031", "0.50831604", "0.507975", "0.50681376", "0.50681376", "0.50616527", "0.506017", "0.5051868", "0.5040354", "0.5037367", "0.50359285", "0.50348", "0.50304806", "0.5024882", "0.5022043", "0.50218153", "0.50151336", "0.5008483", "0.5007023", "0.50018734", "0.49945104", "0.49875084", "0.49856234", "0.4970968", "0.49672988", "0.49649873", "0.4962173", "0.49594852", "0.495457", "0.4947998", "0.49464193", "0.49424657", "0.4941596" ]
0.56521416
12
Gets the value of jobScheduler.
public function getJobScheduler() { return $this->jobScheduler; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getJob(SchedulerInterface $scheduler);", "public function getRemoteScheduler()\n {\n return $this->remoteScheduler;\n }", "public function getRemoteScheduler()\n {\n return $this->remoteScheduler;\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function getJob()\n {\n return $this->job;\n }", "public function getJob()\n {\n return $this->job;\n }", "public function getJob()\n\t{\n\t\treturn $this->compose('Job', 'Jobs');\n\t}", "public function getScheduling()\n {\n return $this->scheduling;\n }", "public function getJob(): string\n {\n return $this->job;\n }", "public static function getCurrentJob()\n {\n return (string) Configuration::getGlobalValue(self::CURRENT_TASK_CLI);\n }", "public function getSetJob()\n {\n return $this->get(self::_SET_JOB);\n }", "public function Get() {\n\t\treturn $this->CronJobs;\n\t}", "public function getSqsJob()\n {\n return $this->job;\n }", "public function getSchedulerCommandUser() {\n return null;\n }", "function _get_cron_lock() {\n\tglobal $wpdb;\n\n\t$value = 0;\n\tif ( wp_using_ext_object_cache() ) {\n\t\t/*\n\t\t * Skip local cache and force re-fetch of doing_cron transient\n\t\t * in case another process updated the cache.\n\t\t */\n\t\t$value = wp_cache_get( 'doing_cron', 'transient', true );\n\t} else {\n\t\t$row = $wpdb->get_row( $wpdb->prepare( \"SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1\", '_transient_doing_cron' ) );\n\t\tif ( is_object( $row ) )\n\t\t\t$value = $row->option_value;\n\t}\n\n\treturn $value;\n}", "public function getScheduledJob($params, $context) {\n\t\treturn \\OMV\\Rpc\\Rpc::call(\"cron\", \"get\", $params, $context);\n\t}", "public function setScheduler() {}", "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 getDailyjob()\n {\n return $this->get(self::_DAILYJOB);\n }", "public static function getJobs() {\n\t\treturn self::$jobs;\n\t}", "static function fetchJobSchedule( $jobId ) {\n global $wpdb;\n $resultset = $wpdb->get_results($wpdb->prepare(\n \"SELECT job_id, classname, repeat_time_minutes, repeat_daily_at, active_yn, last_run_date \n FROM job_scheduler\n WHERE job_id = %d\", $jobId));\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n foreach( $resultset as $record ) {\n return $record;\n }\n return null;\n }", "public function getScheduledInterval()\n {\n return $this->scheduledInterval;\n }", "public static function fetch()\n {\n return eZPersistentObject::fetchObject( eZStaticExportScheduler::definition(),\n null,\n null,\n true );\n }", "public function getJobType()\n {\n return $this->job_type;\n }", "public function schedule(): Schedule\n {\n return $this->schedule;\n }", "public function getJob() : ?JobInterface {\n return $this->configuration['job'] instanceof JobInterface ?\n $this->configuration['job'] :\n ($this->jobStorage->load($this->configuration['job']) ?? NULL);\n }", "public function getSchedule()\n\t\t{\n\t\t\tif ($this->schedule === NULL)\n\t\t\t{\n\t\t\t\t$this->schedule = new ECash_Transactions_Schedule($this);\n\t\t\t}\n\n\t\t\treturn $this->schedule;\n\t\t}", "public function getScheduleId()\n {\n if (array_key_exists(\"scheduleId\", $this->_propDict)) {\n return $this->_propDict[\"scheduleId\"];\n } else {\n return null;\n }\n }", "public function getScheduleTime()\n {\n return $this->schedule_time;\n }", "function getJobId() {\n return $this->helper->getJobId();\n }", "function getJobId() {\n return $this->helper->getJobId();\n }", "function getJobId() {\n return $this->helper->getJobId();\n }", "function getJobId() {\n return $this->helper->getJobId();\n }", "function getJobId() {\n return $this->helper->getJobId();\n }", "public function getScheduleStatus(){return $this->status;}", "public function setJobScheduler(JobScheduler $jobScheduler)\n {\n $this->jobScheduler = $jobScheduler;\n\n return $this;\n }", "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 getReplicationSchedule()\n {\n return $this->replication_schedule;\n }", "public function getJobId()\n {\n return $this->job_id;\n }", "public function getCronStatus()\n {\n // get the last job with status pending or running\n $lastJob = Mage::getModel('cron/schedule')->getCollection()\n ->addFieldToFilter('status', array(\n 'in' => array(\n Mage_Cron_Model_Schedule::STATUS_PENDING,\n Mage_Cron_Model_Schedule::STATUS_RUNNING,\n )\n )\n )\n ->setOrder('scheduled_at', Varien_Data_Collection_Db::SORT_ORDER_DESC)\n ->setPageSize(1)\n ->getFirstItem();\n\n // check if last job has been scheduled within allowed interval\n $ok = true;\n if ($lastJob && $lastJob->getId()) {\n $locale = Mage::app()->getLocale();\n\n $scheduledAt = $locale->date($lastJob->getScheduledAt(), Varien_Date::DATETIME_INTERNAL_FORMAT);\n $scheduledAt = $locale->utcDate(null, $scheduledAt);\n\n // now\n $now = $locale->date(null, Varien_Date::DATETIME_INTERNAL_FORMAT);\n $now = $locale->utcDate(null, $now);\n\n // if last job was scheduled before the current time\n if ($now->isLater($scheduledAt)) {\n $allowedTime = $now->subHour($this->_allowedTimeDiffJob);\n if ($allowedTime->isLater($scheduledAt)) {\n $ok = false;\n }\n }\n } else {\n $ok = false;\n }\n\n $message = '';\n if ($ok) {\n $image = $this->_getTickImageLink();\n $message = Mage::helper('emvcore')->__(\n '<span class=\"icon-status\">%s</span> Magento Cron Process has been correctly configured!',\n $image\n );\n } else {\n $image = $this->_getUnTickImageLink();\n $message = Mage::helper('emvcore')->__(\n '<span class=\"icon-status\">%s</span> Magento Cron Process has not been correctly activated!',\n $image\n );\n }\n\n return $message;\n }", "public function getHourlySchedule()\n {\n return $this->hourly_schedule;\n }", "public function getHourlySchedule()\n {\n return $this->hourly_schedule;\n }", "public function getBackupSchedule()\n {\n return $this->backup_schedule;\n }", "public function getJobs()\n {\n return $this->jobs;\n }", "public function getJobs()\n {\n return $this->jobs;\n }", "public function getJobName() : string\n {\n if (is_null($this->jobName)) {\n throw new \\Error(__(\"Not valid value for jobName.\"));\n }\n\n return (string)$this->getConfigValue($this->jobName) . \"-\" . date('YmdHis');\n }", "public function getMonthlySchedule()\n {\n return $this->monthly_schedule;\n }", "public function getIdSchedule()\n {\n return $this->idSchedule;\n }", "public function setJob($value)\n {\n return $this->set(self::_JOB, $value);\n }", "public function setJob($value)\n {\n return $this->set(self::_JOB, $value);\n }", "public function getScheduleStatus()\n {\n if (!$this->scheduleStatus) {\n return false;\n } else {\n list($scheduleStatus) = explode(';', $this->scheduleStatus);\n\n return $scheduleStatus;\n }\n }", "public function getCronDefinition()\n {\n return $this->cron_script; \n }", "public function getSchedule(): ?GovernanceSchedule {\n $val = $this->getBackingStore()->get('schedule');\n if (is_null($val) || $val instanceof GovernanceSchedule) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'schedule'\");\n }", "public function getInstanceSchedulePolicy()\n {\n return $this->instance_schedule_policy;\n }", "public function schedule(Schedulable $scheduler)\n {\n\n return $scheduler->minutes('0,30');\n }", "public function getJobType()\n\t{\n\t\tif (!isset($this->_jobType))\n\t\t{\n\n\t\t\t$component = Craft::createComponent(\"Craft\\\\\".$this->type);\n\n\t\t\tif ($component)\n\t\t\t{\n\t\t\t\t$component->model = $this;\n\t\t\t}\n\n\t\t\t$this->_jobType = $component;\n\n\t\t\t// Might not actually exist\n\t\t\tif (!$this->_jobType)\n\t\t\t{\n\t\t\t\t$this->_jobType = false;\n\t\t\t}\n\t\t}\n\n\t\t// Return 'null' instead of 'false' if it doesn't exist\n\t\tif ($this->_jobType)\n\t\t{\n\t\t\treturn $this->_jobType;\n\t\t}\n\t}", "public function getJobId(): string\n {\n return $this->job_id;\n }", "public function getJobId()\n {\n return $this->jobId;\n }", "public function getStatus()\r\n\t{\r\n\t\t$select\t= $this->_db->select()->from('Cron_Jobs', array('active'))->where('id = ?', $this->_getId());\r\n\t\t$status\t= $this->_db->fetchRow($select);\r\n\t\t\r\n\t\treturn $status['active'];\r\n\t}", "public function getScheduleType()\n\t{\n\t\treturn $this->schedule_type;\n\t}", "public function getAzureJob()\n {\n return $this->job;\n }", "public function getJobs()\n {\n $this->refreshConfig();\n return $this->get();\n }", "function scheduler(\n ?SchedulerInterface $instance = null,\n ): SchedulerInterface {\n /** @var SchedulerInterface|null $scheduler */\n static $scheduler;\n\n if ($instance !== null) {\n $scheduler = $instance;\n if (defined('EVENT_LOOP_DEFAULT_HANDLE_SIGNALS') && EVENT_LOOP_DEFAULT_HANDLE_SIGNALS) {\n register_default_signal_handler();\n }\n } elseif (!$scheduler) {\n if (extension_loaded('uv')) {\n $scheduler = new Scheduler\\Uv();\n } elseif (extension_loaded('ev')) {\n $scheduler = new Scheduler\\Ev();\n } elseif (extension_loaded('event')) {\n $scheduler = new Scheduler\\Event();\n } else {\n $scheduler = new Scheduler\\Select();\n }\n }\n\n if ($scheduler === null) {\n throw new RuntimeException(\n \"Unable to create default scheduler and a default one couldn't be created\"\n );\n }\n\n return $scheduler;\n }", "protected function _getCronHelper()\n {\n return $this->_cronHelper;\n }", "function getschedulerstatus ($problem) {\n $result = mysql_db_query (\"vishnu_central\",\n \"select * from scheduler_request where \" .\n \"problem = \\\"\" . $problem . \"\\\";\");\n $errResult = reportSqlError (\"vishnu_central\",\n \"select * from scheduler_request where \" .\n \"problem = \\\"\" . $problem . \"\\\";\");\n if ($errResult != \"\")\t\n return $errResult;\n\n $value = mysql_fetch_array ($result);\n mysql_free_result ($result);\n return $value;\n }", "public function getSchedulename()\n {\n return $this->name;\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 }", "protected function _getCron()\n {\n return Mage::getModel('core/config_data')->load(self::CRON_STRING_PATH, 'path');\n }", "public function getCronJobLock()\r\n {\r\n return $this->_loadClass('lockFile', true, array(GEMS_ROOT_DIR . '/var/settings/cron_lock.txt'));\r\n }", "public function getTimerServiceExecutor()\n {\n return $this->timerServiceExecutor;\n }", "public function getScheduled(): int\n {\n return $this->scheduled;\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 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 getJobStatus()\n {\n return $this->jobStatus;\n }", "public function getJob($name)\n {\n $headers = [\"name\" => $name];\n\n return $this->call(\"GetJob\", $headers);\n }", "public function getJobTitle()\n {\n return $this->jobTitle;\n }", "static function fetchJobScheduleParameters( $jobId ) {\n global $wpdb;\n $resultset = $wpdb->get_results($wpdb->prepare(\n \"SELECT name, value \n FROM job_scheduler_param\n WHERE job_id = %d\n ORDER BY name\", $jobId));\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n $jobParams = array();\n foreach( $resultset as $record ) {\n $jobParams[$record->name] = $record->value;\n }\n return $jobParams;\n }", "public function getDailySchedule()\n {\n return $this->daily_schedule;\n }", "public function getDailySchedule()\n {\n return $this->daily_schedule;\n }", "public function getjobTypeId()\n {\n return $this->jobtype_id;\n }", "public function getCronJobLock()\n {\n return $this->getLockFile('cron_lock.txt');\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 }", "protected function _getSchedule()\n {\n // Get frequency and offset from posted data\n $data = Mage::app()->getRequest()->getPost('groups');\n $frequency = !empty($data['emailchef']['fields']['emailchef_cron_frequency']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_frequency']['value'] :\n EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::HOURLY;\n $offset = !empty($data['emailchef']['fields']['emailchef_cron_offset']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_offset']['value'] :\n 0;\n\n // Get period between calls and calculate explicit hours using this and offset\n $period = EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::getPeriod($frequency);\n if ($period === null) {\n Mage::log('eMailChef: Could not find cron frequency in valid list. Defaulted to hourly', Zend_Log::ERR);\n $period = 1;\n }\n $hoursStr = $this->_calculateHourFreqString($period, $offset);\n\n return \"0 {$hoursStr} * * *\";\n }", "public function get(Crontab $crontab): string\n {\n return (string) $this->redisFactory->get($crontab->getMutexPool())->get(\n $this->getMutexName($crontab)\n );\n }", "public function getJobTitle()\n {\n return $this->getProperty(\"JobTitle\");\n }", "private function getJobAwardedStage()\n {\n return $this->model->whereCompanyId($this->scope->id())\n ->whereActive(1)\n ->first();\n }", "public function getListCronJobsCreation() {\n\t\treturn $this->_getConfigValueArray('cronJobs');\n\t}", "public function getJob()\n {\n return $this->hasOne(Jobs::className(), ['job_id' => 'job_id']);\n }", "protected function getCronPageId()\n {\n $cronPage = $this->getOption('cronpage');\n\n if (!$cronPage) {\n $cronPage = tx_rnbase_configurations::getExtensionCfgValue('mkmailer', 'cronpage');\n }\n\n return $cronPage;\n }", "static function getOutstandingAllocationScraperJob() {\n global $wpdb;\n $resultset = $wpdb->get_results($wpdb->prepare(\n \"SELECT MIN(created_date) `created_date`\n FROM wp_lh_jobs \n WHERE classname IN (\n 'com.macbackpackers.jobs.AllocationScraperJob', \n 'com.macbackpackers.jobs.AllocationScraperWorkerJob', \n 'com.macbackpackers.jobs.CloudbedsAllocationScraperWorkerJob', \n 'com.macbackpackers.jobs.CreateAllocationScraperReportsJob', \n 'com.macbackpackers.jobs.BookingScraperJob', \n 'com.macbackpackers.jobs.SplitRoomReservationReportJob',\n 'com.macbackpackers.jobs.UnpaidDepositReportJob',\n 'com.macbackpackers.jobs.GroupBookingsReportJob' )\n AND status IN ( %s, %s )\", \n self::STATUS_SUBMITTED, self::STATUS_PROCESSING ));\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n // guaranteed null or int\n $rec = array_shift($resultset);\n\n // if null, then no job exists\n if( $rec->created_date == null) {\n return null;\n }\n return $rec->created_date;\n }", "public function getJob()\n {\n return $this->hasOne(Job::class, ['id' => 'job_id']);\n }", "public function getJobId()\n {\n if (array_key_exists('MessageId', $this->job)) {\n return $this->job['MessageId'];\n }\n\n return $this->job['messageId'];\n }", "public function current()\n {\n return $this->job;\n }", "public function get_job_list() {\n return $this->find_all_jobs();\n }", "public function getJobTypeName(): ?string\n {\n return $this->jobTypeName;\n }", "public function getJob()\n {\n $this->resolveChildren();\n\n $job = new Job($this->getJobConfig());\n\n foreach ($this->children as $child) {\n $job->add($child->getJob());\n }\n\n return $job;\n }", "public function getValue()\n {\n if ($this->isClosure($this->value)) {\n return $this->callClosure($this->value);\n }\n return $this->value;\n }", "public function get_value() {\r\n\t\tif ( $this->key === 'job_title' ) {\r\n\t\t\treturn $this->listing->get_name();\r\n\t\t}\r\n\r\n\t\tif ( $this->key === 'job_description' ) {\r\n\t\t\treturn $this->listing->get_data('post_content');\r\n\t\t}\r\n\r\n\t\t// othewise, retrieve from wp_postmeta\r\n\t\treturn get_post_meta( $this->listing->get_id(), '_'.$this->key, true );\r\n\t}", "public function getJobById($jobId)\n\t{\n\n\t\tif (!isset($this->_jobsById) || !array_key_exists($jobId, $this->_jobsById))\n\t\t{\n\t\t\t$jobRecord = Scheduler_JobRecord::model()->findById($jobId);\n\n\t\t\tif ($jobRecord)\n\t\t\t{\n\t\t\t\t$this->_jobsById[$jobId] = Scheduler_JobModel::populateModel($jobRecord);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_jobsById[$jobId] = null;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_jobsById[$jobId];\n\t}" ]
[ "0.7225849", "0.6790756", "0.6790756", "0.6758146", "0.67573243", "0.6533129", "0.6533129", "0.6409407", "0.63870674", "0.63131", "0.62630975", "0.6262035", "0.6011149", "0.592905", "0.5880879", "0.5874512", "0.5828768", "0.576533", "0.5743308", "0.573874", "0.57279265", "0.5704559", "0.5686889", "0.56732374", "0.5651741", "0.5634855", "0.56005114", "0.5594368", "0.5558965", "0.5521179", "0.55093145", "0.55093145", "0.55093145", "0.55093145", "0.55093145", "0.5505282", "0.54937005", "0.5475065", "0.5461495", "0.54581445", "0.5445141", "0.54422134", "0.54422134", "0.54266393", "0.53948253", "0.53948253", "0.5382686", "0.5355349", "0.53329355", "0.5331588", "0.5331588", "0.53268623", "0.5323539", "0.5315481", "0.52996594", "0.5298501", "0.5288888", "0.52771586", "0.52673924", "0.52657825", "0.5257667", "0.5249387", "0.52375185", "0.5234711", "0.5233008", "0.5227167", "0.52168745", "0.5206457", "0.51856923", "0.5185515", "0.5169004", "0.5161236", "0.5159534", "0.5158264", "0.514918", "0.51431197", "0.5136168", "0.51308125", "0.51282585", "0.51282585", "0.5109612", "0.5100808", "0.5095917", "0.5085165", "0.5073953", "0.50709033", "0.50548136", "0.50431424", "0.5036315", "0.5029157", "0.5021033", "0.50203496", "0.5020336", "0.501319", "0.5002668", "0.499595", "0.49938574", "0.4992152", "0.4987764", "0.49854517" ]
0.83196986
0
Sets the value of jobScheduler.
public function setJobScheduler(JobScheduler $jobScheduler) { $this->jobScheduler = $jobScheduler; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setScheduler() {}", "public function setJob(SchedulersJob $job)\n {\n $this->job = $job;\n }", "public function getJobScheduler()\n {\n return $this->jobScheduler;\n }", "public function setCommand(SchedulerCommand $command) {\n $this->command = $command;\n }", "public function setJob($value)\n {\n return $this->set(self::_JOB, $value);\n }", "public function setJob($value)\n {\n return $this->set(self::_JOB, $value);\n }", "public function unsetScheduler() {}", "public function setSchedule(?GovernanceSchedule $value): void {\n $this->getBackingStore()->set('schedule', $value);\n }", "public function setSchedule($schedule)\n {\n $this->schedule = $schedule;\n }", "public function setSchedule($schedule = false) {\n if ($schedule === false) {\n return false;\n }\n\n if (!CronExpression::isValidExpression($schedule)) {\n throw new \\Exception(\"Invalid schedule, must use cronjob format\");\n }\n\n $this->schedule = CronExpression::factory($schedule);\n }", "public function setCron($cron)\n\t{\t\t\t\t\n\t\t$this->_cron = (bool)$cron;\n\t}", "public function getJob(SchedulerInterface $scheduler);", "public function setRemoteScheduler($remoteScheduler)\n {\n $this->remoteScheduler = $remoteScheduler;\n\n return $this;\n }", "public function setRemoteScheduler($remoteScheduler)\n {\n $this->remoteScheduler = $remoteScheduler;\n\n return $this;\n }", "public function setScheduledJob($params, $context) {\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, [\n\t\t\t\"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t]);\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, \"rpc.powermgmt.setscheduledjob\");\n\t\t// Set missing configuration object fields.\n\t\t$params['username'] = \"root\";\n\t\t$params['sendemail'] = FALSE;\n\t\tswitch ($params['type']) {\n\t\tcase \"reboot\":\n\t\t\t$params['command'] = \"systemctl reboot\";\n\t\t\tbreak;\n\t\tcase \"shutdown\":\n\t\t\t$params['command'] = \"systemctl poweroff\";\n\t\t\tbreak;\n\t\tcase \"standby\":\n\t\t $pm = new \\OMV\\System\\PowerManagement();\n\t\t if (TRUE === $pm->isStateSupported(\n\t\t \\OMV\\System\\PowerManagement::STATE_SUSPENDHYBRID))\n\t\t $params['command'] = \"systemctl hybrid-sleep\";\n else if (TRUE === $pm->isStateSupported(\n \\OMV\\System\\PowerManagement::STATE_HIBERNATE))\n $params['command'] = \"systemctl hibernate\";\n else if (TRUE === $pm->isStateSupported(\n \\OMV\\System\\PowerManagement::STATE_SUSPEND))\n $params['command'] = \"systemctl suspend\";\n else\n $params['command'] = \"systemctl poweroff\";\n\t\t\tbreak;\n\t\t}\n\t\treturn \\OMV\\Rpc\\Rpc::call(\"cron\", \"set\", $params, $context);\n\t}", "public function setScheduleId($val)\n {\n $this->_propDict[\"scheduleId\"] = $val;\n return $this;\n }", "public function setScheduling($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1\\Scheduling::class);\n $this->scheduling = $var;\n\n return $this;\n }", "function SetRunTime($jobtype='send')\n\t{\n\t\t$allowed_jobtypes = array_keys($this->Schedule);\n\n\t\tif (!in_array($jobtype, $allowed_jobtypes)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$jobtime = time();\n\t\t$jobtype = $this->Db->Quote($jobtype);\n\n\t\t$query = \"UPDATE \" . SENDSTUDIO_TABLEPREFIX . \"settings_cron_schedule SET lastrun={$jobtime} WHERE jobtype='{$jobtype}'\";\n\t\t$result = $this->Db->Query($query);\n\n\t\tif (!$result) {\n\t\t\ttrigger_error('Cannot set CRON schedule', E_USER_NOTICE);\n\t\t\treturn;\n\t\t}\n\n\t\t$number_affected = $this->Db->NumAffected($result);\n\t\tif ($number_affected == 0) {\n\t\t\t$query = \"INSERT INTO \" . SENDSTUDIO_TABLEPREFIX . \"settings_cron_schedule (lastrun, jobtype) VALUES ({$jobtime}, '{$jobtype}')\";\n\t\t\t$result = $this->Db->Query($query);\n\t\t}\n\t}", "public function setScheduleItems($val)\n {\n $this->_propDict[\"scheduleItems\"] = $val;\n return $this;\n }", "public function testOrgApacheSlingCommonsSchedulerImplQuartzScheduler()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.commons.scheduler.impl.QuartzScheduler';\n\n $crawler = $client->request('POST', $path);\n }", "public function setAllowCustomAssignmentSchedule($val)\n {\n $this->_propDict[\"allowCustomAssignmentSchedule\"] = $val;\n return $this;\n }", "public function __construct(ResponseScheduleController $scheduler)\n {\n parent::__construct();\n $this->scheduler = $scheduler;\n }", "public function setSchedule($schedule)\n\t{\n\t\tif ($schedule === '') {\n\t\t\t$schedule = '* * * * * *';\n\t\t} elseif ($schedule === null) {\n\t\t\t$this->_schedule = $schedule;\n\t\t\treturn;\n\t\t}\n\t\t$schedule = trim($schedule);\n\t\t$this->_schedule = $schedule;\n\t\t$this->_attr = [];\n\t\tif (strlen($schedule) > 1 && $schedule[0] == '@') {\n\t\t\tif (is_numeric($triggerTime = substr($schedule, 1))) {\n\t\t\t\t$this->_triggerTime = (int) $triggerTime;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (self::$_validatorCache) {\n\t\t\t$minuteValidator = self::$_validatorCache['m'];\n\t\t\t$hourValidator = self::$_validatorCache['h'];\n\t\t\t$domValidator = self::$_validatorCache['dom'];\n\t\t\t$monthValidator = self::$_validatorCache['mo'];\n\t\t\t$dowValidator = self::$_validatorCache['dow'];\n\t\t\t$yearValidator = self::$_validatorCache['y'];\n\t\t\t$fullValidator = self::$_validatorCache['f'];\n\t\t} else {\n\t\t\t$minute = '(?:[0-9]|[1-5][0-9])';\n\t\t\t$minuteStar = '\\*(?:\\/(?:[1-9]|[1-5][0-9]))?';\n\t\t\t$minuteRegex = $minute . '(?:\\-(?:[1-9]|[1-5][0-9]))?(?:\\/(?:[1-9]|[1-5][0-9]))?';\n\t\t\t$hour = '(?:[0-9]|1[0-9]|2[0-3])';\n\t\t\t$hourStar = '\\*(?:\\/(?:[1-9]|1[0-9]|2[0-3]))?';\n\t\t\t$hourRegex = $hour . '(?:\\-(?:[1-9]|1[0-9]|2[0-3]))?(?:\\/(?:[1-9]|1[0-9]|2[0-3]))?';\n\t\t\t$dom = '(?:(?:[1-9]|[12][0-9]|3[01])W?)';\n\t\t\t$domWOW = '(?:[1-9]|[12][0-9]|3[01])';\n\t\t\t$domStar = '\\*(?:\\/(?:[1-9]|[12][0-9]|3[01]))?';\n\t\t\t$domRegex = '(?:' . $dom . '(?:\\-' . $dom . ')?(?:\\/' . $domWOW . ')?|' . '(?:L(?:\\-[1-5])?)' . ')';\n\t\t\t$month = '(?:[1-9]|1[012]|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][1] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][2] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][3] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][4] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][5] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][6] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][7] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][8] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][9] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][10] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][11] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][12] . ')';\n\t\t\t$monthStar = '\\*(?:\\/(?:[1-9]|1[012]))?';\n\t\t\t$monthRegex = $month . '(?:\\-' . $month . ')?(?:\\/(?:[1-9]|1[012]))?';\n\t\t\t$dow = '(?:[0-6]|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][0] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][1] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][2] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][3] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][4] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][5] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][6] . ')';\n\t\t\t$dowStar = '\\*(?:\\/[0-6])?';\n\t\t\t$dowRegex = '(?:[0-6]L|' . $dow . '(?:(?:\\-' . $dow . ')?(?:\\/[0-6])?|#[1-5])?)';\n\t\t\t$year = '(?:19[7-9][0-9]|20[0-9][0-9])';\n\t\t\t$yearStar = '\\*(?:\\/[0-9]?[0-9])?';\n\t\t\t$yearRegex = $year . '(?:\\-' . $year . ')?(?:\\/[0-9]?[0-9])?';\n\t\t\t$fullValidator = '/^(?:(@(?:annually|yearly|monthly|weekly|daily|hourly))|' .\n\t\t\t\t'(?#minute)((?:' . $minuteStar . '|' . $minuteRegex . ')(?:\\,(?:' . $minuteStar . '|' . $minuteRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#hour)((?:' . $hourStar . '|' . $hourRegex . ')(?:\\,(?:' . $hourStar . '|' . $hourRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#DoM)(\\?|(?:(?:' . $domStar . '|' . $domRegex . ')(?:,(?:' . $domStar . '|' . $domRegex . '))*))[\\s]+' .\n\t\t\t\t'(?#month)((?:' . $monthStar . '|' . $monthRegex . ')(?:\\,(?:' . $monthStar . '|' . $monthRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#DoW)(\\?|(?:' . $dowStar . '|' . $dowRegex . ')(?:\\,(?:' . $dowStar . '|' . $dowRegex . '))*)' .\n\t\t\t\t'(?#year)(?:[\\s]+' .\n\t\t\t\t\t'((?:' . $yearStar . '|' . $yearRegex . ')(?:\\,(?:' . $yearStar . '|' . $yearRegex . '))*)' .\n\t\t\t\t')?' .\n\t\t\t')$/i';\n\n\t\t\t$minuteValidator = '/^(\\*|' . $minute . ')(?:\\-(' . $minute . '))?(?:\\/(' . $minute . '))?$/i';\n\t\t\t$hourValidator = '/^(\\*|' . $hour . ')(?:\\-(' . $hour . '))?(?:\\/(' . $hour . '))?$/i';\n\t\t\t$domValidator = '/^(\\*|\\?|L|' . $domWOW . ')(W)?(?:\\-(' . $domWOW . ')(W)?)?(?:\\/(' . $domWOW . '))?$/i';\n\t\t\t$monthValidator = '/^(\\*|' . $month . ')(?:\\-(' . $month . '))?(?:\\/(' . $month . '))?$/i';\n\t\t\t$dowValidator = '/^(\\*|\\?|' . $dow . ')(L)?(?:\\-(' . $dow . ')(L)?)?(?:\\/(' . $dow . '))?(?:#([1-5]))?$/i';\n\t\t\t$yearValidator = '/^(\\*|' . $year . ')(?:\\-(' . $year . '))?(?:\\/([1-9]?[0-9]))?$/i';\n\t\t\tself::$_validatorCache = [\n\t\t\t\t\t'm' => $minuteValidator,\n\t\t\t\t\t'h' => $hourValidator,\n\t\t\t\t\t'dom' => $domValidator,\n\t\t\t\t\t'mo' => $monthValidator,\n\t\t\t\t\t'dow' => $dowValidator,\n\t\t\t\t\t'y' => $yearValidator,\n\t\t\t\t\t'f' => $fullValidator,\n\t\t\t\t];\n\t\t}\n\n\t\t$i = 0;\n\t\tdo {\n\t\t\tif (!preg_match($fullValidator, $schedule, $matches)) {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $schedule);\n\t\t\t}\n\t\t\tif ($matches[1]) {\n\t\t\t\tforeach (self::$_intervals as $interval => $intervalSchedule) {\n\t\t\t\t\tif ($interval == $matches[1]) {\n\t\t\t\t\t\t$schedule = $intervalSchedule;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} while ($matches[1]);\n\n\t\t$this->_attr[self::MINUTE] = [];\n\t\tforeach (explode(',', $matches[2]) as $match) {\n\t\t\tif (preg_match($minuteValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['min' => 0, 'end' => 59];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['min' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $data['min'];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 59; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::MINUTE][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::HOUR] = [];\n\t\tforeach (explode(',', $matches[3]) as $match) {\n\t\t\tif (preg_match($hourValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['hour' => 0, 'end' => 23];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['hour' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $m2[1];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 23; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::HOUR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::DAY_OF_MONTH] = [];\n\t\tforeach (explode(',', $matches[4]) as $match) {\n\t\t\tif (preg_match($domValidator, $match, $m2)) {\n\t\t\t\t$data = ['dom' => $m2[1]]; // *, ?, \\d, L\n\t\t\t\t$data['domWeekday'] = $m2[2] ?? null;\n\t\t\t\t$data['end'] = $m2[3] ?? ($m2[1] != 'L' ? $m2[1] : null);\n\t\t\t\t//$data['endWeekday'] = $m2[4] ?? null;\n\t\t\t\t$data['endWeekday'] = $m2[4] ?? (($m2[3] ?? null) ? null : $data['domWeekday']);\n\t\t\t\t$data['period'] = (int) max($m2[5] ?? 1, 1);\n\t\t\t\tif (!($m2[3] ?? 0) && ($m2[5] ?? 0)) {\n\t\t\t\t\t$data['end'] = 31; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::DAY_OF_MONTH][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::MONTH_OF_YEAR] = [];\n\t\tforeach (explode(',', $matches[5]) as $match) {\n\t\t\tif (preg_match($monthValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['moy' => 1, 'end' => 12];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['moy' => (int) $this->translateMonthOfYear($m2[1])];\n\t\t\t\t\t$data['end'] = (isset($m2[2]) && $m2[2]) ? (int) $this->translateMonthOfYear($m2[2]) : $data['moy'];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 12; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::MONTH_OF_YEAR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::DAY_OF_WEEK] = [];\n\t\tforeach (explode(',', $matches[6]) as $match) {\n\t\t\tif (preg_match($dowValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*' || $m2[1] === '?') {\n\t\t\t\t\t$data = ['dow' => 0, 'end' => 6];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['dow' => (int) $this->translateDayOfWeek($m2[1])];\n\t\t\t\t\t$data['end'] = (isset($m2[3]) && $m2[3]) ? (int) $this->translateDayOfWeek($m2[3]) : $data['dow'];\n\t\t\t\t}\n\t\t\t\t$data['lastDow'] = $m2[2] ?? null;\n\t\t\t\t$data['lastEnd'] = $m2[4] ?? null;\n\t\t\t\t$data['period'] = (int) max($m2[5] ?? 1, 1);\n\t\t\t\t$data['week'] = $m2[6] ?? null;\n\t\t\t\tif (!($m2[3] ?? 0) && ($m2[5] ?? 0)) {\n\t\t\t\t\t$data['end'] = 6; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::DAY_OF_WEEK][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::YEAR] = [];\n\t\t$matches[7] ??= '*';\n\t\tforeach (explode(',', $matches[7]) as $match) {\n\t\t\tif (preg_match($yearValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['year' => self::YEAR_MIN];\n\t\t\t\t\t$data['end'] = self::YEAR_MAX;\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['year' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $m2[1];\n\t\t\t\t}\n\t\t\t\t$data['period'] = max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = self::YEAR_MAX; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::YEAR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\t}", "public function schedule(string $strtotime): Job\n {\n $this->wait = $strtotime;\n\n return $this;\n }", "function scheduler(\n ?SchedulerInterface $instance = null,\n ): SchedulerInterface {\n /** @var SchedulerInterface|null $scheduler */\n static $scheduler;\n\n if ($instance !== null) {\n $scheduler = $instance;\n if (defined('EVENT_LOOP_DEFAULT_HANDLE_SIGNALS') && EVENT_LOOP_DEFAULT_HANDLE_SIGNALS) {\n register_default_signal_handler();\n }\n } elseif (!$scheduler) {\n if (extension_loaded('uv')) {\n $scheduler = new Scheduler\\Uv();\n } elseif (extension_loaded('ev')) {\n $scheduler = new Scheduler\\Ev();\n } elseif (extension_loaded('event')) {\n $scheduler = new Scheduler\\Event();\n } else {\n $scheduler = new Scheduler\\Select();\n }\n }\n\n if ($scheduler === null) {\n throw new RuntimeException(\n \"Unable to create default scheduler and a default one couldn't be created\"\n );\n }\n\n return $scheduler;\n }", "public function setSetJob(Down_GuildSetJob $value)\n {\n return $this->set(self::_SET_JOB, $value);\n }", "public function getRemoteScheduler()\n {\n return $this->remoteScheduler;\n }", "public function getRemoteScheduler()\n {\n return $this->remoteScheduler;\n }", "static function toggleScheduledJob( $scheduledJobId ) {\n\n // find existing job\n $job = self::fetchJobSchedule( $scheduledJobId );\n\n if( $job ) {\n global $wpdb;\n $returnval = $wpdb->update(\n \"job_scheduler\",\n array( 'last_updated_date' => current_time('mysql', 1),\n 'active_yn' => $job->active_yn == 'Y' ? 'N' : 'Y' ),\n array( 'job_id' => $scheduledJobId ) );\n \n if(false === $returnval) {\n throw new DatabaseException(\"Error occurred during UPDATE\");\n }\n }\n }", "function set_jobtitle($jobtitle) {\n\t\t$this->jobtitle = $jobtitle;\n\t}", "public function setQueue()\n {\n throw new \\RuntimeException('It is not possible to set job queue, you must create a new job');\n }", "function changeJob($newjob){\n $this->job = $newjob; // Change the person's job\n }", "public function setUpdateScheduleType($val)\n {\n $this->_propDict[\"updateScheduleType\"] = $val;\n return $this;\n }", "public function setStartAndDueDateTime(?WorkbookDocumentTaskSchedule $value): void {\n $this->getBackingStore()->set('startAndDueDateTime', $value);\n }", "public function setSchedule(Schedule $schedule): UpdateScheduleService\n {\n $this->schedule = $schedule;\n return $this;\n }", "protected function setModel(): void\n {\n $this->model = SchedulerCellLock::class;\n }", "protected function schedule(Schedule $schedule)\n {\n // Get the start time\n $started = date('h:i:s');\n\n if (config('app.env') === 'prod') {\n // At 6am, fire off the job to grab all the data for that year.\n $schedule->job(new FetchAppData($started))->dailyAt('06:00');\n\n // And once again at 6pm for redundancy, just in case.\n $schedule->job(new FetchAppData($started))->dailyAt('18:00');\n }\n\n if (config('app.env') === 'dev') {\n // Do it once in the middle of the night also for the dev DB.\n $schedule->job(new FetchAppData($started))->dailyAt('01:00');\n }\n\n // Once a year on August 1st at 12:00am, move the current academic year\n // setting to whatever the current year is.\n $schedule->job(new SetAcademicYear())->cron('0 0 1 8 *');\n }", "public function updateScheduler($tasks);", "public function setData()\n {\n throw new \\RuntimeException('It is not possible to set job data, you must create a new job');\n }", "public function setClass()\n {\n throw new \\RuntimeException('It is not possible to set job class, you must create a new job');\n }", "public function schedule(Schedulable $scheduler)\n {\n\n return $scheduler->minutes('0,30');\n }", "static function activate_the_scheduler(){\n\t\tif(!wp_next_scheduled(self::hook)) {\n\t\t\twp_schedule_event( current_time( 'timestamp' ), self::interval, self::hook);\n\t\t}\n\t}", "protected function schedule(Schedule $schedule): void\n {\n $this->schedule = $schedule;\n\n $this->scheduleStatJobs();\n\n if (config('schedule.ship_matrix.enabled')) {\n $this->scheduleVehicleJobs();\n }\n\n if (config('schedule.comm_links.enabled')) {\n $this->scheduleCommLinkJobs();\n }\n\n if (config('schedule.starmap.enabled')) {\n $this->scheduleStarmapJobs();\n }\n\n if (config('schedule.galactapedia.enabled')) {\n $this->scheduleGalactapediaJobs();\n }\n }", "public function setSchedule(Schedule $schedule): UpdateScheduleService;", "public function setData($value) : Job\n {\n $this->validateJson($value);\n\n if ($this->data['data'] !== $value) {\n $this->data['data'] = $value;\n $this->setModified('data');\n }\n\n return $this;\n }", "public function setJobTitle($value)\n {\n return $this->setProperty(\"JobTitle\", $value, true);\n }", "protected function setLastJobAsActive(){\n\t\t$this->setProjectJob(end($this->getProject()->jobs));\n\t}", "public function setQueueId(?int $value) : Job\n {\n\n if ($this->data['queue_id'] !== $value) {\n $this->data['queue_id'] = $value;\n $this->setModified('queue_id');\n }\n\n return $this;\n }", "public function setSchedule ()\n {\n $this->loadComponent('DateTime');\n $this->loadModel('ScheduleTime');\n $data = $this->Auth->user();\n $id_fortune = $data['id'];\n $days = $this->DateTime->allDayInWeek();\n $months = $this->DateTime->allDayInMonth();\n $times = $this->ScheduleTime->getListTime();\n if ($this->Check->isId($id_fortune)) {\n $this->set([\n 'times' => $times,\n 'days' => $months,\n 'id' => $id_fortune\n ]);\n } else{\n $this->Flash->error(__('Id not found'));\n }\n }", "public function setScheduledAt($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->scheduled_at !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->scheduled_at !== null && $tmpDt = new DateTime($this->scheduled_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->scheduled_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);\n\t\t\t\t$this->modifiedColumns[] = CampaignPeer::SCHEDULED_AT;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}", "public function setJobOptions(array $options)\n\t{\n\t\t$this->job_options = $options;\n\t}", "public function getScheduling()\n {\n return $this->scheduling;\n }", "protected function schedule(Schedule $schedule): void\n {\n //\n }", "protected function schedule(Schedule $schedule)\n\t{\n\t}", "public function setnewJobId($aJobId) {\r\n $lOld = $this->mVal['jobid'];\r\n $this -> mJobId = $aJobId;\r\n $this -> mVal['jobid'] = $aJobId;\r\n\r\n if (isset($this->mVal['jobnr'])) {\r\n if (substr($lOld, 0, 1) == 'A') {\r\n $lJobNr = intval(substr($aJobId,1));\r\n $this->mVal['jobnr'] = $lJobNr;\r\n } \r\n }\r\n }", "public function getSetJob()\n {\n return $this->get(self::_SET_JOB);\n }", "protected function schedule(Schedule $schedule)\n {\n //\n }", "protected function schedule(Schedule $schedule)\n {\n //\n }", "protected function schedule(Schedule $schedule)\n {\n //\n }", "public function setStatus(int $value) : Job\n {\n\n if ($this->data['status'] !== $value) {\n $this->data['status'] = $value;\n $this->setModified('status');\n }\n\n return $this;\n }", "public function setSettings(?AccessReviewScheduleSettings $value): void {\n $this->getBackingStore()->set('settings', $value);\n }", "public function testOrgApacheSlingCommonsSchedulerImplSchedulerHealthCheck()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.commons.scheduler.impl.SchedulerHealthCheck';\n\n $crawler = $client->request('POST', $path);\n }", "function deactivate() {\n\t$scheduler = new CSL_Feed_Import_Scheduler;\n\t$scheduler->clear();\n}", "public function set_subject($subject = NULL)\n\t{\n\t\t$this->_subject = $subject;\n\t}", "public function edit(Cronjob $cronjob)\n {\n //\n }", "public function setIsSystemRule($val)\n {\n $this->_propDict[\"isSystemRule\"] = boolval($val);\n return $this;\n }", "function activate() {\n\t$scheduler = new CSL_Feed_Import_Scheduler;\n\t// The first run will start run in 20 minutes.\n\t$first_run = time() + ( 20 * MINUTE_IN_SECONDS );\n\n\t// Clear Scheduler of any previous cron events to be sure.\n\t$scheduler->clear();\n\n\t// Schedule the first run.\n\t$scheduler->setup()->schedule_next( $first_run );\n}", "protected function schedule(Schedule $schedule)\n {\n $this->schedule = $schedule;\n\n $this->__scheduleCrawlProxy();\n $this->__scheduleCleanProxy();\n $this->__scheduleScrapeWebCategory();\n $this->__scheduleScrapeWebProduct();\n $this->__scheduleUpdateWebCategory();\n $this->__scheduleUpdateWebProduct();\n// $this->__scheduleHorizonSnapshot();\n }", "protected function schedule(Schedule $schedule)\n {\n set_time_limit(0);\n\n // $schedule->job(new SchedulerJob(['command' => 'demo']))->everyMinute();\n }", "public function setValue($value) {}", "public function setValue($value) {}", "function setWorkTime( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->WorkTime = $value;\n }", "public function process(ContainerBuilder $container)\n {\n if (!$container->has(SchedulerService::class)) {\n return;\n }\n\n $taggedServices = $container->findTaggedServiceIds('task_scheduler.task');\n $scheduler = new Reference(SchedulerService::class);\n\n foreach ($taggedServices as $id => $attrs) {\n $definition = $container->findDefinition($id);\n $definition->addMethodCall('setSchedulerService', [$scheduler]);\n }\n }", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function editSchedule(callable $editor): void\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n\n $this->app->booted(function () use ($editor) {\n $schedule = $this->app->make(Schedule::class);\n\n $editor($schedule);\n });\n }", "public function set_subject($subject) {\n\t\t\t$this->subject = $subject;\n\t\t}", "public function setJobType($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\BigQuery\\Reservation\\V1\\Assignment\\JobType::class);\n $this->job_type = $var;\n\n return $this;\n }", "public function setQueuedAtAttribute($value)\n {\n $value = ($value) ? : Carbon::now('Europe/London');\n $this->attributes['queued_at'] = $value;\n }", "public function setValue($val) : self {return $this->setNewValue($this->value, $val);}", "public function setJob($job)\n {\n $this->job = $job;\n\n return $this;\n }", "public function setTaskTriggers($val)\n {\n $this->_propDict[\"taskTriggers\"] = $val;\n return $this;\n }", "public function edit(CronJob $cronJob)\n {\n //\n }", "public function testSetJobNameSetsCall()\n {\n $this->class->set_job_name('job');\n\n $this->assertEquals('resque/job', $this->get_reflection_property_value('request')['call']);\n }", "public function SetJobPriority(SetJobPriority $parameters)\n {\n return $this->__soapCall('SetJobPriority', array($parameters));\n }", "public function setVal($val){\n\t\t\t$this->_val = $val;\n\t\t}", "public static function setCurrentJob($job)\n {\n return (bool) Configuration::updateGlobalValue(self::CURRENT_TASK_CLI, $job);\n }", "public function setAutoResponderSubject($value) { $this->_autoResponderSubject = $value; }", "public function setScheduleType($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->schedule_type !== $v) {\n\t\t\t$this->schedule_type = $v;\n\t\t\t$this->modifiedColumns[] = CampaignPeer::SCHEDULE_TYPE;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setStartTime($starttime){\n $this->_starttime = $starttime;\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->call(function () {amoController::setWaybills();})\n ->cron('0 0-23/3 * * *');\n $schedule->call(function () {amoController::getStatistics();})\n ->hourly();\n }" ]
[ "0.7628835", "0.6624116", "0.6425214", "0.6099231", "0.59361845", "0.59361845", "0.58539003", "0.57756466", "0.5680822", "0.56208795", "0.54188806", "0.5378278", "0.53535354", "0.53535354", "0.52828336", "0.5164766", "0.5161749", "0.51417303", "0.5100599", "0.5051072", "0.50465333", "0.49727052", "0.49673393", "0.4941399", "0.49404067", "0.4934124", "0.49050504", "0.49050504", "0.48944154", "0.487305", "0.48711762", "0.48660588", "0.48433843", "0.4807575", "0.48060918", "0.47631338", "0.47600257", "0.4742174", "0.47015935", "0.46918648", "0.4652049", "0.46237662", "0.46123314", "0.4607819", "0.45531285", "0.45351082", "0.45137772", "0.4499998", "0.44993308", "0.44984263", "0.44952682", "0.44896406", "0.4485", "0.4484399", "0.4460138", "0.4439995", "0.44386375", "0.44386375", "0.44386375", "0.44318622", "0.4425667", "0.44223312", "0.44050857", "0.43800247", "0.43749997", "0.4374617", "0.4365423", "0.43477237", "0.43451434", "0.43381906", "0.43381906", "0.43375197", "0.43373677", "0.43372947", "0.43372947", "0.43372947", "0.43372947", "0.43372947", "0.43372947", "0.43372947", "0.43372947", "0.43372947", "0.43372947", "0.43372947", "0.4330052", "0.4325223", "0.43240058", "0.431699", "0.43110213", "0.42879045", "0.42842248", "0.4282863", "0.42758438", "0.42564893", "0.425088", "0.42427272", "0.4241224", "0.4233934", "0.42326912", "0.42255634" ]
0.6536229
2
Gets the value of maxProcesses.
public function getMaxProcesses() { return $this->maxProcesses; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMaxProcesses(): int\n {\n return $this->maxProcesses;\n }", "public function getMaxJobsPerProcess(): int\n {\n return $this->maxJobsPerProcess;\n }", "public function getMinProcesses(): int\n {\n return $this->minProcesses;\n }", "public function getMemoryMax(): int\n {\n return $this->memoryMax;\n }", "public function getMaxNumber()\n {\n return $this->maxNumber;\n }", "public function setMaxProcesses($maxProcesses)\n {\n $this->maxProcesses = $maxProcesses;\n\n return $this;\n }", "public function getProcesses()\r\n {\r\n return $this->processes;\r\n }", "public function getMaxcount()\n {\n return $this->maxCount;\n }", "public function getMax() {\n return $this->max;\n }", "public function getMaxApplications()\n {\n if (is_null($this->maxApplications)) {\n /** @psalm-var ?int $data */\n $data = $this->raw(self::FIELD_MAX_APPLICATIONS);\n if (is_null($data)) {\n return null;\n }\n $this->maxApplications = (int) $data;\n }\n\n return $this->maxApplications;\n }", "public function getMaximum()\n {\n return $this->max;\n }", "public function getMax()\n {\n return $this->_maxValue;\n }", "public function getMaximum() {\r\n return $this->maximumvalue;\r\n }", "public function getMaxValue()\n {\n return $this->get('MaxValue');\n }", "protected function getOptimalNumberOfChildProcesses(): int\n {\n $coreNumber = 1;\n $detectCommand = [\n 'linux' => 'cat /proc/cpuinfo | grep processor | wc -l',\n ];\n\n $os = strtolower(trim(PHP_OS));\n\n if (isset($detectCommand[$os])) {\n $coreNumber = intval($this->execute($detectCommand[$os]));\n }\n\n return $coreNumber;\n }", "public function getMaxLimit()\n {\n return $this->max_limit;\n }", "public function setMaxProcesses(int $maxProcesses): void\n {\n $this->maxProcesses = $maxProcesses;\n }", "public static function getMemoryLimit(): int\n {\n $result = static::getIniValue('memory_limit');\n $result = Convert::valueToBytes($result);\n\n return $result;\n }", "public function getMaximum()\n {\n return $this->maximum;\n }", "function getMax() { return $this->readMaxValue(); }", "public static function getMax()\n {\n return memory_get_peak_usage(true);\n }", "public static function get_max_value() {\n return self::MAX_VALUE;\n }", "function getMaxValue() { return $this->readMaxValue(); }", "function getMaxValue() { return $this->readMaxValue(); }", "protected function _getMax()\n {\n $max = 0;\n if (!empty($this->_tagsArray)) {\n $p_size = 0;\n foreach ($this->_tagsArray as $cKey => $cVal) {\n $c_size = $cVal['size'];\n if ($c_size > $p_size) {\n $max = $c_size;\n $p_size = $c_size;\n }\n }\n }\n return $max;\n }", "public function getMaxItems()\n {\n return isset($this->max_items) ? $this->max_items : 0;\n }", "function getNota_max()\n {\n if (!isset($this->inota_max) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->inota_max;\n }", "function getNota_max()\n {\n if (!isset($this->inota_max) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->inota_max;\n }", "public function getMaxHops()\n {\n return $this->max_hops;\n }", "public function getMaxNodeCount()\n {\n return $this->max_node_count;\n }", "public function getMaxNbChilds()\n {\n return $this->getOption('max', 0);\n }", "public function getItemsMax() {\n\t\treturn \\Services::get('submission')->getMax($this->_getItemsParams());\n\t}", "public function getMaxLoad()\n {\n return $this->maxLoad;\n }", "public function getMaxItemsCount() {\n\t\t\treturn $this->maxItemsCount;\n\t\t}", "public function getCountMax(): int\n {\n return $this->countMax;\n }", "public function getMax()\n {\n return $this->_fields['Max']['FieldValue'];\n }", "public function getMaxPerIp()\n {\n return $this->maxPerIp;\n }", "function max() { return $this->max; }", "function get_version_max() {\n return $this->version_max;\n }", "public function getMaxSequence()\n {\n return $this->max_sequence;\n }", "public function getMaximumItemCount()\n {\n return $this->maximumItemCount;\n }", "public function getMaxVersions()\n {\n return $this->max_versions;\n }", "public function numberProcesses()\n {\n $proc_count = 0;\n $dh = opendir('/proc');\n while ($dir = readdir($dh)) {\n if (is_dir('/proc/' . $dir)) {\n if (preg_match('/^[0-9]+$/', $dir)) {\n $proc_count ++;\n }\n }\n }\n return $proc_count;\n }", "public function getMemoryLimit()\n {\n return $this->memoryLimit;\n }", "public function getMaxValue();", "public function getMaxValue();", "abstract public function maxMax(): int;", "public function getMaxConcurrent(): ?int\n {\n return $this->maxConcurrent;\n }", "public function getMaxUse(): int\n {\n return $this->max_use;\n }", "public function getMaxNumSteps()\n {\n return $this->max_num_steps;\n }", "public function getMaxResults()\n {\n return $this->max_results;\n }", "public function getNotificationCounterMax()\n {\n return self::NOTIFICATIONS_COUNTER_MAX;\n }", "static function getSiteMaxSize() {\n return self::getMetaValueRange(PostProperty::META_SIZE, false, 10000000);\n }", "public function getMax()\n {\n return $this->_fMax;\n }", "public function getMaxVersions()\r\n {\r\n return $this->maxVersions;\r\n }", "public function getMaxSize() {\n\t\t\treturn $this->maxSize >= 0 ? $this->maxSize : $this->getTotalMaxSize();\n\t\t}", "protected function max_value() {\n $max = 0;\n foreach ($this->data_collections as $data_collection) {\n foreach ($data_collection->get_items() as $item) {\n if ($max < $item->get_value()) {\n $max = $item->get_value();\n }\n }\n }\n return $max;\n }", "public function getCurrentMemoryLimit() {\n return ini_get('memory_limit');\n }", "public function getAllowedMaxFileNumber() {\n return $this->allowedMaxFileNumber;\n }", "public function getMaxSize()\r\n {\r\n return $this->max_size;\r\n }", "public function getMaxConnections() {\n return @$this->attributes['max_connections'];\n }", "public function getMaxOccupancy()\n {\n return $this->maxOccupancy;\n }", "public function getMaxPerUserId()\n {\n return $this->maxPerUserId;\n }", "public function max_connections()\n {\n $channel = ChannelRepository::getPublic($this);\n\n return $channel->max_connections;\n }", "public function getMaxBatchSize() \n {\n return $this->_fields['MaxBatchSize']['FieldValue'];\n }", "public function getNumeroProcesso() {\n return $this->iNumeroProcesso;\n }", "public function getMaxChildrenPerFamily()\n {\n return $this->maxChildrenPerFamily;\n }", "public function getMaxInstanceRequestConcurrency()\n {\n return $this->max_instance_request_concurrency;\n }", "public function getMaxCount(): ?int\n {\n return $this->maxCount;\n }", "public function getMaximumQuantity()\n {\n return $this->maximumQuantity;\n }", "public function getMaxArguments()\n {\n return $this->maxArgs;\n }", "public function getMaxPageSize()\n {\n return $this->maxPageSize;\n }", "public function getImgMax()\n {\n return $this->_params['imgmax'];\n }", "public function getPhpMax()\n {\n return $this->getComposerJson()->extra->magento_connect->php_max;\n }", "public function maxCapacity() \r\n {\r\n return $this->maxCapacity;\r\n }", "public function getMaxSize(): int\n {\n return $this->maxSize;\n }", "public function getMaxPlayers() : int {\r\n\r\n return (int) $this->getMain()->getDatabase()->get(\"max_players\", [\"table\" => \"Games\", \"name\" => $this->getName()])->fetchArray()[0];\r\n\r\n }", "protected function getMaxItemsCount()\n {\n return $this->getParam(self::PARAM_MAX_ITEMS_TO_DISPLAY) ?: $this->getMaxCountInBlock();\n }", "public function getMaxExecutionTime()\n\t{\n\t\tif(!isset($this->_maxExecutionTime)){\n\t\t\t$this->_maxExecutionTime = $this->dontHardcodeService->searchDontHardcodeByParamNameAndFilterName(__CLASS__,'maxExecutionTime',true);\n\t\t}\n\n\t\tif(is_numeric($this->_maxExecutionTime) && $this->_maxExecutionTime > 44){\n\t\t\treturn $this->_maxExecutionTime;\n\t\t}\n\t\telse{\n\t\t\treturn 120;\n\t\t}\n\t}", "public function getMaxSize() : int{\n return $this->maxSize;\n }", "public function get_maximum_tries() {\n $max = 1;\n foreach ($this->get_response_class_ids() as $responseclassid) {\n $max = max($max, $this->get_response_class($responseclassid)->get_maximum_tries());\n }\n return $max;\n }", "public function getMaxReplicas(): int {\n return $this->maxReplicas;\n }", "public function getMaxItems() {\n\t\t$q = $this->bdd->prepare('SELECT count(1) FROM items');\n\t\t$q->execute();\n\t\treturn intval($q->fetch(PDO::FETCH_COLUMN));\n\t}", "public static function getMaxExecutionTime(): int\n {\n return static::getIniValue('max_execution_time');\n }", "public function getMaxEvents()\n {\n return $this->maxEvents;\n }", "public function getMaxChildCountAttribute() : int\n {\n $counts = $this->allChild->pluck('max_child_count')->toArray();\n\n return count($counts) ? max($counts) + 1 : 0;\n }", "public function getMaxConnectionsPerIp()\n {\n return $this->_maxConnectionsPerIp;\n }", "public function hasMpMax(){\r\n return $this->_has(4);\r\n }", "function rlip_get_maxruntime() {\n $maxruntime = (int)ini_get('max_execution_time');\n $maxruntime -= 2; // TBD: MUST STOP BEFORE time limit is reached!\n //echo \"\\nrlip_get_maxruntime(b):{$maxruntime}\\n\";\n if ($maxruntime < RLIP_MAXRUNTIME_MIN) {\n $maxruntime = RLIP_MAXRUNTIME_MIN;\n }\n return $maxruntime;\n}", "public function getOperationPrimeMaximumAmount()\n {\n\n return $this->operation_prime_maximum_amount;\n }", "public function getProcessId(): int\r\n {\r\n return $this->processId;\r\n }", "public function getVo2Max() {\n return $this->vo2Max;\n }", "public function getMaxConfs()\n {\n return $this->max_confs;\n }", "public function maxSortingNumber(){\n $result = $this->repo->maxSortingNumber();\n return $result;\n }", "public function maxCount($var = null): int\n {\n return $this->loadHeaderProperty(\n 'max_count',\n $var,\n static function ($value) {\n return (int)($value ?? Grav::instance()['config']->get('system.pages.list.count'));\n }\n );\n }", "public function getMax(): int;", "public function getMaxProperties(): int\n {\n return $this->maxProperties;\n }", "public function getProcess()\n {\n return $this->get(self::PROCESS);\n }", "public function hasMaxMp(){\r\n return $this->_has(4);\r\n }", "protected function getMemoryLimit(): int\n\t{\n\t\tif (!function_exists('ini_get'))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\t$memLimit = ini_get(\"memory_limit\");\n\n\t\tif ((is_numeric($memLimit) && ($memLimit < 0)) || !is_numeric($memLimit))\n\t\t{\n\t\t\t$memLimit = 0; // 1.2a3 -- Rare case with memory_limit < 0, e.g. -1Mb!\n\t\t}\n\n\t\t$memLimit = Conversions::humanToIntegerBytes($memLimit);\n\n\t\treturn $memLimit;\n\t}" ]
[ "0.8922041", "0.77285427", "0.70736605", "0.6827342", "0.6705074", "0.66877884", "0.65899014", "0.6569188", "0.6443798", "0.64368933", "0.6434681", "0.63893414", "0.6357359", "0.6356836", "0.633951", "0.6330948", "0.6294615", "0.6287439", "0.62839246", "0.62774795", "0.62661576", "0.6263936", "0.62558913", "0.6210608", "0.61947256", "0.6184542", "0.6182555", "0.6182555", "0.6152296", "0.61262286", "0.6102478", "0.6098729", "0.60926366", "0.6088882", "0.608073", "0.6079266", "0.606083", "0.604624", "0.6035221", "0.6031716", "0.6010411", "0.6007811", "0.600362", "0.5963395", "0.59358275", "0.59358275", "0.59269756", "0.59229106", "0.59134454", "0.5912795", "0.5910906", "0.59094214", "0.59064394", "0.59008265", "0.5891529", "0.5878567", "0.58752024", "0.5849175", "0.58477163", "0.58330405", "0.5830338", "0.5830081", "0.58258516", "0.58156157", "0.58092594", "0.58057344", "0.5797869", "0.5774506", "0.5767616", "0.57663596", "0.576633", "0.5759778", "0.5746041", "0.5733079", "0.57258505", "0.5718892", "0.5709258", "0.56877714", "0.5686581", "0.56679404", "0.56625444", "0.5660614", "0.5657505", "0.5635416", "0.5633013", "0.5617106", "0.5612718", "0.56109947", "0.5600357", "0.55934936", "0.55903673", "0.5575602", "0.55713207", "0.5566407", "0.55545384", "0.5549837", "0.55478776", "0.5546528", "0.55355406", "0.5534274" ]
0.91522306
0
Sets the value of maxProcesses.
public function setMaxProcesses($maxProcesses) { $this->maxProcesses = $maxProcesses; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMaxProcesses(int $maxProcesses): void\n {\n $this->maxProcesses = $maxProcesses;\n }", "public function setMaxJobsPerProcess(int $maxJobsPerProcess): void\n {\n $this->maxJobsPerProcess = $maxJobsPerProcess;\n }", "public function getMaxProcesses(): int\n {\n return $this->maxProcesses;\n }", "public function getMaxProcesses()\n {\n return $this->maxProcesses;\n }", "public function setMaxJobs($maxJobs)\n\t{\n\t\t$this->maxJobs = $maxJobs;\n\t}", "public function setMaximumValue(int $maximumValue): void;", "public function setMaximum($value) {\r\n $this->internalSetMaximum($value);\r\n }", "public function setMax( int $max ): void {\n\t\t\t$this->maximum = $max;\n\t\t}", "public function setMinProcesses(int $minProcesses): void\n {\n $this->minProcesses = $minProcesses;\n }", "public function SetMaxCount ($maxCount);", "public function getMaxJobsPerProcess(): int\n {\n return $this->maxJobsPerProcess;\n }", "public function setMaxSize($num) {\n if (is_numeric($num) && $num > 0) {\n $this->_max = (int) $num;\n }\n }", "public function setProgressMax(int $value)\n {\n $this->update(['progress_max' => $value]);\n }", "public function setProcesses($processes)\r\n {\r\n $this->processes = $processes;\r\n\r\n return $this;\r\n }", "public function setMaxVersions($var)\n {\n GPBUtil::checkInt32($var);\n $this->max_versions = $var;\n $this->has_max_versions = true;\n\n return $this;\n }", "public function setMaxLength(int $max):void {\r\n\t\t$this->maxLength = $max;\r\n\t}", "public function setProcessId(?int $value): void {\n $this->getBackingStore()->set('processId', $value);\n }", "protected function setMemoryLimit() {}", "public function setMaximumSessions($maximumSessions)\n {\n $this->maximumSessions = (int) $maximumSessions;\n }", "function Set_max_size($ServerName, $max_size){\n\t\tself::Run_flushctl_command($ServerName, \" set max_size \".$max_size);\n\t}", "public function setMaxSequence($var)\n {\n GPBUtil::checkInt64($var);\n $this->max_sequence = $var;\n\n return $this;\n }", "public function setMaxRunTimeInMinutes(?int $value): void {\n $this->getBackingStore()->set('maxRunTimeInMinutes', $value);\n }", "public function setMaxNodeCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->max_node_count = $var;\n\n return $this;\n }", "public function setMaxValue($maxValue);", "protected function setLimits()\n {\n if (!isset($this->settings->cpuLoad)) {\n $this->settings->cpuLoad = \"low\";\n }\n\n $memoryLimit = self::MAX_MEMORY_RATIO;\n $timeLimit = self::EXECUTION_TIME_RATIO;\n\n switch ($this->settings->cpuLoad) {\n case \"medium\":\n $timeLimit = $timeLimit / 2;\n break;\n case \"low\":\n $timeLimit = $timeLimit / 4;\n break;\n\n case \"fast\":\n default:\n break;\n }\n\n $this->memoryLimit = $this->maxMemoryLimit * $memoryLimit;\n $this->executionLimit = $this->maxExecutionTime * $timeLimit;\n }", "public function processes(Processes $processes = null);", "public function setMaxValue($value)\n\t{\n\t\t$this->setViewState('MaxValue',$value,'');\n\t}", "function set_sys_limits()\n {\n if (is_numeric($this->_params->get('time_limit'))) {\n set_time_limit($this->_params->get('time_limit'));\n // avoid next execution\n // @TODO Change to static variable\n $this->_params->set('time_limit', '');\n $this->_paramsDef->set('time_limit', '');\n }\n\n if ($this->_params->get('memory_limit') != 'default') {\n ini_set(\"memory_limit\", $this->_params->get('memory_limit'));\n $this->_params->set('memory_limit', 'default');\n $this->_paramsDef->set('memory_limit', 'default');\n }\n\n }", "public function setMaxNumSteps($var)\n {\n GPBUtil::checkInt64($var);\n $this->max_num_steps = $var;\n\n return $this;\n }", "public function setMaxcount($count)\n {\n $this->maxCount = $count;\n }", "function setProcessCount($inProcessCount) {\n\t\tif ( $inProcessCount !== $this->_ProcessCount ) {\n\t\t\t$this->_ProcessCount = $inProcessCount;\n\t\t\t$this->_Modified = true;\n\t\t}\n\t\treturn $this;\n\t}", "public function setProcess($value)\n {\n return $this->set(self::PROCESS, $value);\n }", "public function setHistogramMax(int $max)\n {\n $this->max = $max;\n }", "public function getMinProcesses(): int\n {\n return $this->minProcesses;\n }", "public function setXMax($xMax) {}", "public function setMaxModerationScore($maxMod){\r\n\t\t$this->MAX_MODERATE_SCORE = $maxMod;\r\n\t}", "private function setMaximumRecords($maximum){\n\t\t$this->maximumRecords = $maximum;\n\t}", "public function setMaxBeds($maxBeds);", "public function test_admin_set_max_num_players()\n {\n $this->assertTrue($this->postScriptumServer->adminSetMaxNumPlayers(78));\n }", "public function setMaximumNumberOfTokens($maximum)\n {\n return $this->setOption('maximumnumberoftokens', $maximum);\n }", "public function setMax($max) {\n\t\t$this->attributes['max'] = $max;\n\t\t$this->max = $max;\n\t\treturn $this;\n\t}", "public function process($maxNumberOfMessages = null);", "function setMax($max) {\n $this->field['max'] = (int) $max;\n\n return $this;\n }", "public function setProcess( $process )\n {\n \n $this->process = $process;\n \n }", "public function setMaxSize($max){\n $this->maxSize = $max;\n return $this;\n }", "public function setAutomaticMaximum($value) {\r\n $this->automaticMaximum = $this->setAutoMinMax($this->automaticMaximum, $this->automaticMinimum,\r\n $value);\r\n }", "function setNota_max($inota_max = '')\n {\n $this->inota_max = $inota_max;\n }", "function setNota_max($inota_max = '')\n {\n $this->inota_max = $inota_max;\n }", "public function setLimit ($value)\r\n\t{\r\n\t\t$this->limit = $value;\r\n\t}", "public function setMemoryLimit(int $memoryLimit): void\n\t{\n\t\t$this->memoryLimit = $memoryLimit;\n\t}", "public function setMax($value)\n {\n if (is_array($value)) {\n $value = array2Point($value);\n }\n\n if (!($value instanceof Point)) {\n throw new InvalidConfigException('Invalid `max` attribute value; it must be a Point object or an array that can be converted to a Point object');\n }\n\n $this->_max = $value;\n }", "public function setMaxLimit($var)\n {\n GPBUtil::checkInt64($var);\n $this->max_limit = $var;\n\n return $this;\n }", "public function setMax($max) {\n $this->max = $max;\n return $this;\n }", "public function setMax($max) {\n $this->max = $max;\n return $this;\n }", "public static function setGlobalMaxLength(int $maxLength):void {\r\n\t\tself::$globalMaxLength = $maxLength;\r\n\t}", "public function setMaximum(?Json $value): void {\n $this->getBackingStore()->set('maximum', $value);\n }", "public function setMaxBatchSize($value) \n {\n $this->_fields['MaxBatchSize']['FieldValue'] = $value;\n return $this;\n }", "public function setMaxExecuting($max_execing)\n {\n $this->max_execing = max(1, $max_execing + 0);\n }", "public function setImgMax($value)\n {\n if ($value !== null) {\n $this->_params['imgmax'] = $value;\n } else {\n unset($this->_params['imgmax']);\n }\n }", "public static function setNumberMaxBlocked($nb){\n Configuration::where('id', 1)\n ->update(['nb_max_times_bloked' => $nb]);\n }", "public function setMaxParticipants($maxParticipants) {\n $this->maxParticipants = $maxParticipants;\n }", "public function setMax($max)\n {\n $this->max = $max;\n\n return $this;\n }", "public function setMaxConcurrent(?int $maxConcurrent): self\n {\n $this->maxConcurrent = $maxConcurrent;\n\n return $this;\n }", "public function setMaxLimit(int $max, callable|string $callback = null): self\n {\n $this->maxLimit = [$max, $callback];\n\n return $this;\n }", "public function _setMaxScore($maxScore) {\n\t\t$this->_maxScore = $maxScore;\n\t}", "public function setParentProcessId(?int $value): void {\n $this->getBackingStore()->set('parentProcessId', $value);\n }", "public function setMemoryMax(int $memory): DaemonCommand\n {\n $this->memoryMax = $memory;\n\n return $this;\n }", "public function test_admin_set_max_num_players()\n {\n $this->assertTrue($this->btwServer->adminSetMaxNumPlayers(78));\n }", "public function test_admin_set_max_num_players()\n {\n $this->assertTrue($this->btwServer->adminSetMaxNumPlayers(78));\n }", "public function setMemoryLimit($limit) {\n\t\tif (! in_array ( $limit, $this->getAllowedMemoryLimitValues () )) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$currentLimit = $this->getLimitFromIni ();\n\t\t\n\t\tif ($currentLimit < $limit) {\n\t\t\tini_set ( 'memory_limit', $limit . 'M' );\n\t\t}\n\t}", "public function __construct (int $newMax)\r\n {\r\n $this->nombreMaxObjets = $newMax;\r\n $this->contenu = array();\r\n }", "public function setMaxValue($value)\n {\n $this->set('MaxValue', (int) $value);\n return $this;\n }", "public function setMaxPerUserId($maxPerUserId)\n {\n if ($maxPerUserId != $this->maxPerUserId) {\n $this->maxPerUserId = $maxPerUserId;\n }\n }", "public function getMaxNbChilds()\n {\n return $this->getOption('max', 0);\n }", "public function setMaxPerIp($maxPerIp)\n {\n if ($maxPerIp != $this->maxPerIp) {\n $this->maxPerIp = $maxPerIp;\n }\n }", "public function setMaxImageSize($maxImageSize = null)\n\t{\n\t\t$this->maxImageSize = $maxImageSize;\n\t}", "public function setOperationPrimeMaximumAmount($v)\n {\n if ($v === ''){\n $v = null;\n }\n elseif ($v !== null){\n \n if(is_string($v)){\n $v = str_replace(\n array(' ',','),\n array('','.'),\n $v\n );\n }\n \n if(is_numeric($v)) {\n $v = (float) $v;\n }\n }\n if ($this->operation_prime_maximum_amount !== $v) {\n $this->operation_prime_maximum_amount = $v;\n $this->modifiedColumns[] = OperationPrimesPeer::OPERATION_PRIME_MAXIMUM_AMOUNT;\n }\n\n\n return $this;\n }", "public function setMaximumAttendeesCount($val)\n {\n $this->_propDict[\"maximumAttendeesCount\"] = intval($val);\n return $this;\n }", "public function setMaxNumber(int $maxNumber)\n {\n $this->maxNumber = $maxNumber;\n\n return $this;\n }", "public function maxDownloads(?int $maxDownloads): self\n {\n $new = clone $this;\n $new->maxDownloads = $maxDownloads;\n\n return $new;\n }", "public function setMaxSteps( $stepCount )\n {\n $this->maxStepCount = $stepCount;\n }", "private function setProcess(Process $process): void\n {\n $this->process = $process;\n }", "public function setMaxOpenHandles($maxOpenHandles) {}", "public function setMaxItems($var)\n {\n GPBUtil::checkUint64($var);\n $this->max_items = $var;\n\n return $this;\n }", "public function adminSetMaxNumPlayers(int $slots) : bool\n {\n return $this->_consoleCommand('AdminSetMaxNumPlayers', $slots, 'Set MaxNumPlayers to ' . $slots);\n }", "public function SetMaxSize ($maxSize);", "public function SetNumPages()\n\t\t{\n\t\t\t$this->_pricenumpages = ceil($this->GetNumProducts() / GetConfig('CategoryProductsPerPage'));\n\t\t}", "public function setMaxSizeOfInstructions($value) {}", "public function setMaxReplicas(int $maxReplicas): Hpa {\n $this->maxReplicas = $maxReplicas;\n return $this;\n }", "public function setMax($value)\n {\n $this->_maxValue = $value;\n return $this;\n }", "public function setMax($value)\n {\n $this->_fields['Max']['FieldValue'] = $value;\n return $this;\n }", "public function setNumberOfJobs($value)\n {\n return $this->set('NumberOfJobs', $value);\n }", "public function setMaxRuntime(int $runtime)\n {\n $this->maxRuntime = $runtime;\n return $this;\n }", "public function setMaxTries($tries)\n {\n $this->maxTries = $tries;\n }", "public function setMaxInstanceRequestConcurrency($var)\n {\n GPBUtil::checkInt32($var);\n $this->max_instance_request_concurrency = $var;\n\n return $this;\n }", "public function setMaxResults($var)\n {\n GPBUtil::checkInt32($var);\n $this->max_results = $var;\n\n return $this;\n }", "protected function getOptimalNumberOfChildProcesses(): int\n {\n $coreNumber = 1;\n $detectCommand = [\n 'linux' => 'cat /proc/cpuinfo | grep processor | wc -l',\n ];\n\n $os = strtolower(trim(PHP_OS));\n\n if (isset($detectCommand[$os])) {\n $coreNumber = intval($this->execute($detectCommand[$os]));\n }\n\n return $coreNumber;\n }", "public function setLimit(int $limit): void\n {\n $this->limit = $limit;\n }", "public function updatePeriodMaxCycles()\r\n {\r\n // edit period max cycles if It is greater than or equal 0 and is numeric\r\n // If period max cycles <= 0 or null, recurring profile will run forever\r\n if ($periodMaxCycles = $this->_recurringProfile->getPeriodMaxCycles()) {\r\n if ((string)(int) $periodMaxCycles === ltrim($periodMaxCycles, '0') && $periodMaxCycles > 0) {\r\n $periodMaxCycles = (int) $periodMaxCycles - 1;\r\n $this->_recurringProfile->setPeriodMaxCycles($periodMaxCycles);\r\n $this->_recurringProfile->save();\r\n }\r\n }\r\n }", "private function updateMemoryLimit()\r\n {\r\n if (function_exists('ini_set')) {\r\n // phpcs:ignore Magento2.Functions.DiscouragedFunction\r\n $result = ini_set('display_errors', 1);\r\n if ($result === false) {\r\n $error = error_get_last();\r\n throw new InvalidArgumentException(__(\r\n 'Failed to set ini option display_errors to value 1. %1',\r\n $error['message']\r\n ));\r\n }\r\n $memoryLimit = trim(ini_get('memory_limit'));\r\n if ($memoryLimit != -1 && $this->getMemoryInBytes($memoryLimit) < 756 * 1024 * 1024) {\r\n // phpcs:ignore Magento2.Functions.DiscouragedFunction\r\n $result = ini_set('memory_limit', '756M');\r\n if ($result === false) {\r\n $error = error_get_last();\r\n throw new InvalidArgumentException(__(\r\n 'Failed to set ini option memory_limit to 756M. %1',\r\n $error['message']\r\n ));\r\n }\r\n }\r\n }\r\n }" ]
[ "0.8677376", "0.70779717", "0.70726836", "0.70328265", "0.63711935", "0.62363136", "0.62348264", "0.6233567", "0.62086964", "0.6094635", "0.5951544", "0.595038", "0.59419936", "0.58988464", "0.5826341", "0.576923", "0.5750858", "0.5725557", "0.5719905", "0.57037616", "0.5625242", "0.5622579", "0.56203073", "0.55805", "0.5554908", "0.5538919", "0.5479596", "0.54374945", "0.5431357", "0.54116416", "0.5400849", "0.53868234", "0.5385114", "0.53697336", "0.5363543", "0.53537697", "0.53416467", "0.53334093", "0.53306854", "0.5322912", "0.5312877", "0.5302563", "0.528867", "0.5280045", "0.52716565", "0.5267199", "0.52658623", "0.52658623", "0.52529836", "0.52526045", "0.5232579", "0.52278334", "0.5224818", "0.5224818", "0.5223725", "0.5219728", "0.5214375", "0.5206171", "0.51889545", "0.51774704", "0.51673913", "0.5161402", "0.51455605", "0.51341474", "0.5133835", "0.5133018", "0.51293033", "0.51287186", "0.51287186", "0.5127999", "0.5121315", "0.51096827", "0.50991654", "0.50934446", "0.5085487", "0.50628436", "0.50627416", "0.5046763", "0.5028916", "0.50238097", "0.5021567", "0.5010239", "0.5010109", "0.5009359", "0.49997127", "0.49965808", "0.49884182", "0.4988171", "0.49835518", "0.49813452", "0.49712375", "0.49702537", "0.496918", "0.49621686", "0.49500695", "0.49445647", "0.49383664", "0.49215955", "0.49119467", "0.49099845" ]
0.7850646
1
Gets the value of name.
public function getName() { return $this->name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNamedValue(): string {\n return self::$namedValues[$this->value];\n }", "public function get($name)\n {\n return $this->values[$name];\n }", "public function getName() {\n //return the value name\n return $this->Name;\n }", "function getName () {return $this->getFieldValue ('name');}", "public function get($name)\n\t{\n\t\tif (isset($this->values[$name])) {\n\t\t\treturn $this->values[$name];\n\t\t}\n\t}", "public function getName()\n {\n return $this->getValue('name');\n }", "public function __get($name)\n {\n $key = upperCaseSplit($name, '_');\n return $this->data[$key];\n }", "public function get($name)\n\t{\n\t\treturn $this->data[$name];\n\t}", "public function getValue($name) {\n\t\treturn $this->getField($name)->getValue();\n\t}", "public function GetName () \r\n\t{\r\n\t\treturn ($Name);\r\n\t}", "public function getName () {\n\treturn $this->get('name');\n }", "public function name()\n\t{\n\t\treturn $this->array['name'] ?? '';\n\t}", "protected function GetName() {\n\t\treturn $this->name;\n\t}", "public function get($name) {\n return $this->app->getVar($name);\n }", "public function getName() { return $this->data['name']; }", "public function GetName () {\n\t\treturn $this->name;\n\t}", "public function __get($name) {\n\t\treturn $this->_values[$name];\n\t}", "public function getname()\n {\n return $this->name;\n }", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get($name) {\n\t\treturn $this->$name;\n\t}", "public function getName() {\n return $this->get(\"name\");\n }", "public function get_name(){\n\t\treturn $this->name;\n\t}", "public function get(string $name): string;", "public function get($name) {\n return $this->$name;\n }", "public function get_name() {\r\n return $this->name;\r\n }", "public function get( $name );", "public function get_name() {\n\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->get($this->meta()->name_key);\n\t}", "public function get_name() {\n return $this->name;\n }", "function get_name () {\n return $this -> name;\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function get_name()\n\t{\n\t\treturn $this->name;\n\t}", "function get_name()\n\t{\n\t\treturn $this->name;\n\t}", "public function getValue( $name )\n {\n $name = us($name);\n return isset($this->values[$name]) ? $this->values[$name] : null;\n }", "public function getName()\n {\n return $this['name'];\n }", "public function get(string $name);", "public function __get(string $name): string\n {\n return $this->get($name);\n }", "public function get_name()\n {\n return $this->name;\n }", "public function get_name()\n {\n return $this->name;\n }", "function getName()\n {\n return $this->getAttribute(\"name\");\n }", "public function name() {\n\t\treturn $this->name;\n\t}", "private function get_name()\n\t{\n\t\treturn $this->m_name;\n\t}", "private function get_name()\n\t{\n\t\treturn $this->m_name;\n\t}", "public function __get($name)\n {\n if ($name == 'value') {\n return $this->value;\n }\n }", "public function getnameAttribute() : String\n {\n $locale = LaravelLocalization::getCurrentLocale();\n $fieldName = 'name';\n $column = $fieldName.\"_\" . $locale;\n $value = $this->{$column};\n return $value;\n }", "public function get_name() {\n return $this->_name;\n }", "public function __get($name)\n {\n return $this->data[$name];\n }", "public function __get($name)\n {\n return $this->data[$name];\n }", "public function __get($name)\n {\n return $this->data[$name];\n }", "function\tgetName() {\n\t\treturn $this->name ;\n\t}", "public function getValue(string $strName);", "public function get_name()\n {\n\n return $this->name;\n }", "public function getName()\n {\n return $this->getProperty('name');\n }", "public function __get($name)\n {\n Precondition::isTrue(isset($this->data[$name]), 'field ' . $name . ' does not exist');\n\n return $this->data[$name];\n }", "function get_name() {\n return $this->name;\n }", "public function name() {\n return $this->name;\n }", "public function __get($name)\n {\n return $this->getParam($name);\n }", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->_name;\n\t}", "public function getName() {\n return @$this->attributes['name'];\n }", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get($name);", "public function get_name() \n {\n return $this->name;\n }", "public function __get($name)\n {\n $name = $this->normalize($name);\n if (isset($this->data[$name])) {\n return $this->data[$name];\n }\n }", "public function get_name(): string\n {\n return $this->name;\n }", "public function __get($name) {\n\t\tif ($name === 'event_name')\n\t\t\t$ret = $this->getEventName ();\n\t\telse\n\t\t\t$ret = $this->$name;\n\t\treturn $ret;\n\t}", "public function __get($name) {\n return $this->getVariable($name);\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public function name()\n {\n return $this->name;\n }", "public\tfunction\tgetName() { return\t$this->_name; }", "public\tfunction\tgetName() { return\t$this->_name; }", "public function get_name(){\n return $this->name;\n }", "public function getName(): string {\n return (string) $this->name;\n }", "public static function getValue($name){\n $inputs = self::getInput();\n $field = explode('-',$name);\n\n if(!empty($inputs) && isset($inputs['wpmg'])){\n if(array_key_exists($field[1], $inputs['wpmg'])){\n if(array_key_exists($field[2], $inputs['wpmg']['filter'])){\n return $inputs['wpmg']['filter']['title'];\n }\n }\n }\n }", "public function name() { return $this->name; }" ]
[ "0.75381005", "0.7405078", "0.7381985", "0.7282211", "0.7276208", "0.7266412", "0.7227739", "0.7189687", "0.7098494", "0.7092022", "0.70773", "0.7076518", "0.70735705", "0.70502377", "0.70491976", "0.70451844", "0.7038331", "0.7033327", "0.7031629", "0.7031629", "0.7031629", "0.7031629", "0.70306957", "0.70290685", "0.702179", "0.6997794", "0.6992595", "0.6989111", "0.69824696", "0.6979883", "0.69739616", "0.69710195", "0.69692844", "0.6945961", "0.6945961", "0.6945961", "0.6925322", "0.692202", "0.69187343", "0.6913586", "0.6904232", "0.69038624", "0.6898635", "0.6898635", "0.68980664", "0.6894811", "0.6883216", "0.6883216", "0.6878306", "0.68741584", "0.6873933", "0.6866855", "0.6866855", "0.6866855", "0.68590516", "0.6850578", "0.6847955", "0.6846281", "0.6844096", "0.684203", "0.6841446", "0.6839487", "0.68372124", "0.68372124", "0.68372124", "0.6820109", "0.6816381", "0.68118685", "0.68118685", "0.68118685", "0.68118685", "0.68118685", "0.68118685", "0.68118685", "0.68118685", "0.68118685", "0.68118685", "0.68118685", "0.68118685", "0.68075246", "0.6806195", "0.679912", "0.67983824", "0.6793048", "0.6782667", "0.6782667", "0.6782667", "0.6782667", "0.6782667", "0.6782667", "0.6782667", "0.6782667", "0.6782667", "0.6782667", "0.6782667", "0.6782201", "0.6782201", "0.6780958", "0.67723316", "0.6761518", "0.67603683" ]
0.0
-1
Sets the value of name.
public function setName($name) { $this->name = $name; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setName(?string $name): void\n {\n $this->name['value'] = $name;\n }", "public function setName(?string $name): void\n {\n $this->name['value'] = $name;\n }", "public function setName(?string $name): void\n {\n $this->name['value'] = $name;\n }", "public function SetName ($name);", "function setName($value) {\n $this->name = $value;\n }", "function setName($value) {\n $this->name = $value;\n }", "public function setName($value)\r\n {\r\n $this->name = $value;\r\n }", "public function setName($value)\r\n {\r\n $this->name = $value;\r\n }", "public function setName($name)\n {\n $this->setValue('name', $name);\n }", "public function setName($name)\n {\n $this->_name = (string)$name;\n }", "public function setName($name) {\n\t\t$this->_name = (string)$name;\n\t}", "private function setName($name) {\n if (is_string($name)) {\n $this->name = $name;\n }\n }", "public function setName( string $name ) {\n\t\t$this->name = $name;\n\t}", "function set_name($name) {\n $this->name = $name;\n }", "protected function _setName($name, $value) {}", "public function setName($name) {\n\t\t$this->_name = $name;\n\t}", "public function set_name( $name ) {\n\t\t$this->set_prop( 'name', $name );\n\t}", "public function setName($name) {\r\n\t\t$this->name = $name;\r\n\t}", "public function set_name($name);", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName( $name )\n\t{\n\t\t$this->setAttribute( \"name\", $name );\n\t}", "public function setName( $name )\n\t{\n\t\t$this->setAttribute( \"name\", $name );\n\t}", "public function setName($name){\n \n $this->name = $name;\n \n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name)\r\n {\r\n $this->name = $name;\r\n }", "public function setName( $name ) {\n\t\t$this->mName = $name;\n\t}", "public function setName($name){\n\t\t$this->name = $name;\n\t}", "public function setName($name){\n\t\t$this->name = $name;\n\t}", "protected function setName($value)\n\t{\n\t\t$this->name = $value;\n\t}", "protected function setName($value)\n\t{\n\t\t$this->name = $value;\n\t}", "public function setName($name) {\n $this->name = $name;\n }", "public function setName(string $name)\n {\n $this->name = $name;\n }", "protected function setName(string $name) {\n $this->name = $name;\n }", "public function setName($name) \n {\n $this->_name = $name; \n }", "public function setName ($name){\n\t\tif($name){\n\t\t\t$this->Item['name'] = substr($name, 0,100);\n\t\t}\n\t}", "public function setName($name)\n\t{\n\t\t$this->_name = $name;\n\t}", "public function setName($name)\n\t{\n\t\t$this->_name = $name;\n\t}", "public function setName(string $name) {\n\n $this->name = $name;\n\n }", "public function setName( $name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->name = $name;\n }", "public function setName($name) \n {\n $this->name = $name;\n }", "public function setName($_name)\n {\n if (is_string($_name)) {\n \t$this->_name = $_name;\n }\n }", "public function setName($name){\n $this->_name = $name;\n }", "public function setName($name)\n\t{\n\t\t$this->name = $name;\n\t}", "public function setName($name)\n\t{\n\t\t$this->name = $name;\n\t}", "public function setName($name)\n\t{\n\t\t$this->name = $name;\n\t}", "public function setName($name)\n\t{\n\t\t$this->name = $name;\n\t}", "public function setName($name)\n\t{\n\t\t$this->name = $name;\n\t}", "public function setName($name)\n\t{\n\t\t$this->name = $name;\n\t}", "public function setName($name)\n\t{\n\t\t$this->name = $name;\n\t}", "function setName($name) {\n $this->name = $name;\n }", "public function setName(string $name)\n\t{\n\t\t$this->name = $name;\n\t}", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }" ]
[ "0.86565363", "0.86565363", "0.86565363", "0.8521062", "0.84509873", "0.8440147", "0.841955", "0.841955", "0.8405379", "0.8386645", "0.8386294", "0.83700997", "0.8350948", "0.83488965", "0.8324642", "0.8321818", "0.83181703", "0.83170635", "0.83061904", "0.8300407", "0.8300407", "0.8300407", "0.8300407", "0.8300407", "0.8300407", "0.8300407", "0.8300407", "0.8298897", "0.8298897", "0.8298897", "0.8298897", "0.82982874", "0.82982874", "0.8292606", "0.8277851", "0.8277851", "0.8277851", "0.8277851", "0.8277851", "0.8277851", "0.8273152", "0.82662773", "0.8257146", "0.8249498", "0.8249498", "0.824917", "0.824917", "0.8247306", "0.8231498", "0.8224271", "0.8223798", "0.8212918", "0.820694", "0.820694", "0.8203497", "0.82029355", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.82013375", "0.8187738", "0.81870174", "0.8185825", "0.8174113", "0.8174113", "0.8174113", "0.8174113", "0.8174113", "0.8174113", "0.8174113", "0.8161987", "0.81524146", "0.81404763", "0.81404763" ]
0.0
-1
Gets the value of remoteScheduler.
public function getRemoteScheduler() { return $this->remoteScheduler; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getJobScheduler()\n {\n return $this->jobScheduler;\n }", "public function setRemoteScheduler($remoteScheduler)\n {\n $this->remoteScheduler = $remoteScheduler;\n\n return $this;\n }", "public function setRemoteScheduler($remoteScheduler)\n {\n $this->remoteScheduler = $remoteScheduler;\n\n return $this;\n }", "public function getScheduling()\n {\n return $this->scheduling;\n }", "public function getScheduleStatus(){return $this->status;}", "public static function fetch()\n {\n return eZPersistentObject::fetchObject( eZStaticExportScheduler::definition(),\n null,\n null,\n true );\n }", "public function getSchedulerCommandUser() {\n return null;\n }", "public function getJob(SchedulerInterface $scheduler);", "public function getIgnoreRemoteSchedulers()\n {\n return $this->ignoreRemoteSchedulers;\n }", "public function getReplicationSchedule()\n {\n return $this->replication_schedule;\n }", "public function getScheduledJob($params, $context) {\n\t\treturn \\OMV\\Rpc\\Rpc::call(\"cron\", \"get\", $params, $context);\n\t}", "public function Get() {\n\t\treturn $this->CronJobs;\n\t}", "function getschedulerstatus ($problem) {\n $result = mysql_db_query (\"vishnu_central\",\n \"select * from scheduler_request where \" .\n \"problem = \\\"\" . $problem . \"\\\";\");\n $errResult = reportSqlError (\"vishnu_central\",\n \"select * from scheduler_request where \" .\n \"problem = \\\"\" . $problem . \"\\\";\");\n if ($errResult != \"\")\t\n return $errResult;\n\n $value = mysql_fetch_array ($result);\n mysql_free_result ($result);\n return $value;\n }", "public function getScheduleTime()\n {\n return $this->schedule_time;\n }", "public function getMonthlySchedule()\n {\n return $this->monthly_schedule;\n }", "public function getScheduledInterval()\n {\n return $this->scheduledInterval;\n }", "function _get_cron_lock() {\n\tglobal $wpdb;\n\n\t$value = 0;\n\tif ( wp_using_ext_object_cache() ) {\n\t\t/*\n\t\t * Skip local cache and force re-fetch of doing_cron transient\n\t\t * in case another process updated the cache.\n\t\t */\n\t\t$value = wp_cache_get( 'doing_cron', 'transient', true );\n\t} else {\n\t\t$row = $wpdb->get_row( $wpdb->prepare( \"SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1\", '_transient_doing_cron' ) );\n\t\tif ( is_object( $row ) )\n\t\t\t$value = $row->option_value;\n\t}\n\n\treturn $value;\n}", "public function getScheduleStatus()\n {\n if (!$this->scheduleStatus) {\n return false;\n } else {\n list($scheduleStatus) = explode(';', $this->scheduleStatus);\n\n return $scheduleStatus;\n }\n }", "protected function getSendingSchedule()\n\t{\n\t\treturn null;\n\t}", "public function getScheduleId()\n {\n if (array_key_exists(\"scheduleId\", $this->_propDict)) {\n return $this->_propDict[\"scheduleId\"];\n } else {\n return null;\n }\n }", "public function setScheduler() {}", "public function getHourlySchedule()\n {\n return $this->hourly_schedule;\n }", "public function getHourlySchedule()\n {\n return $this->hourly_schedule;\n }", "public function getScheduled(): int\n {\n return $this->scheduled;\n }", "protected function getReceiverValue()\n\t{\n\t\t$payment = $this->request->getPayment();\n\n\t\treturn $this->request->get('receiver.'.$payment->id);\n\t}", "public function getSchedule()\n\t\t{\n\t\t\tif ($this->schedule === NULL)\n\t\t\t{\n\t\t\t\t$this->schedule = new ECash_Transactions_Schedule($this);\n\t\t\t}\n\n\t\t\treturn $this->schedule;\n\t\t}", "private function selectServicesHistory($scheduler ){\n $result = $scheduler->adminLoadHistoryService();\n return $this->transformToJSON($result);\n }", "public function getCronStatus()\n {\n // get the last job with status pending or running\n $lastJob = Mage::getModel('cron/schedule')->getCollection()\n ->addFieldToFilter('status', array(\n 'in' => array(\n Mage_Cron_Model_Schedule::STATUS_PENDING,\n Mage_Cron_Model_Schedule::STATUS_RUNNING,\n )\n )\n )\n ->setOrder('scheduled_at', Varien_Data_Collection_Db::SORT_ORDER_DESC)\n ->setPageSize(1)\n ->getFirstItem();\n\n // check if last job has been scheduled within allowed interval\n $ok = true;\n if ($lastJob && $lastJob->getId()) {\n $locale = Mage::app()->getLocale();\n\n $scheduledAt = $locale->date($lastJob->getScheduledAt(), Varien_Date::DATETIME_INTERNAL_FORMAT);\n $scheduledAt = $locale->utcDate(null, $scheduledAt);\n\n // now\n $now = $locale->date(null, Varien_Date::DATETIME_INTERNAL_FORMAT);\n $now = $locale->utcDate(null, $now);\n\n // if last job was scheduled before the current time\n if ($now->isLater($scheduledAt)) {\n $allowedTime = $now->subHour($this->_allowedTimeDiffJob);\n if ($allowedTime->isLater($scheduledAt)) {\n $ok = false;\n }\n }\n } else {\n $ok = false;\n }\n\n $message = '';\n if ($ok) {\n $image = $this->_getTickImageLink();\n $message = Mage::helper('emvcore')->__(\n '<span class=\"icon-status\">%s</span> Magento Cron Process has been correctly configured!',\n $image\n );\n } else {\n $image = $this->_getUnTickImageLink();\n $message = Mage::helper('emvcore')->__(\n '<span class=\"icon-status\">%s</span> Magento Cron Process has not been correctly activated!',\n $image\n );\n }\n\n return $message;\n }", "public function getDailySchedule()\n {\n return $this->daily_schedule;\n }", "public function getDailySchedule()\n {\n return $this->daily_schedule;\n }", "public function schedule(): Schedule\n {\n return $this->schedule;\n }", "public function __invoke() {\n \n return $this->_value;\n }", "protected function _getSchedule()\n {\n // Get frequency and offset from posted data\n $data = Mage::app()->getRequest()->getPost('groups');\n $frequency = !empty($data['emailchef']['fields']['emailchef_cron_frequency']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_frequency']['value'] :\n EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::HOURLY;\n $offset = !empty($data['emailchef']['fields']['emailchef_cron_offset']['value']) ?\n $data['emailchef']['fields']['emailchef_cron_offset']['value'] :\n 0;\n\n // Get period between calls and calculate explicit hours using this and offset\n $period = EMailChef_EMailChefSync_Model_Adminhtml_System_Source_Cron_Frequency::getPeriod($frequency);\n if ($period === null) {\n Mage::log('eMailChef: Could not find cron frequency in valid list. Defaulted to hourly', Zend_Log::ERR);\n $period = 1;\n }\n $hoursStr = $this->_calculateHourFreqString($period, $offset);\n\n return \"0 {$hoursStr} * * *\";\n }", "public function addRemoteScheduler(\n RemoteScheduler $remoteScheduler\n ) {\n $this->remoteSchedulerCollection[] = $remoteScheduler;\n return $this;\n }", "public function get()\r\n {\r\n return $this->mRetval;\r\n }", "public static function getCurrentJob()\n {\n return (string) Configuration::getGlobalValue(self::CURRENT_TASK_CLI);\n }", "private function selectSpecificService($scheduler, $id ){\n $result = $scheduler->adminLoadServiceSpecific($id);\n return $this->transformToJSON($result);\n }", "public function getServit()\n {\n return $this->servit;\n }", "public function __invoke()\n {\n return $this->value;\n }", "public function getValue()\n {\n if ($this->isClosure($this->value)) {\n return $this->callClosure($this->value);\n }\n return $this->value;\n }", "public function getAllowCustomAssignmentSchedule()\n {\n if (array_key_exists(\"allowCustomAssignmentSchedule\", $this->_propDict)) {\n return $this->_propDict[\"allowCustomAssignmentSchedule\"];\n } else {\n return null;\n }\n }", "public function getBackupSchedule()\n {\n return $this->backup_schedule;\n }", "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()\n {\n\n return $this->africasTalkingStatus(\n ($status = $this->status->getFinalStatus())\n ? $status\n : 'undefined'\n );\n }", "public function schedule(Schedulable $scheduler)\n {\n\n return $scheduler->minutes('0,30');\n }", "public function getIdSchedule()\n {\n return $this->idSchedule;\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function getInstanceSchedulePolicy()\n {\n return $this->instance_schedule_policy;\n }", "public function getReturnVal()\n {\n return $this->return_value;\n }", "function getValue() {\n\t\treturn $this->sValue;\n\t}", "public function getsheduleId()\n {\n return $this->shedule_id;\n }", "public function getScheduleType()\n\t{\n\t\treturn $this->schedule_type;\n\t}", "public function getCurrentVal() {}", "public function getSchedule(): ?GovernanceSchedule {\n $val = $this->getBackingStore()->get('schedule');\n if (is_null($val) || $val instanceof GovernanceSchedule) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'schedule'\");\n }", "protected function _getCron()\n {\n return Mage::getModel('core/config_data')->load(self::CRON_STRING_PATH, 'path');\n }", "public function getReceiver()\n {\n return $this->receiver;\n }", "public function getReceiver()\n {\n return $this->receiver;\n }", "public function getTimerServiceExecutor()\n {\n return $this->timerServiceExecutor;\n }", "public function getReceiver() {\n return $this->_receiver;\n }", "public function getRemote()\n {\n return $this->remote;\n }", "public function getScheduleTime(){return $this->time_of_day;}", "public function getRunningSecond()\n {\n return $this->get(self::RUNNING_SECOND);\n }", "public function get()\n\t{\n\t\treturn $this->_value;\n\t}", "private function selectServicesUsers($scheduler ){\n $result = $scheduler->adminLoadServiceUsers();\n return $this->transformToJSON($result);\n }", "public function getValue() {\n\t\treturn $this->data[\"value\"];\n\t}", "public function getSchedulename()\n {\n return $this->name;\n }", "public function getStatus()\r\n\t{\r\n\t\t$select\t= $this->_db->select()->from('Cron_Jobs', array('active'))->where('id = ?', $this->_getId());\r\n\t\t$status\t= $this->_db->fetchRow($select);\r\n\t\t\r\n\t\treturn $status['active'];\r\n\t}", "public function getWeeklySchedule()\n {\n return $this->weekly_schedule;\n }", "public function getWeeklySchedule()\n {\n return $this->weekly_schedule;\n }", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {\n\t\treturn $this -> value;\n\t}", "static function process_scheduler(){\n\t\treturn self::process_offline_leads();\n\t}", "public function getSetJob()\n {\n return $this->get(self::_SET_JOB);\n }", "public function getValue()\n\t{\n\t\treturn $this->data['value'];\n\t}", "public function getEventValue()\n {\n return $this->eventValue;\n }", "public function getEventValue()\n {\n return $this->eventValue;\n }", "public function getReceiver(){\n return $this->receiver;\n }", "public function getValue()\n {\n return $this->_value;\n }", "public function getValue()\n {\n return $this->_value;\n }", "public function getValue()\n {\n return $this->_value;\n }" ]
[ "0.6188893", "0.60450715", "0.60450715", "0.58440465", "0.5839281", "0.5795439", "0.57819617", "0.55901086", "0.5466731", "0.5452755", "0.538558", "0.535038", "0.5342178", "0.5321049", "0.53181267", "0.5267654", "0.5266548", "0.52626693", "0.52548325", "0.52446395", "0.5191226", "0.5181139", "0.5181139", "0.51691884", "0.5137605", "0.51050586", "0.5093591", "0.50893867", "0.5079203", "0.5079203", "0.5070417", "0.5045084", "0.5042178", "0.5022733", "0.5009672", "0.5008847", "0.500067", "0.4986517", "0.49640116", "0.49551103", "0.4949148", "0.49436814", "0.49336013", "0.49156782", "0.49118394", "0.490902", "0.48935688", "0.4892325", "0.48908004", "0.48845422", "0.4844443", "0.48301172", "0.4810432", "0.4810105", "0.48060802", "0.48054856", "0.4802476", "0.4802476", "0.47873667", "0.47850636", "0.47821525", "0.4773714", "0.47606128", "0.47392073", "0.4739078", "0.473775", "0.473363", "0.47329056", "0.47285908", "0.47285908", "0.47245532", "0.47245532", "0.47245532", "0.47245532", "0.47245532", "0.47245532", "0.47245532", "0.47245532", "0.47245532", "0.47245532", "0.47245532", "0.47245532", "0.47245532", "0.47245532", "0.47236213", "0.47236213", "0.47236213", "0.47236213", "0.47236213", "0.4714346", "0.47111648", "0.47046027", "0.47037473", "0.4700141", "0.4700141", "0.4699889", "0.46998796", "0.46998796", "0.46998796" ]
0.8206617
1
Sets the value of remoteScheduler.
public function setRemoteScheduler($remoteScheduler) { $this->remoteScheduler = $remoteScheduler; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setScheduler() {}", "public function getRemoteScheduler()\n {\n return $this->remoteScheduler;\n }", "public function getRemoteScheduler()\n {\n return $this->remoteScheduler;\n }", "public function addRemoteScheduler(\n RemoteScheduler $remoteScheduler\n ) {\n $this->remoteSchedulerCollection[] = $remoteScheduler;\n return $this;\n }", "public function setSchedule(?GovernanceSchedule $value): void {\n $this->getBackingStore()->set('schedule', $value);\n }", "public function setScheduledJob($params, $context) {\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, [\n\t\t\t\"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t]);\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, \"rpc.powermgmt.setscheduledjob\");\n\t\t// Set missing configuration object fields.\n\t\t$params['username'] = \"root\";\n\t\t$params['sendemail'] = FALSE;\n\t\tswitch ($params['type']) {\n\t\tcase \"reboot\":\n\t\t\t$params['command'] = \"systemctl reboot\";\n\t\t\tbreak;\n\t\tcase \"shutdown\":\n\t\t\t$params['command'] = \"systemctl poweroff\";\n\t\t\tbreak;\n\t\tcase \"standby\":\n\t\t $pm = new \\OMV\\System\\PowerManagement();\n\t\t if (TRUE === $pm->isStateSupported(\n\t\t \\OMV\\System\\PowerManagement::STATE_SUSPENDHYBRID))\n\t\t $params['command'] = \"systemctl hybrid-sleep\";\n else if (TRUE === $pm->isStateSupported(\n \\OMV\\System\\PowerManagement::STATE_HIBERNATE))\n $params['command'] = \"systemctl hibernate\";\n else if (TRUE === $pm->isStateSupported(\n \\OMV\\System\\PowerManagement::STATE_SUSPEND))\n $params['command'] = \"systemctl suspend\";\n else\n $params['command'] = \"systemctl poweroff\";\n\t\t\tbreak;\n\t\t}\n\t\treturn \\OMV\\Rpc\\Rpc::call(\"cron\", \"set\", $params, $context);\n\t}", "public function setAllowCustomAssignmentSchedule($val)\n {\n $this->_propDict[\"allowCustomAssignmentSchedule\"] = $val;\n return $this;\n }", "public function setSchedule($schedule)\n {\n $this->schedule = $schedule;\n }", "public function unsetScheduler() {}", "public function setCron($cron)\n\t{\t\t\t\t\n\t\t$this->_cron = (bool)$cron;\n\t}", "public function setCommand(SchedulerCommand $command) {\n $this->command = $command;\n }", "public function setScheduledAt($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->scheduled_at !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->scheduled_at !== null && $tmpDt = new DateTime($this->scheduled_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->scheduled_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);\n\t\t\t\t$this->modifiedColumns[] = CampaignPeer::SCHEDULED_AT;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}", "public function setScheduleItems($val)\n {\n $this->_propDict[\"scheduleItems\"] = $val;\n return $this;\n }", "public function setScheduleId($val)\n {\n $this->_propDict[\"scheduleId\"] = $val;\n return $this;\n }", "public function setSchedule ()\n {\n $this->loadComponent('DateTime');\n $this->loadModel('ScheduleTime');\n $data = $this->Auth->user();\n $id_fortune = $data['id'];\n $days = $this->DateTime->allDayInWeek();\n $months = $this->DateTime->allDayInMonth();\n $times = $this->ScheduleTime->getListTime();\n if ($this->Check->isId($id_fortune)) {\n $this->set([\n 'times' => $times,\n 'days' => $months,\n 'id' => $id_fortune\n ]);\n } else{\n $this->Flash->error(__('Id not found'));\n }\n }", "public function setSettings(?AccessReviewScheduleSettings $value): void {\n $this->getBackingStore()->set('settings', $value);\n }", "public function setSchedule($schedule = false) {\n if ($schedule === false) {\n return false;\n }\n\n if (!CronExpression::isValidExpression($schedule)) {\n throw new \\Exception(\"Invalid schedule, must use cronjob format\");\n }\n\n $this->schedule = CronExpression::factory($schedule);\n }", "public function setUpdateScheduleType($val)\n {\n $this->_propDict[\"updateScheduleType\"] = $val;\n return $this;\n }", "public function setRemoteServerResponse($value)\n {\n $this->remote_server_response = $value;\n\n $this->save();\n }", "public function setSchedule($schedule)\n\t{\n\t\tif ($schedule === '') {\n\t\t\t$schedule = '* * * * * *';\n\t\t} elseif ($schedule === null) {\n\t\t\t$this->_schedule = $schedule;\n\t\t\treturn;\n\t\t}\n\t\t$schedule = trim($schedule);\n\t\t$this->_schedule = $schedule;\n\t\t$this->_attr = [];\n\t\tif (strlen($schedule) > 1 && $schedule[0] == '@') {\n\t\t\tif (is_numeric($triggerTime = substr($schedule, 1))) {\n\t\t\t\t$this->_triggerTime = (int) $triggerTime;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (self::$_validatorCache) {\n\t\t\t$minuteValidator = self::$_validatorCache['m'];\n\t\t\t$hourValidator = self::$_validatorCache['h'];\n\t\t\t$domValidator = self::$_validatorCache['dom'];\n\t\t\t$monthValidator = self::$_validatorCache['mo'];\n\t\t\t$dowValidator = self::$_validatorCache['dow'];\n\t\t\t$yearValidator = self::$_validatorCache['y'];\n\t\t\t$fullValidator = self::$_validatorCache['f'];\n\t\t} else {\n\t\t\t$minute = '(?:[0-9]|[1-5][0-9])';\n\t\t\t$minuteStar = '\\*(?:\\/(?:[1-9]|[1-5][0-9]))?';\n\t\t\t$minuteRegex = $minute . '(?:\\-(?:[1-9]|[1-5][0-9]))?(?:\\/(?:[1-9]|[1-5][0-9]))?';\n\t\t\t$hour = '(?:[0-9]|1[0-9]|2[0-3])';\n\t\t\t$hourStar = '\\*(?:\\/(?:[1-9]|1[0-9]|2[0-3]))?';\n\t\t\t$hourRegex = $hour . '(?:\\-(?:[1-9]|1[0-9]|2[0-3]))?(?:\\/(?:[1-9]|1[0-9]|2[0-3]))?';\n\t\t\t$dom = '(?:(?:[1-9]|[12][0-9]|3[01])W?)';\n\t\t\t$domWOW = '(?:[1-9]|[12][0-9]|3[01])';\n\t\t\t$domStar = '\\*(?:\\/(?:[1-9]|[12][0-9]|3[01]))?';\n\t\t\t$domRegex = '(?:' . $dom . '(?:\\-' . $dom . ')?(?:\\/' . $domWOW . ')?|' . '(?:L(?:\\-[1-5])?)' . ')';\n\t\t\t$month = '(?:[1-9]|1[012]|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][1] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][2] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][3] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][4] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][5] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][6] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][7] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][8] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][9] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][10] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][11] . '|' .\n\t\t\t\tself::$_keywords[self::MONTH_OF_YEAR][12] . ')';\n\t\t\t$monthStar = '\\*(?:\\/(?:[1-9]|1[012]))?';\n\t\t\t$monthRegex = $month . '(?:\\-' . $month . ')?(?:\\/(?:[1-9]|1[012]))?';\n\t\t\t$dow = '(?:[0-6]|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][0] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][1] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][2] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][3] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][4] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][5] . '|' .\n\t\t\t\tself::$_keywords[self::DAY_OF_WEEK][6] . ')';\n\t\t\t$dowStar = '\\*(?:\\/[0-6])?';\n\t\t\t$dowRegex = '(?:[0-6]L|' . $dow . '(?:(?:\\-' . $dow . ')?(?:\\/[0-6])?|#[1-5])?)';\n\t\t\t$year = '(?:19[7-9][0-9]|20[0-9][0-9])';\n\t\t\t$yearStar = '\\*(?:\\/[0-9]?[0-9])?';\n\t\t\t$yearRegex = $year . '(?:\\-' . $year . ')?(?:\\/[0-9]?[0-9])?';\n\t\t\t$fullValidator = '/^(?:(@(?:annually|yearly|monthly|weekly|daily|hourly))|' .\n\t\t\t\t'(?#minute)((?:' . $minuteStar . '|' . $minuteRegex . ')(?:\\,(?:' . $minuteStar . '|' . $minuteRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#hour)((?:' . $hourStar . '|' . $hourRegex . ')(?:\\,(?:' . $hourStar . '|' . $hourRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#DoM)(\\?|(?:(?:' . $domStar . '|' . $domRegex . ')(?:,(?:' . $domStar . '|' . $domRegex . '))*))[\\s]+' .\n\t\t\t\t'(?#month)((?:' . $monthStar . '|' . $monthRegex . ')(?:\\,(?:' . $monthStar . '|' . $monthRegex . '))*)[\\s]+' .\n\t\t\t\t'(?#DoW)(\\?|(?:' . $dowStar . '|' . $dowRegex . ')(?:\\,(?:' . $dowStar . '|' . $dowRegex . '))*)' .\n\t\t\t\t'(?#year)(?:[\\s]+' .\n\t\t\t\t\t'((?:' . $yearStar . '|' . $yearRegex . ')(?:\\,(?:' . $yearStar . '|' . $yearRegex . '))*)' .\n\t\t\t\t')?' .\n\t\t\t')$/i';\n\n\t\t\t$minuteValidator = '/^(\\*|' . $minute . ')(?:\\-(' . $minute . '))?(?:\\/(' . $minute . '))?$/i';\n\t\t\t$hourValidator = '/^(\\*|' . $hour . ')(?:\\-(' . $hour . '))?(?:\\/(' . $hour . '))?$/i';\n\t\t\t$domValidator = '/^(\\*|\\?|L|' . $domWOW . ')(W)?(?:\\-(' . $domWOW . ')(W)?)?(?:\\/(' . $domWOW . '))?$/i';\n\t\t\t$monthValidator = '/^(\\*|' . $month . ')(?:\\-(' . $month . '))?(?:\\/(' . $month . '))?$/i';\n\t\t\t$dowValidator = '/^(\\*|\\?|' . $dow . ')(L)?(?:\\-(' . $dow . ')(L)?)?(?:\\/(' . $dow . '))?(?:#([1-5]))?$/i';\n\t\t\t$yearValidator = '/^(\\*|' . $year . ')(?:\\-(' . $year . '))?(?:\\/([1-9]?[0-9]))?$/i';\n\t\t\tself::$_validatorCache = [\n\t\t\t\t\t'm' => $minuteValidator,\n\t\t\t\t\t'h' => $hourValidator,\n\t\t\t\t\t'dom' => $domValidator,\n\t\t\t\t\t'mo' => $monthValidator,\n\t\t\t\t\t'dow' => $dowValidator,\n\t\t\t\t\t'y' => $yearValidator,\n\t\t\t\t\t'f' => $fullValidator,\n\t\t\t\t];\n\t\t}\n\n\t\t$i = 0;\n\t\tdo {\n\t\t\tif (!preg_match($fullValidator, $schedule, $matches)) {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $schedule);\n\t\t\t}\n\t\t\tif ($matches[1]) {\n\t\t\t\tforeach (self::$_intervals as $interval => $intervalSchedule) {\n\t\t\t\t\tif ($interval == $matches[1]) {\n\t\t\t\t\t\t$schedule = $intervalSchedule;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} while ($matches[1]);\n\n\t\t$this->_attr[self::MINUTE] = [];\n\t\tforeach (explode(',', $matches[2]) as $match) {\n\t\t\tif (preg_match($minuteValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['min' => 0, 'end' => 59];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['min' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $data['min'];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 59; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::MINUTE][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::HOUR] = [];\n\t\tforeach (explode(',', $matches[3]) as $match) {\n\t\t\tif (preg_match($hourValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['hour' => 0, 'end' => 23];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['hour' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $m2[1];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 23; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::HOUR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::DAY_OF_MONTH] = [];\n\t\tforeach (explode(',', $matches[4]) as $match) {\n\t\t\tif (preg_match($domValidator, $match, $m2)) {\n\t\t\t\t$data = ['dom' => $m2[1]]; // *, ?, \\d, L\n\t\t\t\t$data['domWeekday'] = $m2[2] ?? null;\n\t\t\t\t$data['end'] = $m2[3] ?? ($m2[1] != 'L' ? $m2[1] : null);\n\t\t\t\t//$data['endWeekday'] = $m2[4] ?? null;\n\t\t\t\t$data['endWeekday'] = $m2[4] ?? (($m2[3] ?? null) ? null : $data['domWeekday']);\n\t\t\t\t$data['period'] = (int) max($m2[5] ?? 1, 1);\n\t\t\t\tif (!($m2[3] ?? 0) && ($m2[5] ?? 0)) {\n\t\t\t\t\t$data['end'] = 31; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::DAY_OF_MONTH][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::MONTH_OF_YEAR] = [];\n\t\tforeach (explode(',', $matches[5]) as $match) {\n\t\t\tif (preg_match($monthValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['moy' => 1, 'end' => 12];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['moy' => (int) $this->translateMonthOfYear($m2[1])];\n\t\t\t\t\t$data['end'] = (isset($m2[2]) && $m2[2]) ? (int) $this->translateMonthOfYear($m2[2]) : $data['moy'];\n\t\t\t\t}\n\t\t\t\t$data['period'] = (int) max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = 12; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::MONTH_OF_YEAR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::DAY_OF_WEEK] = [];\n\t\tforeach (explode(',', $matches[6]) as $match) {\n\t\t\tif (preg_match($dowValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*' || $m2[1] === '?') {\n\t\t\t\t\t$data = ['dow' => 0, 'end' => 6];\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['dow' => (int) $this->translateDayOfWeek($m2[1])];\n\t\t\t\t\t$data['end'] = (isset($m2[3]) && $m2[3]) ? (int) $this->translateDayOfWeek($m2[3]) : $data['dow'];\n\t\t\t\t}\n\t\t\t\t$data['lastDow'] = $m2[2] ?? null;\n\t\t\t\t$data['lastEnd'] = $m2[4] ?? null;\n\t\t\t\t$data['period'] = (int) max($m2[5] ?? 1, 1);\n\t\t\t\t$data['week'] = $m2[6] ?? null;\n\t\t\t\tif (!($m2[3] ?? 0) && ($m2[5] ?? 0)) {\n\t\t\t\t\t$data['end'] = 6; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::DAY_OF_WEEK][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\n\t\t$this->_attr[self::YEAR] = [];\n\t\t$matches[7] ??= '*';\n\t\tforeach (explode(',', $matches[7]) as $match) {\n\t\t\tif (preg_match($yearValidator, $match, $m2)) {\n\t\t\t\tif ($m2[1] === '*') {\n\t\t\t\t\t$data = ['year' => self::YEAR_MIN];\n\t\t\t\t\t$data['end'] = self::YEAR_MAX;\n\t\t\t\t} else {\n\t\t\t\t\t$data = ['year' => $m2[1]];\n\t\t\t\t\t$data['end'] = $m2[2] ?? $m2[1];\n\t\t\t\t}\n\t\t\t\t$data['period'] = max($m2[3] ?? 1, 1);\n\t\t\t\tif (!($m2[2] ?? 0) && ($m2[3] ?? 0)) {\n\t\t\t\t\t$data['end'] = self::YEAR_MAX; //No end with period\n\t\t\t\t}\n\t\t\t\t$this->_attr[self::YEAR][] = $data;\n\t\t\t} else {\n\t\t\t\tthrow new TInvalidDataValueException('timescheduler_invalid_string', $match);\n\t\t\t}\n\t\t}\n\t}", "public function setTicketSystem(?string $value): void {\n $this->getBackingStore()->set('ticketSystem', $value);\n }", "public function setWorkflowSlotUser() {\n $this->workflowSlotUser = WorkflowSlotUserTable::instance()->getUserBySlotId($this->nextStation->workflow_slot_id);#\n }", "public function setReceiver($receiver) {\n $this->_receiver = $receiver;\n }", "public function __construct(ResponseScheduleController $scheduler)\n {\n parent::__construct();\n $this->scheduler = $scheduler;\n }", "function SetRunTime($jobtype='send')\n\t{\n\t\t$allowed_jobtypes = array_keys($this->Schedule);\n\n\t\tif (!in_array($jobtype, $allowed_jobtypes)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$jobtime = time();\n\t\t$jobtype = $this->Db->Quote($jobtype);\n\n\t\t$query = \"UPDATE \" . SENDSTUDIO_TABLEPREFIX . \"settings_cron_schedule SET lastrun={$jobtime} WHERE jobtype='{$jobtype}'\";\n\t\t$result = $this->Db->Query($query);\n\n\t\tif (!$result) {\n\t\t\ttrigger_error('Cannot set CRON schedule', E_USER_NOTICE);\n\t\t\treturn;\n\t\t}\n\n\t\t$number_affected = $this->Db->NumAffected($result);\n\t\tif ($number_affected == 0) {\n\t\t\t$query = \"INSERT INTO \" . SENDSTUDIO_TABLEPREFIX . \"settings_cron_schedule (lastrun, jobtype) VALUES ({$jobtime}, '{$jobtype}')\";\n\t\t\t$result = $this->Db->Query($query);\n\t\t}\n\t}", "public function setStartAndDueDateTime(?WorkbookDocumentTaskSchedule $value): void {\n $this->getBackingStore()->set('startAndDueDateTime', $value);\n }", "public function updateScheduler($tasks);", "public function setReceiver($receiver){\n $this->receiver = $receiver;\n }", "public function setQueuedAtAttribute($value)\n {\n $value = ($value) ? : Carbon::now('Europe/London');\n $this->attributes['queued_at'] = $value;\n }", "public function editSchedule(callable $editor): void\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n\n $this->app->booted(function () use ($editor) {\n $schedule = $this->app->make(Schedule::class);\n\n $editor($schedule);\n });\n }", "public function setSchedule(Schedule $schedule): UpdateScheduleService;", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setAutoResponderSubject($value) { $this->_autoResponderSubject = $value; }", "function setValue ($value) {\n\t\t$this->_value = $value;\n\t}", "public function setVal($val){\n\t\t\t$this->_val = $val;\n\t\t}", "public function setValue ( $value ) {\n\t\t\t$value = $this->_castValue ( $value );\n\t\t\t$zoneId = $this->_configurationModel->getZoneId ();\n\t\t\t$endpoint = sprintf ( \"zones/%s/%s\", $zoneId, $this->_endpoint );\n\t\t\t$this->_requestModel->setType ( $this->_usePatchToSet ? Request::REQUEST_PATCH : Request::REQUEST_PUT );\n\t\t\t$this->_requestModel->setData ( array ( \"$this->_dataKey\" => $value ) );\n\t\t\treturn $this->_requestModel->resolve ( $endpoint );\n\t\t}", "public function setExecutor($executor)\n {\n $this->executor = $executor;\n }", "public function setRole(?OnlineMeetingRole $value): void {\n $this->getBackingStore()->set('role', $value);\n }", "public function setValue($value)\n\t{\n\t\tif (parent::getValue() === $value) {\n\t\t\treturn;\n\t\t}\n\n\t\tparent::setValue($value);\n\t\tif ($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()) {\n\t\t\t$this->getPage()->getCallbackClient()->setValue($this, $value);\n\t\t}\n\t}", "public function setSchedule(Schedule $schedule): UpdateScheduleService\n {\n $this->schedule = $schedule;\n return $this;\n }", "public function setsheduleId($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (int) $v;\n }\n\n if ($this->shedule_id !== $v) {\n $this->shedule_id = $v;\n $this->modifiedColumns[] = ActionTypePeer::SHEDULE_ID;\n }\n\n\n return $this;\n }", "public function setIsAutomated($val)\n {\n $this->_propDict[\"isAutomated\"] = boolval($val);\n return $this;\n }", "function setValue($value) {\n $this->value = $value;\n }", "public function setRefresh($callable)\n {\n // we allow the refresh callable to be empty if only synchronous\n // data value generation is supported\n if (!empty($callable) && !is_callable($callable)) {\n throw new InvalidConfigException('refresh must be a callable.');\n }\n\n $this->_refreshCallable = $callable;\n }", "private function _setTimeZone()\n {\n /** @var WebApplication|ConsoleApplication $this */\n $timezone = $this->getConfig()->getGeneral()->timezone;\n\n if (!$timezone) {\n $timezone = $this->getProjectConfig()->get('system.timeZone');\n }\n\n if ($timezone) {\n $this->setTimeZone($timezone);\n }\n }", "public function setValue($value){\n $this->_value = $value;\n }", "public function setValue($val) : self {return $this->setNewValue($this->value, $val);}", "public function setSenderShiftId(?string $value): void {\n $this->getBackingStore()->set('senderShiftId', $value);\n }", "public function set($mVal)\r\n {\r\n $this->mRetval = $mVal;\r\n }", "function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}", "public function setSynchronization($val)\n {\n $this->_propDict[\"synchronization\"] = $val;\n return $this;\n }", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setSvrtime($value)\n {\n return $this->set(self::SVRTIME, $value);\n }", "public function getScheduleStatus(){return $this->status;}", "public function setRemoteIdentifier($val)\n {\n $this->_propDict[\"remoteIdentifier\"] = $val;\n return $this;\n }", "public function setIgnoreRemoteSchedulers($ignoreRemoteSchedulers)\n {\n $this->ignoreRemoteSchedulers = $ignoreRemoteSchedulers;\n\n return $this;\n }", "public function setTimeZone(?string $value): void {\n $this->getBackingStore()->set('timeZone', $value);\n }", "public function __set( $name, $value )\n {\n\t\t\tif( property_exists( \"UserSVC\", $name ) )\n\t\t\t\t$this->$name = $value;\n }", "public function setUserSyncInbound($val)\n {\n $this->_propDict[\"userSyncInbound\"] = $val;\n return $this;\n }", "public function setProcessValueCallable($callable)\n {\n $this->processValueCallable = $callable;\n }", "protected function schedule(Schedule $schedule)\n {\n\n /**\n * Get next-available time from YunoJuno\n * and store it in the Settings table\n *\n * @return void\n */\n $schedule->call(function () {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'https://app.yunojuno.com/p/peabay');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)');\n $page = curl_exec($ch);\n curl_close($ch);\n\n $page = preg_replace('/\\s+/', '', $page);\n preg_match('/\\<strong\\>Next\\&nbsp\\;Available\\:(.*?)\\<\\/strong\\>/', $page, $matches);\n $nextAvailable = count($matches) > 0 ? $matches[1] : 'Unavailable';\n $nextAvailable = str_replace('&nbsp;', ' ', $nextAvailable);\n $nextAvailable = strtotime($nextAvailable);\n\n if ($nextAvailable !== false) {\n \\App\\Models\\Settings::firstOrCreate(['name' => 'next_available']);\n \\App\\Models\\Settings::where('name', 'next_available')->update(['value' => $nextAvailable]);\n }\n })->hourly();\n }", "public function setStatus(?string $value): void {\n $this->getBackingStore()->set('status', $value);\n }", "public function setStatus(?string $value): void {\n $this->getBackingStore()->set('status', $value);\n }", "public function setRemoteData($data)\n {\n // cast boolean values\n if(key_exists('status', $data) && (empty($data['status']) || $data['status'] === 'false')) {\n $data['status'] = false;\n } elseif(key_exists('status', $data)) {\n $data['status'] = true;\n }\n \n $this->getBean()->setRemoteData($data);\n \n return $this;\n }", "public function setRunningSecond($value)\n {\n return $this->set(self::RUNNING_SECOND, $value);\n }", "public static function setSender($val) \n { \n emailSettings::$sender = $val; \n }", "public function setName($name)\n {\n $x = new SetScheduleAttributes($this);\n $y = $x->name((string) $name);\n $this->client->sendCommand($y);\n \n $this->attributes->name = (string) $name;\n \n return $this;\n }", "public function setGearmanServers(array $servers) {\n\t\t$this->servers = $servers;\n\t}", "protected function schedule(Schedule $schedule): void\n {\n //\n }", "public static function setRuntimeConfig(HttpResponse $response)\n {\n //$group_id = $response->post(\"group_id\");\n $session_id = $response->post(\"session_id\");\n\n $workers = $response->post(\"workers\");\n if (intval($workers) <= 0) {\n $workers = 1;\n }\n\n $debug = $response->post(\"debug\");\n $debug = intval($debug) == 1 ? 1 : 0;\n\n return RPC::call($session_id, \"\\\\Seals\\\\Library\\\\RpcApi::setRuntimeConfig\", [$workers, $debug], 1, true);\n\n }", "public function setSvrTime($value)\n {\n return $this->set(self::_SVR_TIME, $value);\n }", "public function setReceiver(User $receiver)\n {\n $this->user = $receiver;\n }", "public function setRemoteFile($remoteFileName){\n\t\t$this->remote_file = $remoteFileName;\n\t}", "public function setSubtaskId($value)\n {\n return $this->set(self::SUBTASK_ID, $value);\n }", "public function setSubtaskId($value)\n {\n return $this->set(self::SUBTASK_ID, $value);\n }", "public function setJob($value)\n {\n return $this->set(self::_JOB, $value);\n }", "public function setJob($value)\n {\n return $this->set(self::_JOB, $value);\n }", "function setRemoteTable($table){\n\t\t$this->remote_table = $table;\n\t}" ]
[ "0.69327307", "0.625823", "0.625823", "0.59188825", "0.5682513", "0.54953665", "0.53554296", "0.52054965", "0.5185135", "0.5155908", "0.51381963", "0.5079699", "0.50524247", "0.50249225", "0.5009302", "0.49716103", "0.49573696", "0.49493518", "0.4899536", "0.4789742", "0.47711796", "0.47455382", "0.47444975", "0.4735719", "0.47338116", "0.47189152", "0.47079793", "0.46698734", "0.46596465", "0.4591512", "0.45790488", "0.45340374", "0.45340374", "0.45339474", "0.45339474", "0.45339474", "0.45339474", "0.45339474", "0.45339474", "0.45339474", "0.45339474", "0.45339474", "0.45339474", "0.45339474", "0.45170462", "0.4509042", "0.45042393", "0.45026198", "0.44930726", "0.4492474", "0.44915703", "0.44914877", "0.44745854", "0.44627294", "0.44576877", "0.44522715", "0.44403017", "0.44396737", "0.4438662", "0.44384044", "0.44381824", "0.44264212", "0.43939587", "0.4380511", "0.4380511", "0.4380511", "0.4380511", "0.4380511", "0.4380511", "0.4380511", "0.4380511", "0.4380511", "0.4380511", "0.43799365", "0.43735427", "0.43659392", "0.4355122", "0.43542078", "0.43450943", "0.43436962", "0.43375793", "0.43271947", "0.43201798", "0.43201798", "0.43188587", "0.43076822", "0.43066636", "0.43027616", "0.4299591", "0.42986414", "0.42966813", "0.4288151", "0.4287657", "0.42845592", "0.4277981", "0.4277981", "0.42673075", "0.42673075", "0.42649442" ]
0.70448786
1
Gets the value of replace.
public function getReplaceExisting() { return $this->replaceExisting; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function replaceContent() {\n \treturn $this->_doReplacement();\n\t}", "public function getReplace()\n {\n return $this->readOneof(4);\n }", "public function getReplacementText();", "public function get_replace()\n {\n return preg_replace('/^insert/', 'replace', $this->get_insert());\n }", "public function getModifiedValue(): string\n {\n\t\treturn $this->applyModifiers((string) $this->value);\n\t}", "protected function getReplacementValue($placeholder) {\n\t\tif (array_key_exists($placeholder, $this->replacementValuesCache)) {\n\t\t\treturn $this->replacementValuesCache[$placeholder];\n\t\t}\n\n\t\t$value = array_get($this->getAllReplacements(), $placeholder);\n\t\tif (is_callable($value)) {\n\t\t\t$value = call_user_func($value, $this);\n\t\t}\n\t\t$this->replacementValuesCache[$placeholder] = $value;\n\n\t\treturn $value;\n\t}", "private function retrieve_id() {\n\t\t$replacement = null;\n\n\t\tif ( ! empty( $this->args->ID ) ) {\n\t\t\t$replacement = $this->args->ID;\n\t\t}\n\n\t\treturn $replacement;\n\t}", "function GetReplaceMode() {\n\t\t\treturn $this->ReplaceMode;\n\t\t}", "public function getReplacementID();", "protected function _getVarreplacement($arrMatch) {\n return $this->_objResponse->$arrMatch[1];\n }", "private function replaceExactValue($value)\n {\n return $this->exactReplacements[$value];\n }", "public function getNewValue()\n {\n return $this->new_value;\n }", "public function contentStrReplace() {}", "public function getPairsSearchReplace()\n {\n switch ($this->type) {\n case self::TYPE_URL:\n return self::searchReplaceUrl($this->search, $this->replace);\n case self::TYPE_URL_NORMALIZE_DOMAIN:\n return self::searchReplaceUrl($this->search, $this->replace, true, true);\n case self::TYPE_PATH:\n return self::searchReplacePath($this->search, $this->replace);\n case self::TYPE_STRING:\n default:\n return self::searchReplaceWithEncodings($this->search, $this->replace);\n }\n }", "protected function _getReplacement($line)\n {\n return $this->_params['replacement']\n ? $this->_params['replacement']\n :substr($line, 0, 1) . str_repeat('*', strlen($line) - 1);\n }", "function replace($data, &$element, $c)\r\n \t{\r\n \t\treturn $data;\r\n \t}", "function getValue() {\n global ${$this->name}, ${$this->name.\"_name\"}, ${$this->name.\"_old\"}; // ${$this->name} = ${\"surname\"} = $surname\n $ext=substr(${$this->name.\"_name\"},-3);\n if ($ext==\"\") $ext=${$this->name.\"_old\"};\n if ($ext==\"\") $ext=$this->value;\n return $ext;\n }", "function getReplacesTerms() {\n\t\treturn $this->_ReplacesTerms;\n\t}", "public function newValue()\n\t{\n\t\tif(is_null($this->new_value) or strlen($this->new_value) == '')\n\t\t{\n\t\t\treturn $this->revisionNullString;\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\tif(strpos($this->key, '_id'))\n\t\t\t{\n\t\t\t\t$model = str_replace('_id', '', $this->key);\n\t\t\t\t$item = $model::find($this->new_value);\n\n\t\t\t\tif(!$item)\n\t\t\t\t{\n\t\t\t\t\treturn $this->format($this->key, $this->revisionUnknownString);\n\t\t\t\t}\n\n\t\t\t\treturn $this->format($this->key, $item->identifiableName());\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\t// Just a failsafe, in the case the data setup isn't as expected.\n\t\t}\n\n\t\treturn $this->format($this->key, $this->new_value);\n\t}", "public function getValue()\n {\n return $this->str_value;\n }", "public function getValue(): string\n {\n return gmp_strval($this->value);\n }", "public function getValue(): string\n {\n return $this->transform($this->value);\n }", "protected function _getIfreplacement($arrMatch) {\n $blnResult = false;\n\n eval('$blnResult = (' . $arrMatch[1] . ');');\n\n if($blnResult) {\n return $arrMatch[2];\n } else {\n return \"\";\n }\n }", "public static function replace( $value=\"\", $pattern=\"\", $replace=\"\" )\n {\n $value = Sanitize::toString( $value );\n $pattern = Sanitize::toString( $pattern );\n $output = @preg_replace( $pattern, $replace, $value );\n $value = is_string( $output ) ? $output : $value;\n return $value;\n }", "public function GetReplacement($placeholder)\n {\n if (isset($this->texts[$placeholder]))\n {\n return $this->texts[$placeholder];\n }\n return $this->phpTranslator->GetReplacement($placeholder);\n }", "public function getExistingValue()\n {\n return $this->existingValue;\n }", "function r($search, $replace, $subject) {\n\t\treturn str_replace($search, $replace, $subject);\n\t}", "function tpl_modifier_replace($string, $search, $replace)\r\n{\r\n\treturn str_replace($search, $replace, $string);\r\n}", "public function getOriginalSearchValue(): ?string\n {\n return $this->originalValue;\n }", "public function compile()\n\t{\n\t\t$value = $this->value();\n\n\t\tif ( ! empty($this->parameters))\n\t\t{\n\t\t\t$params = $this->parameters;\n\t\t\t$value = strtr($value, $params);\n\t\t}\n\n\t\treturn $value;\n\t}", "private function retrieve_tag() {\n\t\t$replacement = null;\n\n\t\tif ( isset( $this->args->ID ) ) {\n\t\t\t$tags = $this->get_terms( $this->args->ID, 'post_tag' );\n\t\t\tif ( $tags !== '' ) {\n\t\t\t\t$replacement = $tags;\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}", "function _findValue(&$values)\r\n {\r\n return $this->getValue();\r\n }", "protected function _getConstreplacement($arrMatch) {\n return constant($arrMatch[1]);\n }", "public function value()\n {\n if ($this->is_previewed) {\n $value = $this->post_value();\n } else {\n $mod = $this->getRealMod();\n $value = get_theme_mod($mod, false);\n }\n\n return $value;\n }", "public function getValue(){\n return $this->_content;\n }", "function get_value_edit()\n\t{\n\t\treturn $this->value;\n\t}", "public function value() {\n if ($this->_m_value !== null)\n return $this->_m_value;\n $this->_m_value = $this->lookupTable()[($this->tag() - 213)];\n return $this->_m_value;\n }", "private function retrieve_searchphrase() {\n\t\t$replacement = null;\n\n\t\tif ( ! isset( $replacement ) ) {\n\t\t\t$search = get_query_var( 's' );\n\t\t\tif ( $search !== '' ) {\n\t\t\t\t$replacement = esc_html( $search );\n\t\t\t}\n\t\t}\n\n\t\treturn $replacement;\n\t}", "public function getValue(): string\n {\n return $this->fusionValue('value') ?? '';\n }", "protected function replaceVariable($matches) {\n\t\tif (preg_match(\"/^\\d+$/\", $matches[1])) {\n\t\t\t$id = (int)$matches[1];\n\t\t\t$data = $this->simu->getDataById($id);\n\t\t} else {\n\t\t\t$name = $matches[1];\n\t\t\t$data = $this->simu->getDataByName($name);\n\t\t}\n\t\tif ($data === null) {\n\t\t\treturn $matches[0];\n\t\t}\n\t\tif ($matches[2] == 'L') {\n\t\t\t$value = $data->getChoiceLabel();\n\t\t\tif ($data->getType() == 'multichoice') {\n\t\t\t\t$value = implode(',', $value);\n\t\t\t}\n\t\t\treturn $value;\n\t\t} else {\n\t\t\t$value = $data->getValue();\n\t\t\tswitch ($data->getType()) {\n\t\t\t\tcase 'money':\n\t\t\t\t\t$value = NumberFunction::formatNumber((float)$value, 2, $this->simu->getDecimalPoint(), $this->simu->getGroupingSeparator(), $this->simu->getGroupingSize());\n\t\t\t\tcase 'percent':\n\t\t\t\tcase 'number':\n\t\t\t\t\t$value = str_replace('.', $this->simu->getDecimalPoint(), $value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'array':\n\t\t\t\tcase 'multichoice':\n\t\t\t\t\t$value = implode(',', $value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'text':\n\t\t\t\t\tif (preg_match('/^https?\\:\\/\\//', $value)) {\n\t\t\t\t\t\tif (preg_match('/(jpg|jpeg|gif|png|svg)$/i', $value)) {\n\t\t\t\t\t\t\t$value = '<img src=\"'.$value.'\" alt=\"'.$value.'\">';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$value = '<a href=\"'.$value.'\">'.$value.'</a>';\n\t\t\t\t\t\t}\n\t\t\t\t\t} elseif (preg_match('/^data\\:image\\//', $value)) {\n\t\t\t\t\t\t$value = '<img src=\"'.$value.'\" alt=\"*\">';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn $value;\n\t\t}\n\t}", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function getValue(): string\n {\n return $this->value;\n }", "public function doReplacements($attribute) {\n\n\t\t$value = $this->getAttribute($attribute);\n\n\t\tif ($placeholders = $this->getPlaceholders($attribute)) {\n\t\t\t$value = $this->processReplacements($value, $placeholders);\n\t\t}\n\n\t\treturn $value;\n\t}", "function &getValue () {\n\t\treturn $this->_value;\n\t}", "function get_var($value) {\n\t\tglobal $agi;\n\n\t\t$r = $agi->get_variable( $value );\n\t\tif ($r['result'] == 1) {\n\t\t\t$result = $r['data'];\n\t\t\treturn trim($result);\n\t\t}\n\t\treturn '';\n\t}", "public function __invoke() {\n \n return $this->_value;\n }", "public function render_to_var($context = array()){\n\t\tob_start();\n\t\t$this->render($context);\n // we have to get rid of newlines, tabs, etc because WP can create convert \n // some things to `<br>` automatically...and we don't want that!\n\t\t$value = preg_replace(\"/\\r+|\\n+|\\t+/\", \"\", ob_get_contents());\n\t\tob_end_clean();\n\t\treturn $value;\n\t}", "public function replace_value($value)\n {\n if ( ! self::$assets_init)\n { \n // Assets library\n ee()->load->add_package_path(PATH_THIRD.'assets/');\n ee()->load->library('assets_lib');\n self::$assets_init = TRUE;\n }\n\n // get selected file url\n if ( ! empty($value))\n {\n // heavy lifting\n $file_row = ee()->assets_lib->get_file_row_by_id($value);\n $source = ee()->assets_lib->instantiate_source_type($file_row);\n $file = $source->get_file($value);\n\n if ($file instanceof Assets_base_file)\n {\n // get the file_url\n $value = $file->url();\n }\n }\n\n return $value;\n }", "private function resolveReplacement(Mailcode_Parser_Safeguard_Formatter_Location $location) : string\n {\n if($location->requiresAdjustment())\n {\n return $this->getReplaceString($location);\n }\n\n return $location->getPlaceholder()->getNormalizedText();\n }", "private function value()\n {\n $this->white();\n switch ($this->currentByte) {\n case '{':\n return $this->obj();\n case '[':\n return $this->arr();\n case '\"':\n case \"'\":\n return $this->string();\n case '-':\n case '+':\n case '.':\n return $this->number();\n default:\n return \\is_numeric($this->currentByte) ? $this->number() : $this->word();\n }\n }", "public function val() {\n $translation = $this->translator->getTranslation(ValueUtils::val($this->key), ValueUtils::val($this->parameters));\n if ($translation === null) {\n $translation = '???'.ValueUtils::val($this->key).'???';\n }\n return $translation;\n }", "public function getNewValue(): ?string;", "function replace( $search, $replace ) {\n\treturn partial( 'str_replace', $search, $replace );\n}", "protected function getValue() {\r\n return $this->_value;\r\n }", "public function replace($key, $value, $replacement);", "public function value(): string\n {\n return $this->get('value');\n }", "protected function replaceVars($value) {\n\t\t$value = str_replace(\"%remote%\", $_SERVER[\"REMOTE_ADDR\"], $value);\n\t\t$value = str_replace(\"%agent%\", \"\\\"\".$_SERVER[\"HTTP_USER_AGENT\"].\"\\\"\", $value);\n\t\t$value = str_replace(\"%user%\", \"\\\"\".DhbwSSOAgent::getVar('user').\"\\\"\", $value);\n\t\treturn $value;\n\t}", "protected function getSearchValue()\n {\n return \"'\" . $this->searchValue . \"'\";\n }", "function getValue() {\n\t\treturn $this->sValue;\n\t}", "public function getCurrentVal() {}", "private function Value()\n\t{\n\t\t$peek = $this->lexer->glimpse();\n\n\t\tif ( DocLexer::T_EQUALS === $peek['type'] )\n\t\t\treturn $this->FieldAssignment();\n\n\t\treturn $this->PlainValue();\n\t}", "public function getValue()\n {\n return $this->_db->prepareStringToOut($this->_value);\n }", "public function getReplaces(): ReplaceCollection;", "public function getValue() {\n\n\t\treturn trim(\n\t\t\tfile_get_contents(\n\t\t\t\tself::PINDIR.'/gpio'.$this->iPinNumber.'/value'\n\t\t\t)\n\t\t);\n\t}", "public function getValue(): mixed;", "public function getValue(): mixed;", "public function __invoke()\n {\n return $this->value;\n }", "protected function runReplacementQueue()\n {\n\t\t$file = $this->file_contents;\n\t\tforeach($this->queuedChanges as $change)\n\t\t{\n\t\t\t$file = util::str_replace_once($change[0], $change[1], $this->file_contents);\n\t\t}\n\t\t\n\t\t$this->queuedChanges = array(); // Empty it.\n\t\t\n\t\treturn $file;\n\t}", "public function getValue()\n {\n return $this->get(self::_VALUE);\n }", "public function getValue()\n {\n return $this->get(self::_VALUE);\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 function getLiteralValue();", "private function retrieve_modified() {\n\t\t$replacement = null;\n\n\t\tif ( ! empty( $this->args->post_modified ) ) {\n\t\t\t$replacement = mysql2date( get_option( 'date_format' ), $this->args->post_modified, true );\n\t\t}\n\n\t\treturn $replacement;\n\t}", "function getValue() { return $this->readText(); }", "function testReplaceWihtoutRegex(){\n\t\t#mdx:replace_no_regex\n\t\tParam::get('money')\n\t\t\t->context(['money'=>'3,50'])\n\t\t\t->filters()\n\t\t\t->replace(',','.');\n\n\t\t$output = Param::get('money')->process()->output;\n\t\t#/mdx var_dump($output)\n\t\t$this->assertEquals('3.50', $output);\n\n\t}", "function getValue() { return $this->readText(); }", "public function val() {\n\t\t$str = '';\n\n\t\tforeach($this->valuesArray as $value) {\n\t\t\t$str .= $value->val();\n\t\t}\n\n\t\treturn $str;\n\t}", "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 get_value() {\n return $this->value;\n }", "public function &getValue();", "public function process(): string\n {\n return preg_replace_callback(\n sprintf($this->pattern, $this->getSrcAttributeNameForRegex()),\n $this->replaceCallback(),\n $this->html\n );\n }", "function getValue(){\r\n\t\treturn $this->value;\r\n\t}", "public function get_value() {\n\t\treturn $this->_value;\n\t}", "public static function get($key, $replacement = null)\n {\n if (empty(static::$cache)) {\n $configs = DBConfig::all();\n\n foreach ($configs as $config) {\n static::$cache[$config->_key] = $config->value;\n }\n }\n\n if (isset(static::$cache[$key])) return static::$cache[$key];\n else return $replacement;\n \n // shouldn't happend...\n /*$config = DBConfig::where('key', '=', $key)->first();\n\n if (is_null($config)) return $replacement;\n else {\n static::$cache[$key] = $config->value;\n return $config->value;\n }*/\n }", "static public function get($key = null,$replace = null)\n {\n if (is_null($key)) {\n throw new Exception('第一个参数必填');\n }\n\n $param = explode('.',$key);\n $file = $param[0];\n $offset = array_slice($param,1);\n\n if (! isset(self::$config[$file])) {\n if (!file_exists(self::$configPath. \"/{$file}.php\")) {\n throw new Exception(\"{$file}配置文件不存在\");\n }\n self::$config[$file] = include_once self::$configPath. \"/{$file}.php\";\n }\n\n $value = self::recursionGetValue(self::$config[$file],$offset);\n return is_null($value) ? $replace : $value;\n }", "public function get()\n\t{\n\t\treturn $this->_value;\n\t}", "public function getValue() : string {\n\t\treturn $this->token;\n\t}", "public function getAsciiReplace();", "public function getValue(){\n return $this->_value;\n }", "function replace($key, $value, $expire = 0) {\n return $this->cacheObj->replace($key, $value, $expire);\n }", "private function getNodeValue($path) {\n if($this->vars_alter){\n $val = $this->vars_alter->getValue($path);\n if($val){ return $val; }\n }\n $val = $this->vars->getValue($path);\n return $val;\n }", "public function getValueToSet()\n {\n return $this->newValue;\n }", "public function get_value()\n {\n return $this->value;\n }", "public function getProcessedReplacements()\n {\n $values = $this->getReplacements();\n\n if (null !== ($git = $this->getGitHashPlaceholder())) {\n $values[$git] = $this->getGitHash();\n }\n\n if (null !== ($git = $this->getGitShortHashPlaceholder())) {\n $values[$git] = $this->getGitHash(true);\n }\n\n if (null !== ($git = $this->getGitTagPlaceholder())) {\n $values[$git] = $this->getGitTag();\n }\n\n if (null !== ($git = $this->getGitVersionPlaceholder())) {\n $values[$git] = $this->getGitVersion();\n }\n\n if (null !== ($date = $this->getDatetimeNowPlaceHolder())) {\n $values[$date] = $this->getDatetimeNow($this->getDatetimeFormat());\n }\n\n $sigil = $this->getReplacementSigil();\n\n foreach ($values as $key => $value) {\n unset($values[$key]);\n\n $values[\"$sigil$key$sigil\"] = $value;\n }\n\n return $values;\n }", "function replaceContent($regex, $replacement){\n\t\t$this->html_result=preg_replace($regex, $replacement, $this->html_result);\n\t}" ]
[ "0.66474456", "0.61618227", "0.61497897", "0.6129005", "0.5872304", "0.58652705", "0.56982577", "0.5667266", "0.5596112", "0.5559531", "0.5470766", "0.54267204", "0.53907233", "0.5325346", "0.5324983", "0.5301073", "0.52974194", "0.52885115", "0.5230831", "0.5224544", "0.5222482", "0.52183235", "0.5217466", "0.5193847", "0.5186525", "0.5168443", "0.5153813", "0.5152804", "0.51421934", "0.5112383", "0.5111763", "0.5096454", "0.5095695", "0.50798553", "0.5067417", "0.50597477", "0.5050217", "0.50467646", "0.50306344", "0.50162446", "0.5015226", "0.5015226", "0.5015226", "0.5015226", "0.5015226", "0.5015226", "0.5003258", "0.4996925", "0.4986792", "0.49786913", "0.4971501", "0.49648523", "0.49590927", "0.49532104", "0.49497634", "0.49477082", "0.49240798", "0.4908288", "0.4903166", "0.4897867", "0.48929173", "0.48834118", "0.48720306", "0.4869954", "0.48695308", "0.48436263", "0.48431113", "0.4840457", "0.48293984", "0.48293984", "0.48208424", "0.48192725", "0.48098633", "0.48098633", "0.4808458", "0.48061532", "0.48041597", "0.4802091", "0.47997257", "0.4797259", "0.47929212", "0.47768307", "0.47768307", "0.47761777", "0.47754303", "0.47695464", "0.47684357", "0.4763943", "0.47632557", "0.47597945", "0.47597766", "0.47592485", "0.47518402", "0.4751531", "0.47512722", "0.47479793", "0.4742367", "0.47412732", "0.4733521", "0.47229442" ]
0.5592575
9
Sets the value of replace.
public function setReplaceExisting($replace) { $this->replaceExisting = $replace; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function replace($key, $value, $replacement);", "public function setValue($search, $replace, $limit = -1)\n {\n $pattern = '|\\$\\{([^\\}]+)\\}|U';\n preg_match_all($pattern, $this->_documentXML, $matches);\n foreach ($matches[0] as $value) {\n $valueCleaned = preg_replace('/<[^>]+>/', '', $value);\n $valueCleaned = preg_replace('/<\\/[^>]+>/', '', $valueCleaned);\n $this->_documentXML = str_replace($value, $valueCleaned, $this->_documentXML);\n }\n\n if (substr($search, 0, 2) !== '${' && substr($search, -1) !== '}') {\n $search = '${' . $search . '}';\n }\n\n if (!is_array($replace)) {\n if (!PHPWord_Shared_String::IsUTF8($replace)) {\n $replace = utf8_encode($replace);\n }\n $replace = htmlspecialchars($replace);\n } else {\n foreach ($replace as $key => $value) {\n $replace[$key] = htmlspecialchars($value);\n }\n }\n\n $regExpDelim = '/';\n $escapedSearch = preg_quote($search, $regExpDelim);\n $this->_documentXML = preg_replace(\"{$regExpDelim}{$escapedSearch}{$regExpDelim}u\", $replace, $this->_documentXML, $limit);\n }", "function set($key, $value)\n {\n $this->content = str_replace('${'.$key.'}', $value, $this->content);\t\n }", "public function replace(array $values = []): void\n {\n\t\t$this->values = $values;\n\t}", "protected function doSet($value)\n {\n }", "function replace($search,$replace){\n\t\tsettype($search,\"string\");\n\n\t\t// prevod StringBuffer na string\n\t\tif(is_object($replace)){\n\t\t\t$replace = $replace->toString();\n\t\t}\n\n\t\tfor($i=0;$i<sizeof($this->_Items);$i++){\n\t\t\t$this->_Items[$i]->replace($search,$replace);\n\t\t}\n\t}", "function userReplace($key, $text) {\r\n if (!$this->feed['params']['user_replace_on']) return $text;\r\n if (!is_array($this->feed['params']['replace'])) return $text;\r\n if (count($this->feed['params']['replace'][$key])) {\r\n foreach ($this->feed['params']['replace'][$key] as $v) {\r\n if ($v['limit'] == '') $v['limit'] = -1;\r\n $text = preg_replace($v['search'], $v['replace'], $text, $v['limit']);\r\n }\r\n }\r\n return $text;\r\n }", "function replace($search,$replace = null){\n\t\tif(is_array($search)){\n\t\t\t$_replaces_keys = array();\n\t\t\t$_replaces_values = array();\n\t\t\tforeach(array_keys($search) as $key){\n\t\t\t\t$_replaces_keys[] = $key;\n\t\t\t\t$_replaces_values[] = $search[$key];\n\t\t\t} \n\t\t\tif(sizeof($_replaces_keys)==0){\n\t\t\t\treturn $this;\n\t\t\t} \n\t\t\t$this->_String4 = str_replace($_replaces_keys,$_replaces_values,$this->_String4);\n\t\t\treturn $this;\n\t\t}\n\t\t$this->_String4 = str_replace($search,$replace,$this->_String4);\n\t\treturn $this;\n\t}", "private function replace($key, $value)\n {\n if ($value !== null && $value !== '' && $value !== 0 && $value !== 0.0) {\n $this->data[$key] = $value;\n }\n }", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function replace( $old, $new );", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "function replaceContent($regex, $replacement){\n\t\t$this->html_result=preg_replace($regex, $replacement, $this->html_result);\n\t}", "public static function replace( $value=\"\", $pattern=\"\", $replace=\"\" )\n {\n $value = Sanitize::toString( $value );\n $pattern = Sanitize::toString( $pattern );\n $output = @preg_replace( $pattern, $replace, $value );\n $value = is_string( $output ) ? $output : $value;\n return $value;\n }", "public function set($n,$v){\n\t\t$this->Template->set($n, $v);\n\t}", "public function withReplace() {\n $this->replace = true;\n return $this;\n }", "public function replace($source, $value)\n {\n if (strpos($this->modifiers, 'g') !== false) {\n $this->modifiers = str_replace('g', '', $this->modifiers);\n\n return preg_replace($this->getRegex(), $value, $source);\n }\n\n return preg_replace($this->getRegex(), $value, $source, $this->replaceLimit);\n }", "public function replace($search, $replace) {\n $this->_value = str_replace($search, $replace, $this->_value);\n $this->countLength();\n \n return $this;\n }", "public function set_many($replaces)\n\t{\n\t\tforeach ($replaces as $key => $value)\n\t\t{\n\t\t\t$this->values[$this->block][$key] = $value;\n\t\t}\n\t}", "protected function replace($search, $replace, $path)\n {\n file_put_contents($path, str_replace($search, $replace, file_get_contents($path)));\n }", "public function set($variable, $value);", "public function replace(array $data);", "public function canReplaceAValueByAnother()\n {\n $object0 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $object1 = $this->getMock('ATM_Config_Abstract', array('getName'));\n $this->object->append($object0);\n $this->object->append($object1);\n $this->object->append($object0);\n $expect = array($object0, $object1, $object0);\n $this->assertAttributeEquals($expect, 'content', $this->object);\n $this->object->searchAndReplace($object0, $object1);\n $expect = array($object1, $object1, $object1);\n $this->assertAttributeEquals($expect, 'content', $this->object);\n }", "abstract public function setValue($value);", "public function query_replace($key, $value) {\n\t\t\t\\uri\\query::replace($this->object, $key, $value);\n\t\t}", "public function setReplace($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Spanner\\V1\\Mutation\\Write::class);\n $this->writeOneof(4, $var);\n\n return $this;\n }", "function setValue ($value) {\n\t\t$this->_value = $value;\n\t}", "final public function __set($index, $value)\n {\n $this->_registry->$index = $value;\n }", "public function replace( $find, $replace ) {\n while ( $this->string != ( $changed_string = $this->replaceFirstOccurance( $find, $replace, $this->string ) ) ) {\n $this->string = $changed_string;\n }\n return $this;\n }", "protected function setValueForPart($search, $replace, $documentPartXML, $limit)\n {\n // Note: we can't use the same function for both cases here, because of performance considerations.\n if (self::MAXIMUM_REPLACEMENTS_DEFAULT === $limit) {\n return str_replace($search, $replace, $documentPartXML);\n }\n $regExpEscaper = new RegExp();\n\n return preg_replace($regExpEscaper->escape($search), $replace, $documentPartXML, $limit);\n }", "public function replace(string $text, int $line = -1): void\n {\n $this->replaceLine($text, $line);\n }", "public function replace($path);", "public function setValue($v){\n $this->value = $v;\n }", "public function replaceValue(&$node, $name, $value) {\n\t\t$domElement = $this->getChildNode($node, $name);\n\t\tif (!is_null($domElement)) {\n\t\t\t$node->removeChild($domElement);\n\t\t\t$this->setValue($node, $value, $name, true);\n\t\t}\n\t}", "public function setValue($value){\n $this->_value = $value;\n }", "function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}", "private function replaceFirst(&$value, $origin, $replace)\n {\n if (strpos($value, $origin) === 0) {\n $value = substr_replace($value, $replace, 0, strlen($origin));\n }\n }", "public function replace($path, $value) {\n $this->commands[] = array(\n 'opcode' => COUCHBASE_SDCMD_REPLACE,\n 'path' => $path,\n 'value' => $value,\n );\n return $this;\n }", "public function setPlaceHolder($key, $value)\n {\n $this->placeHolders[$key] = $value;\n }", "function setValue($value) {\n $this->value = $value;\n }", "public function replaceValue(int $index, string $value)\n {\n $this->messageWithValues = $this->replaceTag(\n $index,\n $value,\n $this->messageWithValues\n );\n }", "public function replace( $search, $replace ) {\n $i = &$this->getInstance();\n $i = str_replace($search, $replace, $i);\n return $this;\n }", "public static function replace(&$object, $key, $value) {\n\t\t\t$qarray = \\uri\\generate::query_array($object);\n\t\t\t$qarray[$key] = $value;\n\t\t\t\\uri\\actions::modify($object, 'replace', 'QUERY', self::build_query($qarray));\n\t\t}", "public function replace_value($value)\n {\n if ( ! self::$assets_init)\n { \n // Assets library\n ee()->load->add_package_path(PATH_THIRD.'assets/');\n ee()->load->library('assets_lib');\n self::$assets_init = TRUE;\n }\n\n // get selected file url\n if ( ! empty($value))\n {\n // heavy lifting\n $file_row = ee()->assets_lib->get_file_row_by_id($value);\n $source = ee()->assets_lib->instantiate_source_type($file_row);\n $file = $source->get_file($value);\n\n if ($file instanceof Assets_base_file)\n {\n // get the file_url\n $value = $file->url();\n }\n }\n\n return $value;\n }", "protected function replace(Node $node)\n {\n }", "public function replace(string $key, $element): void;", "public function contentStrReplace() {}", "function replace($table='', $keyandvalue) {\n return $this->_query_insert_replace($table, $keyandvalue, 'REPLACE');\n }", "public function replace( $table, $set, $where, $shutdown=false );", "function tpl_modifier_replace($string, $search, $replace)\r\n{\r\n\treturn str_replace($search, $replace, $string);\r\n}", "public function replace(array $values = [])/*# : ReplaceStatementInterface */;", "public function setValue($value) {\n $this->node->setAttribute('value', iconv(xp::ENCODING, 'utf-8', $value));\n }", "public function replace($key, $value, $expiry = 0, $cas = null) {}", "public function setNodeValue($value) {\n $this->nodeValue = $value;\n }", "private function searchAndReplace()\n {\n foreach ($this->objWorksheet->getRowIterator() as $row)\n\t\t{\n\t\t\t$cellIterator = $row->getCellIterator();\n\t\t\tforeach ($cellIterator as $cell)\n\t\t\t{\n\t\t\t\t$cell->setValue(str_replace($this->_search, $this->_replace, $cell->getValue()));\n\t\t\t}\n\t\t}\n }", "public function processFindReplace ()\n {\n\n if ( $this->replaceQuery ) {\n\n $this->replace ();\n\n } else {\n\n $this->find ();\n\n }\n\n }", "public function replaceContent() {\n \treturn $this->_doReplacement();\n\t}", "public function setValue($value) {\n $this->value = $value->value;\n }", "public function __set($name, $value) {\n\t\t\tif (isset($this->object->$name) && $name != 'authority') {\n\t\t\t\t\\uri\\actions::modify($this->object, 'replace', $name, $value);\n\t\t\t\treturn $value;\n\t\t\t} else {\n\t\t\t\t$this->_err('FORBIDDEN', debug_backtrace(), $name);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}", "protected function _setValue($name, $value) {}", "public function regexReplace($pattern,$replace)\n {\n $this->provider->regexReplace($pattern,$replace);\n \n return $this;\n }", "protected function replaceInFile($search, $replace, $path)\n {\n file_put_contents($path, str_replace($search, $replace, file_get_contents($path)));\n }", "protected function replaceInFile($search, $replace, $path)\n {\n file_put_contents($path, str_replace($search, $replace, file_get_contents($path)));\n }", "public function set(string $path, $value);", "final public function set($tag, $content) {\n $this->template = str_replace(\"{\".$tag.\"}\", $content, $this->template);\n }", "public function setContent($subst)\n\t{\n\t\t$this->vars['content'] = $subst;\n\t}", "public function testReplace1()\n {\n $this->assertEquals(Str::replace('foo', 'oo', 'yy'), 'fyy');\n }", "public function set()\n {\n if ( ! $this->value ) {\n $this->generate();\n }\n }", "function set($path, $value)\n\t\t{\n\t\t\t$this->Init();\n\t\t\t$path = explode(\"/\", $path);\n\t\t\t$pointer = end($path);\n\t\t\t$tmp = $value;\n\t\t\twhile($pointer){\n\t\t\t\tif (!empty($pointer)){\n\t\t\t\t\t$tmp = array($pointer=>$tmp);\n\t\t\t\t\t$pointer = prev($path);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->settings = array_merge_recursive_overwrite($this->settings, $tmp);\n\t\t\t$this->saveSettings();\n\t\t}", "protected function register_replacement( $variable, $value ) {\n\t\t$this->replace_vars->safe_register_replacement(\n\t\t\t$variable,\n\t\t\t$this->get_identity_function( $value )\n\t\t);\n\t}", "public function replace($selector, $replacement);", "function replace($key, $value, $expire = 0) {\n $memObj = self::getMemcacheObj();\n return $memObj->replace($key, $value, false, $expire);\n }", "function replace($key, $value, $expire = 0) {\n $memObj = self::getMemcacheObj();\n return $memObj->replace($key, $value, false, $expire);\n }", "public function setValue($value) {\n $this->value = $value;\n }", "public function setValue($value) {\n $this->value = $value;\n }", "public function setValue($value) {\n $this->value = $value;\n }", "public function setValue($value) {\n $this->value = $value;\n }", "public function testReplace()\n {\n $value = uniqid();\n $metaInfo = Metainfo::fromValue('test', $value);\n $metaInfo->setPackage($this->package);\n \n $this->repo->save($metaInfo, true);\n \n $remaining = $this->repo->findAll();\n $this->assertCount(1, $remaining);\n $info = current($remaining);\n $this->assertEquals($value, $info->getValue());\n }", "function textblock_template_replace(&$textblock, $replace)\n{\n foreach ($replace as $key => $value) {\n $textblock['title'] = str_replace(\"%$key%\", $value, $textblock['title']);\n $textblock['text'] = str_replace(\"%$key%\", $value, $textblock['text']);\n }\n}", "public function setVal($val){\n\t\t\t$this->_val = $val;\n\t\t}" ]
[ "0.6478835", "0.6086138", "0.605601", "0.59226733", "0.5859709", "0.58564544", "0.5773983", "0.5718874", "0.57151866", "0.56689143", "0.56689143", "0.56689143", "0.56689143", "0.56689143", "0.56689143", "0.56689143", "0.56689143", "0.56689143", "0.56689143", "0.56689143", "0.5668666", "0.5668666", "0.5640204", "0.56335914", "0.56335914", "0.56335914", "0.56335914", "0.56335914", "0.56335914", "0.56335914", "0.56335914", "0.56335914", "0.56335914", "0.5622956", "0.56218594", "0.5617647", "0.5594476", "0.55844635", "0.5557964", "0.55498195", "0.55274", "0.5523252", "0.5507662", "0.54890454", "0.5474943", "0.5469262", "0.54654926", "0.5455793", "0.5452832", "0.5450719", "0.5412845", "0.5411746", "0.54109246", "0.5397184", "0.5394643", "0.53863484", "0.5383678", "0.5371285", "0.5359713", "0.5322436", "0.53175664", "0.5303002", "0.52983147", "0.52890706", "0.5284412", "0.5278778", "0.5275075", "0.52684844", "0.5266891", "0.5262352", "0.5238471", "0.5223687", "0.5218909", "0.5215919", "0.52066773", "0.520646", "0.52037656", "0.5196448", "0.5194894", "0.519411", "0.5193609", "0.5191899", "0.5189881", "0.5189881", "0.5186332", "0.5185019", "0.51839435", "0.5181407", "0.5171466", "0.5163701", "0.5152605", "0.51411206", "0.5140537", "0.5140537", "0.51388526", "0.51388526", "0.51388526", "0.51388526", "0.5131699", "0.51253814", "0.51222044" ]
0.0
-1
Gets the value of spoolerId.
public function getSpoolerId() { return $this->spoolerId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getShoptId()\n {\n return $this->getParameter('shop_id');\n }", "public function id()\n\t{\n\t\treturn $this->SqueezePlyrID ;\n\t}", "function getSId() {\n return $this->sId;\n }", "public function getSteamId() : string\n {\n return $this->steamId;\n }", "public function setSpoolerId($spoolerId)\n {\n $this->spoolerId = $spoolerId;\n\n return $this;\n }", "public function getPlayerSportId() {\n\t\treturn ($this->playerSportId);\n\t}", "public function getShopId()\n {\n return $this->getParameter('shopId');\n }", "public function getPayerId() {\n\t\treturn $this->_getField(self::$PAYER_ID);\n\t}", "public function getSellerId()\n {\n return $this->_fields['SellerId']['FieldValue'];\n }", "public function getStickerId()\r\n {\r\n $message = $this->getMessage();\r\n return $message['stickerId'];\r\n }", "private function getShopId() {\n\t\t\treturn $this->shopId;\n\t\t}", "public function getId(){\n if(!$this->id){\n return $this->getShippingOptionId().'_'.md5($this->getShippingServiceName());\n }\n return $this->id;\n }", "public function getPayerId(): ?string\n {\n return $this->{self::PAYER_ID};\n }", "public function getShiptoid()\n {\n return $this->shiptoid;\n }", "public function getShopifyId() {\n return $this->getShopifyProperty('id');\n }", "public function getId() \r\n\t{\r\n\t\treturn $this->sId;\r\n\t}", "public function getSellerId()\n {\n return $this->driver->seller_id;\n }", "public function getSupplierId()\n {\n return isset($this->feedbackFields['supplier_id']) ? $this->feedbackFields['supplier_id'] : null;\n }", "public function getStoneId()\n {\n return $this->get(self::_STONE_ID);\n }", "public function getSvrId()\n {\n return $this->get(self::_SVR_ID);\n }", "public function getShopId()\n {\n return $this->metaRefreshValues['shopid'];\n }", "public static function getSecurityID()\n {\n $token = SecurityToken::inst();\n return $token->getValue();\n }", "public function getSellerID()\n {\n return $this->sellerID;\n }", "public function getSellerId()\n {\n return $this->seller_id;\n }", "public function getOfferSellerId()\n {\n return $this->offer_seller_id;\n }", "public function getId()\n {\n return $this->sys->getId();\n }", "public function getShoeID() {\n\t\treturn $this->_shoe_id;\n\t}", "function getDevId()\n {\n return $this->_props['DevId'];\n }", "public function getIdentifier()\n {\n return $this->id;\n }", "public function se_get_id() {\n\t\treturn version_compare( WC_VERSION, '3.0', '>=' ) ? $this->get_id() : $this->id;\n\t}", "public function se_get_id() {\n\t\treturn version_compare( WC_VERSION, '3.0', '>=' ) ? $this->get_id() : $this->id;\n\t}", "public function getId(): ?string\n {\n return $this->sId;\n }", "public function getShipmentId()\n {\n return $this->_fields['ShipmentId']['FieldValue'];\n }", "public function getSkuId()\n {\n return $this->skuId;\n }", "public function getBuyableIdentifier()\n {\n return method_exists($this, 'getKey') ? $this->getKey() : $this->id;\n }", "public function getId()\n {\n return $this->getValue('session_id');\n }", "public function getScoutKey()\n {\n return $this->id;\n }", "public function identifier()\n {\n return $this->id;\n }", "public function getStageId()\n {\n return $this->get(self::_STAGE_ID);\n }", "public function getStageId()\n {\n return $this->get(self::_STAGE_ID);\n }", "public function getStageId()\n {\n return $this->get(self::_STAGE_ID);\n }", "public function getWholesalerId()\n {\n $value = $this->get(self::wholesaler_id);\n return $value === null ? (integer)$value : $value;\n }", "public function getSid(){\n return $this->sid;\n }", "public function _getShipmentId() {\n\t\treturn $this->_shipmentId;\n\t}", "public function getProgramId()\n {\n return $this->ProgramId;\n }", "public function getSellerShipping() {\r\n return Mage::getResourceModel ( 'eav/entity_attribute' )->getIdByCode ( 'catalog_product', 'seller_shipping_option' );\r\n }", "protected function getSessionId() {\r\n\t\treturn $this->id;\r\n\t}", "private function _getStoreId() {\n $store_id = 1;\n return $store_id;\n }", "public function getIdentifier()\n {\n $sellerId = ($this->getSeller()) ? $this->getSeller()->getId() : '';\n\n return $sellerId.$this->getAmount().$this->getCurrency();\n }", "public function getShipmentId()\n {\n return $this->shipmentId;\n }", "function getStageId() {\n\t\treturn $this->getData('stageId');\n\t}", "public function getListingId() {\n\treturn ($this->listingId);\n}", "public function getSourcedId()\n {\n return isset($context['sourcedId']) ? $context['sourcedId'] : null;\n }", "public function getSessId()\n {\n return $this->sess_id;\n }", "public function getProductSeller()\n {\n $product = $this->coreRegistry->registry('product');\n $productId = $product->getId();\n $sellerId = $this->helper->getSellerIdByProductId($productId);\n return $sellerId;\n }", "public function getId()\n {\n return $this->identifier;\n }", "public function getIdTaker()\n {\n return $this->idTaker;\n }", "public function id()\n {\n return $this->identity['jobId'];\n }", "public function getDriverId()\n {\n return isset($this->driverId) ? $this->driverId : null;\n }", "public function getSecretId()\n {\n return $this->secret_id;\n }", "public function getShntlotser()\n {\n return $this->shntlotser;\n }", "private function getRetailerId()\n {\n $retailerId = null;\n if ($this->currentStore->getRetailer() && $this->currentStore->getRetailer()->getId()) {\n $retailerId = (int) $this->currentStore->getRetailer()->getId();\n }\n\n return $retailerId;\n }", "public function getDistriStoreId()\n {\n return $this->distri_store_id;\n }", "public function getStudentId() {\n\t\tpreg_match ( '/\\d{9}/', $this->transcript, $ID ); // this will get the SID of the student\n\n\t\tif (count ( $ID ) > 0) {\n\t\t\t\t\n\t\t\t// $key= mt_rand ( MIN_KEY, MAX_KEY ); // will append a random key to the SI\n\t\t\treturn $ID [0]; // . strval($key);\n\t\t} else\n\t\t\treturn null;\n\t}", "public function get_woo_payer_id() {\n\n\t\t$environment = $this->wc_gateway()->get_option( 'environment', 'live' );\n\n\t\t$api_prefix = '';\n\n\t\tif ( 'live' !== $environment ) {\n\t\t\t$api_prefix = 'sandbox_';\n\t\t}\n\n\t\t$option_key = 'woocommerce_ppec_payer_id_' . $environment . '_' . md5( $this->wc_gateway()->get_option( $api_prefix . 'api_username' ) . ':' . $this->wc_gateway()->get_option( $api_prefix . 'api_password' ) );\n\n\t\t$payer_id = get_option( $option_key );\n\n\t\tif ( $payer_id ) {\n\t\t\treturn $payer_id;\n\t\t} else {\n\t\t\t$result = $this->get_woo_pal_details();\n\n\t\t\tif ( ! empty( $result['PAL'] ) ) {\n\t\t\t\tupdate_option( $option_key, wc_clean( $result['PAL'] ) );\n\n\t\t\t\treturn $payer_id;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getStoreId(){\n return $this->_getData(self::STORE_ID);\n }", "public function GetPlatID() {\n\t\treturn $this -> _mPlatID;\n\t}", "function getSiteId() {\n\t\treturn $this->getData('siteId');\n\t}", "public function getPayerRefPackingsId() {\n \treturn $this->_payerRefPackingsId;\n }", "public function getSpCode()\n {\n return $this->sp_code;\n }", "public static function id()\n {\n return self::$id;\n }", "public function getTskId()\n {\n return $this->tsk_id;\n }", "public function getId():string {\n return $this->id;\n }", "public function getStoreId();", "public function getStoreId();", "public function getStoreId();", "public static function get()\n {\n return self::$id;\n }", "public function getSecretID()\n {\n return $this->secretID;\n }", "public function getId()\n {\n return isset($this->id) ? $this->id : '';\n }", "public function getId()\n {\n return isset($this->id) ? $this->id : '';\n }", "protected function getID() {\n return $this->id;\n }", "public function getBookingId(): ?string\n {\n return $this->bookingId;\n }", "public function id(): string\n {\n return $this->id;\n }", "public function id(): string\n {\n return $this->id;\n }", "public function id(): string\n {\n return $this->id;\n }", "protected function getId() {\n // Since initializePurgersService() autogenerates the IDs, ours is known.\n return 'id0';\n }", "public function getSerialId()\n {\n return $this->get(self::_SERIAL_ID);\n }", "public function getIdentifier()\n {\n return $this->_identifier;\n }", "public function getIdentifier()\n {\n return $this->_identifier;\n }" ]
[ "0.6924408", "0.66728663", "0.66101444", "0.6495256", "0.6418618", "0.63752896", "0.63141745", "0.63072616", "0.6307243", "0.62718004", "0.62631947", "0.6237434", "0.62312007", "0.620991", "0.6207137", "0.61597025", "0.6155357", "0.61525714", "0.6122486", "0.610456", "0.6101447", "0.6090311", "0.60719055", "0.60487217", "0.6014136", "0.598912", "0.59781307", "0.59679717", "0.59666467", "0.59585774", "0.59585774", "0.593513", "0.5923349", "0.59130436", "0.59055793", "0.58965147", "0.5889623", "0.58747965", "0.58648276", "0.58648276", "0.58648276", "0.58581597", "0.58351237", "0.58334833", "0.5833216", "0.5808161", "0.5803901", "0.57906324", "0.57751554", "0.57606876", "0.5759242", "0.574207", "0.574187", "0.5741004", "0.5716179", "0.5709455", "0.57083064", "0.56965107", "0.56918675", "0.5690382", "0.5678843", "0.56644547", "0.5661377", "0.5656225", "0.5654304", "0.56503475", "0.56503475", "0.56503475", "0.56503475", "0.56503475", "0.56503475", "0.56503475", "0.56503475", "0.56503475", "0.56503475", "0.56503475", "0.5649131", "0.56484056", "0.56471443", "0.56459755", "0.5641303", "0.5638319", "0.5638046", "0.56344295", "0.5632112", "0.5632112", "0.5632112", "0.56317854", "0.56308484", "0.5627317", "0.5627317", "0.56265366", "0.5614983", "0.56143194", "0.56143194", "0.56143194", "0.5613113", "0.560608", "0.5599621", "0.5599621" ]
0.8963735
0
Sets the value of spoolerId.
public function setSpoolerId($spoolerId) { $this->spoolerId = $spoolerId; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSpoolerId()\n {\n return $this->spoolerId;\n }", "function setDevId($value)\n {\n $this->_props['DevId'] = $value;\n }", "public function setShoeID($value) {\n\t\t$this->_shoe_id = $value;\n\t}", "public function setId($workerId)\n\t{\n\t\t$this->id = $workerId;\n\t}", "private function set_steamid($sSteamid) {\r\n $this->steamid = $sSteamid;\r\n }", "function SetId($value) { $this->id=$value; }", "private function set_steamid($sSteamid) {\n $this->steamid = $sSteamid;\n }", "public function set_id($setid){\n $this->id = $setid;\n }", "public function setId($sId) \r\n\t{\r\n\t\t$this->sId = $sId;\r\n\t}", "public function setId($sId) {\n $this->sId = $sId;\n }", "public function setRequestorId(?string $value): void {\n $this->getBackingStore()->set('requestorId', $value);\n }", "public function setStoneId($value)\n {\n return $this->set(self::_STONE_ID, $value);\n }", "public function setSellerId($value)\n {\n $this->_fields['SellerId']['FieldValue'] = $value;\n return $this;\n }", "function setStageId($stageId) {\n\t\t$this->setData('stageId', $stageId);\n\t}", "function setSiteId($value)\n {\n $this->_props['SiteId'] = $value;\n }", "public function setSourceId(?string $value): void {\n $this->getBackingStore()->set('sourceId', $value);\n }", "public function setShipmentId($value)\n {\n $this->_fields['ShipmentId']['FieldValue'] = $value;\n return $this;\n }", "public function updateId() {\n $this->Id = session_id();\n }", "function setId($id) {\r\n $this->_id = $id;\r\n }", "protected function setSessionId($id) {\r\n\t\t$this->id = $id;\r\n\t}", "function setId_serie($iid_serie)\n {\n $this->iid_serie = $iid_serie;\n }", "public function setStoreId($id);", "function setId($id) {\n\t\t$this->_id = $id;\n\t}", "public function SetId ($id);", "public function setSvrId($value)\n {\n return $this->set(self::_SVR_ID, $value);\n }", "public function setSettingsId($value)\n {\n $this->_settingsId = $value;\n }", "public function setId($id){\n $this->_id = $id;\n }", "private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}", "public function setSeriesIdAttribute($value)\n {\n $this->attributes['series_id'] = $value ? $value : null;\n }", "public function setCallId(?string $value): void {\n $this->getBackingStore()->set('callId', $value);\n }", "function set_id($id) {\n\t\t$this->id = $id;\n\t}", "public function setStageId($value)\n {\n return $this->set(self::_STAGE_ID, $value);\n }", "public function setStageId($value)\n {\n return $this->set(self::_STAGE_ID, $value);\n }", "function set_id($id)\n {\n $this->id = $id;\n }", "public function setStageId($value)\n {\n return $this->set(self::_STAGE_ID, $value);\n }", "public function insertSellerId()\n {\n $font_options = $this->getFontOptions();\n\n $this->sticker->text('ID: ' . $this->getSellerId(), $this->textXPosition, $this->textYPosition, function ($font) use ($font_options) {\n $font->file($font_options['file']);\n $font->color($font_options['color']);\n $font->size($font_options['size']);\n $font->align($font_options['align']);\n $font->valign($font_options['valign']);\n });\n\n return $this;\n }", "public function setSenderShiftId(?string $value): void {\n $this->getBackingStore()->set('senderShiftId', $value);\n }", "function setId($id) {\n $this->id = $id;\n }", "function setId($id) {\n $this->id = $id;\n }", "public function setOfferPoolId(?int $offerPoolId = null): self\n {\n // validation for constraint: int\n if (!is_null($offerPoolId) && !(is_int($offerPoolId) || ctype_digit($offerPoolId))) {\n throw new InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($offerPoolId, true), gettype($offerPoolId)), __LINE__);\n }\n if (is_null($offerPoolId) || (is_array($offerPoolId) && empty($offerPoolId))) {\n unset($this->OfferPoolId);\n } else {\n $this->OfferPoolId = $offerPoolId;\n }\n \n return $this;\n }", "protected function setInternalIdentifier($id)\n {\n $this->_id = $id;\n }", "function setSwimMeetId($id)\r\n {\r\n $this->_swimmeetid = $id ;\r\n }", "public function setPayloadId(?string $value): void {\n $this->getBackingStore()->set('payloadId', $value);\n }", "public function setId($id)\n {\n $this->setIdSale($id);\n }", "public function setOperationPrimeRRewardTransporterId($v)\n {\n if ($v === ''){\n $v = null;\n }\n elseif ($v !== null){\n \n if(is_numeric($v)) {\n $v = (int) $v;\n }\n }\n if ($this->operation_prime_r_reward_transporter_id !== $v) {\n $this->operation_prime_r_reward_transporter_id = $v;\n $this->modifiedColumns[] = OperationPrimesPeer::OPERATION_PRIME_R_REWARD_TRANSPORTER_ID;\n }\n\n if ($this->aRRewardTransporters !== null && $this->aRRewardTransporters->getRRewardTransporterId() !== $v) {\n $this->aRRewardTransporters = null;\n }\n\n\n return $this;\n }", "function setId($id)\n {\n $this->id = $id;\n }", "public function setID($id) {\n $this->id = $id; \n }", "public function setIDSender($idSender){\n $this->IDsender = $idSender;\n }", "public static function set($id)\n {\n self::$id = $id;\n }", "public function setSourceId(?string $sourceId): void\n {\n $this->sourceId['value'] = $sourceId;\n }", "public function setId($id) {\r\n $this->_id = $id;\r\n }", "function setId($id){\r\n\t\t$this->id = $id;\r\n\t}", "public function _setShipmentId($shipmentId) {\n\t\t$this->_shipmentId = $shipmentId;\n\t}", "public function setId(?string $value): void {\n $this->getBackingStore()->set('id', $value);\n }", "public function setId(?string $value): void {\n $this->getBackingStore()->set('id', $value);\n }", "public function setId(?string $value): void {\n $this->getBackingStore()->set('id', $value);\n }", "public function setId(?string $value): void {\n $this->getBackingStore()->set('id', $value);\n }", "public function setWholesalerId($value)\n {\n return $this->set(self::wholesaler_id, $value);\n }", "private function setId($id)\n {\n $this->id = $id;\n }", "function setId($id){\n\t\t$this->id = $id;\n\t}", "public function setId(string $sId): self\n {\n $this->sId = $sId;\n return $this;\n }", "public function set_id( $id ) {\n\t\t\t$this->id = $id;\n\t\t}", "public function setId($id) { $this->id = $id; }", "public function getShoptId()\n {\n return $this->getParameter('shop_id');\n }", "public function setId($pId) {\n\t\t$this->Id = $pId;\n\t}", "public function getOfferSellerId()\n {\n return $this->offer_seller_id;\n }", "public function setId($id) {\n $this->id = $id;\n }", "function setId($id) {\r\n\t\t// Set id and wipe data\r\n\t\t$this->_id = $id;\r\n\t}", "public function setId($id)\n {\n $this->_id = $id;\n }", "public function setId($id)\n {\n $this->setIdExpert($id);\n }", "public function setId($id) \n {\n $this->id = $id;\n }", "public function setId( $id )\n {\n $this->id = $id;\n }", "public function setIdPlanDesarrollo( $idPlanDesarrollo ){\n\t\t \t$this->idPlanDesarrollo = $idPlanDesarrollo;\n\t\t }", "function setId($value) {\n $this->_id = intval($value);\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setID($_id) \n \t{\n \t\t$this->_id = $_id;\n \t}", "public function setID($id){\n $this->id = $id;\n }", "function setId($id)\n\t{\n\t\t// Set id\n\t\t$this->_id\t = $id;\n\t}", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n\n \n }", "public function setId($id) {\r\n $this->id = $id;\r\n }", "public function setId($id) {\r\n $this->id = $id;\r\n }", "public function set_id($id){\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function setShippingOptionId($id){\n $this->shippingOptionId = $id;\n }", "public function setIdVit($id){\n\t\t$this->id = $id;\n\t}", "function set_id( $id ){\n\t\t$this->id = $id;\n\t\t// this is add request. so number is 0\n\t\tif( $this->id == $this->id_base ){\n\t\t\t$this->number = 0;\n\t\t\t$this->is_new = true;\n\t\t}\n\t\t// parse number\n\t\telse{\n\t\t\t$this->number = str_replace($this->id_base.'-', '', $this->id);\n\n\t\t\t// load instance data\n\t\t\t$this->instance = jcf_field_settings_get( $this->id );\n\t\t\tif( !empty($this->instance) ){\n\t\t\t\t$this->slug = $this->instance['slug'];\n\t\t\t}\n\t\t}\n\t}", "public function setID($_id) \n\t{\n\t\t$this->_id = $_id;\n\t}", "public function setNameId($name_id)\n {\n $this->name_id = $name_id;\n }", "public function setId($id) {\n $this->vendorData[\"ID_VENDOR\"] = (int)$id;\n }", "private function set_id(int $id)\n {\n $this->_id = $id;\n }", "public function setId($id){\n\t\tself::$_id[get_class($this)] = $id;\n\t}", "public function initShoutsRelatedByPosterId()\n\t{\n\t\t$this->collShoutsRelatedByPosterId = array();\n\t}", "public function setId($id)\n {\n $this->id = $id;\n }", "function setId($id) {\n\t\t$this->setData('id', $id);\n\t}", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function setId( $id ) {\n\t\t$this->id = $id;\n\t}", "public function setId( $id ) {\n\t\t$this->id = $id;\n\t}" ]
[ "0.7614699", "0.5765551", "0.5629419", "0.562274", "0.56028014", "0.5570891", "0.5570046", "0.5528579", "0.5524883", "0.5508818", "0.54853743", "0.5332341", "0.532547", "0.52503264", "0.5247285", "0.52160317", "0.5198355", "0.5178315", "0.5173086", "0.51405865", "0.513875", "0.51188856", "0.5116151", "0.51159805", "0.5103407", "0.50997496", "0.5090699", "0.5078747", "0.50773454", "0.5076269", "0.5066086", "0.5062931", "0.5062931", "0.50622404", "0.5061074", "0.5060447", "0.5051989", "0.50494754", "0.50494754", "0.50452864", "0.50393486", "0.5038223", "0.50315726", "0.5031511", "0.5023999", "0.50231886", "0.5021565", "0.5011082", "0.50103134", "0.50079495", "0.5004133", "0.49974287", "0.49936014", "0.49927714", "0.49927714", "0.49927714", "0.49927714", "0.49851993", "0.49847734", "0.49841535", "0.49837756", "0.4976157", "0.49744427", "0.49713823", "0.4963622", "0.49597254", "0.4953561", "0.4951582", "0.49456358", "0.49411225", "0.49357608", "0.4934419", "0.4931309", "0.49262246", "0.4921172", "0.4919216", "0.49124894", "0.49067307", "0.49043238", "0.49043238", "0.49043238", "0.49011764", "0.489541", "0.489541", "0.489129", "0.4887394", "0.48865932", "0.48855883", "0.48840183", "0.48838305", "0.48825535", "0.48825228", "0.48777097", "0.4876174", "0.48752564", "0.48703882", "0.4869176", "0.486837", "0.48681298", "0.48681298" ]
0.74592406
1
Gets the value of ignoreRemoteSchedulers.
public function getIgnoreRemoteSchedulers() { return $this->ignoreRemoteSchedulers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setIgnoreRemoteSchedulers($ignoreRemoteSchedulers)\n {\n $this->ignoreRemoteSchedulers = $ignoreRemoteSchedulers;\n\n return $this;\n }", "public function getRemoteScheduler()\n {\n return $this->remoteScheduler;\n }", "public function getRemoteScheduler()\n {\n return $this->remoteScheduler;\n }", "public function getInboundConnectionsBlocked()\n {\n if (array_key_exists(\"inboundConnectionsBlocked\", $this->_propDict)) {\n return $this->_propDict[\"inboundConnectionsBlocked\"];\n } else {\n return null;\n }\n }", "public function getRemoteCallEnabled() {\n\t\tif (is_null($this->remoteCallEnabled)) {\n\t\t\t$this->remoteCallEnabled = Mage::getStoreConfigFlag('dev/aoe_templatehints/enablePhpstormRemoteCall');\n\t\t}\n\t\treturn $this->remoteCallEnabled;\n\t}", "public function getInboundNotificationsBlocked()\n {\n if (array_key_exists(\"inboundNotificationsBlocked\", $this->_propDict)) {\n return $this->_propDict[\"inboundNotificationsBlocked\"];\n } else {\n return null;\n }\n }", "public function getUnicastResponsesToMulticastBroadcastsBlocked()\n {\n if (array_key_exists(\"unicastResponsesToMulticastBroadcastsBlocked\", $this->_propDict)) {\n return $this->_propDict[\"unicastResponsesToMulticastBroadcastsBlocked\"];\n } else {\n return null;\n }\n }", "public function getNoInterrumpir( ) {\n return $this->noInterrumpir;\n }", "public function getIncomingTrafficBlocked()\n {\n if (array_key_exists(\"incomingTrafficBlocked\", $this->_propDict)) {\n return $this->_propDict[\"incomingTrafficBlocked\"];\n } else {\n return null;\n }\n }", "public function getStatusBlacklist()\n {\n return $this->status_blacklist;\n }", "public function getMonitoredStopVisitCancellation()\n {\n return $this->monitoredStopVisitCancellation;\n }", "public function getOutboundConnectionsBlocked()\n {\n if (array_key_exists(\"outboundConnectionsBlocked\", $this->_propDict)) {\n return $this->_propDict[\"outboundConnectionsBlocked\"];\n } else {\n return null;\n }\n }", "public function getImportIgnore() {\n return $this->getThirdPartySetting('config_import_ignore', 'import_ignore', $this->import_ignore);\n }", "public function getIgnoreWarnings()\n {\n return $this->ignore_warnings;\n }", "public function getIgnoreFailedSubtask()\n {\n return $this->get(self::IGNORE_FAILED_SUBTASK);\n }", "public function getDisabled()\n {\n return array_filter($this->storage, function($val)\n {\n return $val['status'] === ProviderInterface::STATUS_DISABLED;\n });\n }", "public function getStopLineNoticeCancellation()\n {\n return $this->stopLineNoticeCancellation;\n }", "public function getDisableExternalSubdomain()\n {\n return $this->disable_external_subdomain;\n }", "public function getSmsNotificationsEnabled()\n {\n if (array_key_exists(\"smsNotificationsEnabled\", $this->_propDict)) {\n return $this->_propDict[\"smsNotificationsEnabled\"];\n } else {\n return null;\n }\n }", "public function getDisableConditions()\n {\n $value = $this->_config->get('general/disable_conditions');\n\n if ($value === null) {\n $value = [];\n }\n\n return $value;\n }", "public function getSuspended()\n {\n return $this->suspended;\n }", "public function getSuspended()\n {\n return $this->suspended;\n }", "public function getDisabledByMicrosoftStatus()\n {\n if (array_key_exists(\"disabledByMicrosoftStatus\", $this->_propDict)) {\n return $this->_propDict[\"disabledByMicrosoftStatus\"];\n } else {\n return null;\n }\n }", "public function getIgnored() : bool\n {\n return $this->ignored;\n }", "public function excludePendingOrders()\n {\n return $this->scopeConfig->getValue('wesupply_api/wesupply_order_export/wesupply_order_filter_pending', ScopeInterface::SCOPE_STORE);\n }", "public function blacklist()\n {\n return $this['blacklist'];\n }", "public function getIgnore()\n {\n return $this->ignore;\n }", "protected function getSendingSchedule()\n\t{\n\t\treturn null;\n\t}", "public function ignoredActivityIDs() {\n\t\treturn $this->get('GARMIN_IGNORE_IDS');\n\t}", "public function getScheduleStatus()\n {\n if (!$this->scheduleStatus) {\n return false;\n } else {\n list($scheduleStatus) = explode(';', $this->scheduleStatus);\n\n return $scheduleStatus;\n }\n }", "public function getBlacklist()\n {\n return $this->blacklist;\n }", "public function getBlacklist()\n {\n return $this->blacklist;\n }", "function getDoNotPublishList()\r\n\t\t{\r\n\t\t\tif (!empty($this->_doNotPublishList)) {\r\n\t\t\t\treturn $this->_doNotPublishList;\r\n\t\t\t} else {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}", "public function getDisableTxService()\n {\n return $this->disable_tx_service;\n }", "public function getNegativeCaching()\n {\n return isset($this->negative_caching) ? $this->negative_caching : false;\n }", "private function sites_with_outdated_modem()\r\n {\r\n return $this->sites_repository()->sites_with_outdated_modem();\r\n }", "public function getSystemMessages()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('systemMessages');\n }", "public function getSwtCallOff()\n {\n return isset($this->swtCallOff) ? $this->swtCallOff : null;\n }", "public function getBlacklist()\n {\n return $this->blacklist;\n }", "public function getIgnoreDoingSubtask()\n {\n return $this->get(self::IGNORE_DOING_SUBTASK);\n }", "public function getIgnoreVersionDetection()\n {\n if (array_key_exists(\"ignoreVersionDetection\", $this->_propDict)) {\n return $this->_propDict[\"ignoreVersionDetection\"];\n } else {\n return null;\n }\n }", "public function getSkipReboot()\n {\n return $this->skip_reboot;\n }", "public function getRetainDisabledHandlers()\n\t{\n\t\treturn $this->_retainDisabledHandlers;\n\t}", "protected function getJobWorkersConfig() : array\n {\n $config = $this->getMessageJobSourceConfig();\n\n return $config['parameters']['workers'] ?? [];\n }", "public function getPendingSchedules()\n {\n return $this->db->where('status', self::STATUS_PENDING)\n ->get($this->cron_schedule_table_name)\n ->result_array();\n }", "public function getBypassDirSyncOverridesEnabled()\n {\n if (array_key_exists(\"bypassDirSyncOverridesEnabled\", $this->_propDict)) {\n return $this->_propDict[\"bypassDirSyncOverridesEnabled\"];\n } else {\n return null;\n }\n }", "public function getStealthModeBlocked()\n {\n if (array_key_exists(\"stealthModeBlocked\", $this->_propDict)) {\n return $this->_propDict[\"stealthModeBlocked\"];\n } else {\n return null;\n }\n }", "public function getIsBlocked()\n {\n return $this->isBlocked;\n }", "public function getSmsAllowed()\n {\n return $this->smsAllowed;\n }", "private function getNonDatabaseIps()\n {\n return array_merge_recursive(\n array_map(function ($ip) {\n $ip['whitelisted'] = true;\n\n return $ip;\n }, $this->formatIpArray($this->config()->get('whitelist'))),\n array_map(function ($ip) {\n $ip['whitelisted'] = false;\n\n return $ip;\n }, $this->formatIpArray($this->config()->get('blacklist')))\n );\n }", "public function getBlocked()\n {\n return $this->Blocked;\n }", "public function getIsBlocked();", "public function getPersonalMessageTurnedOff() {\r\n return Mage::getStoreConfig(\r\n 'giftwrap/message/personal_message_disable_msg');\r\n }", "protected static function fallbackAvailable()\n {\n return static::$fallbackAvailable;\n }", "public function getStopOnError(): bool\n {\n return $this->stopOnError;\n }", "public function getCommunicationDisabledUntil(): int\n {\n return $this->communication_disabled_until;\n }", "private function getFilteredConfig()\n {\n return array_diff_key($this->resolvedBaseSettings, array_flip($this->primaryReadReplicaConfigIgnored));\n }", "public function getIsUnPublishJobRunning()\n {\n return $this->isUnPublishJobRunning;\n }", "public function getEnableMonitoring()\n {\n return $this->enableMonitoring;\n }", "public function getEnableSms()\n {\n return $this->enableSms;\n }", "public function useRemoteSubscription()\n {\n return false;\n }", "public function getExclude()\n {\n return $this->exclude;\n }", "public function getBlocking()\n {\n return $this->_blocking;\n }", "public function get_repeats_on() {\n return (array) edd_get_option( 'edd_commissions_payout_schedule_on', array() );\n }", "private function get_current_sites() {\n\t\t\tif ( empty( $this->current_sites ) ) {\n\t\t\t\t$sites = $this->get_value( 'sites', 'list' );\n\t\t\t\tif ( ! empty( $sites ) ) {\n\t\t\t\t\t$this->current_sites = array_filter( $sites );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this->current_sites;\n\t\t}", "public function getPausedWorker()\n {\n return (array)$this->redis->smembers(self::$pausedWorkerKey);\n }", "public function getRemoteTrafficSelector()\n {\n return $this->remote_traffic_selector;\n }", "public function getPendingReceived()\n {\n $value = $this->get(self::pending_received);\n return $value === null ? (integer)$value : $value;\n }", "public static function getNotRunningStatusesArray(): array\n {\n return [\n ProcessStatuses::COMPLETED,\n ProcessStatuses::FAILED,\n ProcessStatuses::KILLED,\n ];\n }", "public function getShouldNotProcess()\n\t{\n\t\t$state = $this->data->get(\"state\");\n\t\treturn !$state || $state == self::STATE_NONE || $state == self::STATE_STOPPED;\n\t}", "public function getAllowCustomAssignmentSchedule()\n {\n if (array_key_exists(\"allowCustomAssignmentSchedule\", $this->_propDict)) {\n return $this->_propDict[\"allowCustomAssignmentSchedule\"];\n } else {\n return null;\n }\n }", "public function getRankedPlayEnabled()\n {\n return $this->get('rankedPlayEnabled', false);\n }", "public function getIgnoreIfNotAvailable()\n {\n return $this->_ignoreIfRenderModeNotAvailable;\n }", "public function getDisablePodOverprovisioning()\n {\n return $this->disable_pod_overprovisioning;\n }", "public static function getQueueSites()\n {\n $sitesQueue = array();\n $sites = AibolitModel::getAllSites();\n foreach ($sites as $site) {\n if (in_array($site['scanner']['queue'], array(AibolitModel::STATUS_SCANNED, AibolitModel::STATUS_QUEUE, AibolitModel::STATUS_STOP))) {\n $sitesQueue[] = $site['domain'];\n }\n }\n \n return $sitesQueue;\n }", "final public function getIgnore()\n {\n return (bool)$this->getOption('data-ignore');\n }", "public function getIpLockIsDisabled() {}", "public function getUseBreadcrumbs()\n {\n return Mage::getStoreConfigFlag('bs_register/schedule/breadcrumbs');\n }", "protected function filter_redis_get_multi($value)\n {\n if (is_null($value)) {\n $value = false;\n }\n\n return $value;\n }", "public function getGlobalPortRulesFromGroupPolicyMerged()\n {\n if (array_key_exists(\"globalPortRulesFromGroupPolicyMerged\", $this->_propDict)) {\n return $this->_propDict[\"globalPortRulesFromGroupPolicyMerged\"];\n } else {\n return null;\n }\n }", "public static function getExcludedChannelCodes()\n {\n if (!static::canUse()) {\n return array();\n }\n\n static $codes = null;\n if ($codes === null) {\n $codes = ImConnector\\Connector::getListConnectorNotNewsletter();\n }\n\n return $codes;\n }", "public function getRemoteIpLookup(): bool\r\n {\r\n return $this->remoteIpLookup;\r\n }", "public function getEnabledSites()\n\t{\n\t\t$sites = get_option('social_curator_enabled_sites');\n\t\t$enabled = array();\n\t\tif ( !is_array($sites) ) return $enabled;\n\t\tforeach ( $sites as $key => $site ){\n\t\t\tif ( isset($site['enabled']) ) $enabled[] = $key;\n\t\t}\n\t\treturn $enabled;\n\t}", "public function getIsMonTicket() {\n return $this->get(self::ISMONTICKET);\n }", "public function getMonitoredFiles()\n {\n return $this->monitoredFiles;\n }", "public function getProcNotif(){\n return $this->_data['proc_notif'];\n }", "public function setWorkers()\r\n {\r\n if (!is_array($this->workers)) {\r\n\r\n $gearmanCache = $this->container->get('gearman.cache');\r\n $this->workers = $gearmanCache->get();\r\n }\r\n\r\n /**\r\n * Always will be an Array\r\n */\r\n\r\n return $this->workers;\r\n }", "public function getUnsentOrderCutoff()\n {\n return (integer) $this->scopeConfig->getValue(\n 'orderflow_inventory_import/settings/unsent_order_cutoff',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_WEBSITE\n );\n }", "public static function exclusive()\n {\n // Change setting\n self::$settings['exclude'] = true;\n\n // Return exclusion list\n return self::$exclude;\n }", "public function getCronExportOrderConfigStatus()\n {\n $status = [$this->getDefaultStatusForState(LocalOrder::STATE_HOLDED)];\n if ($this->getConfigValue(self::XML_PATH . 'order/filter_status')) {\n $unprocessedData = $this->getConfigValue(self::XML_PATH . 'order/filter_status');\n // Processing data\n $status = explode(',', $unprocessedData);\n }\n return $status;\n }", "public function getMessageMonitor()\n {\n return $this->messageMonitor;\n }", "public function getReceiver() {\n return $this->_receiver;\n }", "public function getReceiver()\n {\n return $this->receiver;\n }", "public function getReceiver()\n {\n return $this->receiver;\n }", "public static function get_allowed_on_network()\n {\n }", "public function getPending()\n\t{\n\t\treturn $this->pending;\n\t}", "public function getUseCurrencyExchangeRates()\n {\n return $this->_useCurrencyExchangeRates;\n }", "public function isEnabledInSystem()\r\n\t{\r\n\t\t// Get global vars\r\n\t\tglobal $realtime_webservice_global_enabled;\r\n\t\t// If both vars have a value, then it IS enabled\r\n\t\treturn $realtime_webservice_global_enabled;\r\n\t}", "private function _getServer(){\n\t\textract($this->configs);\n\t\t$orderServer = array();\n\t\tif(is_string($servers))\t{\n\t\t\t$servers = array($servers);\n\t\t}\n\t\t\n\t\tif ( $masterServer !== false && is_string($masterServer)){\n\t\t\t$orderServer[] = $servers[$masterServer];\n\t\t\tunset($servers[$masterServer]);\n\t\t}\n\t\t$orderServer = array_merge($orderServer,$servers); \n\t\t\n\t\tforeach($orderServer as $url ) {\n\t\t\tif($this->_checkServerIsOnline($url)){\n\t\t\t\treturn $url;\n\t\t\t}\n\t\t}\n\t\n\t\t\t\t\n\t\treturn false ;\n\t}", "public function getScheduledInterval()\n {\n return $this->scheduledInterval;\n }" ]
[ "0.69714403", "0.5693276", "0.5693276", "0.53177327", "0.5224337", "0.52107793", "0.5139619", "0.51013875", "0.5060054", "0.50352335", "0.49342975", "0.49088922", "0.487296", "0.4866089", "0.48356846", "0.47815722", "0.47778866", "0.47384715", "0.47315", "0.47205272", "0.46918273", "0.46918273", "0.46697387", "0.46436387", "0.4639845", "0.46325612", "0.46176752", "0.4569403", "0.45633885", "0.45550874", "0.45339596", "0.45339596", "0.45228958", "0.45203695", "0.4518194", "0.45101002", "0.45048133", "0.450177", "0.45006245", "0.45003897", "0.4496345", "0.44895166", "0.44767773", "0.44746816", "0.44732293", "0.4470914", "0.44610956", "0.4459024", "0.44471967", "0.4445712", "0.4437254", "0.44366834", "0.44362393", "0.4411355", "0.44073638", "0.43975917", "0.43932688", "0.4388491", "0.43778613", "0.43777195", "0.43707985", "0.4368513", "0.43654534", "0.43595973", "0.43586648", "0.4351976", "0.43416414", "0.43394405", "0.43393433", "0.43352932", "0.4331184", "0.43216825", "0.4321519", "0.43152678", "0.43133542", "0.43058404", "0.43041995", "0.43007234", "0.42958325", "0.42906293", "0.42897186", "0.42880425", "0.42860177", "0.42846653", "0.42838857", "0.427299", "0.42688227", "0.4263948", "0.42630497", "0.42596146", "0.42594817", "0.42563105", "0.42553216", "0.42553216", "0.42540428", "0.42503223", "0.42418924", "0.42373002", "0.4234816", "0.423449" ]
0.8771035
0
Sets the value of ignoreRemoteSchedulers.
public function setIgnoreRemoteSchedulers($ignoreRemoteSchedulers) { $this->ignoreRemoteSchedulers = $ignoreRemoteSchedulers; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIgnoreRemoteSchedulers()\n {\n return $this->ignoreRemoteSchedulers;\n }", "public function setRemoteScheduler($remoteScheduler)\n {\n $this->remoteScheduler = $remoteScheduler;\n\n return $this;\n }", "public function setRemoteScheduler($remoteScheduler)\n {\n $this->remoteScheduler = $remoteScheduler;\n\n return $this;\n }", "public function useRemoteSubscription()\n {\n return false;\n }", "public function setAllowAllCaptiveNetworkPlugins(?bool $value): void {\n $this->getBackingStore()->set('allowAllCaptiveNetworkPlugins', $value);\n }", "public function setScheduler() {}", "public function setMiracastBlocked(?bool $value): void {\n $this->getBackingStore()->set('miracastBlocked', $value);\n }", "static function setAllowExternalConnections($b) {\n self::$allow_external_connections = $b;\n }", "public function setUnicastResponsesToMulticastBroadcastsBlocked($val)\n {\n $this->_propDict[\"unicastResponsesToMulticastBroadcastsBlocked\"] = $val;\n return $this;\n }", "public function setRemoteIp($remoteIp);", "public function cancelAllMonitors () {\n $this->callMethod( 'cancelAllMonitors');\n $this->_handlersMonitorFile = array();\n }", "public function setReceiver($receiver) {\n $this->_receiver = $receiver;\n }", "public function setIgnoreIfSet($ignoreIfSet)\n\t{\n\t\t$this->ignoreIfSet = StringHelper::booleanValue($ignoreIfSet);\n\t}", "public function setAppsBlockInstallFromUnknownSources(?bool $value): void {\n $this->getBackingStore()->set('appsBlockInstallFromUnknownSources', $value);\n }", "function setDoNotPublishList($list)\r\n\t\t{\r\n\t\t\t$this->_doNotPublishList = $list;\r\n\t\t}", "public function setBlacklist(array $blacklist)\n {\n $this->blacklist = $blacklist;\n }", "function setDisableRemoteFonts($disable_remote_fonts) {\n $this->fields['disable_remote_fonts'] = $disable_remote_fonts;\n return $this;\n }", "function setDisableRemoteFonts($disable_remote_fonts) {\n $this->fields['disable_remote_fonts'] = $disable_remote_fonts;\n return $this;\n }", "public function setBlackListedFiles($black_listed_files=null)\n {\n if (!(is_array($black_listed_files) && count($black_listed_files) > 0)) {\n return;\n }\n $this->black_listed_files = $black_listed_files;\n }", "public function unsetScheduler() {}", "public static function setIgnoreAclPermissions($ignore=true){\n\t\t\n\t\t\\GO::debug(\"setIgnoreAclPermissions(\".var_export($ignore, true).')');\n\t\t\n\t\t$oldValue = \\GO::$ignoreAclPermissions;\n\t\t\\GO::$ignoreAclPermissions=$ignore;\n\n\t\treturn $oldValue;\n\t}", "public function addRemoteScheduler(\n RemoteScheduler $remoteScheduler\n ) {\n $this->remoteSchedulerCollection[] = $remoteScheduler;\n return $this;\n }", "public function setIgnore(bool $ignore): void;", "public function setRemoteIp($remoteIp)\n {\n $this->_remoteIp = $remoteIp;\n }", "function setNonBlockingSocket()\n\t{\n\t\tsocket_set_nonblock($this->socket);\n\t}", "public static function blacklist(array $blacklist)\n {\n config()->set('vue-translation.blacklist', $blacklist);\n }", "public function setScriptExecutionDisabled(ContextInterface $ctx, SetScriptExecutionDisabledRequest $request): void;", "function disableclient()\n {\n\n exec('ifconfig ' . escapeshellarg($this->interface) . ' down');\n }", "public function setReceiver($receiver){\n $this->receiver = $receiver;\n }", "public function setRetainDisabledHandlers($value)\n\t{\n\t\tif ($value !== 0 && $value !== null && (!is_string($value) || strtolower($value) !== 'null' && $value !== '0')) {\n\t\t\t$value = TPropertyValue::ensureBoolean($value);\n\t\t} else {\n\t\t\t$value = null;\n\t\t}\n\t\tif ($this->_retainDisabledHandlers !== $value) {\n\t\t\t$this->_retainDisabledHandlers = $value;\n\t\t\t$this->syncEventHandlers();\n\t\t}\n\t}", "function setServerURLs($serverURLs) {\n\t\t$this->m_serverURLs = $serverURLs;\n\t}", "public static function network_disable_theme($stylesheets)\n {\n }", "function setIgnoreParameters($ignoreParameters) {\n $this->ignoreParameters = $ignoreParameters;\n }", "public function setRoaming($roaming) {\n if (!is_bool($roaming)) {\n throw new InvalidArgumentException(\"\\\"roaming\\\" is no boolean\");\n }\n $this->roaming = $roaming;\n }", "public function testReportConcurrentUsersToNewRelicModuleDisabledFromConfig()\n {\n /** @var \\Magento\\Framework\\Event\\Observer|\\PHPUnit_Framework_MockObject_MockObject $eventObserver */\n $eventObserver = $this->getMockBuilder(\\Magento\\Framework\\Event\\Observer::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->config->expects($this->once())\n ->method('isNewRelicEnabled')\n ->willReturn(false);\n\n $this->model->execute($eventObserver);\n }", "public function setAllowedCaptiveNetworkPlugins(?SpecifiedCaptiveNetworkPlugins $value): void {\n $this->getBackingStore()->set('allowedCaptiveNetworkPlugins', $value);\n }", "public function setInboundConnectionsBlocked($val)\n {\n $this->_propDict[\"inboundConnectionsBlocked\"] = $val;\n return $this;\n }", "public function setFactoryResetBlocked(?bool $value): void {\n $this->getBackingStore()->set('factoryResetBlocked', $value);\n }", "public static function setIpBlacklist($ips = []) {\n\t\tif (!is_array($ips)) {\n\t\t\t$ips = func_get_args();\n\t\t}\n\n\t\tself::instance()->ipBlacklist($ips);\n\t}", "public function setAllowCustomAssignmentSchedule($val)\n {\n $this->_propDict[\"allowCustomAssignmentSchedule\"] = $val;\n return $this;\n }", "public function setDisableSslVerify($b = true) {\n $this->disableSslVerify = $b;\n if ($b) {\n $this->log('Caution: Disabling SSL verification.', 'Warning');\n }\n }", "public function setIncomingTrafficBlocked($val)\n {\n $this->_propDict[\"incomingTrafficBlocked\"] = $val;\n return $this;\n }", "public function setGearmanServers(array $servers) {\n\t\t$this->servers = $servers;\n\t}", "protected function setBreakFlag()\n\t{\n\t\t$registry = Factory::getConfiguration();\n\t\t$registry->set('volatile.breakflag', true);\n\t}", "public function setThrottleStop($b=true) {\n $this->throttleStop=!empty($b);\n }", "public function addRemoteFilter()\n {\n $this->queryBuilder->addFilter(new Filters\\Job\\Remote());\n }", "public function setScreenCaptureBlocked(?bool $value): void {\n $this->getBackingStore()->set('screenCaptureBlocked', $value);\n }", "public function setSsh(bool $ssh)\n {\n $this->ssh = $ssh;\n }", "public function setMode($isLocal){\n $this->isLocalMode = (bool)$isLocal;\n }", "function DisableCron()\n\t{\n\t\t$this->cronok = false;\n\n\t\t$this->Db->StartTransaction();\n\n\t\t$query = \"UPDATE \" . SENDSTUDIO_TABLEPREFIX . \"settings SET cronok='0', cronrun1=0, cronrun2=0\";\n\t\t$res = $this->Db->Query($query);\n\t\tif (!$res) {\n\t\t\t$this->Db->RollbackTransaction();\n\t\t\treturn false;\n\t\t}\n\n\t\t$query = \"DELETE FROM \" . SENDSTUDIO_TABLEPREFIX . \"settings_cron_schedule\";\n\t\t$this->Db->Query($query);\n\t\tforeach (array_keys($this->Schedule) as $jobtype) {\n\t\t\t$query = \"INSERT INTO \" . SENDSTUDIO_TABLEPREFIX . \"settings_cron_schedule(jobtype, lastrun) VALUES ('\" . $this->Db->Quote($jobtype) . \"', 0)\";\n\t\t\t$res = $this->Db->Query($query);\n\t\t\tif (!$res) {\n\t\t\t\t$this->Db->RollbackTransaction();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$this->Db->CommitTransaction();\n\n\t\treturn true;\n\t}", "public function setRemoteFile($remoteFileName){\n\t\t$this->remote_file = $remoteFileName;\n\t}", "public function setFallbackReviewers(?array $value): void {\n $this->getBackingStore()->set('fallbackReviewers', $value);\n }", "public function setIgnoreFailedSubtask($value)\n {\n return $this->set(self::IGNORE_FAILED_SUBTASK, $value);\n }", "public function setCron($cron)\n\t{\t\t\t\t\n\t\t$this->_cron = (bool)$cron;\n\t}", "public static function smush_deactivated() {\n\t\tif ( ! class_exists( '\\\\Smush\\\\Core\\\\Modules\\\\CDN' ) ) {\n\t\t\trequire_once __DIR__ . '/modules/class-cdn.php';\n\t\t}\n\n\t\tModules\\CDN::unschedule_cron();\n\n\t\tif ( is_multisite() && is_network_admin() ) {\n\t\t\t/**\n\t\t\t * Updating the option instead of removing it.\n\t\t\t *\n\t\t\t * @see https://incsub.atlassian.net/browse/SMUSH-350\n\t\t\t */\n\t\t\tupdate_site_option( WP_SMUSH_PREFIX . 'networkwide', 1 );\n\t\t}\n\t}", "public function setIgnoreMinimumExecutionTime($ignoreMinimumExecutionTime)\n\t{\n\t\t$this->ignoreMinimumExecutionTime = $ignoreMinimumExecutionTime;\n\t}", "public static function set_autodiscover_fallback($val) {\n\t\tself::$autodiscover_fallback = (bool)$val;\n\t}", "public static function whitelist(array $whitelist)\n {\n config()->set('vue-translation.whitelist', $whitelist);\n }", "function setWhiteList($whiteList) {\n\t\t$this->_whiteList = $whiteList;\n\t}", "public function setIps()\n {\n if ($this->module->sandbox) {\n $this->ips = $this->sandboxIps;\n } else {\n $this->ips = $this->productionIps;\n }\n }", "public function resetPartialRIssuesAllplugins($v = true)\n {\n $this->collRIssuesAllpluginsPartial = $v;\n }", "public function setCameraBlocked(?bool $value): void {\n $this->getBackingStore()->set('cameraBlocked', $value);\n }", "public function setIgnoreValidation() {\r\n\t\t$this->getOnepage()->getQuote()->getBillingAddress()->setShouldIgnoreValidation(true);\r\n\t\t$this->getOnepage()->getQuote()->getShippingAddress()->setShouldIgnoreValidation(true);\r\n\t}", "public function resetPartialRIssuesNarrationplugins($v = true)\n {\n $this->collRIssuesNarrationpluginsPartial = $v;\n }", "protected function registerPathToExcludeSubmitChanges(string $path, bool $leading = false): void\n {\n if ($leading)\n {\n $pattern = sprintf('|^%s|', preg_quote($path, '|'));\n }\n else\n {\n $pattern = sprintf('|^%s$|', preg_quote($path, '|'));\n }\n\n $this->excludeSubmitChangesPatterns[] = $pattern;\n }", "public function forceSourceOff()\n {\n $this->sendCommand(static::RCMD_SRC_FORCE_OFF);\n }", "static public function disable_cron()\n {\n wp_clear_scheduled_hook( self::$cron_name );\n }", "public function setInboundNotificationsBlocked($val)\n {\n $this->_propDict[\"inboundNotificationsBlocked\"] = $val;\n return $this;\n }", "public function setIgnoreVersionDetection(?bool $value): void {\n $this->getBackingStore()->set('ignoreVersionDetection', $value);\n }", "public function setSchedule($schedule = false) {\n if ($schedule === false) {\n return false;\n }\n\n if (!CronExpression::isValidExpression($schedule)) {\n throw new \\Exception(\"Invalid schedule, must use cronjob format\");\n }\n\n $this->schedule = CronExpression::factory($schedule);\n }", "public function setPromotions(bool $promotions):void\n {\n $this->promotions = $promotions;\n }", "public function setRemoteTrafficSelector($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->remote_traffic_selector = $arr;\n\n return $this;\n }", "protected function setHandlers($handlers)\n {\n (fn () => $this->signalHandlers = $handlers)\n ->call($this->registry);\n }", "protected function disableNativeScriptFilter()\n {\n $this->registerJs(join(\"\\n\", [\n '(function(){ // yii-resource-smart-load extension',\n ' var app = ' . RSmartLoad::JS_GLOBAL_OBJ_PRIVATE_PATH . ';',\n ' var parentFunc = app.addResource;',\n ' app.addResource = function(hash, resource, comment){',\n ' var isAlreadyLoaded = Boolean(app.getResourceByHash(hash));',\n ' if(!isAlreadyLoaded){',\n ' yii.reloadableScripts.push(resource);',\n ' }',\n ' parentFunc.apply(this, arguments);',\n ' } ',\n '})();'\n ]), self::POS_END);\n }", "public function setIgnored(bool $ignored) : self\n {\n $this->initialized['ignored'] = true;\n $this->ignored = $ignored;\n return $this;\n }", "public function setIgnoreItems(array $ignoreItems): void;", "public function setWaterSupplyThroughPipes() : void\n {\n $this->waterSuppliedThroughPipes = true;\n }", "public function setLocal(bool $local = false): self;", "public function setVolatile($volatile) {}", "function deactivate_ipc(){\n\t\t\n\t\t}", "public function testReportConcurrentAdminsToNewRelicModuleDisabledFromConfig()\n {\n /** @var \\Magento\\Framework\\Event\\Observer|\\PHPUnit_Framework_MockObject_MockObject $eventObserver */\n $eventObserver = $this->getMockBuilder(\\Magento\\Framework\\Event\\Observer::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->config->expects($this->once())\n ->method('isNewRelicEnabled')\n ->willReturn(false);\n\n $this->model->execute($eventObserver);\n }", "protected function setOverrides()\n {\n $config = $this->app['config']->get('cartalyst.sentinel');\n\n $users = $config['users']['model'];\n\n $roles = $config['roles']['model'];\n\n $persistences = $config['persistences']['model'];\n\n if (class_exists($users)) {\n if (method_exists($users, 'setRolesModel')) {\n forward_static_call_array([$users, 'setRolesModel'], [$roles]);\n }\n\n if (method_exists($users, 'setPersistencesModel')) {\n forward_static_call_array([$users, 'setPersistencesModel'], [$persistences]);\n }\n\n if (method_exists($users, 'setPermissionsClass')) {\n forward_static_call_array([$users, 'setPermissionsClass'], [$config['permissions']['class']]);\n }\n }\n\n if (class_exists($roles) && method_exists($roles, 'setUsersModel')) {\n forward_static_call_array([$roles, 'setUsersModel'], [$users]);\n }\n\n if (class_exists($persistences) && method_exists($persistences, 'setUsersModel')) {\n forward_static_call_array([$persistences, 'setUsersModel'], [$users]);\n }\n }", "public function setWhitelist(array $whitelist): void\n {\n $this->whitelist = $whitelist;\n }", "public function setIgnore($array)\n {\n $this->Ignore = $array;\n }", "function statusMessagesOff()\n\t{\n\t\t$this->bStatusMessages = false;\n\t}", "public static function setIpWhitelist($ips = []) {\n\t\tif (!is_array($ips)) {\n\t\t\t$ips = func_get_args();\n\t\t}\n\n\t\tself::instance()->ipWhitelist($ips);\n\t}", "function socket_set_nonblock($socket)\n{\n global $socketSpy;\n\n $socketSpy->socketSetNonblockWasCalledWithArg($socket);\n}", "public static function disableSyncingFor($class)\n {\n static::$syncingDisabledFor[$class] = true;\n }", "public static function disableSyncingFor($class)\n {\n static::$syncingDisabledFor[$class] = true;\n }", "public function setOverrideAllowed($overrideAllowed);", "public function setWinners($winners)\n\t{\n\t\t$this->winners = $winners;\n\t}", "public function setNoexec($ne)\n {\n $this->noexec = (boolean) $ne;\n }", "protected function setPriority() {}", "public function setMaintenanceWindowBlocked(?bool $value): void {\n $this->getBackingStore()->set('maintenanceWindowBlocked', $value);\n }", "public function getRemoteScheduler()\n {\n return $this->remoteScheduler;\n }", "public function getRemoteScheduler()\n {\n return $this->remoteScheduler;\n }", "public function setIgnore(array $value)\n {\n $this->ignored = $value;\n\n return $this;\n }", "public function setUfIgnoreList(array $ufIgnoreList): void\n\t{\n\t\t$this->ufIgnoreList = $ufIgnoreList;\n\t}", "public function ignoreCache()\n {\n $this->ignoreCache = true;\n }", "public function setGlobalPaths($paths);" ]
[ "0.69477856", "0.48181123", "0.48181123", "0.457614", "0.45135045", "0.44640344", "0.4446317", "0.4367527", "0.43238932", "0.42298776", "0.4220765", "0.4196584", "0.41918296", "0.41889003", "0.41695395", "0.41565666", "0.41542816", "0.41542816", "0.41542068", "0.41521546", "0.4147763", "0.41358018", "0.4132478", "0.4127603", "0.41111466", "0.41038755", "0.40953672", "0.40814292", "0.4038828", "0.40329674", "0.40227377", "0.4015592", "0.40111068", "0.40109462", "0.40092835", "0.40024847", "0.39951336", "0.3993836", "0.39892238", "0.39869097", "0.39822984", "0.39801723", "0.39769176", "0.39722466", "0.39714095", "0.39590943", "0.3956704", "0.39476755", "0.39390332", "0.39372602", "0.392118", "0.3916143", "0.3912388", "0.3910401", "0.3907991", "0.39074466", "0.39059836", "0.3905391", "0.3900356", "0.38852146", "0.38770732", "0.38743743", "0.38721725", "0.38674963", "0.38588747", "0.38577953", "0.38550436", "0.38544652", "0.3843329", "0.38407332", "0.383766", "0.3837524", "0.38352206", "0.38316217", "0.3830704", "0.38161933", "0.38095674", "0.3802219", "0.37950167", "0.37850213", "0.37842143", "0.37820786", "0.37811786", "0.37788785", "0.37724137", "0.37694746", "0.37625542", "0.375618", "0.375618", "0.37545434", "0.3752258", "0.37433466", "0.37413675", "0.37322694", "0.37188137", "0.37188137", "0.37175226", "0.37134776", "0.37129763", "0.37088943" ]
0.80260164
0
Add RemoteScheduler in remoteSchedulerCollection
public function addRemoteScheduler( RemoteScheduler $remoteScheduler ) { $this->remoteSchedulerCollection[] = $remoteScheduler; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRemoteScheduler($remoteScheduler)\n {\n $this->remoteScheduler = $remoteScheduler;\n\n return $this;\n }", "public function setRemoteScheduler($remoteScheduler)\n {\n $this->remoteScheduler = $remoteScheduler;\n\n return $this;\n }", "public function getRemoteScheduler()\n {\n return $this->remoteScheduler;\n }", "public function getRemoteScheduler()\n {\n return $this->remoteScheduler;\n }", "public function setScheduler() {}", "public static function addSched($sched) {\n global $login;\n //LoginDao::authenticateUserGroupId($sched->userGroupId);\n //$clientId = $sched->clientId;\n //if ($clientId) {\n // LoginDao::authenticateClientId($sched->clientId);\n //}\n $eventId = null;\n $appt = ApptEdit::from($sched, $login->userGroupId);\n if (isset($sched->schedEvent)) {\n $event = SchedEvent::from($sched->schedEvent);\n $event->save();\n $eventId = $event->schedEventId;\n $sched->schedEvent->id = $eventId;\n }\n $sched->schedEventId = $eventId;\n $appt->schedEventId = $eventId;\n $appt->save();\n $sched->id = $appt->schedId;\n if (isSet($sched->schedEvent)) \n $sched->schedEvent->maxRepeatDate = SchedDao::repeatSched($sched);\n return $sched;\n }", "public function registerSchedule($schedule)\n {\n }", "public function updateScheduler($tasks);", "public function setScheduleItems($val)\n {\n $this->_propDict[\"scheduleItems\"] = $val;\n return $this;\n }", "protected function createSchedulerUser() {}", "function cron_add_minute( $schedules ) {\r\n $schedules['everyminute'] = array( 'interval' => 60, 'display' => __( 'Once Every Minute' ) ); \r\n return $schedules; \r\n }", "function rlip_schedulding_init() {\n global $CFG, $DB;\n\n // Check whether the scheduled tasks table exists\n $dbman = $DB->get_manager();\n $table = new xmldb_table('elis_scheduled_tasks');\n if (!$dbman->table_exists($table)) {\n return;\n }\n\n // If we haven't setup a scheduled task for the block yet, do so now\n if (!$DB->record_exists('elis_scheduled_tasks', array('plugin' => 'block_rlip'))) {\n require_once($CFG->dirroot.'/elis/core/lib/tasklib.php');\n\n // Add a cron task for the RLIP block\n elis_tasks_update_definition('block_rlip');\n }\n}", "function Set_Scheduled_Payments($schedule, $structure, $module, $status, $merge=true)\n{\n\t$log = ECash::getLog('scheduling');\n\t$holidays = Fetch_Holiday_List();\n\t$pd_calc = new Pay_Date_Calc_3($holidays);\n\n\t$application_id = $structure->application_id;\n\t$transaction_type = $structure->payment_type;\n\n\t// Context is based on the type of payments the agent\n\t// set up for the customer. We use this for reporting\n\t// to determine if the payment is a collections payment, etc. \n\tswitch($transaction_type)\n\t{\n\t\tcase 'payment_arrangement':\n\t\t\t$context = 'arrangement';\n\t\t\tbreak;\n\t\tcase 'partial_payment':\n\t\t\t$context = 'partial';\n\t\t\tbreak;\n\t\tcase 'next_payment_adjustment':\n\t\tcase 'manual_payment':\n\t\t\t$context = 'manual';\n\t\t\tbreak;\n\t\tcase 'ad_hoc':\n\t\t\t$context = 'generated';\n\t\t\tbreak;\n\t}\n\t\n\tif(! $application = ECash::getApplicationById($application_id))\n\t{\n\t\tthrow new Exception(\"Cannot locate application $application_id\");\n\t}\n\n\t$graces = Get_Grace_Periods();\n\t$fees_applied = 0.0;\n\t$princ_applied = 0.0;\n\n\t$new_schedule = array();\n\n\t$base = $structure->payment_type;\n\t$num_payments = intval($structure->$base->num);\n\n\t$renewal = ECash::getFactory()->getRenewalClassByApplicationID($application_id);\n\t$balance_info = Fetch_Balance_Information($application_id);\n\n\t$balance = array(\n\t\t'principal' \t\t=> $balance_info->principal_pending,\n\t\t'fee' \t\t\t\t=> $balance_info->fee_pending,\n\t\t'service_charge' \t=> $balance_info->service_charge_pending,\n\t);\n\n\t$total_balance = array_sum($balance);\n\n\t$rules = $application->getBusinessRules();\n\t$rate_calc = $application->getRateCalculator();\n\t\n\t/**\n\t * Find the last date we're paid up till. We'll calculate from this point\n\t * up till the payment date.\n\t */\n\t$paid_to = Interest_Calculator::getInterestPaidPrincipalAndDate($schedule, FALSE, $rules);\n\t$paid_to_date = $paid_to['date'];\n\t\n\t$service_charge_type = $rules['service_charge']['svc_charge_type'];\n\t\n\tif(isset($rules['check_payment_type']))\n\t{\n\t\t$check_type = $rules['check_payment_type'];\n\t}\n\telse\n\t{\n\t\t$check_type = 'ACH';\n\t}\n\n\t$non_ach_array = array('adjustment_internal', 'credit_card', 'moneygram', 'money_order', 'western_union');\n \tif($check_type != 'ACH')\n {\n\t\t$non_ach_array[] = 'personal_check';\n }\n\n\tfor ($i = 0; $i < $num_payments; $i++)\n\t{\n\t\t$payment = $structure->$base->rows[$i];\n\t\t$payment_amount = floatval($payment->actual_amount);\n\t\t$due_date = date(\"Y-m-d\", strtotime($payment->date));\n\t\t$payment_type = $payment->payment_type;\n\n\t\t//Set the interest amount's initial value, grab it from the row.\n\t\t$interest_amount = floatval($payment->interest_amount);\n\t\t\n\t\t//Start building comments\n\t\t$agent = ECash::getAgent();\n\t\t$comment = \"[Payment created by \" . $agent->getFirstLastName() . \"]\";\t\t\n\t\tif (($payment->desc))\n\t\t{\n\t\t\t$comment .= \" \" . $payment->desc;\n\t\t}\n\n\t\t/**\n\t\t * If the payment type is non-ach, we use the same day as the due date.\n\t\t */\n\t\tif (in_array($payment_type, $non_ach_array))\n\t\t{\n\t\t\t$action_date = $due_date;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/**\n\t\t\t * We should already be doing input validation on the front-end to prevent due dates \n\t\t\t * for today or in the past, but just in case we'll try and handle it here.\n\t\t\t */\n\t\t\tif(strtotime($due_date) > strtotime(date('Y-m-d')) \n\t\t\t&& strtotime($pd_calc->Get_Last_Business_Day($due_date)) >= strtotime(date('Y-m-d')))\n\t\t\t{\n\t\t\t\t$action_date = $pd_calc->Get_Last_Business_Day($due_date);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$action_date = date('Y-m-d');\n\t\t\t}\n\t\t}\n\n\t\t//Do stuff that's specific to a service charge type\n\t\tswitch ($service_charge_type)\n\t\t{\n\t\t\tcase 'Daily':\n\t\t\t\t$interest_amount = $rate_calc->calculateCharge($balance['principal'], $paid_to_date, $due_date);\n\n\t\t\t\t// Don't accrue past default date\n\t\t\t\tif ($rules['loan_type_model'] == 'CSO')\n\t\t\t\t{\n\t\t\t\t\tif ($renewal->hasDefaulted($application_id))\n\t\t\t\t\t\t$interest_amount = 0.00;\n\t\t\t\t}\n\n\t\t\t\t//[#47687] dont use $structure->payment->interest_range(s) from the submit, use the calculated paid to interest date\n\t\t\t\t//If its not a manual payment, or the date is in the future, let's add an interest comment\n\t\t\t\tif ($interest_amount > 0 && ($base != 'manual_payment' || (strtotime($paid_to_date) < strtotime($due_date))))\n\t\t\t\t{\n\t\t\t\t\t$days_diff = Date_Util_1::dateDiff(strtotime($paid_to_date), strtotime($due_date));\n\t\t\t\t\t$comment .= \" [Service Charge includes Interest of $interest_amount for $days_diff days ({$paid_to_date} thru {$due_date})]\";\n\t\t\t\t\t$intcomment = \"Interest accrued for $days_diff days ({$paid_to_date} thru {$due_date})\";\n\t\t\t\t}\n\t\t\t\t//log the current balances before we modify the balances.\n\t\t\t\t$log->Write(\"Balances - P: {$balance['principal']} F: {$balance['fee']} INT: {$interest_amount} SC: {$balance['service_charge']} | AMT: $payment_amount\");\n\n\t\t\t\t//add interest to what is owed if the date is in the future Subtract amount from total balance\n\t\t\t\tif(((strtotime($paid_to_date) < strtotime($due_date))))\n\t\t\t\t{\n\t\t\t\t\t$balance['service_charge'] = bcadd($balance['service_charge'], $interest_amount, 2);\n\t\t\t\t\t$total_balance = bcadd($total_balance, $interest_amount, 2);\n\t\t\t\t\t$total_balance = bcsub($total_balance, $payment_amount, 2);\n\t\t\t\t}\n\n\t\t\t\t//allocate amounts! Amount allocation comes AFTER the adjustments are made\n\t\t\t\t$amounts = AmountAllocationCalculator::generateAmountsFromBalance(-$payment_amount, $balance);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Fixed':\n\t\t\tdefault:\n\t\t\t\t//build fixed interest comments\n\t\t\t\t$comment .= \"[Fixed Service Charge]\";\n\t\t\t\t$intcomment = \"[Fixed Interest Charge]\";\n\n\t\t\t\t//Log the current balances before we modify the interest.\n\t\t\t\t$log->Write(\"Balances - P: {$balance['principal']} F: {$balance['fee']} INT: {$interest_amount} SC: {$balance['service_charge']} | AMT: $payment_amount\");\n\n\t\t\t\t//allocate amounts! We're allocating amounts BEFORE the adjustments are made!\n\t\t\t\t$amounts = AmountAllocationCalculator::generateAmountsFromBalance(-$payment_amount, $balance);\n\n\t\t\t\t//We're not assessing a service charge on applications with fixed interest! [#31223]\n\t\t\t\t$interest_amount = 0;\n\t\t\t\t$log->Write(\"Fixed interest loan. Not assessing any interest\");\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (count($amounts))\n\t\t{\n\t\t\tif($base == 'manual_payment')\n\t\t\t{\n\t\t\t\t$effects_princ = false;\n\t\t\t\tforeach($amounts as $amount_balance)\n\t\t\t\t{\n\t\t\t\t\tif ($amount_balance->event_amount_type == 'principal' && abs($amount_balance->amount) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$effects_princ = true;\n\t\t\t\t\t\t$effected_princ_amount = abs($amount_balance->amount);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($interest_amount > 0 && ( $base != 'manual_payment' || (strtotime($paid_to_date) < strtotime($due_date))))\n\t\t\t{\n\t\t\t\t//Check and see if the date is the date of the next service charge\n\t\t\t\t//If it is, don't register a new charge. Complete the current one [Agean #11047]\n\t\t\t\t//If payment arrangments are redone for the same day exclude payment arrangments from this. I hate you so much, Will [#17906]\n\t\t\t\tif ($base != 'payment_arrangement' && $status->next_service_charge_date != 'N/A' && strtotime($status->next_service_charge_date) == strtotime($due_date) && strtotime($due_date) <= time())\n\t\t\t\t{\n\t\t\t\t\t//Complete the current service charge\n\t\t\t\t\t$trids = Record_Current_Scheduled_Events_To_Register($due_date, $application_id, $status->next_service_charge_id);\n\t\t\t\t\tforeach ($trids as $trid)\n\t\t\t\t\t{\n\t\t\t\t\t\tPost_Transaction($application_id, $trid);\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$log->Write( __FUNCTION__ . \" :: Adding Interest: \".$interest_amount);\n\t\t\t\t\t$intamounts = Array(Event_Amount::MakeEventAmount('service_charge', abs($interest_amount)));\n\t\t\t\t\t$event = Schedule_Event::MakeEvent($action_date, $action_date, $intamounts, 'assess_service_chg', $intcomment, 'scheduled');\n\t\t\t\t\t$new_schedule[] = $event;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$log->Write( __FUNCTION__ . \" :: Adding with payment event amounts: \".print_r($amounts, true));\n\t\t\t//non ach\n\t\t\tif (in_array($payment_type, $non_ach_array))\n\t\t\t{\n\t\t\t\t$event = Schedule_Event::MakeEvent($action_date, $due_date, $amounts, $payment_type, $comment, 'scheduled', $context);\n\t\t\t}\n\t\t\telse //ach\n\t\t\t{\n\t\t\t\t$event = Schedule_Event::MakeEvent($action_date, $due_date, $amounts, $payment_type, $comment, 'scheduled', $context);\n\t\t\t}\n\t\t\t$new_schedule[] = $event;\n\t\t}\n\n\t\tif(strtotime($due_date) > strtotime($last_payment)) $last_payment = $due_date;\n\n\t\t/**\n\t\t * Update the Paid to Date - This is where we start to calculate interest from\n\t\t * when there is more than one payment and we're using Daily Interest\t\t \n\t\t */ \n \t\t$paid_to_date = $due_date;\n\t}\n\n\tif (isset($structure->$base->discount_amount) &&\n\t\t(floatval($structure->$base->discount_amount) > 0.0))\n\t{\n\t\tif (($structure->$base->discount_desc))\n\t\t{\n\t\t\t$comment = $structure->$base->discount_desc;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$comment = \"Discount adjustment\";\n\t\t}\n\n\t\t$amounts = AmountAllocationCalculator::generateAmountsFromBalance($structure->$base->discount_amount, $balance);\n\t\t$new_schedule[] = Schedule_Event::MakeEvent($last_payment, $last_payment, $amounts, 'adjustment_internal', $comment, 'scheduled', 'arrangement');\n\t}\n\n\tif ($merge)\n\t{\n\t\t$new_schedule = Merge_Schedules($schedule, $new_schedule);\n\t}\n\n\treturn $new_schedule;\n}", "public function cron_add_pull_time_interval( $schedules ) {\n\t\t$schedules['syn_pull_time_interval'] = array(\n\t\t\t'interval' => intval( $this->push_syndicate_settings['pull_time_interval'] ),\n\t\t\t'display' => __( 'Pull Time Interval', 'push-syndication' )\n\t\t);\n\n\t\treturn $schedules;\n\n\t}", "public function addJobschedule($params)\n {\n $batch_date = $this->getDate();\n\n $request = [\n 'id' => $params['scheduleId'],\n 'jobSpecification' => [\n 'priority' => 0,\n 'jobManagerTask' => [\n 'id' => $params['jobId'],\n 'commandLine' => $params['commandLine'],\n 'constraints' => [\n 'retentionTime' => 'PT2H'\n ],\n 'userIdentity' => [\n 'autoUser' => [\n 'scope' => 'task',\n 'elevationLevel' => 'admin',\n ],\n ]\n ],\n 'poolInfo' => [\n 'poolId' => $params['poolId'],\n ],\n ],\n 'schedule' => [\n 'recurrenceInterval' => $params['interval']\n ],\n ];\n\n $request = json_encode($request);\n $content_len = strlen($request);\n\n $data = sprintf(\"POST\\n\\n\\n%d\\n\\napplication/json;odata=minimalmetadata\\n%s\\n\\n\\n\\n\\n\\n/%s/jobschedules\\napi-version:%s\\ntimeout:20\",\n $content_len,\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 ->withHeader('Content-Type: application/json;odata=minimalmetadata')\n ->withHeader('Content-Length: ' . $content_len)\n ->withData($request)\n ->returnResponseObject()\n ->post();\n dump($response);\n// Log::debug(print_r($response, true));\n\n if ($response->status == 201) {\n return true;\n } else {\n return false;\n }\n }", "protected function getCron_TaskCollectionService()\n {\n $this->services['cron.task_collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('cron.task.core.prune_all_forums');\n $instance->add('cron.task.core.prune_forum');\n $instance->add('cron.task.core.prune_shadow_topics');\n $instance->add('cron.task.core.prune_notifications');\n $instance->add('cron.task.core.queue');\n $instance->add('cron.task.core.tidy_cache');\n $instance->add('cron.task.core.tidy_database');\n $instance->add('cron.task.core.tidy_plupload');\n $instance->add('cron.task.core.tidy_search');\n $instance->add('cron.task.core.tidy_sessions');\n $instance->add('cron.task.core.tidy_warnings');\n $instance->add('cron.task.text_reparser.pm_text');\n $instance->add('cron.task.text_reparser.poll_option');\n $instance->add('cron.task.text_reparser.poll_title');\n $instance->add('cron.task.text_reparser.post_text');\n $instance->add('cron.task.text_reparser.user_signature');\n $instance->add('cron.task.core.update_hashes');\n $instance->add('phpbb.viglink.cron.task.viglink');\n\n return $instance;\n }", "public function cron_add_schedules( $schedules ) {\n $schedules['md5_hash_weekly'] = array(\n 'interval' => 604800,\n 'display' => __( 'Once Weekly' )\n );\n return $schedules;\n }", "function add_to_cron( $newsletter_id, $send_id ) {\r\n global $wpdb;\r\n\r\n $result = $wpdb->query( $wpdb->prepare( \"UPDATE {$this->tb_prefix}enewsletter_send_members SET status = 'by_cron' WHERE send_id = %d AND status = 'waiting_send'\", $send_id ) );\r\n\r\n $count_send_members = $this->get_count_send_members( $send_id, 'by_cron' );\r\n\r\n wp_redirect( add_query_arg( array( 'page' => $_REQUEST['page'], 'newsletter_action' => 'send_newsletter', 'newsletter_id' => $newsletter_id, 'updated' => 'true', 'dmsg' => urlencode( $count_send_members . ' ' . __( 'Members are added to CRON list', 'email-newsletter' ) ) ), 'admin.php' ) );\r\n\r\n exit;\r\n }", "function emp_cron_schedules($schedules){\n\t$schedules['em_minute'] = array(\n\t\t'interval' => 60,\n\t\t'display' => 'Every Minute'\n\t);\n\treturn $schedules;\n}", "function rlip_schedule_add_job($data) {\n global $DB, $USER;\n\n //calculate the next run time, for use in both records\n $nextruntime = (int)(time() + rlip_schedule_period_minutes($data['period']) * 60);\n\n $userid = isset($data['userid']) ? $data['userid'] : $USER->id;\n $data['timemodified'] = time();\n if (isset($data['submitbutton'])) { // formslib!\n unset($data['submitbutton']);\n }\n $ipjob = new stdClass;\n $ipjob->userid = $userid;\n $ipjob->plugin = $data['plugin'];\n $ipjob->config = serialize($data);\n\n //store as a redundant copy in order to prevent elis task strangeness\n $ipjob->nextruntime = $nextruntime;\n\n if (!empty($data['id'])) {\n $ipjob->id = $data['id'];\n $DB->update_record(RLIP_SCHEDULE_TABLE, $ipjob);\n // Must delete any existing task records for the old schedule\n $taskname = 'ipjob_'. $ipjob->id;\n $DB->delete_records('elis_scheduled_tasks', array('taskname' => $taskname));\n } else {\n $ipjob->id = $DB->insert_record(RLIP_SCHEDULE_TABLE, $ipjob);\n }\n\n $task = new stdClass;\n $task->plugin = 'block_rlip';\n $task->taskname = 'ipjob_'. $ipjob->id;\n $task->callfile = '/blocks/rlip/lib.php';\n $task->callfunction = serialize('run_ipjob'); // TBD\n $task->lastruntime = 0;\n $task->blocking = 0;\n $task->minute = 0;\n $task->hour = 0;\n $task->day = '*';\n $task->month = '*';\n $task->dayofweek = '*';\n $task->timezone = 0;\n $task->enddate = null;\n $task->runsremaining = null;\n $task->nextruntime = $nextruntime;\n return $DB->insert_record('elis_scheduled_tasks', $task);\n}", "private function createSchedule()\n {\n $days = DisplayScheduleDay::singleton()->dbObject('Day')->enumValues();\n foreach ($days as $day) {\n $scheduleDay = DisplayScheduleDay::create();\n $scheduleDay->Day = $day;\n $this->Schedule()->add($scheduleDay);\n }\n }", "public function initialteRedmineCronJob()\r\n { \r\n \r\n //GET All projects \r\n $allProjects = $this->client->api('project')->all(array('limit' => 100,'offset' => 0));\r\n foreach ($allProjects['projects'] as $project)\r\n { \r\n \t$this->addProject($project);\r\n }\r\n //GET All issues \r\n $allIssue=$this->client->api('issue')->all();\r\n if($allIssue['total_count'] >= 0)\r\n {\r\n for ($offset=0; $offset <=$allIssue['total_count'] ; $offset+=$allIssue['limit']) \r\n { \r\n \r\n $issueList=$this->client->api('issue')->all(array(\r\n 'limit' => $allIssue['limit'],\r\n 'offset' =>$offset)); \r\n foreach ($issueList['issues'] as $singleIssue)\r\n {\r\n $this->addIssue($singleIssue);\r\n }\r\n }\r\n }\r\n \r\n \r\n // //Get All Timelog Entries \r\n $allTimeEntry=$this->client->api('time_entry')->all();\r\n if($allTimeEntry['total_count'] >= 0)\r\n {\r\n for ($offset=0; $offset <=$allTimeEntry['total_count'] ; $offset+=$allTimeEntry['limit']) \r\n { \r\n \r\n $timeEntryList=$this->client->api('time_entry')->all(array('limit' => $allTimeEntry['limit'],'offset' =>$offset)); \r\n foreach ($timeEntryList['time_entries'] as $singleTimeLog)\r\n {\r\n $this->addTimeEntry($singleTimeLog);\r\n }\r\n }\r\n }\r\n\r\n \r\n }", "function postSchedule(){\r\n\t\t// and update the scheduler on the RelayQuery\r\n\t return $this-> scheduler-> request_complete($this->channel->responseHeaders() ) ; \r\n\t}", "public function getSchedules()\n {\n return $this->hasMany(Schedule::className(), ['lesson_plan_id' => 'lesson_plan_id']);\n }", "public function addSchedule()\n {\n $errorResponse = array();\n $errorResponse['type'] = 'error';\n $errorResponse['title'] = 'Error!';\n\n $inputData = array(\n 'movie' => $this->getPostParam('movie'),\n 'date' => $this->getPostParam('date'),\n 'time' => $this->getPostParam('time'),\n 'room' => $this->getPostParam('room'),\n 'price' => $this->getPostParam('price'),\n );\n\n $errors = $this->validateSchedule($inputData);\n\n if (!empty($errors)) {\n $errorResponse['message'] = $errors;\n\n return $this->application->json($errorResponse);\n }\n\n try {\n $successResponse = array();\n $successResponse['type'] = 'success';\n $successResponse['title'] = 'Added!';\n\n $roomRepository = $this->getRepository('room');\n $room = $roomRepository->loadByProperties(['id' => $inputData['room']]);\n\n $properties = array(\n 'movieId' => (int)$inputData['movie'],\n 'roomId' => (int)$inputData['room'],\n 'date' => $inputData['date'],\n 'time' => $inputData['time'],\n 'ticketPrice' => floatval($inputData['price']),\n 'remainingSeats' => (int)$room[0]->getCapacity(),\n );\n\n $time = explode(':', $properties['time']);\n $properties['time'] = (int)$time[0];\n\n $schedule = $this->getEntity('schedule', $properties);\n $scheduleRepository = $this->getRepository('schedule');\n\n $scheduleRepository->save($schedule);\n\n $successResponse['message'] = 'Movie successfully scheduled';\n\n return $this->application->json($successResponse);\n } catch (\\Exception $ex) {\n $errorResponse['message']\n = 'We\\'re sorry, something went terribly wrong while trying to schedule movie. Please try again later.';\n\n return $this->application->json($errorResponse);\n }\n }", "public function testOrgApacheSlingCommonsSchedulerImplQuartzScheduler()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.commons.scheduler.impl.QuartzScheduler';\n\n $crawler = $client->request('POST', $path);\n }", "function addCronTask()\n{\n require_once __DIR__.\"/models/SchedulesModel.php\";\n require_once __DIR__.\"/models/LogModel.php\";\n\n // Emojione client\n $Emojione = new \\Emojione\\Client(new \\Emojione\\Ruleset());\n\n\n // Get auto repost schedules\n $Schedules = new SchedulesModel;\n $Schedules->where(\"is_active\", \"=\", 1)\n ->where(\"schedule_date\", \"<=\", date(\"Y-m-d H:i:s\"))\n ->where(\"end_date\", \">=\", date(\"Y-m-d H:i:s\"))\n ->orderBy(\"last_action_date\", \"ASC\")\n ->setPageSize(5) // required to prevent server overload\n ->setPage(1)\n ->fetchData();\n\n if ($Schedules->getTotalCount() < 1) {\n // There is not any active schedule\n return false;\n }\n\n // Settings\n $settings = namespace\\settings();\n\n // Random delays between actions\n $random_delay = 0;\n if ($settings->get(\"data.random_delay\")) {\n $random_delay = rand(0, 3600); // up to an hour\n }\n\n // Speeds (action count per day)\n $default_speeds = [\n \"very_slow\" => 1,\n \"slow\" => 2,\n \"medium\" => 3,\n \"fast\" => 4,\n \"very_fast\" => 5,\n ];\n $speeds = $settings->get(\"data.speeds\");\n if (empty($speeds)) {\n $speeds = [];\n } else {\n $speeds = json_decode(json_encode($speeds), true);\n }\n $speeds = array_merge($default_speeds, $speeds);\n\n\n $as = [__DIR__.\"/models/ScheduleModel.php\", __NAMESPACE__.\"\\ScheduleModel\"];\n foreach ($Schedules->getDataAs($as) as $sc) {\n $Log = new LogModel;\n $Account = \\Controller::model(\"Account\", $sc->get(\"account_id\"));\n $User = \\Controller::model(\"User\", $sc->get(\"user_id\"));\n\n // Set default values for the log (not save yet)...\n $Log->set(\"user_id\", $User->get(\"id\"))\n ->set(\"account_id\", $Account->get(\"id\"))\n ->set(\"status\", \"error\");\n\n // Check the account\n if (!$Account->isAvailable() || $Account->get(\"login_required\")) {\n // Account is either removed (unexected, external factors)\n // Or login reqiured for this account\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"Re-login is required for the account.\")\n ->save();\n continue;\n }\n\n // Check the user\n if (!$User->isAvailable() || !$User->get(\"is_active\") || $User->isExpired()) {\n // User is not valid\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"User account is either disabled or expired.\")\n ->save();\n continue;\n }\n\n if ($User->get(\"id\") != $Account->get(\"user_id\")) {\n // Unexpected, data modified by external factors\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n continue;\n }\n\n // Check user access to the module\n $user_modules = $User->get(\"settings.modules\");\n if (!is_array($user_modules) || !in_array(IDNAME, $user_modules)) {\n // Module is not accessible to this user\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"Module is not accessible to your account.\")\n ->save();\n continue;\n }\n\n // Calculate next schedule datetime...\n if (isset($speeds[$sc->get(\"speed\")]) && (int)$speeds[$sc->get(\"speed\")] > 0) {\n $speed = (int)$speeds[$sc->get(\"speed\")];\n $delta = round(86400/$speed) + $random_delay;\n } else {\n $delta = rand(1200, 21600); // 20 min - 6 hours\n }\n\n $next_schedule = date(\"Y-m-d H:i:s\", time() + $delta);\n if ($sc->get(\"daily_pause\")) {\n $pause_from = date(\"Y-m-d\").\" \".$sc->get(\"daily_pause_from\");\n $pause_to = date(\"Y-m-d\").\" \".$sc->get(\"daily_pause_to\");\n if ($pause_to <= $pause_from) {\n // next day\n $pause_to = date(\"Y-m-d\", time() + 86400).\" \".$sc->get(\"daily_pause_to\");\n }\n\n if ($next_schedule > $pause_to) {\n // Today's pause interval is over\n $pause_from = date(\"Y-m-d H:i:s\", strtotime($pause_from) + 86400);\n $pause_to = date(\"Y-m-d H:i:s\", strtotime($pause_to) + 86400);\n }\n\n if ($next_schedule >= $pause_from && $next_schedule <= $pause_to) {\n $next_schedule = $pause_to;\n }\n }\n $sc->set(\"schedule_date\", $next_schedule)\n ->set(\"last_action_date\", date(\"Y-m-d H:i:s\"))\n ->save();\n\n\n // Parse targets\n $targets = @json_decode($sc->get(\"target\"));\n if (is_null($targets)) {\n // Unexpected, data modified by external factors or empty targets\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n continue;\n }\n\n if (count($targets) < 1) {\n // Couldn't find any target for the feed\n // Log data\n $Log->set(\"data.error.msg\", \"Couldn't find any target to search for the feed.\")\n ->save();\n return false;\n }\n\n // Select random target from the defined target collection\n $i = rand(0, count($targets) - 1);\n $target = $targets[$i];\n\n if (empty($target->type) || empty($target->id) ||\n !in_array($target->type, [\"hashtag\", \"location\", \"people\"])) \n {\n // Unexpected invalid target, \n // data modified by external factors\n $sc->set(\"is_active\", 0)->save();\n continue; \n }\n\n $Log->set(\"data.trigger\", $target);\n\n\n // Login into the account\n try {\n $Instagram = \\InstagramController::login($Account);\n } catch (\\Exception $e) {\n // Couldn't login into the account\n $Account->refresh();\n\n // Log data\n if ($Account->get(\"login_required\")) {\n $sc->set(\"is_active\", 0)->save();\n $Log->set(\"data.error.msg\", \"Activity has been stopped\");\n } else {\n $Log->set(\"data.error.msg\", \"Action re-scheduled\");\n }\n $Log->set(\"data.error.details\", $e->getMessage())\n ->save();\n\n continue;\n }\n\n\n // Logged in successfully\n $permissions = $User->get(\"settings.post_types\");\n $video_processing = isVideoExtenstionsLoaded() ? true : false;\n\n $acceptable_media_types = [];\n if (!empty($permissions->timeline_photo)) {\n $acceptable_media_types[] = \"1\"; // Photo\n }\n\n if (!empty($permissions->timeline_video)) {\n $acceptable_media_types[] = \"2\"; // Video\n }\n\n if (!empty($permissions->album_photo) || !empty($permissions->album_video)) {\n $acceptable_media_types[] = \"8\"; // Album\n }\n\n\n // Generate a random rank token.\n $rank_token = \\InstagramAPI\\Signatures::generateUUID();\n\n if ($target->type == \"hashtag\") {\n $hashtag = str_replace(\"#\", \"\", trim($target->id));\n if (!$hashtag) {\n continue;\n }\n\n try {\n $feed = $Instagram->hashtag->getFeed(\n $hashtag,\n $rank_token);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the hashtag\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = array_merge($feed->getRankedItems(), $feed->getItems());\n } else if ($target->type == \"location\") {\n try {\n $feed = $Instagram->location->getFeed(\n $target->id, \n $rank_token);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the location id\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = $feed->getItems();\n } else if ($target->type == \"people\") {\n try {\n $feed = $Instagram->timeline->getUserFeed($target->id);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the user id\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = $feed->getItems();\n }\n\n\n // Found feed item to repost\n $feed_item = null;\n\n // Shuffe items\n shuffle($items);\n\n // Iterate through the items to find a proper item to repost\n foreach ($items as $item) {\n if (!$item->getId()) {\n // Item is not valid\n continue;\n }\n\n if (!in_array($item->getMediaType(), $acceptable_media_types)) {\n // User has not got a permission to post this kind of the item\n continue;\n }\n\n if ($item->getMediaType() == 2 && !$video_processing) {\n // Video processing is not possible now,\n // FFMPEG is not configured\n continue;\n }\n\n if ($item->getMediaType() == 8) {\n $medias = $item->getCarouselMedia();\n $is_valid = true;\n foreach ($medias as $media) {\n if ($media->getMediaType() == 1 && empty($permissions->album_photo)) {\n // User has not got a permission for photo albums\n $is_valid = false;\n break; \n }\n\n if ($media->getMediaType() == 2 && empty($permissions->album_video)) {\n // User has not got a permission for video albums\n $is_valid = false;\n break; \n }\n\n if ($media->getMediaType() == 2 && !$video_processing) {\n // Video processing is not possible now,\n // FFMPEG is not configured\n $is_valid = false;\n break; \n }\n }\n\n if (!$is_valid) {\n // User can not re-post this album post because of the permission \n // (or absence of the ffmpeg video processing)\n continue;\n }\n }\n\n\n $_log = new LogModel([\n \"user_id\" => $User->get(\"id\"),\n \"account_id\" => $Account->get(\"id\"),\n \"original_media_code\" => $item->getCode(),\n \"status\" => \"success\"\n ]);\n\n if ($_log->isAvailable()) {\n // Already reposted this feed\n continue;\n }\n\n // Found the feed item to repost\n $feed_item = $item;\n break;\n }\n\n\n if (empty($feed_item)) {\n $Log->set(\"data.error.msg\", \"Couldn't find the new feed item to repost\")\n ->save();\n continue;\n }\n\n\n // Download the media\n $media = [];\n if ($feed_item->getMediaType() == 1 && $feed_item->getImageVersions2()->getCandidates()[0]->getUrl()) {\n $media[] = $feed_item->getImageVersions2()->getCandidates()[0]->getUrl();\n } else if ($feed_item->getMediaType() == 2 && $feed_item->getVideoVersions()[0]->getUrl()) {\n $media[] = $feed_item->getVideoVersions()[0]->getUrl();\n } else if ($feed_item->getMediaType() == 8) {\n foreach ($feed_item->getCarouselMedia() as $m) {\n if ($m->getMediaType() == 1 && $m->getImageVersions2()->getCandidates()[0]->getUrl()) {\n $media[] = $m->getImageVersions2()->getCandidates()[0]->getUrl();\n\n } else if ($m->getMediaType() == 2 && $m->getVideoVersions()[0]->getUrl()) {\n $media[] = $m->getVideoVersions()[0]->getUrl();\n }\n }\n }\n\n\n $downloaded_media = [];\n foreach ($media as $m) {\n $url_parts = parse_url($m);\n if (empty($url_parts['path'])) {\n continue;\n }\n\n $ext = strtolower(pathinfo($url_parts['path'], PATHINFO_EXTENSION));\n $filename = uniqid(readableRandomString(8).\"-\").\".\".$ext;\n $downres = file_put_contents(TEMP_PATH . \"/\". $filename, file_get_contents($m));\n if ($downres) {\n $downloaded_media[] = $filename;\n }\n }\n\n if (empty($downloaded_media)) {\n $Log->set(\"data.error.msg\", \"Couldn't download the media of the selected post\")\n ->save();\n continue;\n }\n\n $original_caption = \"\";\n if ($feed_item->getCaption()->getText()) {\n $original_caption = $feed_item->getCaption()->getText();\n }\n\n $caption = $sc->get(\"caption\");\n $variables = [\n \"{{caption}}\" => $original_caption,\n \"{{username}}\" => \"@\".$feed_item->getUser()->getUsername(),\n \"{{full_name}}\" => $feed_item->getUser()->getFullName() ?\n $feed_item->getUser()->getFullName() :\n \"@\".$feed_item->getUser()->getUsername()\n ];\n $caption = str_replace(\n array_keys($variables), \n array_values($variables), \n $caption);\n\n $caption = $Emojione->shortnameToUnicode($caption);\n if ($User->get(\"settings.spintax\")) {\n $caption = \\Spintax::process($caption);\n }\n\n $caption = mb_substr($caption, 0, 2200);\n\n\n\n // Try to repost\n try {\n if (count($downloaded_media) > 1) {\n $album_media = [];\n\n foreach ($downloaded_media as $m) {\n $ext = strtolower(pathinfo($m, PATHINFO_EXTENSION));\n\n $album_media[] = [\n \"type\" => in_array($ext, [\"mp4\"]) ? \"video\" : \"photo\",\n \"file\" => TEMP_PATH.\"/\".$m\n ];\n }\n\n $res = $Instagram->timeline->uploadAlbum($album_media, ['caption' => $caption]);\n } else {\n $m = $downloaded_media[0];\n $ext = strtolower(pathinfo($m, PATHINFO_EXTENSION));\n if (in_array($ext, [\"mp4\"])) {\n $res = $Instagram->timeline->uploadVideo(TEMP_PATH.\"/\".$m, [\"caption\" => $caption]);\n } else {\n $res = $Instagram->timeline->uploadPhoto(TEMP_PATH.\"/\".$m, [\"caption\" => $caption]);\n }\n }\n } catch (\\Exception $e) {\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", __(\"An error occured during reposting the media.\"))\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n if (!$res->isOk()) {\n $Log->set(\"data.error.msg\", __(\"An error occured during reposting the media.\"))\n ->set(\"data.error.details\", __(\"Instagram didn't return the expected result.\"))\n ->save();\n continue;\n }\n\n\n // Reposted media succesfully\n // Save log\n $thumb = null;\n if (null !== $feed_item->getImageVersions2()) {\n $thumb = $feed_item->getImageVersions2()->getCandidates()[0]->getUrl();\n } else if (null !== $feed_item->getCarouselMedia()) {\n $thumb = $feed_item->getCarouselMedia()[0]->getImageVersions2()->getCandidates()[0]->getUrl();\n }\n\n\n $Log->set(\"data.grabbed\", [\n \"media_id\" => $feed_item->getId(),\n \"media_code\" => $feed_item->getCode(),\n \"media_type\" => $feed_item->getMediaType(),\n \"media_thumb\" => $thumb,\n \"user\" => [\n \"pk\" => $feed_item->getUser()->getPk(),\n \"username\" => $feed_item->getUser()->getUsername(),\n \"full_name\" => $feed_item->getUser()->getFullName()\n ]\n ]);\n\n $Log->set(\"data.reposted\", [\n \"upload_id\" => $res->getUploadId(),\n \"media_pk\" => $res->getMedia()->getPk(),\n \"media_id\" => $res->getMedia()->getId(),\n \"media_code\" => $res->getMedia()->getCode()\n ]);\n \n $Log->set(\"status\", \"success\")\n ->set(\"original_media_code\", $feed_item->getCode());\n \n\n if ($sc->get(\"remove_delay\") > 0) {\n $Log->set(\"is_removable\", 1)\n ->set(\"remove_scheduled\", date(\"Y-m-d H:i:s\", time() + $sc->get(\"remove_delay\")));\n }\n\n $Log->save();\n\n // Remove downloaded media files\n foreach ($downloaded_media as $m) {\n @unlink(TEMP_PATH.\"/\".$m);\n }\n }\n}", "public function syncFromApi($cron) \n { \n \n $syncMode = (string)Mage::getStoreConfig('payment/sagepaysuite/sync_mode');\n \n if($syncMode === 'async') {\n $transactions = Mage::getModel('sagepaysuite2/sagepaysuite_transaction')\n ->getCollection()\n ->getApproved();\n \n $transactions->addFieldToFilter('created_at', array('neq' => '0000-00-00 00:00:00')); \n \n $ts = gmdate(\"Y-m-d H:i:s\");\n $transactions->addFieldToFilter('created_at', array(\"from\" => gmdate(\"Y-m-d H:i:s\", strtotime(\"-1 day\")), \"to\" => $ts));\n \n if($transactions->getSize()) {\n foreach($transactions as $trn) {\n $trn->updateFromApi();\n }\n }\n }\n \n return $this;\n }", "public function schedules()\n {\n return $this->hasMany('App\\SchedulesWorked', 'customer_id');\n }", "private function retrieveSchedule($team_id, $start_date, $end_date)\n {\n if (isset($team_id, $start_date, $end_date)) {\n try {\n $start_date = new Carbon($start_date);\n $end_date = new Carbon($end_date);\n $schedule = \\Roster::where('date_start', '=', $start_date->toDateString())->where('team_id', '=', $team_id)->first();\n if (!isset($schedule)) {\n $schedule = new \\Roster;\n $schedule->team_id = $team_id;\n $schedule->date_start = $start_date->toDateString();\n $schedule->date_ending = $end_date->toDateString();\n $schedule->roster_stage = 'pending';\n $schedule->save();\n }\n $schedule = \\Roster::where('date_start', '=', $start_date->toDateString())->where('team_id', '=', $team_id)\n ->with('rosteredshift.task')->with(array('team.user' => function ($query) use ($start_date, $end_date) {\n $query->where('user.active', '=', true)\n ->with(array('availspecific' => function ($query) use ($start_date, $end_date) {\n $query->where(function ($query) use ($start_date, $end_date) {\n $query->orWhere(function ($query) use ($start_date, $end_date) {\n $query->where('start_date', '<=', $start_date->toDateString())\n ->where('end_date', '>=', $start_date->toDateString());\n })->orWhere(function ($query) use ($start_date, $end_date) {\n $query->where('start_date', '>=', $start_date->toDateString())\n ->where('start_date', '<=', $end_date->toDateString());\n })->orWhere(function ($query) use ($start_date, $end_date) {\n $query->where('start_date', '<=', $start_date->toDateString())\n ->where('end_date', '>=', $end_date->toDateString());\n })->orWhere(function ($query) use ($start_date, $end_date) {\n $query->where('start_date', '>=', $start_date->toDateString())\n ->where('end_date', '<=', $end_date->toDateString());\n });\n })\n ->where('user_avail_spec.authorized', '=', 'approved');\n }))\n ->with('availgeneral');\n }))->first();\n } catch (\\Exception $e) {\n return Helper::jsonLoader(EXCEPTION, array(\"message\" => $e->getMessage(), \"line\" => $e->getLine(), \"file\" => $e->getFile()));\n }\n foreach ($schedule->rosteredshift as $key => $shift) {\n if ($shift->rostered_start_time !== '0000-00-00 00:00:00') {\n $temp = Carbon::parse($shift->rostered_start_time)->timezone(Helper::organisationTimezone())->toDateTimeString();\n $schedule->rosteredshift[$key]->rostered_start_time = $temp;\n }\n if ($shift->rostered_end_time !== '0000-00-00 00:00:00') {\n $temp = Carbon::parse($shift->rostered_end_time)->timezone(Helper::organisationTimezone())->toDateTimeString();\n $schedule->rosteredshift[$key]->rostered_end_time = $temp;\n }\n }\n $schedule = $schedule->toArray();\n $schedule['timezone'] = Carbon::now(Helper::organisationTimezone())->offset / 60;\n return $schedule;\n } else {\n return Helper::jsonLoader(INCORRECT_DATA);\n }\n }", "public function getIgnoreRemoteSchedulers()\n {\n return $this->ignoreRemoteSchedulers;\n }", "public function add_schedules( $schedules = array() ) {\r\n\t\t$schedules['weekly'] = array(\r\n\t\t\t'interval' => 604800,\r\n\t\t\t'display' => __( 'Once Weekly', 'instagram-feed' )\r\n\t\t);\r\n\t\treturn $schedules;\r\n\t}", "public function setAllowCustomAssignmentSchedule($val)\n {\n $this->_propDict[\"allowCustomAssignmentSchedule\"] = $val;\n return $this;\n }", "function addLatestServer($remote_ip, $service_port, $serverTitle, $connectedClients, $networkSlots )\n\t{\n\t\t$server = \"$remote_ip:$service_port\";\n\t\t$players = \"$connectedClients/$networkSlots\";\n\t\tmysqli_query( Registry::$mysqliLink, \"INSERT INTO recent_servers (name, server, players) VALUES('$serverTitle', '$server', '$players')\");\n\n\t\t// make sure there are not too much servers\n\t\t$count_query = mysqli_fetch_assoc(mysqli_query( Registry::$mysqliLink, \"SELECT COUNT(*) as count FROM recent_servers\"));\n\t\t$count = (int) $count_query['count'];\n\t\t$over = $count - MAX_RECENT_SERVERS;\n\t\tmysqli_query( Registry::$mysqliLink, \"DELETE FROM recent_servers ORDER BY id LIMIT $over\");\n\t}", "public function setIgnoreRemoteSchedulers($ignoreRemoteSchedulers)\n {\n $this->ignoreRemoteSchedulers = $ignoreRemoteSchedulers;\n\n return $this;\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->call(function(){\n $orders = order::where('approved', 'pending')->get();\n foreach ($orders as $order) {\n $order->approved = 'cancelled';\n $order->save();\n }\n })->daily();\n\n $schedule->call(function(){\n $orders = Order::whereNotNull('until')->get();\n foreach ($orders as $order) {\n $service = Service::where('cost', $order->amount)->first();\n $username = $order->username;\n if (Carbon::parse(now())->diffInDays($order->until, false) <= 0) {\n \tif (is_null($order->until)) {\n\t\t\t\t\t\t$until = \"NULL\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$until = $order->until;\n\t\t\t\t\t\t$order->until = null;\n\t\t\t\t\t\t$order->save();\n\t\t\t\t\t\tLog::debug('Neteko Paslaugos: ' . $username . '---'. $service->name);\n\t\t\t\t\t}\n\n\t\t\t\t\t$host = env('Server_IP');\n\t $port = env('Server_PORT');\n\t $password = env('Server_PASS');\n\t $timeout = 3;\n\t $rcon = new Rcon($host, $port, $password, $timeout);\n\n\t if ($rcon->connect()){\n\n \t$rcon->sendCommand('pex user '.$username. 'group set lavonas'); \n \t$rcon->sendCommand('broadcast '.$username. ' Neteko paslaugos, nes jos galiojimas pasibaigė');\n \t\n \t}\n\t\t\t\t}\n\t\t\t}})->daily();\n\n $schedule->call(function(){\n $orders = Order::where('approved', 'done')->whereNull('until')->where('service_name', '!=', 'atleiskit')->delete();\n $orders2 = Order::where('approved', 'cancelled')->delete();\n })->weeklyOn(1, '7:00');;\n\n }", "static function fetchJobSchedules() {\n global $wpdb;\n $resultset = $wpdb->get_results(\n \" SELECT job_id, classname, repeat_time_minutes, repeat_daily_at, active_yn, last_run_date \n FROM job_scheduler\n ORDER BY job_id\");\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n $schedule = array();\n foreach( $resultset as $record ) {\n if( false === empty( $record->repeat_time_minutes ) ) {\n $schedule[] = new ScheduledJobRepeat(\n $record->job_id, \n $record->classname, \n $record->repeat_time_minutes, \n $record->active_yn == 'Y',\n $record->last_run_date,\n self::fetchJobScheduleParameters( $record->job_id ));\n }\n else if( false === empty( $record->repeat_daily_at ) ) {\n $schedule[] = new ScheduledJobDaily(\n $record->job_id, \n $record->classname, \n $record->repeat_daily_at,\n $record->active_yn == 'Y',\n $record->last_run_date,\n self::fetchJobScheduleParameters( $record->job_id ));\n }\n }\n return $schedule;\n }", "public function addRemoteFilter()\n {\n $this->queryBuilder->addFilter(new Filters\\Job\\Remote());\n }", "public function add_auto_export_schedule( $schedules ) {\n\n\t\tif ( $this->exports_enabled ) {\n\n\t\t\t$export_interval = get_option( 'wc_customer_order_csv_export_auto_export_interval' );\n\n\t\t\tif ( $export_interval ) {\n\n\t\t\t\t$schedules['wc_customer_order_csv_export_auto_export_interval'] = array(\n\t\t\t\t\t'interval' => (int) $export_interval * 60,\n\t\t\t\t\t'display' => sprintf( __( 'Every %d minutes', 'woocommerce-customer-order-csv-export' ), (int) $export_interval )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $schedules;\n\t}", "public function ReloadTasks()\n\t{\n\t\t$this->_tasks = array();\n\t\n\t\t$sql = \"SELECT `ps`.*, ISNULL(`a`.`id_task`) AS `active`\n\t\t\t\tFROM `{poker_scheduler}` AS `ps`\n\t\t\t\tLEFT JOIN (SELECT `id_task` FROM `{poker_scheduler}` WHERE `uid`= %d AND `moment` > NOW()) AS `a` USING(`id_task`)\n\t\t\t\tWHERE `uid`= %d AND (`moment` <= NOW() OR `visible` = 1) ORDER BY `moment` DESC\";\n\t\t\n\t\t$res = db_query($sql, $this->_user->uid, $this->_user->uid);\n\t\t\n\t\tif ($res)\n\t\t{\n\t\t\twhile (($task = db_fetch_object($res)))\n\t\t\t{\n\t\t\t\t$triggers = json_decode($task->trigger);\n\t\t\t\t\n\t\t\t\tif (is_array($triggers))\n\t\t\t\t{\n\t\t\t\t\t$task->trigger = $triggers;\n\t\t\t\t\t\n\t\t\t\t\tforeach($triggers as $trigger)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_tasks[$trigger][$task->id_task] = $task;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->ClearNewTask();\n\t\t}\n\t}", "public function registerSchedule($schedule)\n {\n\n $schedule->call(function () {\n\n $settings = Settings::instance();\n\n if ($settings->active) {\n\n $userScores = FinalScore::with('exam')\n ->where('created_at', '>', Carbon::now()->subMinutes('10'))\n ->where('created_at', '<', Carbon::now())\n ->where('complete_status', 0)\n ->get();\n\n $count = 0;\n\n foreach ($userScores as $score) {\n $count++;\n if (Carbon::now()->greaterThan(Carbon::parse($score->completed_at))) {\n FinalScore::where('id', $score['id'])->update([\n 'complete_status' => 1\n ]);\n }\n }\n\n if ($settings->active_trace) {\n trace_log(\"[exam_scores_cron] Query updated count:\" . $count);\n }\n }\n\n })->everyMinute()\n ->name('final_scores')\n ->withoutOverlapping();\n }", "function cron_add_weekly( $schedules ) {\n $schedules['weekly'] = array(\n 'interval' => 604800,\n 'display' => __( 'Once Weekly' )\n );\n return $schedules;\n}", "public function run()\n {\n DB::table('cron_master_lists')->insert([\n \t\t 'description' => 'Advertising Performance',\n \t\t 'route' => 'UpdateCampaignAdvertising',\n \t\t 'sequence' => 10\n \t\t]);\n }", "public function setSchedule(Schedule $schedule): UpdateScheduleService;", "protected function schedule(Schedule $schedule){\n\n $schedule->call(function(Cardinity $cardinity){\n\n /*\n $pdo = DB::getPdo();\n $res = $pdo->query('SELECT * FROM payments GROUP BY user_id DESC HAVING end_access_date <= CURDATE() ORDER BY end_access_date');\n\n $payments = $res->fetchAll(\\PDO::FETCH_CLASS, Payment::class);\n\n foreach($payments as $paymentDb){\n $user = User::where('id', $paymentDb->user_id)->first();\n\n if((bool)$user->is_subscription_renewable){\n $payment = $cardinity->renewSubscribe($paymentDb);\n SubscriptionController::successPayment($paymentDb->plan(), $payment, $user);\n }\n }\n */\n\n $users = User::where('is_email_valid', false)\n ->where('role', 'client')\n ->where('created_at', '<', Carbon::create()->addDay(-7)->format('Y-m-d H:i:s'))\n ->whereNull('start_subscribe_date')\n ->get();\n\n\n if(count($users) > 0) foreach($users as $user){\n $user->forceDelete();\n }\n\n// })->everyMinute();\n })->twiceDaily(1, 11);\n\n\n }", "function my_add_weekly( $schedules ) {\n // add a 'weekly' schedule to the existing set\n $schedules['3_hours'] = array(\n 'interval' => 10800,\n 'display' => __('Every 3 Hours - (Flipkart API call)')\n );\n return $schedules;\n }", "public static function add_schedule_interval( $schedules ) {\n\n\t\t$schedules['5_minutes'] = array(\n\t\t\t'interval' => 300, // 5 minutes in seconds\n\t\t\t'display' => 'Once every 5 minutes',\n\t\t);\n\n\t\treturn $schedules;\n\t}", "function install_cron_scheduler() {\n\tglobal $amp_conf;\n\tglobal $nt;\n\n\t// crontab appears to return an error when no entries, os only fail if error returned AND a list of entries.\n\t// Don't know if this will ever happen, but a failure and a list could indicate something wrong.\n\t//\n\t$outlines = array();\n\texec(\"/usr/bin/crontab -l\", $outlines, $ret);\n\tif ($ret && count($outlines)) {\n\t\t$nt->add_error('retrieve_conf', 'CRONMGR', _(\"Failed to check crontab for cron manager\"), sprintf(_(\"crontab returned %s error code when checking for crontab entries to start freepbx-cron-scheduler.php crontab manager\"),$ret));\n\t} else {\n\t\t$nt->delete('retrieve_conf', 'CRONMGR');\n\t\t$outlines2 = preg_grep(\"/freepbx-cron-scheduler.php/\",$outlines);\n\t\t$cnt = count($outlines2);\n\t\tswitch ($cnt) {\n\t\t\tcase 0:\n\t\t\t\t/** grab any other cronjobs that are running as asterisk and NOT associated with backups\n \t\t\t\t* this code was taken from the backup module for the most part. But seems to work...\n \t\t\t\t*/\n\t\t\t\t$outlines = array();\n\t\t\t\texec(\"/usr/bin/crontab -l | grep -v ^#\\ DO\\ NOT | grep -v ^#\\ \\( | grep -v freepbx-cron-scheduler.php\", $outlines, $ret);\n\t\t\t\t$crontab_entry = \"\";\n\t\t\t\tforeach ($outlines as $line) {\n\t\t\t\t\t$crontab_entry .= $line.\"\\n\";\n\t\t\t\t}\n\t\t\t\t// schedule to run hourly, at a random time. The random time is explicit to accomodate things like module_admin online update checking\n\t\t\t\t// since we will want a random access to the server. In the case of module_admin, that will also be scheduled randomly within the hour\n\t\t\t\t// that it is to run\n\t\t\t\t//\n\t\t\t\t$crontab_entry .= rand(0,59).\" * * * * \".$amp_conf['AMPBIN'].\"/freepbx-cron-scheduler.php\";\n\t\t\t\tsystem(\"/bin/echo '$crontab_entry' | /usr/bin/crontab -\");\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t// already running, nothing to do\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// error, there should never be more than one running\n\t\t\t\techo \"TODO: deal with error here\\n\";\n\t\t\t\t$nt->add_error('retrieve_conf', 'CRONMGR', _(\"Multiple freepbx-cron-scheduler.php running\"), sprintf(_(\"There were %s freepbx-cron-scheduler.php instances running. There should be only 1.\"),$cnt));\n\t\t}\n\t}\n}", "static function schedule_cron() {\n\t\t$is_multisite = is_multisite();\n\t\tif ( $is_multisite ) {\n\t\t\t$primary_blog = get_current_site();\n\t\t\t$current_blog = get_current_blog_id();\n\t\t} else {\n\t\t\t$primary_blog = 1;\n\t\t\t$current_blog = 1;\n\t\t}\n\n\t\t/**\n\t\t * If we're on a multisite, only schedule the cron if we're on the primary blog\n\t\t */\n\t\tif (\n\t\t( ! $is_multisite || ( $is_multisite && $primary_blog->id === $current_blog ) )\n\t\t) {\n\t\t\t$cronsScheduled = false;\n\t\t\tif( ! wp_next_scheduled( 'wp_rest_cache_cron' ) ) {\n\t\t\t\twp_schedule_event( time(), '5_minutes', 'wp_rest_cache_cron' );\n\t\t\t\t$cronsScheduled = true;\n\t\t\t}\n\t\t\tif( ! wp_next_scheduled( 'wp_rest_cache_expired_cron' ) ) {\n\t\t\t\twp_schedule_event( time(), 'hourly', 'wp_rest_cache_expired_cron' );\n\t\t\t\t$cronsScheduled = true;\n\t\t\t}\n\t\t\tif( $cronsScheduled ) {\n\t\t\t\tdo_action( 'wrc_after_schedule_cron', $primary_blog, $current_blog );\n\t\t\t}\n\t\t}\n\t}", "public function registerScheduledCommands($app)\n {\n $app->make(Schedule::class)\n ->call($app->make(CheckQueues::class))\n ->everyMinute()\n ->name('check-queue-alert')\n ->onOneServer();\n }", "public function __construct(ResponseScheduleController $scheduler)\n {\n parent::__construct();\n $this->scheduler = $scheduler;\n }", "public function testOrgApacheSlingCommonsSchedulerImplSchedulerHealthCheck()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.commons.scheduler.impl.SchedulerHealthCheck';\n\n $crawler = $client->request('POST', $path);\n }", "private function selectServicesHistory($scheduler ){\n $result = $scheduler->adminLoadHistoryService();\n return $this->transformToJSON($result);\n }", "public function prepare_data()\n {\n $schedules = wp_get_schedules();\n foreach ($schedules as $key => $data) {\n $scheds['internal_name'] = $key;\n $scheds = array_merge($scheds, $data);\n $modscheds[] = $scheds;\n }\n return $modscheds;\n }", "public function collectSubscribers();", "public function admin_add(){\n \n $this->set(\"title_for_layout\",\"Create a Satellite Group\");\n \n // Load all existing satellites\n $this->set('satellites', $this->Satellite->find('all'));\n }", "function run() {\n\t$scheduler = new CSL_Feed_Import_Scheduler;\n\t$scheduler->setup();\n}", "protected function schedule(Schedule $schedule)\n {\n\n $schedule->call(function () {\n ContestBusinessLogic::insertContests();\n })->hourly()->onSuccess(\n function () {\n FiltersLogic::applyFilter2();\n }\n );\n\n $schedule->call(function () {\n FiltersLogic::sendNotifications2();\n })->twiceDaily(7 , 13);\n\n\n\n $schedule->command('subscription:send_warning_email')->dailyAt(0);\n //corre o InsertContests a cada minuto\n /*$schedule->call(function(){\n ContestBusinessLogic::insertContests();\n })->everyFiveMinutes()->onSuccess(function () {\n FiltersLogic::applyFilter();\n })->onSuccess(function () {\n FiltersLogic::sendNotifications();\n });*/\n\n $schedule->call(function (){\n $entities = Entity::where('status', 1)->get();\n foreach ($entities as $entity) {\n if( !Entity::isEntitySubscribed($entity)){\n $entity->update(['status' => 0]);\n }\n }\n })->daily();\n\n/*\n $schedule->call(function (){\n FiltersLogic::applyFilter();\n })->twiceDaily(9, 15);\n $schedule->call(function (){\n FiltersLogic::sendNotifications();\n })->twiceDaily(9, 14);\n */\n }", "public function getScheduledCollectionUpdates()\n {\n return $this->collectionUpdates;\n }", "function add_cuentadigital_interval($schedules){\n $schedules['cuentadigital_interval'] = array(\n 'interval' => $this->cuentadigital_interval,\n 'display' => __( 'CuentaDigital Interval', 'se' )\n );\n return $schedules;\n }", "private function register_tasks( \\Jobby\\Jobby $runner, $task_list ) {\n foreach( $task_list as $task ) {\n $task_class = $this->crony_job_namespace . '\\\\' . $task;\n\n // Per the interface...\n $task_config = call_user_func( $task_class . '::config' );\n\n // If there's no command registered in the configuration, we'll bind an anonymous function to\n // run our specified task.\n if ( !isset( $task_config['command'] ) ) {\n $task_config['command'] = function() use ($task_class) { return call_user_func( $task_class . '::run' ); };\n }\n \n $runner->add( $task, $task_config );\n }\n }", "protected function schedule(Schedule $schedule)\n {\n {\n $schedule->call(function(){\n\n $usersArray = [];\n $invoices = Invoice::where('is_paid', '0')\n ->where('is_sent','0')\n ->where('last_pay_day', '<=' , Carbon::now()->addDay(1))->get();\n\n foreach ($invoices as $invoice) {\n $invoice->is_sent = 1;\n $invoice->save();\n $usersArray[$invoice->user->id] = $invoice->user;\n }\n foreach ($usersArray as $user) {\n \\Event::fire(new SmsEvent($user));\n }\n return true;\n })->everyFiveMinutes();\n }\n }", "public function getMinuteurSchedulers()\n {\n return $this->hasMany(MinuteurScheduler::className(), ['diffuseur_id' => 'id']);\n }", "public static function init_sync_cron_jobs() {\n\t\t_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\\Jetpack\\Sync\\Actions' );\n\n\t\treturn Actions::init_sync_cron_jobs();\n\t}", "public function __construct() {\n\t\t\t$this->schedules = wp_get_schedules();\n\t\t}", "function Create_Edited_Schedule($application_id, $request, $tr_info)\n{\n\t$holidays = Fetch_Holiday_List();\n\t$pd_calc = new Pay_Date_Calc_3($holidays);\n\t$log = get_log(\"scheduling\");\n\n\t$schedule = array();\n\t$status_date = (isset($request->status_date)) ?\n\t(date(\"Y-m-d\", strtotime($request->status_date))) : null;\n\t$date_fund_actual = $request->date_fund_actual;\n\t$log->Write(\"Creating Edited Schedule for {$application_id}\");\n\t$principal_balance = floatval($request->principal_balance);\n\t$fees_balance = floatval($request->fees_balance);\n\t$return_amount = floatval($request->return_amount);\n\t$num_service_charges = ($request->num_service_charges == \"max\") ?\n\t5 : intval($request->num_service_charges);\n\n\t$agent_id = isset($request->controlling_agent) ? $request->controlling_agent : 0;\n\n\t$today = date(\"Y-m-d\");\n\t$next_business_day = $pd_calc->Get_Next_Business_Day($today);\n\tRemove_Unregistered_Events_From_Schedule($application_id);\n\n\t// First generate the service charge placeholders\n\tfor ($i = 0; $i < $num_service_charges; $i++)\n\t{\n\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, array(),\n\t\t'converted_sc_event',\n\t\t'Placeholder for Cashline interest charge');\n\t}\n\n\t// Now generate the balance amounts.\n\tif ($principal_balance > 0.0)\n\t{\n\t\t// If they requested \"Funds Pending\", we want to set the transaction to pending, and set\n\t\t// the event and the transaction to the date they specified.\n\t\tif($request->account_status == '17') // Set Funds Pending\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => $principal_balance));\n\t\t\t$event = Schedule_Event::MakeEvent($status_date, $status_date, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\n\t\t\t$evid = Record_Event($application_id, $event);\n\t\t\tRecord_Scheduled_Event_To_Register_Pending($status_date, $application_id, $evid);\n\t\t}\n\t\telse if ($request->account_status == '15') // Funding Failed\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$principal_balance));\n\t\t\t$event = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\t\t\t$evid = Record_Event($application_id, $event);\n\t\t\t$trids = Record_Scheduled_Event_To_Register_Pending($today, $application_id, $evid);\n\t\t\tforeach ($trids as $trid)\n\t\t\t{\n\t\t\t\tRecord_Transaction_Failure($application_id, $trid);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => $principal_balance));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t\t'converted_principal_bal',\n\t\t\t\"Converted principal amount for {$application_id}\");\n\t\t}\n\t}\n\tif ($fees_balance > 0.0)\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $fees_balance));\n\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts,\n\t\t'converted_service_chg_bal',\n\t\t\"Converted interest charge amount for {$application_id}\");\n\t}\n\n\t// Scheduling section\n\t$rules = Prepare_Rules($tr_info->rules, $tr_info->info);\n\t$scs_left = max($rules['service_charge']['max_svc_charge_only_pmts'] - $num_service_charges, 0);\n\t$sc_amt = $principal_balance * $rules['interest'];\n\t$sc_comment = \"sched svc chg ({$rules['interest']})\";\n\t$payments = $principal_balance / $rules['principal_payment_amount'];\n\t$total_payments = $rules['service_charge']['max_svc_charge_only_pmts'] + $payments + 1; //add one for the loan date\n\n\tif(!in_array($request->account_status, array(\"19\")))\n\t{\n\t\t$dates = Get_Date_List($tr_info->info, $next_business_day, $rules, ($total_payments ) * 4, null, $next_business_day);\n\n\t\t$index = 0;\n\t\tif (isset($date_fund_actual) && ($date_fund_actual != ''))\n\t\t{\n\t\t\t$date_fund_actual = preg_replace(\"/-/\", \"/\", $date_fund_actual);\n\t\t\t$log->Write(\"Date fund actual is: {$date_fund_actual}\");\n\t\t\t$window = date(\"Y-m-d\", strtotime(\"+10 days\", strtotime($date_fund_actual)));\n\t\t\twhile (strtotime($window) > strtotime($dates['event'][$index])) $index++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile (strtotime($today) > strtotime($dates['event'][$index])) $index++;\n\t\t}\n\t}\n\n\tswitch($request->account_status)\n\t{\n\t\tcase \"1\":\n\t\tcase \"2\": $status_chain = array(\"active\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"3\": $status_chain = array(\"sent\", \"external_collections\", \"*root\"); break;\n\t\tcase \"4\": $status_chain = array(\"new\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"5\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"6\": $status_chain = array(\"pending\", \"external_collections\", \"*root\"); break;\n\t\tcase \"7\": $status_chain = array(\"unverified\", \"bankruptcy\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"8\": $status_chain = array(\"recovered\", \"external_collections\", \"*root\"); break;\n\t\tcase \"9\": $status_chain = array(\"paid\", \"customer\", \"*root\"); break;\n\t\tcase \"10\":\n\t\tcase \"12\":\n\t\tcase \"13\": $status_chain = array(\"ready\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"11\":\n\t\tcase \"14\": $status_chain = array(\"sent\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"15\": $status_chain = array(\"funding_failed\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"16\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"17\": $status_chain = array(\"active\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"18\": $status_chain = array(\"past_due\", \"servicing\", \"customer\", \"*root\"); break;\n\t\tcase \"19\": $status_chain = array(\"sent\",\"external_collections\",\"*root\"); break;\n\t\tcase \"20\": $status_chain = array(\"queued\", \"contact\", \"collections\", \"customer\", \"*root\"); break;\n\t\tcase \"21\": $status_chain = array(\"sent\", \"quickcheck\", \"collections\", \"customer\", \"*root\"); break;\n\t}\n\n\tif (in_array($request->account_status, array(\"1\", \"2\", \"4\", \"17\",\"18\")))\n\t{\n\t\tif ($request->account_status == \"18\")\n\t\t{\n\t\t\t$old_sc_amt = $sc_amt;\n\t\t\t$today = date(\"Y-m-d\");\n\t\t\t$next_day = $pd_calc->Get_Business_Days_Forward($today, 1);\n\t\t\tif ($fees_balance != 0.00)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$fees_balance));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t\t$amounts,\n\t\t\t\t'payment_service_chg', 'repull',\n\t\t\t\t'scheduled', 'generated',$application_id,\n\t\t\t\t-$application_id);\n\t\t\t\t$return_amount = bcsub($return_amount,$fees_balance,2);\n\t\t\t}\n\n\t\t\tif ($return_amount > 0)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$return_amount));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t\t$amounts,\n\t\t\t\t'repayment_principal', 'repull',\n\t\t\t\t'scheduled','generated',$application_id,\n\t\t\t\t-$application_id);\n\t\t\t\t$principal_balance = bcsub($principal_balance,$return_amount,2);\n\t\t\t\t$sc_amt = $principal_balance * $rules['interest'];\n\t\t\t}\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today, $amounts, 'assess_service_chg');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('fee' => $rules['return_transaction_fee']));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $today,\n\t\t\t$amounts,\n\t\t\t'assess_fee_ach_fail', 'ACH Fee Assessed');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('fee' => -$rules['return_transaction_fee']));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($today, $next_day,\n\t\t\t$amounts,\n\t\t\t'payment_fee_ach_fail', 'ACH fee payment');\n\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t$dates['effective'][$index],$amounts, 'payment_service_chg');\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($fees_balance != 0.00)\n\t\t\t{\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$fees_balance));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t\t$amounts, 'payment_service_chg', 'sched svc chg payment');\n\t\t\t}\n\t\t}\n\t\tfor ($i = 0; $i < $scs_left; $i++)\n\t\t{\n\t\t\tif ($sc_amt == 0.0) break;\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['event'][$index],\n\t\t\t$amounts, 'assess_service_chg', $sc_comment);\n\t\t\t$index++;\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t$amounts, 'payment_service_chg',\n\t\t\t'sched svc chg payment');\n\t\t}\n\n\t\twhile ($principal_balance > 0)\n\t\t{\n\t\t\t$charge_amount = min($principal_balance, $rules['principal_payment_amount']);\n\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('principal' => -$charge_amount));\n\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t\t$amounts, 'repayment_principal', 'principal repayment');\n\t\t\t$principal_balance = bcsub($principal_balance,$charge_amount,2);\n\t\t\tif($principal_balance > 0)\n\t\t\t{\n\t\t\t\t$sc_amt = $principal_balance * $rules['interest'];\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => $sc_amt));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t\t$dates['event'][$index],\n\t\t\t\t$amounts, 'assess_service_chg',\n\t\t\t\t$sc_comment);\n\t\t\t\t$index++;\n\t\t\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array('service_charge' => -$sc_amt));\n\t\t\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index],\n\t\t\t\t$dates['effective'][$index],\n\t\t\t\t$amounts, 'payment_service_chg',\n\t\t\t\t'sched svc chg payment');\n\t\t\t}\n\n\t\t}\n\t}\n\telse if ($request->account_status == \"15\") // for Funding Failed\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance\n\t\t));\n\t\t$event = Schedule_Event::MakeEvent($today, $today,\n\t\t$amounts, 'adjustment_internal',\n\t\t'Internal Adjustment');\n\t\tPost_Event($application_id, $event);\n\t}\n\telse if ($request->account_status == \"21\") // ACH Return After QC\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t// Quickcheck (Pending)\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\n\t\t// Cashline Return (Completed)\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'principal' => $request->return_amount\n\t\t));\n\t\t$event = Schedule_Event::MakeEvent($today, $today,\n\t\t$amounts, 'cashline_return',\n\t\t'Cashline Return');\n\t\tPost_Event($application_id, $event);\n\t}\n\tif ($request->account_status == \"5\")\n\t{\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($dates['event'][$index], $dates['effective'][$index],\n\t\t$amounts, 'full_balance',\n\t\t'Full Pull Attempt');\n\t}\n\n\tif (in_array($request->account_status, array(\"12\", \"13\", \"14\")))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif (in_array($request->account_status, array(\"14\", \"11\")))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = AmountAllocationCalculator::generateGivenAmounts(array(\n\t\t'service_charge' => -$request->fees_balance,\n\t\t'principal' => -$request->principal_balance,\n\t\t));\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif (in_array($request->account_status, array('6', '3', '20')))\n\t{\n\t\tif ($status_date != null) $date = $status_date;\n\t\telse $date = $today;\n\n\t\t$amounts = array();\n\t\t$amounts[] = Event_Amount::MakeEventAmount('principal', -$request->principal_balance);\n\t\t$amounts[] = Event_Amount::MakeEventAmount('service_charge', -$request->fees_balance);\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\n\t\t$amounts = array();\n\t\t$amounts[] = Event_Amount::MakeEventAmount('principal', -$request->principal_balance);\n\t\t$amounts[] = Event_Amount::MakeEventAmount('service_charge', -$request->fees_balance);\n\t\t$schedule[] = Schedule_Event::MakeEvent($date, $date,\n\t\t$amounts, 'quickcheck',\n\t\t'Quickcheck');\n\t}\n\n\tif(in_array($request->account_status, array(\"19\")))\n\t{\n\t\tUpdate_Status(NULL,$application_id,$status_chain);\n\t}\n\n\tif (in_array($request->account_status, array(4,5,10,11,16)) && $agent_id)\n\t{\n\t\t$application = ECash::getApplicationById($application_id);\n\t\t$affiliations = $application->getAffiliations();\n\t\t$affiliations->add(ECash::getAgentById($agent_id), 'collections', 'owner', null);\n\t}\n\n\tif (count($schedule) > 0) Update_Schedule($application_id, $schedule);\n\treturn ($status_chain);\n}", "public function addGanttConnector($name, $from, $to, $params)\n{\n$this->$name->addGanttConnector($from, $to, $this->_restructureParams($params));\n}", "static function process_scheduler(){\n\t\treturn self::process_offline_leads();\n\t}", "function BPSP_Schedules() {\r\n add_action( 'courseware_new_teacher_added', array( &$this, 'add_schedule_caps' ) );\r\n add_action( 'courseware_new_teacher_removed', array( &$this, 'remove_schedule_caps' ) );\r\n add_action( 'courseware_group_screen_handler', array( &$this, 'screen_handler' ) );\r\n add_filter( 'courseware_group_nav_options', array( &$this, 'add_nav_options' ) );\r\n }", "public static function vce_call_add_functions($vce) {\n\n /**\n * update a current cron_task\n * @param $id // site_meta table row id\n * @param $timestamp // new timestamp to set\n * @param $properties // key=>value array to update\n *\n * $attributes = json_encode(\n * array (\n * 'component' => *component_name*,\n * 'method' => *component_function_name*,\n * 'properties' => array ('key' => 'value', 'key' => 'value')\n * )\n * );\n */\n $vce->manage_cron_task = function ($attributes) {\n\n // check for a action\n if (isset($attributes['action'])) {\n // move a single attribute to the first array element\n $attributes = array('0' => $attributes);\n }\n\n // check that attributes is not empty\n if (!empty($attributes)) {\n\n global $vce;\n\n foreach ($attributes as $key => $each) {\n // add a cron_task\n if ($each['action'] == \"add\") {\n\n $data = array(\n 'meta_key' => 'cron_task',\n 'meta_value' => $each['value'],\n 'minutia' => $each['timestamp'],\n );\n\n $cron_task_id = $vce->db->insert('site_meta', $data);\n\n return $cron_task_id;\n\n }\n // update a cron_task\n if ($each['action'] == \"update\") {\n\n // update timestamp for cron_task\n $update = array('minutia' => $each['timestamp']);\n\n if (isset($each['value'])) {\n $update['meta_value'] = $each['value'];\n }\n\n $update_where = array('id' => $each['id']);\n $vce->db->update('site_meta', $update, $update_where);\n\n return true;\n\n }\n // delete a cron_task\n if ($each['action'] == \"delete\" && isset($each['id'])) {\n\n // delete cron_task\n $where = array('id' => $each['id']);\n $vce->db->delete('site_meta', $where);\n\n return true;\n\n }\n\n }\n\n }\n\n return false;\n\n };\n\n }", "protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')\n// ->hourly();\n// $schedule->call(function(){\n// $time=date('H');\n $date=date('Y-m-d');\n// $data=[];\n// if($time>0){\n// $reserves=Reserve::where('date',$date)->whereIn('progress',[1,3])->get();\n// foreach($reserves as $k=>$v){\n// $v->progress=2;\n// $v->save();\n// $number=Number::where('reserve_id',$v->id)->where('number_class',1)->first();\n// if($number){\n// $number->number_push=1;\n// $number->number_status=0;\n// $number->save();\n// }\n// }\n// DB::table('reserves')->where('date',$date)->whereIn('progress',[1,3])->where('halt',0)->update('progress',2);\n//// }\n// })->everyMinute();\n\n }", "public function workschedules()\n {\n return $this->hasMany('App\\WorkSchedule', 'customer_id');\n }", "public function testReportConcurrentAdminsToNewRelic()\n {\n /** @var \\Magento\\Framework\\Event\\Observer|\\PHPUnit_Framework_MockObject_MockObject $eventObserver */\n $eventObserver = $this->getMockBuilder(\\Magento\\Framework\\Event\\Observer::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->config->expects($this->once())\n ->method('isNewRelicEnabled')\n ->willReturn(true);\n $this->backendAuthSession->expects($this->once())\n ->method('isLoggedIn')\n ->willReturn(true);\n $userMock = $this->getMockBuilder(\\Magento\\User\\Model\\User::class)->disableOriginalConstructor()->getMock();\n $this->backendAuthSession->expects($this->once())\n ->method('getUser')\n ->willReturn($userMock);\n $this->newRelicWrapper->expects($this->exactly(3))\n ->method('addCustomParameter')\n ->willReturn(true);\n\n $this->model->execute($eventObserver);\n }", "public function schedules()\n {\n return $this->hasMany('App\\Schedule');\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 }", "function cron_add_10_minutes($schedules) {\n\t\t\t$schedules['10minutes'] = array(\n\t\t\t\t'interval' => 600,\n\t\t\t\t'display' => __( 'Once 10 Minutes' )\n\t\t\t);\n\t\t\treturn $schedules;\n\t\t }", "function add_cron_interval( $schedules ) {\n\t$schedules['ten_seconds'] = array(\n\t\t'interval' => 60,\n\t\t'display' => esc_html__( 'Every Ten Seconds' ),\n\t);\n\n\treturn $schedules;\n}", "public function addAvailableScheduleFilter()\n {\n $this->addIsActiveFilter();\n $now = (new \\DateTime('now', new \\DateTimeZone('UTC')))\n ->format(\\Magento\\Framework\\Stdlib\\DateTime::DATETIME_PHP_FORMAT);\n $this->getSelect()\n ->where(\"('$now' <= main_table.active_to OR isnull(main_table.active_to))\");\n\n return $this;\n }", "function updateParlayEmails()\n {\n $ret = array();\n $rs = $this->db->query(\"Select * from CronJobs where routine_id in (Select id from Routines where link = 'crons/send_parlay_emails')\");\n if($rs->num_rows())\n {\n $cron = $rs->row();\n $rs = $this->db->query(\"Select c.id, c.parlayCardId, c.cardDate, min(a.dateTime) as schedule_date\n From SportParlayConfig c\n Inner join SportParlayCards a on a.parlayCardId = c.parlayCardId\n Where (date(now()) between cardDate and endDate) and c.type not in ('profootball2016','collegefootball2016') \n group by c.id\");\n \n $cards = array();\n foreach($rs->result() as $card)\n $cards[$card->cardDate] = $card->schedule_date;\n \n $rs = $this->db->query(\"Select *, date(schedule_date) as date from CronSchedule where cron_id = ? and schedule_date > now()\", array($cron->id));\n $jobs = array();\n foreach($rs->result() as $job)\n $jobs[$job->date] = $job->schedule_date;\n \n foreach($cards as $index => $date)\n {\n if(!isset($jobs[$index])) //Add job into the queue manually\n { \n $data = array('cron_id' => $cron->id, 'schedule_date' => $date);\n $ret['inserted'][] = $data;\n $this->db->insert(\"CronSchedule\", $data);\n \n $data = array('cron_id' => $cron->id, 'schedule_date' => date(\"Y-m-d H:i:s\", strtotime($date) + 3600));\n $ret['inserted'][] = $data;\n $this->db->insert(\"CronSchedule\", $data);\n }\n else\n {\n if($date != $jobs[$index])\n {\n $ret['updated'][] = array('old' => $jobs[$index], \"new\" => $date);\n $this->db->where(array(\"cron_id\" => $cron->id, \"schedule_date\" => $jobs[$index]));\n $this->db->update(\"CronSchedule\", array(\"schedule_date\" => $date));\n }\n }\n }\n }\n \n if(getenv(\"ENV\") == \"prod\")\n {\n $rs = $this->db->query(\"Select * from CronJobs where routine_id in (Select id from Routines where link = 'crons/send_pro_football_email_insurance')\");\n if($rs->num_rows())\n {\n $cron = $rs->row();\n $rs = $this->db->query(\"Select c.id, c.parlayCardId, c.cardDate, min(a.dateTime) as schedule_date\n From SportParlayConfig c\n Inner join SportParlayCards a on a.parlayCardId = c.parlayCardId\n Where (date(now()) between cardDate and endDate) and c.type in ('profootball2016','collegefootball2016') \n group by c.id\");\n\n $cards = array();\n foreach($rs->result() as $card)\n $cards[$card->cardDate] = $card->schedule_date;\n\n $rs = $this->db->query(\"Select *, date(schedule_date) as date from CronSchedule where cron_id = ? and schedule_date > now()\", array($cron->id));\n $jobs = array();\n foreach($rs->result() as $job)\n $jobs[$job->date] = $job->schedule_date;\n\n foreach($cards as $index => $date)\n {\n if(!isset($jobs[$index])) //Add job into the queue manually\n {\n $data = array('cron_id' => $cron->id, 'schedule_date' => date(\"Y-m-d H:i:s\", strtotime($date) - 600));\n $ret['inserted'][] = $data;\n $this->db->insert(\"CronSchedule\", $data);\n }\n else\n {\n if($date != $jobs[$index])\n {\n $ret['updated'][] = array('old' => $jobs[$index], \"new\" => $date);\n $this->db->where(array(\"cron_id\" => $cron->id, \"schedule_date\" => $jobs[$index]));\n $this->db->update(\"CronSchedule\", array(\"schedule_date\" => $date));\n }\n }\n }\n }\n }\n \n $rs = $this->db->query(\"Select * from CronJobs where routine_id in (Select id from Routines where link = 'crons/send_roal_emails')\");\n if($rs->num_rows())\n {\n $cron = $rs->row();\n $rs = $this->db->query(\"Select c.*, max(endTime) as schedule_date from ROALConfigs c\n Inner join ROALQuestions q on q.ROALConfigId = c.id\n Group by c.id\n Having (c.id in (Select distinct ROALConfigId from ROALAnswers where isEmailed = 0) or c.id NOT IN (Select distinct ROALConfigId from ROALAnswers))\n and c.cardDate >= date(now())\");\n \n $cards = array();\n foreach($rs->result() as $card)\n $cards[$card->cardDate] = $card->schedule_date;\n \n $rs = $this->db->query(\"Select *, date(schedule_date) as date from CronSchedule where cron_id = ? and schedule_date > now()\", array($cron->id));\n $jobs = array();\n foreach($rs->result() as $job)\n $jobs[$job->date] = $job->schedule_date;\n \n foreach($cards as $index => $date)\n {\n if(!isset($jobs[$index])) //Add job into the queue manually\n { \n $data = array('cron_id' => $cron->id, 'schedule_date' => date(\"Y-m-d H:i:s\", strtotime($date) + 600));\n $ret['inserted'][] = $data;\n $this->db->insert(\"CronSchedule\", $data);\n }\n else\n {\n if($date != $jobs[$index])\n {\n $ret['updated'][] = array('old' => $jobs[$index], \"new\" => $date);\n $this->db->where(array(\"cron_id\" => $cron->id, \"schedule_date\" => $jobs[$index]));\n $this->db->update(\"CronSchedule\", array(\"schedule_date\" => $date));\n }\n }\n }\n }\n $ret['success'] = true;\n return $ret;\n }", "public static function updateSched($sched) {\n //LoginDao::authenticateSchedId($sched->id);\n /*\n $d = dateToString($sched->date);\n $sql = \"UPDATE scheds SET \";\n $sql .= \"date=\" . quote($d);\n $sql .= \", time_start=\" . quote($sched->timeStart);\n $sql .= \", timestamp=\" . quote($d . \" \" . SchedDao::div($sched->timeStart, 100) . \":\" . ($sched->timeStart % 100));\n $sql .= \", duration=\" . quote($sched->duration);\n $sql .= \", status=\" . quote($sched->status);\n $sql .= \", comment=\" . quote($sched->comment, true);\n $sql .= \", type=\" . quote($sched->type);\n $sql .= \" WHERE sched_id=\" . $sched->id;\n query($sql);\n */\n $appt = ApptEdit::from($sched);\n $appt->save();\n if (isset($sched->schedEvent)) {\n $event = SchedEvent::from($sched->schedEvent);\n /*\n $sql = \"UPDATE sched_events SET \";\n $sql .= \"rp_type=\" . quote($sched->schedEvent->type);\n $sql .= \", rp_every=\" . quote($sched->schedEvent->every);\n $sql .= \", rp_until=\" . quoteDate($sched->schedEvent->until);\n $sql .= \", rp_on=\" . quote($sched->schedEvent->on);\n $sql .= \", rp_by=\" . quote($sched->schedEvent->by);\n $sql .= \", comment=\" . quote($sched->schedEvent->comment);\n $sql .= \" WHERE sched_event_id=\" . $sched->schedEvent->id;\n query($sql);\n */\n $event->save();\n }\n if (isSet($sched->schedEvent)) {\n $sched->schedEvent->maxRepeatDate = SchedDao::repeatSched($sched);\n }\n /*\n if ($sched->clientId && $sched->clientId != 0) {\n AuditDao::log($sched->clientId, AuditDao::ENTITY_SCHED, $sched->id, AuditDao::ACTION_UPDATE, null, CommonCombos::getApptTypeDesc($sched->type));\n // SchedDao::saveClientUpdate(new ClientUpdate($sched->clientId, ClientUpdate::TYPE_APPT_UPDATED, $sched->id, CommonCombos::getApptTypeDesc($sched->type)));\n }\n */\n return $sched;\n }", "function conference_schedule_admin() {\n\treturn Conference_Schedule_Admin::instance();\n}", "function local_campusconnect_cron() {\n $ecslist = ecssettings::list_ecs();\n foreach ($ecslist as $ecsid => $name) {\n $ecssettings = new ecssettings($ecsid);\n\n if ($ecssettings->time_for_cron()) {\n mtrace(\"Checking for updates on ECS server '\".$ecssettings->get_name().\"'\");\n $connect = new connect($ecssettings);\n $queue = new receivequeue();\n\n try {\n $queue->update_from_ecs($connect);\n $queue->process_queue($ecssettings);\n } catch (connect_exception $e) {\n local_campusconnect_ecs_error_notification($ecssettings, $e->getMessage());\n }\n\n mtrace(\"Sending updates to ECS server '\".$ecssettings->get_name().\"'\");\n try {\n export::update_ecs($connect);\n course_url::update_ecs($connect);\n enrolment::update_ecs($connect);\n } catch (connect_exception $e) {\n local_campusconnect_ecs_error_notification($ecssettings, $e->getMessage());\n }\n\n $cms = participantsettings::get_cms_participant();\n if ($cms && $cms->get_ecs_id() == $ecssettings->get_id()) {\n // If we are updating from the ECS with the CMS attached, then check the directory mappings (and sort order).\n directorytree::check_all_mappings();\n }\n\n mtrace(\"Emailing any necessary notifications for '\".$ecssettings->get_name().\"'\");\n notification::send_notifications($ecssettings);\n\n $ecssettings->update_last_cron();\n }\n }\n}", "public function schedules(): HasMany\n {\n return $this->hasMany(Schedule::class);\n }", "function ds_add_email_cron_schedules( $param ) {\n\n $param['fifteen_minute'] = array(\n 'interval' => 900, // seconds* 900/60 = 15 mins\n 'display' => __( 'Every Fifteen Minutes' )\n );\n\n return $param;\n\n }", "public function addcron() {\r\n $os = php_uname('s');\r\n\r\n $file = APP_PATH . '/index.php?c=cron&a=apply';\r\n\r\n\r\n switch ($os) {\r\n case substr($os, 0, 7) == 'Windows':\r\n exec(\"schtasks /create /sc minute /mo 5 /tn 'update_quota' /tr . $file . /ru 'System'\");\r\n break;\r\n\r\n case substr($os, 0, 5) == 'Linux':\r\n switch ($_SERVER['SERVER_PORT']) {\r\n case 80:\r\n $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\r\n break;\r\n\r\n case 443:\r\n $url = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\r\n break;\r\n\r\n default:\r\n $url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\r\n }\r\n\r\n $cmdline = '*/5 * * * * /usr/bin/curl' . $url;\r\n\r\n exec('crontab -e <' . $cmdline);\r\n break;\r\n }\r\n }", "private function addPerformers () {\n//\t\t$selstmt = \"SELECT ACTOR_ID FROM REPORTS_PERFORMERS WHERE REPORT_ID = $rptid\";\n\t\t$resultSet = ORM::for_table (self::REPTS_PERFS_TABLE)->\n\t\t\tselect('actor_id')->\n\t\t\twhere_equal('report_id', $this->id)->\n\t\t\tfind_many();\n\t\t$this->performers = array();\n\t\tforeach ($resultSet as $result) {\n\t\t\t$actorId = $result->actor_id;\n\t\t\t$performer = Actor::findById($actorId);\n\t\t\tif ($performer != NULL) {\n\t\t\t\t$this->performers[] = $performer;\n\t\t\t}\n\t\t}\n\t}", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n // Da ka Event\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/PunchEvent';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('9:13');\n // Check sprint progress.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/amChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('10:00');\n // Verify completed tasks\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/doneIssueChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('17:30');\n // volunteer for unassigned task.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/todoChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n })->weekdays()\n ->everyFiveMinutes()\n ->timezone('Asia/Shanghai')\n ->between('9:50', '22:00');\n }", "function add_cron_intervals( $schedules ) {\n\n\t$schedules['5seconds'] = array( // Provide the programmatic name to be used in code\n\t\t'interval' => 5, // Intervals are listed in seconds\n\t\t'display' => 'Every 5 Seconds' // Easy to read display name\n\t);\n\treturn $schedules; // Do not forget to give back the list of schedules!\n}", "function addServers($servers) {\n return $this->memcached->addServers();\n }", "private function scheduleVehicleJobs(): void\n {\n $hours = config('schedule.ship_matrix.at', []);\n // Ensure first and second key exists\n $hours = array_merge([1, 13], $hours);\n\n $this->schedule\n ->command(DownloadShipMatrix::class, ['--import'])\n ->twiceDaily(\n $hours[0],\n $hours[1],\n );\n\n $this->schedule\n ->command(ImportMsrp::class)\n ->daily();\n\n $this->schedule\n ->command(ImportLoaner::class)\n ->daily();\n }", "private function selectServicesUsers($scheduler ){\n $result = $scheduler->adminLoadServiceUsers();\n return $this->transformToJSON($result);\n }", "public function register_cron_worker() {\n\t\t$attempts = add_filter( 'wp_queue_cron_attempts', 3 );\n\t\t$cron = new Cron( $this->worker( $attempts ) );\n\n\t\t$cron->init();\n\t}", "public function add(PriorityServer $server)\n\t{\n\t\t$this->server_list->append($server);\n\t}", "protected function schedule(Schedule $schedule)\n {\n $schedule->call(function() {\n foreach(Invoice::whereNotNull('bill_date')->whereNull('payment_date')->get() as $invoice) {\n $offer = Offer::find($invoice->offer_id);\n $project = Project::find($offer->project_id);\n $user = User::find($project->user_id);\n\n if (!$project->pref_email_reminder)\n continue;\n\n $contact_client = Contact::find($invoice->to_contact_id);\n $contact_user = Contact::find($invoice->from_contact_id);\n\n if ($invoice->isExpiredDemand()) {\n $data = array(\n 'email' => $contact_client->email,\n 'project_name' => $project->project_name,\n 'client' => $contact_client->getFormalName(),\n 'pref_email_invoice_demand' => $user->pref_email_invoice_demand,\n 'user' => $contact_user->getFormalName()\n );\n Mail::send('mail.invoice_demand', $data, function($message) use ($data) {\n $message->to($data['email'], mb_strtolower(trim($data['client'])));\n $message->subject(config('app.name') . ' - Vordering');\n $message->from(APP_EMAIL);\n });\n\n $message = new MessageBox;\n $message->subject = 'Factuur over betalingsdatum';\n $message->message = 'Een vordering voor '.$project->project_name.' is verzonden naar '.$contact_client->getFormalName().'. De CalculatieTool.com neemt nu geen verdere stappen meer voor afhandeling van deze factuur.';\n $message->from_user = User::where('username', 'system')->first()['id'];\n $message->user_id = $project->user_id;\n\n $message->save();\n\n } else if ($invoice->isExpiredSecond()) {\n $data = array(\n 'email' => $contact_client->email,\n 'project_name' => $project->project_name,\n 'client' => $contact_client->getFormalName(),\n 'pref_email_invoice_last_reminder' => $user->pref_email_invoice_last_reminder,\n 'user' => $contact_user->getFormalName()\n );\n Mail::send('mail.invoice_last_reminder', $data, function($message) use ($data) {\n $message->to($data['email'], mb_strtolower(trim($data['client'])));\n $message->subject(config('app.name') . ' - Tweede betalingsherinnering');\n $message->from(APP_EMAIL);\n });\n\n $message = new MessageBox;\n $message->subject = 'Factuur over betalingsdatum';\n $message->message = 'Een 2e betalingsherinnering voor '.$project->project_name.' is verzonden naar '.$contact_client->getFormalName().'.';\n $message->from_user = User::where('username', 'system')->first()['id'];\n $message->user_id = $project->user_id;\n\n $message->save();\n\n } else if ($invoice->isExpiredFirst()) {\n $data = array(\n 'email' => $contact_client->email,\n 'project_name' => $project->project_name,\n 'client' => $contact_client->getFormalName(),\n 'pref_email_invoice_first_reminder' => $user->pref_email_invoice_first_reminder,\n 'user' => $contact_user->getFormalName()\n );\n Mail::send('mail.invoice_first_reminder', $data, function($message) use ($data) {\n $message->to($data['email'], mb_strtolower(trim($data['client'])));\n $message->subject(config('app.name') . ' - Betalingsherinnering');\n $message->from(APP_EMAIL);\n });\n\n $message = new MessageBox;\n $message->subject = 'Factuur over betalingsdatum';\n $message->message = 'Een 1e betalingsherinnering voor '.$project->project_name.' is verzonden naar '.$contact_client->getFormalName().'.';\n $message->from_user = User::where('username', 'system')->first()['id'];\n $message->user_id = $project->user_id;\n\n $message->save();\n }\n }\n\n })->dailyAt('06:30');\n\n $schedule->call(function() {\n foreach (User::where('active',true)->whereNotNull('confirmed_mail')->whereNull('banned')->whereNull('payment_subscription_id')->get() as $user) {\n if ($user->isAlmostDue()) {\n if (UserGroup::find($user->user_group)->subscription_amount == 0)\n continue;\n\n $data = array(\n 'email' => $user->email,\n 'firstname' => $user->firstname,\n 'lastname' => $user->lastname\n );\n\n Mail::send('mail.due', $data, function($message) use ($data) {\n $message->to($data['email'], ucfirst($data['firstname']) . ' ' . ucfirst($data['lastname']));\n $message->subject(config('app.name') . ' - Account verlengen');\n $message->from(APP_EMAIL);\n });\n }\n }\n })->daily();\n\n $schedule->call(function() {\n foreach (User::where('active',true)->whereNull('confirmed_mail')->get() as $user) {\n if ($user->canArchive()) {\n $user->active = false;\n $user->save();\n }\n }\n\n })->daily();\n\n $schedule->call(function() {\n foreach (Payment::select('user_id')->where('status','paid')->groupBy('user_id')->get() as $payment) {\n $user = User::find($payment->user_id);\n if (!$user)\n continue;\n if (!$user->active)\n continue;\n\n /* Paying */\n Newsletter::subscribe($user->email, [\n 'FNAME' => $user->firstname,\n 'LNAME' => $user->lastname\n ], 'paying');\n\n /* Registration */\n Newsletter::unsubscribe($user->email);\n }\n })->daily();\n\n $schedule->call(function() {\n foreach (User::where('active',true)->whereRaw(\"\\\"confirmed_mail\\\" > NOW() - '1 week'::INTERVAL\")->get() as $user) {\n\n /* Paying */\n Newsletter::subscribe($user->email, [\n 'FNAME' => $user->firstname,\n 'LNAME' => $user->lastname\n ]);\n\n /* Registration */\n Newsletter::unsubscribe($user->email, 'noaccount');\n }\n })->daily();\n\n $schedule->command('oauth:clear')->daily();\n }", "public function Fleetscheduled() {\n\t\ttry {\n\t\t\t// DB::enableQueryLog();\n\t\t\t$requests = UserRequests::where( 'status', 'SCHEDULED' )\n\t\t\t\t->whereHas( 'provider',\n\t\t\t\t\tfunction ( $query ) {\n\t\t\t\t\t\t$query->where( 'fleet', Auth::user()->id );\n\t\t\t\t\t} )->get();\n\t\t\t$requests2 = UserRequests::where( 'status', 'SCHEDULED' )\n\t\t\t\t->where( 'fleet_id', Auth::user()->id )->get();\n\t\t\tforeach ( $requests2 as $key => $value ) {\n\t\t\t\t$exist = false;\n\t\t\t\tforeach ( $requests as $key1 => $value1 ) {\n\t\t\t\t\tif ( $value->id == $value1->id ) {\n\t\t\t\t\t\t$exist = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( ! $exist ) {\n\t\t\t\t\t$requests->push( $value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// dd(DB::getQueryLog());\n\n\t\t\treturn view( 'fleet.request.scheduled', compact( 'requests' ) );\n\t\t} catch ( Exception $e ) {\n\t\t\treturn back()->with( 'flash_error',\n\t\t\t\ttrans( 'admin.something_wrong' ) );\n\t\t}\n\t}", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('make:rss')->hourly();\n\n }", "public function Add_Task(ECash_Nightly_Event $task)\n\t{\n\t\t$task->setServer($this->server);\n\t\t$task->setCompanyShort($this->server->company);\n\t\t$task->setCompanyId($this->server->company_id);\n\n\t\t$this->tasks[] = new CronScheduler_Task($task);\n\t\treturn $task;\n\t}", "protected function schedule(Schedule $schedule)\n {\n $schedule->call(function () {\n\n $unassigned_orders = Order::where('status','New')->get();\n foreach($unassigned_orders as $order){\n $pharmacies = Pharmacy::where('area_id',$order->address->area_id)->get();\n if( empty($pharmacies->first()) ){continue;}\n $pharmacy = $pharmacies->sortBy('priority')->first();\n\n $order->update([\n 'pharmacy_id' => $pharmacy->id,\n 'status' => 'Processing',\n ]);\n }\n })->everyminute();\n }", "public static function fetch()\n {\n return eZPersistentObject::fetchObject( eZStaticExportScheduler::definition(),\n null,\n null,\n true );\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->call(function () {\n $users=User::all();\n foreach ($users as $user){\n $articles=$user->articles()->wherePivot('type','like','achat');\n\n }\n\n DB::table('deal_user')->where('expired_at', '<',Carbon::now())->update(['status' => 'expired']);\n })->everyMinute();\n }" ]
[ "0.6572373", "0.6572373", "0.6366768", "0.6366768", "0.5702534", "0.5109764", "0.5058318", "0.48950315", "0.47843176", "0.4772766", "0.47531956", "0.47453848", "0.47324267", "0.47270203", "0.47241023", "0.47124407", "0.4704427", "0.46833146", "0.4660502", "0.4655491", "0.46513942", "0.46471426", "0.46382996", "0.462901", "0.46177518", "0.46136346", "0.4606781", "0.4604881", "0.45860595", "0.45788905", "0.45636168", "0.4550267", "0.45486647", "0.4546169", "0.45315158", "0.45231432", "0.45211396", "0.45197186", "0.45081952", "0.450125", "0.44984245", "0.44971988", "0.44944775", "0.44878563", "0.44842207", "0.44782713", "0.44672045", "0.44658962", "0.4464897", "0.4452522", "0.44396976", "0.44394237", "0.44262546", "0.44261536", "0.44261324", "0.44179884", "0.44162282", "0.4408752", "0.4390193", "0.4385765", "0.43836018", "0.43782872", "0.43719348", "0.43686762", "0.43661532", "0.43518358", "0.43508384", "0.43486342", "0.4345819", "0.43343848", "0.43318588", "0.4330911", "0.43236864", "0.4319411", "0.4318753", "0.43170056", "0.4309758", "0.43061277", "0.4300593", "0.42940438", "0.42932802", "0.42905772", "0.42903402", "0.4285708", "0.4274624", "0.42714798", "0.42705765", "0.42699552", "0.42662194", "0.4262481", "0.42591363", "0.42538387", "0.42482933", "0.42384067", "0.42383024", "0.4237191", "0.42282394", "0.4226912", "0.42244107", "0.42207113" ]
0.7516411
0
Returns the name of the relation.
public static function getRelationName(): Name { return new Name('get the score'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRelationshipName();", "public function getRelationshipName() {\n\t\treturn self::RelationshipNamePrefix . $this->getToName() . self::RelationshipNameSuffix;\n\t}", "abstract protected function relationName(): string;", "public function getRelationName()\n {\n if ($this->_poll_name == null) {\n //throw exception? wasn't added via Doctrine_Pollable_Storage::addGenerator()\n }\n\n return $this->_poll_name . $this->_name;\n }", "public function getRelation(): string\n {\n return $this->relation;\n }", "public static function getRelationName(): Name\n {\n return new Name('crowdfunding');\n }", "public static function getRelationName(): Name\n {\n return new Name('crowdfunding');\n }", "public static function getRelationName(): Name\n {\n return new Name('composer-in-residence');\n }", "public static function getRelationName(): Name\n {\n return new Name('glass mastered');\n }", "public function name(): string\n {\n if (isset($this->name)) {\n return $this->name;\n }\n\n $relation = Str::studly($this->pivotRelationName);\n\n return 'detach'.$relation.'On'.$this->modelSchema->getTypename();\n }", "public static function getRelationName(): Name\n {\n return new Name('commissioned');\n }", "public function getName() {\n\n //$local_column\n switch($this->type) {\n case self::ONE_TO_ONE:\n $name = $this->getReferencedTable()->getName();\n break;\n case self::MANY_TO_ONE:\n //in this case we need to name the relation based on the column, trimming off _id (if it exists)\n $name = $this->local_columns[0]->getName();\n if(substr($name, -3) === '_id')\n $name = substr($name, 0, -3);\n break;\n case self::ONE_TO_MANY:\n //slightly more complex to remove collisions between m2m names\n $name = Wave\\Inflector::pluralize($this->getReferencedTable()->getName());\n $ref_name = $this->referenced_columns[0]->getName();\n if(substr($ref_name, -3) === '_id')\n $ref_name = substr($ref_name, 0, -3);\n if($ref_name !== $this->getLocalTable()->getName())\n $name .= '_' . $ref_name;\n break;\n case self::MANY_TO_MANY:\n $columns = $this->target_relation->getLocalColumns();\n $name = $columns[0]->getMetadata('relation_name');\n if($name === null) {\n $name = $this->target_relation->getReferencedTable()->getName();\n }\n\n $name = Wave\\Inflector::pluralize($name);\n break;\n }\n\n return Wave\\Inflector::camelize($name);\n\n }", "public static function getRelationName(): Name\n {\n return new Name('part of');\n }", "public function getRelationFieldName() {}", "public static function getRelationName(): Name\n {\n return new Name('allmusic');\n }", "public function getRelaterName()\n {\n $value = $this->get(self::RELATER_NAME);\n return $value === null ? (string)$value : $value;\n }", "public static function getRelationName(): Name\n {\n return new Name('legal representation');\n }", "public static function getRelationName(): Name\n {\n return new Name('online data');\n }", "public static function getRelationName(): Name\n {\n return new Name('mixed at');\n }", "public static function getRelationName(): Name\n {\n return new Name('writer');\n }", "public static function getRelationName(): Name\n {\n return new Name('history site');\n }", "public function getName()\n\t{\n\t\tif(empty($this->name))\n\t\t{\n\t\t\tthrow new Db_Descriptor_MissingValueException('relation name', $this->getParentDescriptor()->getClass());\n\t\t}\n\t\t\n\t\treturn $this->name;\n\t}", "public function getQualifiedForeignKeyName(): string\n {\n return $this->related->getQualifiedKeyName();\n }", "public static function getRelationName(): Name\n {\n return new Name('phonographic copyright');\n }", "public static function getRelationName(): Name\n {\n return new Name('distributed');\n }", "public static function getRelationName(): Name\n {\n return new Name('setlistfm');\n }", "public function getRelationName($attributeName);", "public function getRelationModelName() {\n return $this->relationModelName;\n }", "public static function getRelationName(): Name\n {\n return new Name('last.fm');\n }", "public function relationNames()\n {\n return [\n 'detailbeasiswas'\n ];\n }", "public function relationNames()\n {\n return [\n 'akumulasiPoint',\n 'sanksi',\n 'siswa'\n ];\n }", "public function getRelationshipName(): ?string;", "public function getQualifiedForeignKeyName()\n {\n return $this->foreignKey;\n }", "public function relationNames()\n {\n return [\n 'educador',\n 'user',\n 'planoEducadorLicencas'\n ];\n }", "public function relationNames()\n {\n return [\n 'pegawais'\n ];\n }", "public function getRefRelationCollVarName(Relation $relation)\n {\n return lcfirst($this->getRefRelationPhpName($relation, true));\n }", "public function getRelation()\n {\n return $this->relation;\n }", "public function relationNames()\n {\n return [\n 'immobilien',\n 'kunde'\n ];\n }", "public function getRelation()\r\n {\r\n return $this->relation;\r\n }", "public function getRelated(): string\n {\n return $this->related;\n }", "public function relationNames()\r\n {\r\n return [\n 'especie',\n 'lance'\n ];\r\n }", "public function getForeignKeyName() {\n return $this->foreignKeyName;\n }", "public static function getRelationName(): Name\n {\n return new Name('streaming music');\n }", "public static function getRelationName(): Name\n {\n return new Name('video channel');\n }", "public static function getRelationName(): Name\n {\n return new Name('video channel');\n }", "public function getRelationPhpName(Relation $relation, $plural = false)\n {\n if ($relation->getField()) {\n if ($plural) {\n return ucfirst($this->getBuilder()->getPluralizer()->getPluralForm($relation->getField()));\n }\n\n return ucfirst($relation->getField());\n }\n\n $className = $relation->getForeignEntity()->getName();\n if ($plural) {\n $className = $this->getBuilder()->getPluralizer()->getPluralForm($className);\n }\n\n return ucfirst($className . $this->getRelatedBySuffix($relation));\n }", "public function relationNames()\n {\n return [];\n }", "public function relationNames()\r\n {\r\n return [\r\n 'kelas',\r\n 'siswa'\r\n ];\r\n }", "public function getPKRefRelationVarName(Relation $relation)\n {\n return lcfirst($this->getRefRelationPhpName($relation, false));\n }", "public function relationNames()\n {\n return [\n 'siswa'\n ];\n }", "public function getRelationNames()\n\t{\n\t\treturn array_keys($this->relations);\n\t}", "public function getRefRelationPhpName(Relation $relation, $plural = false)\n {\n $pluralizer = $this->getBuilder()->getPluralizer();\n if ($relation->getRefField()) {\n return ucfirst($plural ? $pluralizer->getPluralForm($relation->getRefField()) : $relation->getRefField());\n }\n\n $className = $relation->getEntity()->getName();\n if ($plural) {\n $className = $pluralizer->getPluralForm($className);\n }\n\n return ucfirst($className . $this->getRefRelatedBySuffix($relation));\n }", "public function relationNames()\n {\n return [\n 'siswas'\n ];\n }", "private static function getHasOneOrManyForeignKeyName(HasOneOrMany $relation)\n {\n if (method_exists($relation, 'getPlainForeignKey')) {\n return $relation->getPlainForeignKey();\n } else {\n // for laravel 5.4+\n return $relation->getForeignKeyName();\n }\n }", "public function instance_slug() {\n\t\t\treturn 'relations';\n\t\t}", "public function name()\n\t{\n\t\tif ($attributes = $this->getRelationValue('attributes')) {\n\t\t\treturn $attributes->loadMissing('translations', 'group.translations')->map(function($attribute) {\n\t\t\t\treturn $attribute->group->getTranslation('name') . ':' . $attribute->getTranslation('value');\n\t\t\t})->implode(' - '); \n\t\t} \n\t}", "private function getPropertyName(): string\n {\n $name = $this->foreignKey->getLocalTableName();\n if ($this->hasLocalUniqueIndex()) {\n $name = TDBMDaoGenerator::toSingular($name);\n }\n return TDBMDaoGenerator::toCamelCase($name);\n }", "public function getRelationTableName()\n {\n if (!empty($this->relationTableName)) {\n return $this->relationTableName;\n }\n $relationTableName = 'tx_' . str_replace('_', '', $this->domainObject->getExtension()->getExtensionKey()) . '_';\n $relationTableName .= strtolower($this->domainObject->getName());\n\n if ($this->useExtendedRelationTableName) {\n $relationTableName .= '_' . strtolower($this->getName());\n }\n $relationTableName .= '_' . strtolower($this->getForeignModelName()) . '_mm';\n\n return $relationTableName;\n }", "public function name()\n\t{\n\t\treturn $this->get($this->meta()->name_key);\n\t}", "public function getName(): string\n {\n return $this->getIdentifier()->getName();\n }", "public function getRelationshipClassName() {\n\t\treturn self::RelationshipClassNamePrefix . static::from_field_name() . static::to_field_name() . self::RelationshipClassNameSuffix;\n\t}", "protected function getRelationTable(string $relation) : string\n {\n return $this->builder\n ->getModel()\n ->{$relation}()\n ->getRelated()\n ->getTable();\n }", "public function getRelationVarName(Relation $relation, $plural = false)\n {\n return lcfirst($this->getRelationPhpName($relation, $plural));\n }", "public function getForeignKeyName()\n {\n $segments = explode('.', $this->getQualifiedForeignKeyName());\n\n return end($segments);\n }", "public function relationNames()\n {\n return [\n 'release'\n ];\n }", "public function getName()\n {\n $person = $this->getPerson()->one();\n return $person->getFullName();\n }", "public function getQualifiedForeignKeyName()\n {\n return $this->farChild->qualifyColumn($this->secondKey);\n }", "public function getQualifiedName(): string\n {\n return $this->namespace.'.'.$this->name;\n }", "public function getForeignKey(): string\n {\n return $this->foreignKey;\n }", "public function relationNames()\r\n {\r\n return [\n 'vendas'\n ];\r\n }", "public function getRel()\n {\n return $this->rel;\n }", "public final function getRelation()\n {\n if ($this->_relation === null)\n {\n $this->_relation = $this->getTable()\n ->getRelation($this->getRelationAlias());\n }\n\n return $this->_relation;\n }", "public function getReferenceName()\n {\n return $this->reference_name;\n }", "public function name()\n {\n if (isset($this->attributes[self::NAME])) {\n return $this->attributes[self::NAME];\n }\n\n return $this->path();\n }", "public function getRevisionHistoryName()\n {\n $revisionHistoryRelation = array_get($this->model->getDynamicProperties(), self::REVISION_HISTORY_NAME_PROPERTY)\n ?: self::REVISION_HISTORY_NAME;\n\n if (defined($this->model . '::REVISION_HISTORY')) {\n $revisionHistoryRelation = $this->model::REVISION_HISTORY;\n }\n\n return $revisionHistoryRelation;\n }", "public function name(): string\n {\n return 'belongsTo';\n }", "public function getQualifiedName()\n {\n // TODO: Implement getQualifiedName() method.\n }", "public function getRel()\r\n {\r\n return $this->rel;\r\n }", "public function getRelationId()\n {\n return $this->relation_id;\n }", "public function getName() {\n return $this->__name;\n }", "public function getName() {\n return $this->getFullName();\n }", "public static function getRelationName($name): string\n {\n\n $RELATIONS_NAME = [\n 'CATEGORIES' => 'categories',\n 'COMMENTS' => 'comments',\n 'USER_lIKES' => 'user_likes'\n\n ];\n\n return Arr::pull($RELATIONS_NAME, Str::upper($name));\n\n }", "public function getName(): string\n {\n if (!$this->useAlternateName) {\n return 'get' . $this->getPropertyName();\n } else {\n $methodName = 'get' . $this->getPropertyName() . 'By';\n\n $camelizedColumns = array_map([TDBMDaoGenerator::class, 'toCamelCase'], $this->foreignKey->getUnquotedLocalColumns());\n\n $methodName .= implode('And', $camelizedColumns);\n\n return $methodName;\n }\n }", "public function name()\n {\n return $this->getName();\n }", "public function name()\n {\n return $this->getName();\n }", "public function getRelationType()\n {\n return $this->relationType;\n }", "public function getRelationType()\n {\n return $this->relationType;\n }", "public function getRealName() {\n\t\treturn $this->name;\n\t}", "public function getFirstForeignKeyName(): string\n {\n return sprintf('%s%s', $this->prefix, $this->getForeignKeyName($this->through_parents->last()));\n }", "public function name(): string\n {\n return $this->pluck('trophyTitleName');\n }", "public function getOppoName()\n {\n return $this->get(self::_OPPO_NAME);\n }", "public function getName() {\n return $this->__name;\n }", "public function getRelationType()\n {\n return $this->relation_type;\n }", "public function getQualifiedName()\r\n {\r\n return $this->getNamespace()->qualify($this->getName());\r\n }", "public function getName()\n {\n return $this->get('name');\n }", "public function getRel(): string;", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function getName() {\n $path = explode('\\\\', get_class($this->object[\"data\"]));\n return array_pop($path);\n }", "public function getForeignKey()\n {\n return $this->table . '.' . $this->foreignKey;\n }" ]
[ "0.80709964", "0.79545003", "0.79404664", "0.7932364", "0.79135466", "0.7878098", "0.7878098", "0.782148", "0.7706934", "0.7662896", "0.76567113", "0.75715476", "0.75588477", "0.75062716", "0.7483293", "0.74785393", "0.7473711", "0.7423222", "0.73826665", "0.7370776", "0.7353008", "0.7199953", "0.7154861", "0.712905", "0.71246725", "0.7102825", "0.7097521", "0.70876354", "0.70655775", "0.69593793", "0.69407076", "0.6930254", "0.6921826", "0.69134635", "0.6888994", "0.6867485", "0.68631345", "0.68416005", "0.6827541", "0.6819567", "0.68160516", "0.67745984", "0.6764283", "0.67031217", "0.67031217", "0.6689575", "0.66691744", "0.6665018", "0.6661395", "0.66338927", "0.6631267", "0.6628905", "0.6626996", "0.66229224", "0.66164714", "0.6611378", "0.6592048", "0.65628916", "0.6527894", "0.6472427", "0.64680207", "0.6466597", "0.6458636", "0.64460474", "0.6423258", "0.641035", "0.64030665", "0.63830346", "0.6378555", "0.63710576", "0.63633966", "0.6335563", "0.63286895", "0.63073766", "0.6306413", "0.6287952", "0.6272345", "0.627184", "0.6259716", "0.624462", "0.6233355", "0.6230848", "0.6228123", "0.62252295", "0.62252295", "0.62251437", "0.62251437", "0.62204367", "0.6215375", "0.62141967", "0.6204063", "0.61938053", "0.6186241", "0.6180927", "0.61790377", "0.6159812", "0.6159089", "0.6159089", "0.615272", "0.61424357" ]
0.76001465
11
verify that the account exists
function check_requirements() { if (!$this->obj_chart->verify_id()) { log_write("error", "page_output", "The requested account (". $this->id .") does not exist - possibly the account has been deleted."); return 0; } unset($sql_obj); // check the lock status of the account $this->locked = $this->obj_chart->check_delete_lock(); return 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function isAccountExist()\n {\n $sessionId = \\Session::getId();\n $account = Account::where('session_id', $sessionId)->first();\n if (!$account) return false;\n\n return true;\n }", "public function checkUserExist($account){\n $query = \"select * from members where account=\\\"$account\\\"\";\n $result = $this->dbh->query($query);\n if($result->rowCount() > 0){\n return true;\n }\n return false;\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 validate_account(){ \n\t\tif($this->data['Client']['account_holder'][0] != ''){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function has_account()\n{\n return file_exists(DEFAULT_ACCOUNTFILE);\n}", "private function new_account($username){\n\t\t\t\t\n\t\t$stmt = $this->db->prepare('SELECT * FROM account WHERE username=:username');\n\t\t$stmt->execute(['username'=>$username]);\n\t\t$result = $stmt->fetch();\n\t\t//the if loop checks if the account exists\n\t\tif(is_array($result) && count($result) > 0){\n\t\t\treturn false;//does exists\n\t\t}\n\t\treturn true;//does not exist\n\t}", "private function checkUserExistence() {\n\t\t\t\t$query = \"select count(email) as count from register where email='$this->email'\";\n\t\t\t\t$resource = returnQueryResult($query);\n\t\t\t\t$result = mysql_fetch_assoc($resource);\n\t\t\t\tif($result['count'] > 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "public function accountExists($email) {\r\n $this->db = new Db();\r\n \r\n $this->db->scrub($email);\r\n $query = \"SELECT UID FROM MEMBER WHERE EMAIL = '\".$email.\"'\";\r\n $results = $this->db->select($query);\r\n return(sizeof($results)>0);\r\n }", "private function verifyAccount()\n {\n $check = $this->db->query('SELECT users.password, users.id FROM users WHERE username = ?', $this->username)->fetchArray();\n //Check of de user in de database staat.\n if (isset($check['password'])) {\n //Check of de password matched\n if (password_verify($this->password, $check['password'])) {\n echo \"AUTH verify complete\";\n $this->setLoggedinUser($check['id']);\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "function isAccountExist($db, $user_email) {\n $TEST_ACCOUNT_EXIST = \"SELECT user_id FROM user WHERE user_email = ?\";\n $accountExist = false; //Par defaut, le compte n'existe pas\n\n if (!is_null($user_email)) {\n $resultats = $db->prepare($TEST_ACCOUNT_EXIST);\n $resultats->execute(array($user_email));\n\n //Le compte existe\n if ($resultats->rowCount() == 1) {\n $accountExist = true;\n }\n $resultats->closeCursor();\n }\n\n return $accountExist;\n}", "private function isAccountValid($account) {\n\t\t// Ensure the prefix is unique (or empty if self-hosted)\n\t\tif ($account->selfHost) return true;\n\t\t$sql = \t<<<EOD\n\t\t\t\tSELECT F_RootID, F_Prefix\n\t\t\t\tFROM T_AccountRoot\n\t\t\t\tWHERE F_Prefix=?\nEOD;\n\t\t$rs = $this->db->Execute($sql, array($account->prefix));\n\t\t\n\t\tswitch ($rs->RecordCount()) {\n\t\t\tcase 0:\n\t\t\t\t// There are no duplicates\n\t\t\t\treturn true;\n\t\t\tcase 1:\n\t\t\t\t// There is a duplicate, but if this is an update it might be the same record\n\t\t\t\treturn ((int)($rs->FetchNextObj()->F_RootID) == (int)($account->id));\n\t\t\tdefault:\n\t\t\t\t// Something is wrong with the database!\n\t\t\t\tthrow new Exception(\"isAccountValid: More than one account was returned with prefix '\".$account->prefix.\"'\");\n\t\t}\n\t}", "public static function checkAccount () {\n $user_id = session::getUserId();\n if ($user_id) {\n $a = q::select('account')->filter('id =', $user_id)->fetchSingle();\n \n // user may have been deleted\n if (empty($a)) {\n self::killSessionAll($user_id);\n return false;\n } \n \n if ($a['locked'] == 1) {\n self::killSessionAll($user_id);\n return false;\n }\n }\n return true;\n }", "public function accountExists($username)\n {\n $params = [\n 'user' => $username,\n 'action' => 'list'\n ];\n\n $accountResponse = $this->apiRequest('accountdetail', $params);\n return $accountResponse->status() == 200 && empty($accountResponse->errors());\n }", "public function hasAccount($key);", "function is_user_exists($cellphone,$password)\n {\n\n $query=$this->db->query(\"SELECT * FROM xl_account WHERE cellphone='{$cellphone}' AND password='{$password}' AND register_user=1\");\n\n if ($query->num_rows()>0) {\n #if exist return true\n return TRUE;\n }\n\n return FALSE; \n }", "protected function hasAccount(): bool\n {\n if (null === $this->hasAccount) {\n $account = $this->accountContext->getAccount();\n if (null !== $account) {\n $this->account = $account;\n $this->hasAccount = true;\n } else {\n $this->hasAccount = false;\n }\n }\n\n return $this->hasAccount;\n }", "public function testCheckIfAccountExpired()\n {\n }", "public function checkemail() {\n\n if (env(\"NEW_ACCOUNTS\") == \"Disabled\" && env(\"GUEST_SIGNING\") == \"Disabled\") {\n\n $account = Database::table(\"users\")->where(\"email\", input(\"email\"))->first();\n if (!empty($account)){\n response()->json(array(\"exists\" => true));\n }else{\n response()->json(array(\"exists\" => false));\n }\n\n }\n\n }", "function dbUserExists($unm)\n{\n\t$result = false;\n\t$sql = \"SELECT username FROM _account WHERE username = '$unm'\";\n\ttry {\n\t\t$stmt = Database :: prepare ( $sql );\n\t\t$stmt->execute();\n\t\t$count = $stmt -> rowCount();\n\t\tif ($count > 0) {\n\t\t\t$result = true; //Username already taken\n\t\t}\n\t\t$stmt->closeCursor ( ) ;\n\t}\n\tcatch(PDOException $e)\n\t{\n\t\techo $e->getMessage();\n\t}\n\treturn $result;\n}", "static public function verifyAccountName(&$accountName, &$error)\n\t{\n\t\treturn true;\n\t}", "public function _assertProfileExists($profile_uid)\n {\n }", "public function existeUser($acc){\n\t\tUtilidades::_log(\"existeUser($acc)\");\n\t\t$db=DB::conectar();\n\t\t$select=$db->prepare('SELECT * FROM user WHERE account=:account');\n\t\t$select->bindValue('account',$acc);\n\t\t$select->execute();\n\t\t$registro=$select->fetch();\n\t\tif(null != registro['id']){\n\t\t\t$usado=False;\n\t\t}else{\n\t\t\t$usado=True;\n\t\t}\t\n\t\treturn $usado;\n\t}", "public function userExists() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection(); \n\t\t\n //inserts username and password in to users table\n $data =(\"SELECT user_id FROM user WHERE username ='{$this->_username}'\");\n\t\t$result = $mysqli->query($data);\n return(mysqli_num_rows($result) > 0) ? 1 : 0;\n }", "private function _isValidAccount( $blz, $account ) {\n return ( TRUE );\n }", "public function setAccountExists($t){\n global $Account_exists;\n $Account_exists = $t;\n }", "protected function _validateAccount() {\n\t\tif(!check($this->_username)) return;\n\t\tif(!check($this->_password)) return;\n\t\t$data = array(\n\t\t\t'username' => $this->_username,\n\t\t\t'password' => $this->_password\n\t\t);\n\t\tif($this->_md5Enabled) {\n\t\t\t$query = \"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_USERNM_.\" = :username AND \"._CLMN_PASSWD_.\" = [dbo].[fn_md5](:password, :username)\";\n\t\t} else {\n\t\t\t$query = \"SELECT * FROM \"._TBL_MI_.\" WHERE \"._CLMN_USERNM_.\" = :username AND \"._CLMN_PASSWD_.\" = :password\";\n\t\t}\n\t\t\n\t\t$result = $this->db->queryFetchSingle($query, $data);\n\t\tif(!is_array($result)) return;\n\t\t\n\t\treturn true;\n\t}", "public function checkaccount()\n {\n $this->data['lang'] = $this->language;\n $apiKey = preg_replace('/[^[:alnum:]]/i', '', $this->request->get['apikey']);\n $this->data['onego_jssdk_url'] = OneGoConfig::get('jsSdkURI').'?apikey='.$apiKey;\n $this->template = 'total/onego_status_jssdk.tpl';\n $this->response->setOutput($this->render());\n }", "public function accountIdExists($id){\n try{\n $sql = 'SELECT idaccount FROM accounts WHERE idaccount=:id';\n $query = pdo()->prepare($sql);\n $query->bindValue(':id', $id, PDO::PARAM_INT);\n $query->execute();\n $res = $query->fetch(PDO::FETCH_ASSOC);\n $query->closeCursor();\n if($res){\n return true;\n }\n }\n catch(Exception $e)\n {\n trigger_error('Echec lors de la vérification si le compte(ID) existe : '.$e->getMessage(), E_USER_ERROR);\n }\n return false;\n }", "public function account()\n {\n if ($response = $this->request('account')) {\n if (isset($response->success) && $response->success == true) {\n return $response->account;\n }\n }\n return false;\n }", "public function check()\n {\n if($this->user_provider->retrieveById($this->user_provider->getAuthIdentifier()))\n return true;\n\n return false;\n }", "public function user_cannot_register_an_account_with_exist_account_credentials() :void\n {\n $this->browse(function (Browser $browser) {\n\t $user1 = factory(User::class)->create();\n\n\t $user2= factory(User::class)->make([\n\t\t 'username'=>$user1->username,\n\t \t'email'=>$user1->email,\n\t\t 'password'=>'secret'\n\t ]);\n\t /*\n\t $user2 = new User();\n\t $user2->name = $user1->name;\n\t $user2->email = $user1->email;\n\t $user2->password = 'secret';*/\n\n $browser->visit('/')\n // ->click('#accountDropdown')\n ->clickLink('Account')\n ->click('#nav-register')\n ->assertSee('Register');\n\n $this->submitForm($browser,\n [\n ['field_name'=>'first_name', 'field_value' =>$user2->first_name, 'field_type'=> 'text'],\n\t ['field_name'=>'last_name', 'field_value' =>$user2->last_name, 'field_type'=> 'text'],\n\t ['field_name'=>'username', 'field_value' =>$user2->username, 'field_type'=> 'text'],\n ['field_name'=>'email', 'field_value' =>$user2->email, 'field_type'=> 'text'],\n ['field_name'=>'password', 'field_value' =>$user2->password, 'field_type'=> 'text'],\n ['field_name'=>'password_confirmation', 'field_value' =>ucfirst($user2->password), 'field_type'=> 'text']\n ]\n );\n\n //Assertion not written\n $browser->assertpathIs('/register')\n\t ->assertSeeIn('#registerForm > div:nth-child(4) .invalid-feedback-content','The username has already been taken.')\n ->assertSeeIn('#registerForm > div:nth-child(5) .invalid-feedback-content','The email has already been taken.')\n ->clickLink('Account')\n ->assertSeeIn('.main-nav', 'Login')\n ->assertSeeIn('.main-nav', 'Sign Up');\n });\n }", "function check_rebrandly_account() {\n $options = get_option('sbrb_settings');\n // If API Key option not set, do nothing\n if( $options['sbrb_api_key'] == '' )\n return;\n\n $url = 'https://api.rebrandly.com/v1/account';\n\n $result = wp_remote_get(\n $url, \n array(\n 'headers' => array(\n 'apikey' => $options['sbrb_api_key']\n )\n )\n );\n\n $response = ( $result['response']['code'] == 200 ) ? true : false;\n\n return $response;\n }", "public function userExists( $user_name ) { return true;}", "private function findAccount() {\n\t\t\tassertArray($this->errorMsgs);\n\t\t\t// find existing email/login\n\t\t\t$result = $this->dbh->query(\"SELECT `affiliateID`, `email`, `password` FROM `affiliates` WHERE `email` = '\".prepDB($this->registrationForm['email']).\"'\");\n\t\t\tif (isset($_REQUEST['affiliateLogin'])) {\n\t\t\t\t// login\n\t\t\t\tif ($this->affiliateID) {\n\t\t\t\t\t// already logged in\n\t\t\t\t\t$this->errorMsgs[] = 'You are already logged in, please log out first';\n\t\t\t\t} elseif ($result->rowCount) {\n\t\t\t\t\t$row = $result->fetchAssoc();\n\t\t\t\t\tif ($row['password'] != $this->registrationForm['password']) {\n\t\t\t\t\t\t// login, incorrect password\n\t\t\t\t\t\t$this->errorMsgs[] = 'Incorrect password for '.$this->registrationForm['email'];\n\t\t\t\t\t\taddErrorField('password');\n\t\t\t\t\t} elseif (!$this->affiliateID) {\n\t\t\t\t\t\t// affiliate id is the logged in flag\n\t\t\t\t\t\t// the only way affiliate id can be set is if user successfully creates a new account or logs in\n\t\t\t\t\t\t$this->affiliateID = $row['affiliateID'];\n\t\t\t\t\t\t// update login count\n\t\t\t\t\t\t$this->dbh->query(\"UPDATE `affiliates` SET `totalLogins` = `totalLogins` + 1 WHERE `affiliateID` = '\".prepDB($this->affiliateID).\"'\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->errorMsgs[] = 'You are already logged in, please log out first';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// no email found\n\t\t\t\t\t$this->errorMsgs[] = 'Email not found';\n\t\t\t\t}\n\t\t\t} elseif ($this->affiliateID) {\n\t\t\t\t// affiliate changing account info\n\t\t\t\tif ($result->rowCount) {\n\t\t\t\t\t$row = $result->fetchAssoc();\n\t\t\t\t\tif ($row['affiliateID'] != $this->affiliateID) {\n\t\t\t\t\t\t// user entered an existing address/login that belongs to another account\n\t\t\t\t\t\t$this->errorMsgs[] = $this->registrationForm['email'].' has an existing account, please enter a different email address';\n\t\t\t\t\t\taddErrorField('email');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->errorMsgs[] = 'You are currently using this email address';\n\t\t\t\t\t\taddErrorField('email');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ($result->rowCount) {\n\t\t\t\t// new account\n\t\t\t\t$row = $result=>fetchAssoc();\n\t\t\t\tif ($row['email'] == prepDB($this->registrationForm['email'])) {\n\t\t\t\t\t$this->errorMsgs[] = $this->registrationForm['email'].' has an existing account, please log in or enter a different email address';\n\t\t\t\t\taddErrorField('email');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function isUserExist($con,$androidId,$username,$email){\n\t$sql = \"SELECT * FROM `access`,`owner` WHERE owner.email = access.email AND owner.android_id = '\".$androidId.\"' AND owner.email='\".$email.\"' AND access.username='\".$username.\"' AND access.enable = 'Y'\";\n\n\t$result = mysqli_query($con,$sql);\n\t$value = @mysqli_num_rows($result);\n\n\tif ($value){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "function userExists( $username ) {\n return true;\n }", "public function hasAccountId()\n {\n return $this->account_id !== null;\n }", "public function testProfileCheckIfUserExists()\n {\n\n }", "public function check_insta_user() {\n \n }", "static public function tryToDeleteAccount() {\r\n\t\tDB::getInstance()->stopAddingAccountID();\r\n\t\t$Account = DB::getInstance()->exec('DELETE FROM `'.PREFIX.'account` WHERE `deletion_hash`='.DB::getInstance()->escape($_GET['delete']).' LIMIT 1');\r\n\t\tDB::getInstance()->startAddingAccountID();\r\n\r\n\t\tif ($Account) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "function checkExistsUser($email){\n\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM user Where email=:email\");\n\t\t$stmt->execute(['email'=>$email]);\n\t\t$result = $stmt->fetchAll();\n\t\t$num_rows = count($result);\n\n\t\tif($num_rows > 0){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function randomUser_exists()\t{\n\t\treturn $this->recordNumber(self::RNDUSERSC_NAME) > 0;\n\t}", "function checkUserExists($username){\n\treturn false;\n}", "public function check_user_exist($con,$username) {\n $query = \"SELECT * FROM user WHERE username = '$username'\";\n $result = mysqli_query($con, $query);\n $count = mysqli_num_rows($result);\n if ($count > 0) {\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "public function testUserNotExisted(){\n $array_test = ['email' => '[email protected]', 'pubid' => 4];\n\n $api = new ApiConnection();\n $dataCheck = [\n 'status' => 401,\n 'message' => \"User does not exist\",\n 'data' => []\n ];\n $this->assertEquals($dataCheck, $api->updateAccount($array_test));\n }", "public function user_exists() {\n\t\t$user = $this->search(\"(uid=\".$this->user.\")\");\n\t\treturn $user !== false;\n\t}", "function create_account($firstname, $lastname, $email, $password) {\n\t$query = \"SELECT * FROM \" . $GLOBALS['db_name'] . \".users WHERE email = '$email' LIMIT 1\";\n\t$result = $GLOBALS['db_connection'] -> query($query);\n\t\n\tif ($result -> num_rows > 0) {\n\t\treturn \"E-Mail address already registered\";\n\t}\n\t\n\t// create account\n\t$unique_id = uniqid();\n\t$query = \"INSERT INTO \" . $GLOBALS['db_name'] . \".users (firstname, lastname, email, password, user_id) VALUES ('$firstname', '$lastname', '$email', '$password', '$unique_id')\";\n\t\t\n\tif ($GLOBALS['db_connection'] -> query($query) === TRUE) {\n\t\treturn TRUE;\n\t} else {\n\t\tdisplay_sql_error();\n\t}\n}", "function checkIfUserExists($conn,$data)\n {\n $sql = \"SELECT * FROM tbl_users \n WHERE email='\".$data['email'].\"' AND username='\".$data['username'].\"'\";\n $result = $conn->query($sql);\n return ($result->num_rows>0 ? true : false);\n }", "public function checkAccount(Account $account, int $lastBlock = -1)\n {\n // TODO: Implement checkAccount() method.\n }", "public function isExists(Request $request){\n $mode = $this->isEmail($request->phn_or_email);\n $user = null;\n $flashmail=$request->phn_or_email;\n if($mode){\n $user = User::where('email', $request->phn_or_email)->first();\n }else{\n $user = User::where('phone', $request->phn_or_email)->first();\n }\n if($user){\n $data['flag'] = 6;\n Session::flash ( 'email', $flashmail );\n return redirect('login-user')->with(['msg2' =>'You already have an account, Please login using ' . $request->phn_or_email,'phn_or_email' => $request->phn_or_email]);\n }else{\n return redirect('registration')->with('msg', 'You dont have an account, Please register.');\n }\n }", "public function hasPwIsExist(){\n return $this->_has(2);\n }", "function exists($user_query){\n\t\t\n\t\t//CALL MEMBER FUNCTION QUERY OF THE CURRENT OBJECT\n\t\t$result = $this->query(\"Select username from users where username='\".$user_query.\"'\");\n\t\t\n\t\t//COUNT RESULTS FROM QUERY\n\t\t$count = mysqli_num_rows($result);\n\n\t\t//IF COUNT HAS COUNTED ONE OR MORE RESULTS, RETURN FALSE BECAUSE EMAIL/USER IS ALREADY REGISTERED!\n\t\tif($count>0){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function Exists();", "public function validateAccount () {\n\n if (empty($_GET['token'])) {\n $_SESSION['errors']['token'] = \"Token oublier.\";\n }\n if (empty($_GET['email'])) {\n $_SESSION['errors']['email'] = \"Email oublier.\";\n }\n\n if (empty($_SESSION['errors'])) {\n $sql = \"SELECT count(*) FROM users WHERE registration_token = :tok AND activated = 0\";\n $query = $this->bdd->prepare($sql);\n $query->bindParam(':tok', $_GET['token']);\n $query->execute();\n $result = $query->fetchColumn();\n\n if ($result > 0) {\n $activated = 1;\n $sql = \"UPDATE users SET activated = :activated WHERE registration_token = :registration_token AND email = :email\";\n $query = $this->bdd->prepare($sql);\n $query->bindParam(':registration_token', $_GET['token']);\n $query->bindParam(':email', $_GET['email']);\n $query->bindParam(':activated', $activated);\n $query->execute();\n $_SESSION['errors']['flash'] = \"compte activer.\";\n } else {\n $_SESSION['errors']['error'] = \"Une erreur est survenue lors de la validation de votre compte, votre compte est soit déjà activé, soit le token de validation est incorrect.\";\n }\n }\n }", "function checkIfUserExist($username, $email) {\n $query = getQuery(\"checkIfUserExist.query\", $username, \"\", $email);\n $result = mysql_query($query);\n\n return (mysql_result($result, 0) >= 1);\n}", "public function checkUserAlreadyExists($usn)\n {\n // database connection\n $dbConnectorObject = new DatabaseConnection();\n $dbConnection = $dbConnectorObject->getConnection();\n\n // query to fetch user by usn.\n $fetchByUSNSql = \"SELECT * FROM appuser WHERE USN = '$usn' AND Active = \".Constants::ACTIVE;\n\n // run the query to fetch the user object by usn.\n $objAppuser = $dbConnection->query($fetchByUSNSql);\n\n if($objAppuser->num_rows > 0){\n return true;\n }else{\n return false;\n }\n }", "function userExists($email) {\r\n\t\t\tif ($this->getUser($email) != false)\r\n\t\t\t\treturn true;\r\n\t\t\treturn false;\r\n\t\t}", "static public function tryToActivateAccount() {\r\n\t\tDB::getInstance()->stopAddingAccountID();\r\n\t\t$Account = DB::getInstance()->query('SELECT id FROM `'.PREFIX.'account` WHERE `activation_hash`='.DB::getInstance()->escape($_GET['activate']).' LIMIT 1')->fetch();\r\n\t\tDB::getInstance()->startAddingAccountID();\r\n\r\n\t\tif ($Account) {\r\n\t\t\tDB::getInstance()->update('account', $Account['id'], 'activation_hash', '');\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "public function userExists()\r\n {\r\n $sql = \"SELECT COUNT(*) FROM (SELECT * FROM doctors WHERE email = :email) AS subquery\";\r\n\r\n $query = $this->db_connection->prepare($sql);\r\n $query->bindValue(':email', $this->email);\r\n $query->execute();\r\n\r\n while($result_row = $query->fetch() ){\r\n if($result_row[0] == 1) return true;\r\n else return false;\r\n }\r\n\r\n return false; \r\n }", "public function checkIfAvailable(){\n $user_check_query = self::$connection->db->prepare(\"SELECT * FROM users WHERE name = ? OR email = ?\");\n $user_check_query->bind_param(\"ss\", self::$signUpName, self::$signUpEmail);\n $user_check_query->execute();\n $users = $user_check_query->get_result()->fetch_assoc();\n $user_check_query->close();\n $nameError = false;\n $emailError = false;\n $_POST = array();\n if (isset($users)) {\n foreach($users as $key=>$value) {\n if (strtolower($users['name']) === strtolower(self::$signUpName) && !$nameError) {\n self::addError(\"signUp\", \"Name already exists.\");\n $nameError = true;\n Auth::CreateView('Auth');\n };\n if ($users['email'] === self::$signUpEmail && !$emailError) {\n self::addError(\"signUp\", \"Email already exists.\");\n $emailError = true;\n Auth::CreateView('Auth');\n };\n }\n } else if(count(self::$signUpErrors) === 0){\n $this->registering();\n return true;\n }\n }", "function verify_username_availability($userName){\n $exists = false;\n if(get_user($userName)){\n $exists = true;\n }\n return $exists;\n}", "private function IsFreeAccount() {\n $ret = TRUE;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($curl, CURLOPT_USERAGENT, DOWNLOAD_STATION_USER_AGENT);\n curl_setopt($curl, CURLOPT_COOKIEFILE, $this->TOUTDEBRID_COOKIE);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_URL, $this->TOUTDEBRID_ACCOUNT_URL);\n $AccountRet = curl_exec($curl);\n curl_close($curl);\n preg_match('/Compte:.*<b>(.*)<\\/b>/', $AccountRet, $match);\n if (isset($match[0])) {\n $compare = strtolower($match[0]);\n if (strstr($compare, $this->TOUTDEBRID_PREMIUM_ACCOUNT_KEYWORD)) {\n $ret = FALSE;\n }\n }\n return $ret;\n }", "function userExists($username, $name, $email) {\n $dbo =& JFactory::getDBO();\n $query = 'SELECT id FROM #__users ' .\n 'WHERE username = ' . $dbo->quote($username) . ' ' .\n 'AND name = ' . $dbo->quote($name) . ' ' .\n 'AND email = ' . $dbo->quote($email);\n \n $dbo->setQuery($query);\n // Checking subscription existence\n if ($user_info = $dbo->loadObjectList()) {\n if (! empty ($user_info)) {\n $user = $user_info[0];\n return $user->id;\n }\n }\n return false;\n }", "protected function assertCustomerExists()\n {\n if (! $this->hasPaystackId()) {\n throw InvalidCustomer::doesNotExist($this);\n }\n }", "public function CheckActivationKeyExists( )\n\t\t{\n\t\t\t$dataArray = array(\n \"activationKey\"=>$this->activationKey\n );\n \n $response = ServiceAPIUtils::CallAPIService( $dataArray,\"/User/CheckActivationKeyExists/123\", \"json\" );\n \n return $response;\n\t\t}", "private function isUserExists($email) {\n $stmt = $this->conn->prepare(\"SELECT id FROM app_users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "public function loginExists() {\n return (bool) $this->local_account;\n }", "public function checkUsernameExists(){\r\n\t\t\t$objDBConn = DBManager::getInstance();\r\n\t\t\tif($objDBConn->dbConnect()){\r\n\t\t\t\t//echo \"SELECT * from trainer where username='\".$_REQUEST[\"username\"].\"'\";\r\n\t\t\t\t$result = mysql_query(\"SELECT * from trainer where username='\".$_REQUEST[\"username\"].\"' LIMIT 1\");\r\n\t\t\t\t$count= mysql_num_rows($result);\r\n\t\t\t\tif($count==0){\r\n\t\t\t\t\t//Username is available\r\n\t\t\t\t\t$objDBConn->dbClose();\r\n\t\t\t\t\t//return true;\r\n\t\t\t\t\techo $count;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//Username already taken.\r\n\t\t\t\t\t$objDBConn->dbClose();\r\n\t\t\t\t\t//return false;\r\n\t\t\t\t\techo $count;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t//echo 'Something went wrong ! ';\r\n\t\t\t\t$objDBConn->dbClose();\r\n\t\t\t\t//return false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "function usernameExists($username) {\n\n\tglobal $connection;\n\n\t$query = \"SELECT username FROM users WHERE username = '{$username}'\";\n\t$result = mysqli_query($connection, $query);\n\tconfirm($result);\n\n\treturn mysqli_num_rows($result) > 0 ? true : false;\n\n}", "function user_exist($uname)\n {\n $this->removeOldTemps();\n \n $res = $this->query(\"SELECT * FROM `{$this->userTable}` WHERE `{$this->tbFields1['email']}` = '\".$uname.\"'\");\n $res2 = $this->query(\"SELECT * FROM `{$this->userTempTable}` WHERE `{$this->tbTmpFields['email']}` = '\".$uname.\"'\"); \n \n if((!$res && !$res2) || (mysql_num_rows($res) == 0 && mysql_num_rows($res2) == 0)){ // no records \n return false;\n }\n return true; \n }", "public function check_user()\n {\n $res = $this->CustomModel->checkUser(\n $this->input->get('index_no')\n );\n\n if (!$res) {\n echo 'not exists';\n }\n }", "function doesUserExist($user) {\r\n global $dbaseUserData, $leagueID, $dbase;\r\n\r\n\r\n $query = \"SELECT username from $dbaseUserData where lid='$leagueID' and username=\\\"$user\\\"\";\r\n $result = $dbase->query($query);\r\n\r\n if ($result == FALSE) {\r\n ErrorNotify(\"Query Failed : $query\");\r\n CloseConnection($link);\r\n return TRUE;\r\n }\r\n \r\n // If we get >0 rows, the username already exists.\r\n $numrows = mysql_num_rows($result);\r\n\r\n if ($numrows == 0) {\r\n return FALSE;\r\n }\r\n\r\n return TRUE;\r\n}", "protected function checkCredentials() {\n $client = \\Drupal::service('akamai.edgegridclient');\n if ($client->isAuthorized()) {\n drupal_set_message('Authenticated to Akamai.');\n }\n else {\n drupal_set_message('Akamai authentication failed.', 'error');\n }\n }", "function DB_check_if_user_exist($usersPass, $usersEmail){\n\n $connection = DB_get_connection();\n $usersPass = md5($usersPass);\n $query = \"SELECT * FROM `users` WHERE Email='$usersEmail' AND password='$usersPass'\";\n $result = mysqli_query($connection, $query);\n if(mysqli_num_rows($result) === 1)\n return true;\n else return false;\n\n}", "public function exists()\n {\n }", "public function exists()\n {\n }", "function userExists($uid)\r\n {\r\n return $this->UD->userExists($uid);\r\n }", "function chkExist($user){\n\tglobal $dbLink;\n\t\n\t$sqlChkExist = \"SELECT uid FROM users WHERE uid='$user'\";\n\t\n\t$dbLink->query($sqlChkExist);\n\t$rows = $dbLink->affected_rows;\n\t\n\tif($rows == 1){\n\t\t$ok==0;\n\t}\n\telse{\n\t\t\t\t\t\t\t$_SESSION['error_message'] = \"The user does not exist\";\n\t\t\t\t\t\t\theader(\"Location: ../admin.php\");\n\t\t\t\t\t\t\tdie();\n\t}\n}", "public function userExists()\n {\n $action = __NAMESPACE__ . '\\actions\\UserExists';\n\n $result = $this->actionController->executeAction($action);\n $content = ($result->getSuccess()) ?: 'That Username Does Not Exist';\n\n $result->setContent($content)\n ->Render();\n }", "public function testCheckCredentials(){\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $result = $db->checkCredentials(\"[email protected]\",\"owner\");\r\n $this->assertEquals(\"[email protected]\",$result[\"emailId\"]);\r\n }", "public function isUserExisted($email) {\r\n $result = mysqli_query($this->con,\"SELECT email from users WHERE email = '$email'\");\r\n $no_of_rows = mysqli_num_rows($result);\r\n if ($no_of_rows > 0) {\r\n // user existed \r\n return true;\r\n } else {\r\n // user not existed\r\n return false;\r\n }\r\n }", "public function check_user_exist_android($email){\n\n $query = $this -> conn -> prepare('SELECT COUNT(*) from androidusers WHERE email =:email');\n $query -> execute(array('email' => $email));\n\n if($query){\n\n $row_count = $query -> fetchColumn();\n\n if ($row_count == 0){\n\n return false;\n\n } else {\n\n return true;\n\n }\n } else {\n\n return false;\n }\n }", "protected function exists() {}", "function userExists($username) {\r\n\t\treturn username_exists($username);\r\n\t}", "public function canCreateAccounts()\n {\n return false;\n }", "public function hasMultipleAccounts();", "function isUserExisted($email) {\n $result = mysql_query(\"SELECT email from users WHERE email = '$email'\",$first);\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user existed \n return true;\n } else {\n // user not existed\n return false;\n }\n }", "public function any_user_exists(){\n $select_query = \"SELECT `id`, `staff_id`, `unit`, `password`, `cpassword` FROM `register_user` \";\n //check if user exists \n $run_select_query = $this->conn->query($select_query);\n if($run_select_query){\n //check if user exists \n if(mysqli_num_rows($run_select_query) > 0){\n //check if \n return true;\n }else{\n return false;\n }\n }\n }", "public function doesUserExist($acr_, $memid, $dev_id) {\n\t\t$acr=strtoupper($acr_);\n\t\t$uid;\n \t$result=mysql_query(\"SELECT uid FROM users WHERE acr='$acr' and memid='$memid'\");\n \tif (mysql_num_rows($result) == 0) {\n \t\treturn FALSE;\n \t}\n \t\n \t$row=mysql_fetch_array($result);\n \t$uid=$row[\"uid\"];\n \t \t\n \t$result=mysql_query(\"SELECT tid FROM $this->tokenTable WHERE uid='$uid' and token='$dev_id'\");\n \tif (mysql_num_rows($result) == 0) {\n \t\treturn FALSE;\n \t}\n \telse return TRUE;\n\t}", "public function doesUserExist($username)\n {\n $apiEndpoint = '/1/user?username='.$username;\n $apiReturn = $this->runCrowdAPI($apiEndpoint, \"GET\", array());\n if ($apiReturn['status'] == '200') {\n return true;\n }\n return false;\n }", "private function isUserExists($email) {\n $stmt = $this->con->prepare(\"SELECT id from users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "public function exists()\r\n {\r\n }", "protected function assertCustomerExists()\n {\n if ( ! $this->paddle_id) {\n throw InvalidPaddleCustomer::nonCustomer($this);\n }\n }", "public function isAccountNonExpired(): bool\n {\n return true;\n }", "function isUserExist($email)\n\t{\n\t\t$stmt = $this->con->prepare(\"SELECT id FROM users WHERE email = ?\");\n\t\t$stmt->bind_param(\"s\", $email);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\treturn $stmt->num_rows > 0;\n\t}", "private function isUserExists($email) {\n\t\t$stmt = $this->conn->prepare(\"SELECT user_id from tb_user WHERE user_email = ?\");\n\t\t$stmt->bind_param(\"s\", $email);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\t$num_rows = $stmt->num_rows;\n\t\t$stmt->close();\n\t\treturn $num_rows > 0;\n\t}", "function user_email_exists($email){\n global $connection;\n\n $query = \"SELECT user_email FROM users WHERE user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirm($result);\n\n //if the user_email column name already has a value that is given by the user when registering\n if (mysqli_num_rows($result) > 0) {\n return true;\n }else{\n return false;\n }\n}", "function DB_email_existing_check($email){\n $connection = DB_get_connection();\n $queryCheck = \"SELECT * FROM `users` WHERE Email='$email'\";\n $result = mysqli_query($connection, $queryCheck);\n if(mysqli_num_rows($result) > 0){\n \n return true;\n \n }else{\n\n return false;\n\n }\n\n}", "public function check_email_existence() {\n\t\t$email = $_GET['email'];\n\t\t$checkExistEmail = $this->User->find('count', array('conditions'=>array('User.email' => $email)));\n\t\techo $checkExistEmail;\n\t\texit();\n\t}", "public function exists() {}", "function canCreateAccounts() {\n return false;\n }" ]
[ "0.7373562", "0.72912043", "0.724113", "0.71496433", "0.70607585", "0.7005978", "0.69454396", "0.6853333", "0.66357553", "0.6546905", "0.65416276", "0.6537872", "0.6524142", "0.64970344", "0.64891005", "0.6411819", "0.6387578", "0.63619477", "0.63420284", "0.6316622", "0.6315985", "0.63112456", "0.6305121", "0.6290991", "0.62804824", "0.6270633", "0.6268545", "0.6236047", "0.619323", "0.6189917", "0.6185161", "0.6178492", "0.6162375", "0.61620647", "0.61569124", "0.61448866", "0.6142791", "0.61393124", "0.61364555", "0.61204785", "0.6114569", "0.6107556", "0.60940516", "0.60787934", "0.6068355", "0.6066453", "0.60634035", "0.60633636", "0.6047787", "0.6038304", "0.60180575", "0.6016036", "0.6001608", "0.5993535", "0.59831136", "0.5983", "0.59791404", "0.5957952", "0.59483844", "0.5947761", "0.5946919", "0.5944401", "0.5940346", "0.5934523", "0.59328234", "0.59300953", "0.5929893", "0.59142035", "0.59101385", "0.59028536", "0.5891579", "0.5884366", "0.5884131", "0.58773005", "0.58767843", "0.5875544", "0.5875165", "0.5872564", "0.586699", "0.5866506", "0.58632815", "0.58538926", "0.5853462", "0.58502144", "0.5847444", "0.5846962", "0.58435786", "0.58433795", "0.5841458", "0.58410144", "0.5838399", "0.583797", "0.5835195", "0.583086", "0.58241624", "0.58206874", "0.58206165", "0.5812815", "0.5808558", "0.5807463", "0.58074504" ]
0.0
-1
/ Define form structure
function execute() { $this->obj_form = New form_input; $this->obj_form->formname = "chart_delete"; $this->obj_form->language = $_SESSION["user"]["lang"]; $this->obj_form->action = "accounts/charts/delete-process.php"; $this->obj_form->method = "post"; // general $structure = NULL; $structure["fieldname"] = "code_chart"; $structure["type"] = "text"; $this->obj_form->add_input($structure); $structure = NULL; $structure["fieldname"] = "description"; $structure["type"] = "text"; $this->obj_form->add_input($structure); // hidden $structure = NULL; $structure["fieldname"] = "id_chart"; $structure["type"] = "hidden"; $structure["defaultvalue"] = $this->id; $this->obj_form->add_input($structure); // confirm delete $structure = NULL; $structure["fieldname"] = "delete_confirm"; $structure["type"] = "checkbox"; $structure["options"]["label"] = "Yes, I wish to delete this account and realise that once deleted the data can not be recovered."; $this->obj_form->add_input($structure); // define submit field $structure = NULL; $structure["fieldname"] = "submit"; $structure["type"] = "submit"; $structure["defaultvalue"] = "delete"; $this->obj_form->add_input($structure); // define subforms $this->obj_form->subforms["chart_delete"] = array("code_chart", "description"); $this->obj_form->subforms["hidden"] = array("id_chart"); if ($this->locked) { $this->obj_form->subforms["submit"] = array(); } else { $this->obj_form->subforms["submit"] = array("delete_confirm", "submit"); } // fetch the form data $this->obj_form->sql_query = "SELECT code_chart, description FROM `account_charts` WHERE id='". $this->id ."' LIMIT 1"; $this->obj_form->load_data(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readForm() {\n\t\t$this->FiscaalGroepID = $this->formHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->formHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->formHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->formHelper(\"GewijzigdOp\", \"\");\n\t}", "abstract function setupform();", "abstract public function forms();", "protected function createFormFields() {\n\t}", "abstract public function createForm();", "abstract public function createForm();", "abstract function form();", "function form_init_data()\r\n {\r\n $this->set_element_value(\"Swimmers\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Meets\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Teams\", FT_CREATE) ;\r\n }", "public function createForm();", "public function createForm();", "public function populateForm() {}", "public static function form_fields(){\n\n \treturn [\n [\n \t'id'=> 'description',\n \t'name'=> 'description', \n \t'desc'=> 'Description', \n \t'val'=>\tnull, \n \t'type'=> 'text',\n \t'maxlength'=> 255,\n \t'required'=> 'required',\n ],\n\n [\n \t'id'=> 'rate',\n \t'name'=> 'rate', \n \t'desc'=> 'Discount Rate', \n \t'val'=>\tnull, \n \t'type'=> 'number',\n \t'min'=> 0,\n \t'max'=> 100,\n \t'step'=> '0.01',\n \t'required'=> 'required',\n ],\n\n [\n \t'id'=> 'stat',\n \t'name'=> 'stat', \n \t'desc'=> 'isActive', \n \t'val'=>1, \n \t'type'=> 'checkbox',\n ],\n ];\n\n }", "public function buildForm()\n {\n }", "function ooForm( ) {\n\n $this->templateobj = new ooFormTemplate(); // $this->templateobj = new ooFormTemplate('templates'); this has to be changed to pass generic options to template engine as required by the engine, each is different, you can't put 'template' in here, you've got to pass an array of options meaningful to the engine.\n\n$this->params_list = $_REQUEST;\n\n//if( $this->debug ) {\n//\tprint \"<pre>\";\n//\tprint \"Dumping Constructor\\n\";\n//\tprint \"Field List\\n\";\n//\tprint_r( $this->fields_list );\n//\tprint \"CGI Parameters\\n\";\n//\tprint_r( $this->params_list );\n// \tprint \"</pre>\";\n//}\n\n }", "public function init_form_fields(){\n \n\t\t$this->form_fields = array(\n\t\t\t'enabled' => array(\n\t\t\t\t'title' => 'Enable/Disable',\n\t\t\t\t'label' => 'Enable Vortex Gateway',\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'description' => '',\n\t\t\t\t'default' => 'no'\n\t\t\t),\n\t\t\t'title' => array(\n\t\t\t\t'title' => 'Title',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => 'This controls the title which the user sees during checkout.',\n\t\t\t\t'default' => 'Vortex Payment',\n\t\t\t\t'desc_tip' => true,\n\t\t\t),\n\t\t\t'description' => array(\n\t\t\t\t'title' => 'Description',\n\t\t\t\t'type' => 'textarea',\n\t\t\t\t'description' => 'This controls the description which the user sees during checkout.',\n\t\t\t\t'default' => 'Paga con Vortex Payment.',\n\t\t\t),\n\t\t\t'BID' => array(\n\t\t\t\t'title' => 'Business ID',\n\t\t\t\t'type' => 'text'\n\t\t\t)\n\n\t\t\t);\n \n\t \t}", "function defform()\n\t{\n\t\t// Definisi elemen form untuk data teman\n\t\t$noteman = array(\n\t\t\t\t\"name\"\t\t=> \"noteman\",\n\t\t\t\t\"id\"\t\t=> \"noteman\",\n\t\t\t\t\"maxlenght\"\t=> \"4\",\n\t\t\t\t\"size\"\t\t=> \"3\",\n\t\t\t\t\"value\"\t\t=> \"\",\n\t\t\t\t\"style\"\t\t=> \"background:red;\"\n\t\t\t);\n\n\t\t$namateman = array(\n\t\t\t\t\"name\"\t\t=> \"namateman\",\n\t\t\t\t\"id\"\t\t=> \"namateman\",\n\t\t\t\t\"maxlenght\"\t=> \"50\",\n\t\t\t\t\"size\"\t\t=> \"35\",\n\t\t\t\t\"value\"\t\t=> \"\",\n\t\t\t\t\"style\"\t\t=> \"background:cyan;\"\n\t\t\t);\n\n\t\t$notelp = array(\n\t\t\t\t\"name\"\t\t=> \"notelp\",\n\t\t\t\t\"id\"\t\t=> \"notelp\",\n\t\t\t\t\"maxlenght\"\t=> \"15\",\n\t\t\t\t\"size\"\t\t=> \"13\",\n\t\t\t\t\"value\"\t\t=> \"\",\n\t\t\t\t\"style\"\t\t=> \"background:cyan;\"\n\t\t\t);\n\n\t\t$email = array(\n\t\t\t\t\"name\"\t\t=> \"email\",\n\t\t\t\t\"id\"\t\t=> \"email\",\n\t\t\t\t\"maxlenght\"\t=> \"35\",\n\t\t\t\t\"size\"\t\t=> \"25\",\n\t\t\t\t\"value\"\t\t=> \"\",\n\t\t\t\t\"style\"\t\t=> \"background:cayn;\"\n\t\t\t);\n\t\t// end definisi\n\n\t\t$atableteman = [\n\t\t\t\"noteman\"\t=> $noteman,\n\t\t\t\"namateman\"\t=> $namateman,\n\t\t\t\"notelp\"\t=> $notelp,\n\t\t\t\"email\"\t\t=> $email\n\t\t];\n\n\t\treturn $atableteman;\n\t}", "function buildForm(){\n\t\t# menampilkan form\n\t}", "public function cs_generate_form() {\n global $post;\n }", "private function prepare_form_data()\n {\n $form_data = array(\n 'email' => array(\n 'name' => 'email',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-email', 'autofocus'=>''),\n ),\n 'password' => array(\n 'name' => 'password',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-password'),\n ),\n\n 'lbl-email' => array(\n 'target' => 'email',\n 'label' => 'E-mail Address',\n ),\n 'lbl-password' => array(\n 'target' => 'password',\n 'label' => 'Password',\n ),\n\n 'btn-submit' => array(\n 'value' => 'Login',\n 'extra' => array(\n 'class' => 'btn btn-primary',\n ),\n ),\n );\n\n return \\DG\\Utility::massage_form_data($form_data);\n }", "abstract public function getFormDesc();", "public function CreateForm();", "public function createForm()\n {\n }", "function form_init_data()\r\n {\r\n // Initialize the form fields\r\n\r\n $this->set_hidden_element_value(\"_action\", FT_ACTION_ADD) ;\r\n\r\n $this->set_element_value(\"Meet Start\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"m\"), \"day\" => date(\"d\"))) ;\r\n $this->set_element_value(\"Meet End\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"m\"), \"day\" => date(\"d\"))) ;\r\n\r\n // If the config is set to US only, initialize the country\r\n\r\n if (FT_US_ONLY)\r\n $this->set_element_value(\"Meet Country\",\r\n FT_SDIF_COUNTRY_CODE_UNITED_STATES_OF_AMERICA_VALUE) ;\r\n\r\n $this->set_element_value(\"Pool Altitude\", \"0\") ;\r\n }", "abstract function getForm();", "abstract protected function getForm();", "protected function form()\n {\n $form = new Form(new Member);\n\n $form->text('open_id', 'Open id');\n $form->text('wx_open_id', 'Wx open id');\n $form->text('access_token', 'Access token');\n $form->number('expires', 'Expires');\n $form->text('refresh_token', 'Refresh token');\n $form->text('unionid', 'Unionid');\n $form->text('nickname', 'Nickname');\n $form->switch('subscribe', 'Subscribe');\n $form->switch('sex', 'Sex');\n $form->text('headimgurl', 'Headimgurl');\n $form->switch('disablle', 'Disablle');\n $form->number('time', 'Time');\n $form->mobile('phone', 'Phone');\n\n return $form;\n }", "public function create_fields() {\n\t\tif ( count( $this->sections ) > 0 ) {\n\t\t\tforeach ( $this->fields as $k => $v ) {\n\t\t\t\t$method = $this->determine_method( $v, 'form' );\n\t\t\t\t$name = $v['name'];\n\t\t\t\tif ( $v['type'] == 'info' ) { $name = ''; }\n\t\t\t\tadd_settings_field( $k, $name, $method, $this->token, $v['section'], array( 'key' => $k, 'data' => $v ) );\n\n\t\t\t\t// Let the API know that we have a colourpicker field.\n\t\t\t\tif ( $v['type'] == 'range' && $this->_has_range == false ) { $this->_has_range = true; }\n\t\t\t}\n\t\t}\n\t}", "public function renderForm()\n {\n $lang = $this->context->language;\n\n $inputs[] = [\n 'type' => 'switch',\n 'label' => $this->l(\"Active\"),\n 'name' => 'active',\n 'values' => [\n [\n 'id' => 'active_on',\n 'value' => 1,\n ],\n [\n 'id' => 'active_off',\n 'value' => 0,\n ],\n ]\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Page Name'),\n 'name' => 'name',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Title'),\n 'name' => 'meta_title_lang',\n 'required' => true,\n 'id' => 'name',\n 'lang' => true,\n 'class' => 'copyMeta2friendlyURL',\n 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Meta Description'),\n 'name' => 'meta_description_lang',\n 'lang' => true,\n 'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ];\n $inputs[] = [\n 'type' => 'tags',\n 'label' => $this->l('Meta Keywords'),\n 'name' => 'meta_keywords_lang',\n 'lang' => true,\n 'hint' => [\n $this->l('To add \"tags\" click in the field, write something, and then press \"Enter.\"'),\n $this->l('Invalid characters:').' &lt;&gt;;=#{}',\n ],\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Friendly URL'),\n 'name' => 'url',\n 'required' => true,\n 'hint' => $this->l('Only letters and the hyphen (-) character are allowed.'),\n ];\n $inputs[] = [\n 'type' => 'text',\n 'label' => $this->l('Breadcrumb URL Parameters'),\n 'name' => 'breadcrumb_parameters',\n 'required' => false,\n 'hint' => $this->l('Parameters to be applied when rendering as a breadcrumb'),\n ];\n\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'css',\n 'label' => $this->l('Style'),\n 'name' => 'style',\n 'lang' => false,\n //'autoload_rte' => true,\n 'id' => 'style',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 50,\n ];\n $inputs[] = [\n 'type' => 'code',\n 'mode' => 'html',\n 'label' => $this->l('Content'),\n 'name' => 'content_lang',\n 'lang' => true,\n //'autoload_rte' => true,\n 'id' => 'content',\n 'enableBasicAutocompletion' => true,\n 'enableSnippets' => true,\n 'enableLiveAutocompletion' => true,\n 'maxLines' => 70,\n ];\n\n\n $allPages = $this->module->getAllHTMLPages(true);\n array_unshift($allPages, '-');\n\n\n if ($this->display == 'edit') {\n $inputs[] = [\n 'type' => 'hidden',\n 'name' => 'id_page'\n ];\n $title = $this->l('Edit Page');\n $action = 'submitEditCustomHTMLPage';\n\n $pageId = Tools::getValue('id_page');\n\n $this->fields_value = $this->module->getHTMLPage($pageId);\n\n // Remove the current page from the list of pages\n foreach ($allPages as $i => $p) {\n if ($p != '-' && $p['id_page'] == $pageId) {\n unset($allPages[$i]);\n break;\n }\n }\n }\n else {\n\n }\n\n // Parent select\n $inputs[] = [\n 'type' => 'select',\n 'label' => $this->l('Parent'),\n 'name' => 'id_parent',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ]\n ];\n //$this->fields_value['id_relatedTo'] = [];\n\n array_shift($allPages);\n\n // List of Pages this Page is related to\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Show On ($page->related[])'),\n 'multiple' => true,\n 'name' => 'id_relatedTo',\n 'options' => [\n 'query' => $allPages,\n 'id' => 'id_page',\n 'name' => 'name'\n ],\n 'hint' => $this->l('Makes this page show up on other pages (not as a child page but as a related page): $page->related[]')\n ];\n\n $inputs[] = [\n 'type' => 'html',\n 'html_content' => '<hr/>',\n 'name' => 'id_page',\n ];\n\n // List of Products\n $products = Product::getProducts($lang->id, 0, 1000, 'id_product', 'ASC');\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Products ($product or $products)'),\n 'name' => 'id_products',\n 'multiple' => true,\n 'options' => [\n 'query' => $products,\n 'id' => 'id_product',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $products. If only one is selected then $product will be populated'),\n ];\n\n // List of Categories\n $categories = Category::getCategories($lang->id, true, false);\n $inputs[] = [\n 'type' => 'swap',\n 'label' => $this->l('Categories ($category or $categories)'),\n 'name' => 'id_categories',\n 'multiple' => true,\n 'options' => [\n 'query' => $categories,\n 'id' => 'id_category',\n 'name' => 'name'\n ],\n 'hint' => $this->l('This will populate $categories. If only one is selected then $category will be populated'),\n ];\n\n $this->fields_form = [\n 'legend' => [\n 'title' => $title,\n 'icon' => 'icon-cogs',\n ],\n 'input' => $inputs,\n 'buttons' => [\n 'save-and-stay' => [\n 'title' => $this->l('Save and Stay'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action.'AndStay',\n 'icon' => 'process-icon-save',\n 'type' => 'submit'\n ]\n\n ],\n 'submit' => [\n 'title' => $this->l('Save'),\n 'class' => 'btn btn-default pull-right',\n 'name' => $action,\n ],\n\n ];\n\n\n return parent::renderForm();\n }", "function initControlStructureForm()\n\t{\n\t\tinclude_once (\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n $form = new ilPropertyFormGUI();\n\n\t\t$form->setId(\"control_structure\");\n\t\t$form->setTitle($this->lng->txt(\"ctrl_structure\"));\n\t\t$form->setFormAction(\"setup.php?cmd=gateway\");\n\n\t\t$ilDB = $this->setup->getClient()->db;\n\t\t$cset = $ilDB->query(\"SELECT count(*) as cnt FROM ctrl_calls\");\n\t\t$crec = $ilDB->fetchAssoc($cset);\n\n\t\t$item = new ilCustomInputGUI($this->lng->txt(\"ctrl_structure_reload\"));\n\t\tif ($crec[\"cnt\"] == 0)\n\t\t{\n\t\t\t$item->setInfo($this->lng->txt(\"ctrl_missing_desc\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$item->setInfo($this->lng->txt(\"ctrl_structure_desc\"));\n\t\t}\n\t\t$form->addItem($item);\n\n\t\t$form->addCommandButton(\"reloadStructure\", $this->lng->txt(\"reload\"));\n\t\treturn $form;\n\t}", "public function valiteForm();", "protected function initializeForm()\n {\n $this->form = new Form();\n $this->form->add(Element::create(\"FieldSet\",\"Report Format\")->add\n (\n Element::create(\"SelectionList\", \"File Format\", \"report_format\")\n ->addOption(\"Hypertext Markup Language (HTML)\",\"html\")\n ->addOption(\"Portable Document Format (PDF)\",\"pdf\")\n ->addOption(\"Microsoft Excel (XLS)\",\"xls\")\n ->addOption(\"Microsoft Word (DOC)\",\"doc\")\n ->setRequired(true)\n ->setValue(\"pdf\"),\n Element::create(\"SelectionList\", \"Page Orientation\", \"page_orientation\")\n ->addOption(\"Landscape\", \"L\")\n ->addOption(\"Portrait\", \"P\")\n ->setValue(\"L\"),\n Element::create(\"SelectionList\", \"Paper Size\", \"paper_size\")\n ->addOption(\"A4\", \"A4\")\n ->addOption(\"A3\", \"A3\")\n ->setValue(\"A4\")\n )->setId(\"report_formats\")->addAttribute(\"style\",\"width:50%\")\n );\n $this->form->setSubmitValue(\"Generate\");\n $this->form->addAttribute(\"action\",Application::getLink($this->path.\"/generate\"));\n $this->form->addAttribute(\"target\",\"blank\");\n }", "public function form()\n {\n\n $this->hidden('key', '字段名')->rules('required');\n $this->editor('val', '平台规则')->rules('required');\n }", "function createForm(){\n\t\t$this->createFormBase();\n\t\t$this->addElement('reset','reset','Reset');\t\t\t\n\t\t$tab['seeker_0'] = '0';\n\t\t$this->setDefaults($tab);\n\t\t$this->addElement('submit','bouton_add_pi','Add a contact',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_contact'\"));\n\t\t$this->createVaFormResolution();\n\t\t$this->createFormGeoCoverage();\n\t\t$this->createFormGrid();\t\n\t\t//Required format\n\t\t$dformat = new data_format;\n\t\t$dformat_select = $dformat->chargeFormDestFormat($this,'required_data_format','Required data format','NetCDF');\n\t\t$this->addElement($dformat_select);\n\t\t$this->getElement('organism_0')->setLabel(\"Organism short name\");\n\t\t$this->getElement('project_0')->setLabel(\"Useful in the framework of\");\n\t\t$this->getElement('dats_abstract')->setLabel(\"Abstract \");\n\t\t$this->getElement('dats_purpose')->setLabel(\"Purpose\");\n\t\t$this->getElement('database')->setLabel(\"Data center\");\n\t\t$this->getElement('new_db_url')->setLabel(\"Data center url\");\n\t\t$this->getElement('dats_use_constraints')->setLabel(\"Access and use constraints\");\t\t\t\n\t\t$this->getElement('sensor_resol_tmp')->setLabel('Temporal (hh:mm:ss)');\t\t\t\n\t\t$this->getElement('place_alt_min_0')->setLabel(\"Altitude min\");\n\t\t$this->getElement('place_alt_max_0')->setLabel(\"Altitude max\");\n\t\t$this->getElement('data_format_0')->setLabel(\"Original data format\");\n\t\t$this->addElement('file','upload_doc','Attached document');\n\t\t$this->addElement('submit','upload','Upload');\n\t\t$this->addElement('submit','delete','Delete');\n\t\t\n\t\tfor ($i = 0; $i < $this->dataset->nbVars; $i++){\n\t\t\t$this->getElement('methode_acq_'.$i)->setLabel(\"Parameter processing related information\");\n\t\t}\n\t\t$this->addElement('submit','bouton_add_variable','Add a parameter',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_param'\"));\n\t\t\n\t\t$this->addElement('submit','bouton_add_projet','Add a project',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_general'\"));\n\t\t$option = array();\n\t\t$option['default'] = \"\";\n\t\t$option['model'] = \"Model\";\n\t\t$option['instrument'] = \"Instrument\";\n\t\t$option['satellite'] = \"Satellite\";\n\t\t$this->addElement('select','source_type','source type :',$option,array('onchange' => \"DeactivateButtonAddSource()\",'onclick' => \"DeactivateButtonAddSource();\",'onmouseover' => 'DeactivateButtonAddSource();' ));\n\t\t$this->addElement('submit','bouton_add_source','Add a source',array('disabled' => 'true','onclick' => \"document.getElementById('frmvadataset').action += '#a_source'\",'onmouseout' => 'DeactivateButtonAddSource();'));\n\t\t\n\t\tif (isset ( $this->dataset->dats_sensors ) && ! empty ( $this->dataset->dats_sensors )) {\n\t\t\t$this->dats_sensors = array();\n\t\t\t$this->dats_sensors = $this->dataset->dats_sensors ;\n\t\t}\n\t\tif (isset ( $this->dataset->sites ) && ! empty ( $this->dataset->sites )) {\n\t\t\t$this->sites = array();\n\t\t\t$this->sites = $this->dataset->sites;\n\t\t}\n\t\t\n\t\tif ( isset ( $this->dataset->dats_id ) && $this->dataset->dats_id > 0) {\n\t\t\tif (isset ( $this->dataset->nbModFormSensor )){\n\t\t\t\tif($this->dataset->nbModForm <= $this->dataset->nbModFormSensor ){\n\t\t\t\t\t$this->dataset->nbModForm = $this->dataset->nbModFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbSatFormSensor )){\n\t\t\t\t//$this->dataset->nbSatFormSensor = $this->dataset->nbSatFormSensor - 1;\n\t\t\t\tif($this->dataset->nbSatForm <= $this->dataset->nbSatFormSensor){\n\t\t\t\t\t$this->dataset->nbSatForm = $this->dataset->nbSatFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbInstruFormSensor )){\n\t\t\t\tif($this->dataset->nbInstruForm <= $this->dataset->nbInstruFormSensor){\n\t\t\t\t\t$this->dataset->nbInstruForm = $this->dataset->nbInstruFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->dataset->nbModForm > 0)\n\t\t\t$this->addMod();\n\t\tif($this->dataset->nbInstruForm > 0)\n\t\t\t$this->addInstru();\t\n\t\tif($this->dataset->nbSatForm > 0)\n\t\t\t$this->addSat();\n\t\t\n\t\t$this->dataset->dats_sensors = null ;\n\t\t$this->dataset->sites = null;\n\t}", "public function buildFormLayout()\n {\n $this->addColumn(6, function(FormLayoutColumn $column) {\n $column->withSingleField('title');\n })->addColumn(6, function(FormLayoutColumn $column) {\n $column->withSingleField('cover');\n $column->withSingleField('description');\n $column->withSingleField('price');\n $column->withSingleField('tags');\n });\n }", "function structure()\n {\n $form = new Apeform(0, 0, false);\n $form->hidden(\"structure\", \"method\");\n $form->hidden($this->table->tablename(), \"table\");\n $field = &$form->hidden($this->GET('method') == \"structure\" ? $this->GET('field') : \"\");\n $newField = &$form->text(\"<u>F</u>ield name\", \"\", $field);\n\n foreach ($this->table->fields as $key)\n $positions[$key] = \"After \" . $key;\n $keys = array_keys($positions);\n $defaultValue = ($field && in_array($field, $keys)) ? $keys[array_search($field, $keys) - 1] : \"\";\n if ($field)\n unset($positions[$field]);\n array_pop($positions);\n $positions[''] = \"At end of table\";\n $label = $field ? \"Move to <u>p</u>osition\" : \"Add at <u>p</u>osition\";\n $afterField = $form->select($label, \"\", $positions, $defaultValue);\n\n $button = $field ? \"Rename/move field\" : \"Add new field\";\n $form->submit($button);\n\n if ($form->isValid()) {\n if (! $field) {\n if ($this->table->add_field($newField, $afterField))\n $this->table->write();\n else\n $form->error(\"Invalid field name\", 3);\n } else {\n while ($row = $this->table->each()) {\n // Copy all the moved values to their new field name.\n $this->table->data[$row['id']][$newField] = $row[$field];\n }\n $newFields = array();\n foreach ($this->table->fields as $oldField) {\n // Copy any unchanged field to the new fields array.\n if ($oldField != $field)\n $newFields[] = $oldField;\n if ($oldField == $afterField)\n $newFields[] = $newField;\n }\n // Add field if position '' (\"At end of table\") was selected.\n if (! $afterField)\n $newFields[] = $newField;\n $this->table->fields = $newFields;\n $this->table->write();\n }\n $field = \"\";\n $newField = \"\";\n }\n\n $formOrder = new Apeform(0, 0, \"order\", false);\n $formOrder->hidden(\"structure\", \"method\");\n $formOrder->hidden($this->table->tablename(), \"table\");\n $order = $formOrder->select(\"Permanently <u>o</u>rder table by\", \"\", $this->table->fields);\n $formOrder->submit(\"Order\");\n\n if ($formOrder->isValid()) {\n $this->table->sort($this->table->fields[$order]);\n $this->table->write();\n }\n\n $this->displayHead();\n\n echo '<table>';\n echo '<tr><th>Field</th><th><small>Guessed type</small></th><th colspan=\"2\">Action</th></tr>';\n foreach ($this->table->fields as $i => $f) {\n echo '<tr><td';\n if (! $i)\n echo ' class=\"primary\" title=\"Row identifier\"';\n echo '>' . $f . '</td>';\n echo '<td><small>' . (isset($this->types[$f]) ? $this->types[$f] : \"\") . '</small></td>';\n echo '<td>';\n if ($i && $this->priv & PRIV_ALTER)\n echo '<a href=\"' . $this->SELF . '?method=structure&table=' . $this->table->tablename() . '&field=' . $f . '\">Change</a>';\n echo '</td><td>';\n if ($i && $this->priv & PRIV_ALTER)\n echo '<a class=\"danger\" href=\"' . $this->SELF . '?method=drop&table=' . $this->table->tablename() . '&field=' . $f . '\">Drop</a>';\n echo '</td></tr>';\n }\n echo '</table>';\n\n if ($this->priv & PRIV_ALTER)\n $form->display();\n if ($this->priv & PRIV_UPDATE)\n $formOrder->display();\n\n echo '<p><table>';\n echo '<tr><th>Statement</th><th>Value</th></tr>';\n echo '<tr><td>Rows</td><td align=\"right\">' . $this->table->num_rows() . '</td></tr>';\n echo '<tr><td>Next autoindex</td><td align=\"right\">' . ($this->table->num_rows() ? max($this->table->ids()) + 1 : 1) . '</td></tr>';\n $filesize = $this->table->exists() ? filesize($this->table->filename) : 0;\n $filemtime = $this->table->exists() ? date(\"Y-m-d H:i\", filemtime($this->table->filename)) : \"\";\n echo '<tr><td>File size</td><td align=\"right\">' . number_format($filesize) . ' Bytes</td></tr>';\n $size = $this->table->num_rows() ? (int) round(($filesize - strlen(implode(\",\", $this->table->fields)) - 2) / $this->table->num_rows()) : 0;\n echo '<tr><td>Average row size</td><td align=\"right\">' . $size . ' Bytes</td></tr>';\n echo '<tr><td>Delimiter</td><td align=\"right\">' . $this->table->delimiter . '</td></tr>';\n echo '<tr><td>Last update</td><td align=\"right\">' . $filemtime . '</td></tr>';\n echo '</table>';\n }", "function createFieldForm($arrLang)\n{\n\n $arrFields = array(\"conference_name\" => array(\"LABEL\" => $arrLang['Conference Name'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:300px;\"),\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"conference_owner\" => array(\"LABEL\" => $arrLang['Conference Owner'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"conference_number\" => array(\"LABEL\" => $arrLang['Conference Number'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_pin\" => array(\"LABEL\" => $arrLang['Moderator PIN'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_options_1\" => array(\"LABEL\" => $arrLang['Moderator Options'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_options_2\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_pin\" => array(\"LABEL\" => $arrLang['User PIN'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_1\" => array(\"LABEL\" => $arrLang['User Options'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_2\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_3\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"start_time\" => array(\"LABEL\" => $arrLang['Start Time (PST/PDT)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"DATE\",\n \"INPUT_EXTRA_PARAM\" => array(\"TIME\" => true, \"FORMAT\" => \"%Y-%m-%d %H:%M\",\"TIMEFORMAT\" => \"12\"),\n \"VALIDATION_TYPE\" => \"ereg\",\n \"VALIDATION_EXTRA_PARAM\" => \"^(([1-2][0,9][0-9][0-9])-((0[1-9])|(1[0-2]))-((0[1-9])|([1-2][0-9])|(3[0-1]))) (([0-1][0-9]|2[0-3]):[0-5][0-9])$\"),\n \"duration\" => array(\"LABEL\" => $arrLang['Duration (HH:MM)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:20px;text-align:center\",\"maxlength\" =>\"2\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"duration_min\" => array(\"LABEL\" => $arrLang['Duration (HH:MM)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:20px;text-align:center\",\"maxlength\" =>\"2\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n/*\n \"recurs\" => array(\"LABEL\" => $arrLang['Recurs'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"reoccurs_period\" => array(\"LABEL\" => $arrLang[\"Reoccurs\"],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"SELECT\",\n \"INPUT_EXTRA_PARAM\" => $arrReoccurs_period,\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\",\n \"EDITABLE\" => \"no\",\n \"SIZE\" => \"1\"),\n \"reoccurs_days\" => array(\"LABEL\" => $arrLang[\"for\"],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"SELECT\",\n \"INPUT_EXTRA_PARAM\" => $arrReoccurs_days,\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\",\n \"EDITABLE\" => \"no\",\n \"SIZE\" => \"1\"),\n*/\n \"max_participants\" => array(\"LABEL\" => $arrLang['Max Participants'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:50px;\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n );\n return $arrFields;\n}", "protected function _readFormFields() {}", "public function addform()\n\t{\n\t\t\t$this->setMethod('post');\n\n\t\t\t\n\t\t\t$this->addElement('radio', 'status', array(\n\t\t\t\t'required' => true,\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'value' => '1' //key of multiOption\n\t\t\t));\n\t\t\n\t\t\n\n\t\t\t$this->addElement('textarea', 'Comment', array( \n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'maxlength' =>'50',\n\t\t\t\t\t\n\t\t\t\t\t'class' => 'validate[required] text-input',\n\t\t\t\t\t'decorators'=>Array(\n\t\t\t\t\t\t'ViewHelper','Errors'\n\t\t\t\t\t),\t\t \n\t\t\t));\n\n\t\t\t\n\n\t\t\t\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 getForm();", "public function form() {\n\t\treturn array();\n\t}", "private function makeform() {\n\n\t$form=new llform($this);\n\t$form->addFieldset('upload','Upload a New Image');\n\t$form->addFieldset('filter','Filter Images');\n\t$form->addFieldset('sort','Sort Order');\n\t$form->addFieldset('boundingbox','Bounding Box');\n\t$form->addFieldset('display','Display Options');\n\t$form->addFieldset('gotopage','Go to page');\n\t\n\t$form->addControl('upload',new ll_edit($form,'imagename',25,40,'Image name (leave blank for file name)'));\n\t$form->addControl('upload',new ll_file($form,'file',5*1024*1024));\n\t$form->addControl('upload',new ll_button($form,'upload','Upload'));\n\t\n\t$form->addControl('filter',$rgf=new ll_radiogroup($form,'filter'));\n\t$rgf->setOptionArrayDual(array('showall','byname'),array('Show All Entries','Show those whose name starts ...'));\n\t$form->addControl('filter',new ll_edit($form,'filterstring',12,20,'... with the following string:'));\n\t$form->addControl('sort',$rgs=new ll_radiogroup($form,'sorttype'));\n\t$rgs->setOptionArrayDual(array('newestfirst','oldestfirst','name'),array('Newest First','Oldest First','By Name'));\n\t$form->addControl('display',new ll_edit($form,'numperpage',3,3,'Number of images per page'));\n\t$form->addControl('display',new ll_button($form,'update','Update Display'));\n\t$form->addControl('display',new ll_button($form,'defaults','Restore Defaults'));\n\t$form->addControl('boundingbox',new ll_edit($form,'maxwidth',3,3,'Max Width'));\n\t$form->addControl('boundingbox',new ll_edit($form,'maxheight',3,3,'Max Height'));\n\t\n\t$form->addControl('gotopage',new ll_button($form,'firstpage','<<< First Page'));\n\t$form->addControl('gotopage',new ll_button($form,'prevpage','<< Prev Page'));\n\t$form->addControl('gotopage',new ll_dropdown($form,'pagenum'));\n\t$form->addControl('gotopage',new ll_button($form,'nextpage','Next Page >>'));\n\t$form->addControl('gotopage',new ll_button($form,'lastpage','Last Page >>>'));\n\t\n\treturn $form;\n}", "abstract protected function _setNewForm();", "abstract public function get_gateway_form_fields();", "private function _set_fields()\n {\n @$this->form_data->question_id = 0;\n\n $this->form_data->category_id = 0;\n $this->form_data->sub_category_id = 0;\n $this->form_data->sub_two_category_id = 0;\n $this->form_data->sub_three_category_id = 0;\n $this->form_data->sub_four_category_id = 0;\n\n $this->form_data->ques_text = '';\n $this->form_data->survey_weight = '';\n $this->form_data->ques_type = '';\n $this->form_data->qus_fixed = 0;\n $this->form_data->ques_expiry_date = '';\n\n\n $this->form_data->filter_question = '';\n $this->form_data->filter_category = 0;\n $this->form_data->filter_type = '';\n $this->form_data->filter_expired = '';\n }", "function form_init_elements()\r\n {\r\n // Swimmer handling\r\n $swimmer = new FERadioGroup(\"Swimmers\",\r\n array(\r\n ucfirst(FT_CREATE) => FT_CREATE\r\n ,ucfirst(FT_IGNORE) => FT_IGNORE)) ;\r\n $swimmer->set_br_flag(false) ;\r\n $this->add_element($swimmer) ;\r\n\r\n // Swim Meets handling\r\n $swimmeets = new FERadioGroup(\"Swim Meets\",\r\n array(\r\n ucfirst(FT_CREATE) => FT_CREATE\r\n ,ucfirst(FT_IGNORE) => FT_IGNORE)) ;\r\n $swimmeets->set_br_flag(false) ;\r\n $this->add_element($swimmeets) ;\r\n\r\n // Swim Teams handling\r\n $swimteams = new FERadioGroup(\"Swim Teams\",\r\n array(\r\n ucfirst(FT_CREATE) => FT_CREATE\r\n ,ucfirst(FT_IGNORE) => FT_IGNORE)) ;\r\n $swimteams->set_br_flag(false) ;\r\n $this->add_element($swimteams) ;\r\n }", "function buildSettingsForm() {}", "abstract function builder_form(): string;", "function init_form_fields() {\n\n $this->form_fields = array(\n\n 'enabled' => array(\n 'title' => 'Активировать',\n 'type' => 'checkbox',\n 'description' => 'Активировать способ доставки КС2008',\n 'default' => 'yes'\n ),\n\n 'title' => array(\n 'title' => 'Заголовок',\n 'type' => 'text',\n 'description' => 'Заговок способа доствки КС2008',\n 'default' => 'Курьерская служба 2008 '\n ),\n\n 'description' => array(\n 'title' => 'Описание',\n 'type' => 'text',\n 'description' => 'Описание способа доставки КС2008',\n 'default' => 'Выберите для доставки через КС2008'\n ),\n\n );\n\n }", "private function printFormTypeDefitions(): void\n {\n $out = self::TPL_BUILD_FORM;\n foreach ($this->fieldsBuffer as $type => $buffer) {\n if (!empty($buffer)) {\n $placeholder = PHP_EOL;\n $placeholder .= sprintf('// %s', trim($this->fieldsMap[$type], '{}'));\n $placeholder .= PHP_EOL;\n $placeholder .= implode(PHP_EOL, $buffer);\n } else {\n $placeholder = '';\n }\n\n $out = str_replace($this->fieldsMap[$type], $placeholder, $out);\n }\n\n print \"\\e[45m$out\\e[0m\\n\";\n }", "function prepare() {\n $this->addChild(new fapitng_FormHidden('form_build_id', array(\n 'value' => $this->build_id,\n )));\n $this->addChild(new fapitng_FormHidden('form_id', array(\n 'value' => $this->id,\n )));\n if ($this->token) {\n $this->addChild(new fapitng_FormHidden('form_token', array(\n 'value' => $this->token,\n )));\n }\n }", "public function setForm() {\n\t\t$translator = Zend_Registry::get('Zend_Translate');\n\t\t$this->setMethod('post');\n\t\t \n\t\t$this->addEnabled();\n\t\t$this->addRentDueDay();\n\t\t$this->addProrationType();\n\t\t$this->addProrationApplyMonth();\n\t\t$this->addSecondMonthDue();\n\t\t$this->addSubmitButton();\n\n\t\t$this->addDisplayGroup( $this->displayGroupArray, 'updateRentProrationSetting',array('legend' => 'rentProrationSettings'));\n\t\t$this->getDisplayGroup('updateRentProrationSetting')->setDecorators(array(\n 'FormElements',\n 'Fieldset', \n\t\t));\n\t}", "public function init_form_fields() {\r\n\r\n $this->form_fields = array(\r\n 'enabled' => array(\r\n 'title' => __('Enable/Disable', 'azericard'),\r\n 'type' => 'checkbox',\r\n 'label' => __('Enable Azericard Payment Module.', 'azericard'),\r\n 'default' => 'no'),\r\n 'title' => array(\r\n 'title' => __('Title:', 'azericard'),\r\n 'type'=> 'text',\r\n 'description' => __('This controls the title which the user sees during checkout.', 'azericard'),\r\n 'default' => __('Azericard', 'azericard')),\r\n 'description' => array(\r\n 'title' => __('Description:', 'azericard'),\r\n 'type' => 'textarea',\r\n 'description' => __('This controls the description which the user sees during checkout.', 'azericard'),\r\n 'default' => __('Pay securely by Credit or Debit card or internet banking through Azericard Secure Servers.', 'azericard')),\r\n\r\n 'select_mode' => array(\r\n 'title' => __( 'Sale mode', 'azericard' ),\r\n 'type' => 'select',\r\n 'description' => __( 'Select which mode do you want to use.', 'azericard' ),\r\n 'options' => array(\r\n 'test' => 'Test mode',\r\n 'production' => 'Production mode'\r\n ),\r\n 'default' => 'Authorize &amp; Capture'\r\n ),\r\n\r\n 'url_test' => array(\r\n 'title' => __('Azericard url (Test mode):', 'azericard'),\r\n 'type' => 'text',\r\n 'class' => 'test-mode',\r\n 'description' => __('Azericard url.', 'azericard'),\r\n 'default' => __('https://213.172.75.248/cgi-bin/cgi_link', 'azericard')),\r\n 'terminal_test' => array(\r\n 'title' => __('Terminal (Test mode)', 'azericard'),\r\n 'type' => 'text',\r\n 'class' => 'test-mode',\r\n 'description' => __('This terminal id use at Azericard.'),\r\n 'default' => __('77777777', 'azericard')),\r\n 'key_for_sign_test' => array(\r\n 'title' => __('Key for sign (Test mode)', 'azericard'),\r\n 'type' => 'text',\r\n 'class' => 'test-mode',\r\n 'description' => __('Given to key by Azericard', 'azericard'),\r\n 'default' => __('00112233445566778899AABBCCDDEEFF', 'azericard')),\r\n\r\n 'url_production' => array(\r\n 'title' => __('Azericard url (Production mode):', 'azericard'),\r\n 'type'=> 'text',\r\n 'class' => 'production-mode',\r\n 'description' => __('Azericard url.', 'azericard'),\r\n 'default' => __('https://213.172.75.248/cgi-bin/cgi_link', 'azericard')),\r\n 'terminal_production' => array(\r\n 'title' => __('Terminal (Production mode)', 'azericard'),\r\n 'type' => 'text',\r\n 'class' => 'production-mode',\r\n 'description' => __('This terminal id use at Azericard.'),\r\n 'default' => __('77777777', 'azericard')),\r\n 'key_for_sign_production' => array(\r\n 'title' => __('Key for sign (Production mode)', 'azericard'),\r\n 'type' => 'text',\r\n 'class' => 'production-mode',\r\n 'description' => __('Given to key by Azericard', 'azericard'),\r\n 'default' => __('00112233445566778899AABBCCDDEEFF', 'azericard')),\r\n\r\n 'redirect_page_id' => array(\r\n 'title' => __('Return Page'),\r\n 'type' => 'select',\r\n 'options' => $this -> get_pages_az('Select Page'),\r\n 'description' => \"URL of success page\"\r\n )\r\n );\r\n }", "private function makeform() {\n\tglobal $qqi;\n\t\n\t$form=new llform($this,'form');\n\t$form->addFieldset('d','');\n\t$form->addControl('d',new ll_listbox($form,'users','Users'));\n\t$form->addControl('d',new ll_button($form,'allusers','Select All','button'));\n\t$form->addControl('d',new ll_listbox($form,'functions','Functions'));\n\t$form->addControl('d',new ll_button($form,'allfunctions','Select All','button'));\n\t$rg=new ll_radiogroup($form,'showby');\n\t\t$rg->addOption('byusers','Rows of Users');\n\t\t$rg->addOption('byfunctions','Rows of Functions');\n\t\t$rg->setValue('byfunctions');\n\t$form->addControl('d',$rg);\t\n\t$form->addControl('d',new ll_button($form,'update','Update Display','button'));\n\treturn $form;\n}", "public function form( &$form )\n\t{\n\t}", "function ting_ting_collection_context_settings_form($conf) {\n $form = array();\n return $form;\n}", "static function add_eb_form(): void {\r\n\t\tself::add_acf_inner_field(self::ebs, self::eb_form, [\r\n\t\t\t'label' => 'Nomination form',\r\n\t\t\t'type' => 'file',\r\n\t\t\t'instructions' => 'Upload the nomination form as a pdf.',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t'field' => self::qualify_field(self::eb_finished),\r\n\t\t\t\t\t\t'operator' => '!=',\r\n\t\t\t\t\t\t'value' => '1',\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t],\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'return_format' => 'id',\r\n\t\t\t'library' => 'all',\r\n\t\t\t'min_size' => '',\r\n\t\t\t'max_size' => '',\r\n\t\t\t'mime_types' => '.pdf',\r\n\t\t]);\r\n\t}", "function init_form_fields() {\n\t\t\t\n\t\t\t$abs_path = str_replace('/wp-admin', '', getcwd());\n\t\t\n\t\t\t$this->form_fields = array(\n\t\t\t\t'enabled' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Activer/Désactiver:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'checkbox', \n\t\t\t\t\t\t\t\t'label' => __( 'Activer le module de paiement Atos.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => 'yes'\n\t\t\t\t\t\t\t), \n\t\t\t\t'title' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Nom:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Intitulé affiché à l\\'utilisateur lors de la commande.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __( 'Paiement sécurisé par carte bancaire', 'woothemes' )\n\t\t\t\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Description:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'textarea', \n\t\t\t\t\t\t\t\t'description' => __( 'Description affichée à l\\'utilisateur lors de la commande.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Payez en toute sécurité grâce à notre système de paiement Atos.', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'merchant_id' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Identifiant commerçant:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Identifiant commerçant fourni par votre banque. Ex: 014295303911112', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('014295303911112', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'pathfile' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier pathfile:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier de configuration \"pathfile\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/param/pathfile', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'request_file' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier request:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier exécutable \"request\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/bin/request', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'response_file' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier response:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier exécutable \"response\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/bin/response', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'payment_means' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Cartes acceptées:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Moyens de paiement acceptés. Ex pour CB, Visa et Mastercard: CB,2,VISA,2,MASTERCARD,2', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('CB,2,VISA,2,MASTERCARD,2', 'woothemes')\n\t\t\t\t\t\t\t),\n\n\t\t\t\t'currency_code' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Devise:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'select', \n\t\t\t\t\t\t\t\t'description' => __( 'Veuillez sélectionner une devise pour les paiemenents.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => '978',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'840' => 'USD',\n\t\t\t\t\t\t\t\t\t'978' => 'EUR',\n\t\t\t\t\t\t\t\t\t'124' => 'CAD',\n\t\t\t\t\t\t\t\t\t'392' => 'JPY',\n\t\t\t\t\t\t\t\t\t'826' => 'GBP',\n\t\t\t\t\t\t\t\t\t'036' => 'AUD' \n\t\t\t\t\t\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'paybtn' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Texte bouton de paiement:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Texte affiché sur le bouton qui redirige vers le terminal de paiement.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Régler la commande.', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'paymsg' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Message page de paiement:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'textarea', \n\t\t\t\t\t\t\t\t'description' => __( 'Message affiché sur la page de commande validée, avant passage sur le terminal de paiement.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Merci pour votre commande. Veuillez cliquer sur le bouton ci-dessous pour effectuer le règlement.', 'woothemes')\n\t\t\t\t\t\t\t)\n\t\t\t\t/*'payreturn' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Texte bouton retour:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Texte affiché sur le bouton de retour ver la boutique.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Retour', 'woothemes')\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);\n\t\t\n\t\t}", "function init_form_fields() {\r\n $this->form_fields = array(\r\n 'enabled' => array(\r\n 'title' => __('Enable/Disable', 'mondido'),\r\n 'type' => 'checkbox',\r\n 'label' => __('Enable mondido Payment Module.', 'mondido'),\r\n 'default' => 'no'),\r\n 'merchant_id' => array(\r\n 'title' => __('Merchant ID', 'mondido'),\r\n 'type' => 'text',\r\n 'description' => __('Merchant ID for Mondido')),\r\n 'secret' => array(\r\n 'title' => __('Secret', 'mondido'),\r\n 'type' => 'text',\r\n 'description' => __('Given secret code from Mondido', 'mondido'),\r\n ),\r\n 'test' => array(\r\n 'title' => __('Test', 'mondido'),\r\n 'type' => 'checkbox',\r\n 'label' => __('Set in testmode.', 'mondido'),\r\n 'default' => 'no')\r\n );\r\n }", "function smarty_block_form($params, $content, &$view)\n{\t\n\t//OBS: se o nome do modelo que o cara colocou como parametro não existir testar para não dar merda!!\n\t\n\t//QUANDO FECHA O BLOCO:\n\t\n if ( isset($content) ) \n {\n\t\t//Passa os parametros inúteis para o processamento direto para a tag\n\t\t$output = '<fieldset';\n\t\tforeach($params as $name => $value){\n\t\t\t$output .= \" $name='$value'\";\n\t\t}\n\t\t$output .= '>';\n \t$output .= $content; //joga os inputs na saida\n\t\t$output .= '</fieldset>';\n\n $modelArr = $view->getTemp('form_modelName');\n array_shift($modelArr);\n $view->unsetTemp('form_modelName');\n $view->setTemp('form_modelName', $modelArr); //unseta essa variavel temporária (nome do modelo)\n\n\t\treturn $output;\n }\n\t\n\t\n\t//QUANDO ABRE O BLOCO:\n\t\n\t//passa o nome do modelo para o input\n\n\tif ( isset($params['model']) ) \n\t{\n $modelArr = $view->getTemp('form_modelName');\n if ( substr($params['model'], 0, 1) == '/' ) $params['model'] = $modelArr[0].$params['model'];\n array_unshift($modelArr, $params['model']);\n\n $view->unsetTemp('form_modelName');\n\t\t$view->setTemp('form_modelName', $modelArr);\n\t\tunset($params['model']);\n\t}\n}", "protected function form()\n {\n $Adv=new Adv();\n $form = new Form($Adv);\n $platform= $Adv->platform;\n $type= $Adv->type;\n $status= $Adv->status;\n $list_array=[\n array(\"field\"=>\"title\",\"title\"=>\"标题\",\"type\"=>\"text\"),\n array(\"field\"=>\"platform\",\"title\"=>\"平台\",\"type\"=>\"select\",\"array\"=>$platform),\n array(\"field\"=>\"type\",\"title\"=>\"类型\",\"type\"=>\"select\",\"array\"=>$type),\n array(\"field\"=>\"image\",\"title\"=>\"图片\",\"type\"=>\"image\"),\n array(\"field\"=>[\"start_time\",\"end_time\"],\"title\"=>\"活动时间\",\"type\"=>\"datetimeRange\"),\n array(\"field\"=>\"font1\",\"title\"=>\"字段1\",\"type\"=>\"text\"),\n array(\"field\"=>\"font2\",\"title\"=>\"字段2\",\"type\"=>\"text\"),\n array(\"field\"=>\"font3\",\"title\"=>\"字段3\",\"type\"=>\"text\"),\n array(\"field\"=>\"font4\",\"title\"=>\"字段4\",\"type\"=>\"text\"),\n array(\"field\"=>\"font5\",\"title\"=>\"字段5\",\"type\"=>\"text\"),\n array(\"field\"=>\"status\",\"title\"=>\"状态\",\"type\"=>\"switch\",\"array\"=>$status),\n array(\"field\"=>\"created_at\",\"title\"=>\"创建时间\",\"type\"=>\"value\")\n ];\n BaseControllers::set_form($form,$list_array);\n return $form;\n }", "abstract protected function getFormIntroductionFields();", "public static function getFormComponents(): array {\n return [\n 'title' => ['attr' => ['required' => true, 'maxlength' => AppConstants::INDEXED_STRINGS_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'status' => ['type' => 'translated', 'attr' => ['required' => true, 'maxlength' => AppConstants::INDEXED_STRINGS_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'startDate' => ['type' => 'date', 'attr' => ['required' => true]],\n 'endDate' => ['type' => 'date', 'attr' => ['required' => true]],\n 'price' => ['attr' => ['max' => AppConstants::SMALL_INTEGER_MAXIMUM_VALUE]],\n 'type' => ['type' => 'translated', 'attr' => ['max' => AppConstants::SMALL_INTEGER_MAXIMUM_VALUE]],\n // 'major_id' => ['type'=>'reference','attr' => ['maxlength' => AppConstants::STRINGS_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'requiredNumberOfUsers' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'appliedUsersCount' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'language' => ['details-type' => 'multi-data'],\n 'location' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'workHoursCount' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'willTakeCertificate' => ['type' => 'boolean', 'attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n // 'major' => [\n // 'type' => 'reference',\n // 'reference' => 'major.name',\n // 'displayColumn' => 'major.name',\n // ],\n 'company' => [\n 'type' => 'reference',\n 'reference' => 'company.name',\n 'displayColumn' => 'company.name',\n ],\n 'requiredNumberOfUsers' => ['attr' => ['max' => AppConstants::SMALL_INTEGER_MAXIMUM_VALUE]],\n 'briefDescription' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'fullDescription' => ['attr' => ['required' => true, 'maxlength' => AppConstants::TEXT_MAXIMUM_LENGTH, 'minlength' => AppConstants::STRINGS_MINIMUM_LENGTH]],\n 'majors' => ['details-type' => 'multi-data-majors'],\n\n ];\n }", "public function form()\n {\n $this->select('type', '计算类型')\n ->options(Interest::$typeMap)\n ->default(Interest::TYPE_FUTURE)->required();\n\n $this->number('value', '计算值')->required();\n $this->number('years', '存入年限')->required();\n $this->rate('rate', '年化利率')->required();\n }", "static function build_form_standard($form) {\n if (!isset($_REQUEST['value'])) {\n $_REQUEST['value'] = \"\";\n }\n if (!isset($_REQUEST['option'])) {\n $_REQUEST['option'] = \"\";\n }\n if (!isset($_REQUEST['queryStatus'])) {\n $_REQUEST['queryStatus'] = false;\n }\n if (!isset($_REQUEST['oldsubaction'])) {\n $_REQUEST['oldsubaction'] = \"\";\n }\n if (!isset($form['unableInsert'])) {\n $form['unableInsert'] = false;\n }\n if (!isset($form['unableQuery'])) {\n $form['unableQuery'] = false;\n }\n if (!isset($form['unableUpdate'])) {\n $form['unableUpdate'] = false;\n }\n if (!isset($form['unableDelete'])) {\n $form['unableDelete'] = false;\n }\n if (!isset($form['unableBrowse'])) {\n $form['unableBrowse'] = false;\n }\n if (!isset($form['unableReport'])) {\n $form['unableReport'] = false;\n }\n if (!isset($form['fieldsPerRow'])) {\n $form['fieldsPerRow'] = 1;\n }\n if (!isset($form['show_not_nulls'])) {\n $form['show_not_nulls'] = false;\n }\n if (!isset($form['msj_not_null'])) {\n $form['msj_not_null'] = \"* Campos Requeridos!\";\n }\n if (!isset($form['buttons'])) {\n $form['buttons'] = array();\n $form['buttons'][\"insert\"] = \"Adicionar\";\n $form['buttons'][\"query\"] = \"Consultar\";\n $form['buttons'][\"browse\"] = \"Visualizar\";\n $form['buttons'][\"report\"] = \"Reporte\";\n \n } else {\n \tif (!isset($form['buttons'][\"insert\"])) {\n \t\t$form[\"buttons\"][\"insert\"] = \"Adicionar\";\n \t}\n \tif (!isset($form['buttons'][\"query\"])) {\n \t\t$form[\"buttons\"][\"query\"] = \"Consultar\";\n \t}\n \tif (!isset($form['buttons'][\"browse\"])) {\n \t\t$form[\"buttons\"][\"browse\"] = \"Visualizar\";\n \t}\n \tif (!isset($form['buttons'][\"report\"])) {\n \t\t$form[\"buttons\"][\"report\"] = \"Reporte\";\n \t}\n }\n $controller = Dispatcher::get_controller();\n $controller_name = Router::get_controller();\n if (!array_key_exists('dataRequisite', $form)) {\n $form['dataRequisite'] = 1;\n }\n if (!$form['dataRequisite']) {\n Generator::forms_print(\"<font style='font-size:11px'><div align='center'><i><b>No hay datos en consulta</b></i></div></font>\");\n } else {\n Generator::forms_print(\"<center>\");\n if ($_REQUEST['oldsubaction'] == 'Modificar') {\n $_REQUEST['queryStatus'] = true;\n }\n if ($controller->view != 'browse') {\n if (!$_REQUEST['queryStatus']) {\n if (!$form['unableInsert']) {\n $caption = $form['buttons']['insert'];\n Generator::forms_print(\"<input type='button' class='controlButton' id='adiciona' value='$caption' lang='Adicionar' onclick='enable_insert(this)'>&nbsp;\");\n }\n if (!$form['unableQuery']) {\n $caption = $form['buttons']['query'];\n Generator::forms_print(\"<input type='button' class='controlButton' id='consulta' value='$caption' lang='Consultar' onclick='enable_query(this)'>&nbsp;\\r\\n\");\n }\n $ds = \"disabled='disabled'\";\n } else {\n $query_string = get_kumbia_url(\"$controller_name/fetch/\");\n Generator::forms_print(\"<input type='button' id='primero' class='controlButton' onclick='window.location=\\\"{$query_string}0/&amp;queryStatus=1\\\"' value='Primero'>&nbsp;\");\n Generator::forms_print(\"<input type='button' id='anterior' class='controlButton' onclick='window.location=\\\"{$query_string}\" . ($_REQUEST['id'] - 1) . \"/&amp;queryStatus=1\\\"' value='Anterior'>&nbsp;\");\n Generator::forms_print(\"<input type='button' id='siguiente' class='controlButton' onclick='window.location=\\\"{$query_string}\" . ($_REQUEST['id'] + 1) . \"/&amp;queryStatus=1\\\"' value='Siguiente'>&nbsp;\");\n Generator::forms_print(\"<input type='button' id='ultimo' class='controlButton' onclick='window.location=\\\"{$query_string}last/&amp;queryStatus=1\\\"' value='Ultimo'>&nbsp;\");\n $ds = \"\";\n }\n //El Boton de Actualizar\n if ($_REQUEST['queryStatus']) {\n if (!$form['unableUpdate']) {\n if (isset($form['buttons']['update'])) {\n $caption = $form['buttons']['update'] ? $form['buttons']['update'] : \"Modificar\";\n } else {\n $caption = \"Modificar\";\n }\n if (isset($form['updateCondition'])) {\n if (strpos($form['updateCondition'], '@')) {\n ereg(\"[\\@][A-Za-z0-9_]+\", $form['updateCondition'], $regs);\n foreach($regs as $reg) {\n $form['updateCondition'] = str_replace($reg, $_REQUEST[\"fl_\" . str_replace(\"@\", \"\", $reg) ], $form['updateCondition']);\n }\n }\n $form['updateCondition'] = \" \\$val = (\" . $form['updateCondition'] . \");\";\n eval($form['updateCondition']);\n if ($val) {\n Generator::forms_print(\"<input type='button' class='controlButton' id='modifica' value='$caption' lang='Modificar' $ds onclick=\\\"enable_update(this)\\\">&nbsp;\");\n }\n } else {\n Generator::forms_print(\"<input type='button' class='controlButton' id='modifica' value='$caption' lang='Modificar' $ds onclick=\\\"enable_update(this)\\\">&nbsp;\");\n }\n }\n //El de Borrar\n if (!$form['unableDelete']) {\n if (isset($form['buttons']['delete'])) {\n $caption = $form['buttons']['delete'] ? $form['buttons']['delete'] : \"Borrar\";\n } else {\n $caption = \"Borrar\";\n }\n Generator::forms_print(\"<input type='button' class='controlButton' id='borra' value='$caption' lang='Borrar' $ds onclick=\\\"enable_delete()\\\">\\r\\n&nbsp;\");\n }\n }\n if (!$_REQUEST['queryStatus']) {\n if (!$form['unableBrowse']) {\n $caption = $form['buttons']['browse'];\n Generator::forms_print(\"<input type='button' class='controlButton' id='visualiza' value='$caption' lang='Visualizar' onclick='enable_browse(this, \\\"$controller_name\\\")'>&nbsp;\\r\\n\");\n }\n }\n //Boton de Reporte\n if (!$_REQUEST['queryStatus']) {\n if (!$form['unableReport']) {\n $caption = $form['buttons']['report'];\n Generator::forms_print(\"<input type='button' class='controlButton' id='reporte' value='$caption' lang='Reporte' onclick='enable_report(this)'>&nbsp;\\r\\n\");\n }\n } else {\n Generator::forms_print(\"<br /><br />\\n<input type='button' class='controlButton' id='volver' onclick='window.location=\\\"\" . get_kumbia_url(\"$controller_name/back\") . \"\\\"' value='Atr&aacute;s'>&nbsp;\\r\\n\");\n }\n Generator::forms_print(\"</center><br />\\r\\n\");\n Generator::forms_print(\"<table align='center'><tr>\\r\\n\");\n $n = 1;\n //La parte de los Componentes\n Generator::forms_print(\"<td align='right' valign='top'>\\r\\n\");\n foreach($form['components'] as $name => $com) {\n switch ($com['type']) {\n case 'text':\n Component::build_text_component($com, $name, $form);\n break;\n case 'combo':\n Component::build_standard_combo($com, $name);\n break;\n case 'helpText':\n Component::build_help_context($com, $name, $form);\n break;\n case 'userDefined':\n Component::build_userdefined_component($com, $name, $form);\n break;\n case 'time':\n Component::build_time_component($com, $name, $form);\n break;\n case 'password':\n Component::build_standard_password($com, $name);\n break;\n case 'textarea':\n Component::build_text_area($com, $name);\n break;\n case 'image':\n Component::build_standard_image($com, $name);\n break;\n //Este es el Check Chulito\n \n case 'check':\n if ($com['first']) {\n Generator::forms_print(\"<b>\" . $com['groupcaption'] . \"</b></td><td><table cellpadding=0>\");\n }\n Generator::forms_print(\"<tr><td>\\r\\n<input type='checkbox' disabled name='fl_$name' id='flid_$name' style='border:1px solid #FFFFFF'\");\n if ($_REQUEST['fl_' . $name] == $com['checkedValue']) {\n Generator::forms_print(\" checked='checked' \");\n }\n if ($com[\"attributes\"]) {\n foreach($com[\"attributes\"] as $nitem => $item) {\n Generator::forms_print(\" $nitem='$item' \");\n }\n }\n Generator::forms_print(\">\\r\\n</td><td>\" . $com['caption'] . \"</td></tr>\");\n if ($com[\"last\"]) Generator::forms_print(\"</table>\");\n break;\n //Textarea\n \n case 'textarea':\n Generator::forms_print(\"<b>\" . $com['caption'] . \" :</br></td><td><textarea disabled='disabled' name='fl_$name' id='flid_$name' \");\n foreach($com['attributes'] as $natt => $vatt) {\n Generator::forms_print(\"$natt='$vatt' \");\n }\n Generator::forms_print(\">\" . $_REQUEST['fl_' . $name] . \"</textarea>\");\n break;\n //Oculto\n \n case 'hidden':\n if (!isset($_REQUEST['fl_' . $name])) {\n $_REQUEST['fl_' . $name] = \"\";\n }\n Generator::forms_print(\"<input type='hidden' name='fl_$name' id='flid_$name' value='\" . (isset($com['value']) ? $com['value'] : $_REQUEST['fl_' . $name]) . \"'/>\\r\\n\");\n break;\n }\n if ($form['show_not_nulls']) {\n if ($com['type'] != 'hidden') {\n if (isset($com['notNull']) && $com['valueType'] != 'date') {\n Generator::forms_print(\"*\\n\");\n }\n }\n }\n if ($com['type'] != 'hidden') {\n Generator::forms_print(\"</td>\");\n if ($com['type'] == 'check') {\n if ($com['last']) {\n if (!($n % $form['fieldsPerRow'])) {\n Generator::forms_print(\"</tr><tr>\\r\\n\");\n }\n $n++;\n Generator::forms_print(\"<td align='right' valign='top'>\");\n }\n } else {\n if (!($n % $form['fieldsPerRow'])) {\n Generator::forms_print(\"</tr><tr>\\r\\n\");\n }\n $n++;\n Generator::forms_print(\"<td align='right' valign='top'>\");\n }\n }\n }\n if ($form['show_not_nulls']) {\n Generator::forms_print(\"</td></tr><tr><td colspan='2' align='center'><i class='requerido'>\" . $form['msj_not_null'] . \"</i></tr></td>\");\n }\n Generator::forms_print(\"<br /></td></tr><tr>\n\t\t\t\t<td colspan='2' align='center'>\n\t\t\t\t<div id='reportOptions' style='display:none' class='report_options'>\n\t\t\t\t<table>\n\t\t\t\t<tr>\n\t\t\t\t<td align='right'>\n\t\t\t\t<b>Formato Reporte:</b>\n\t\t\t\t\t<select name='reportType' id='reportType'>\n\t\t\t\t\t\t<option value='pdf'>PDF</option>\n\t\t\t\t\t\t<option value='xls'>EXCEL</option>\n\t\t\t\t\t\t<option value='doc'>WORD</option>\n\t\t\t\t\t\t<option value='html'>HTML</option>\n\t\t\t\t\t</select>\n\t\t\t\t</td>\n\t\t\t\t<td align='center'>\n\t\t\t\t<b>Ordenar Por:</b>\n\t\t\t\t\t<select name='reportTypeField' id='reportTypeField'>\");\n reset($form['components']);\n for ($i = 0;$i <= count($form['components']) - 1;$i++) {\n if (!isset($form['components'][key($form['components']) ]['notReport'])) {\n $form['components'][key($form['components']) ]['notReport'] = false;\n }\n if (!$form['components'][key($form['components']) ]['notReport']) {\n if (isset($form['components'][key($form['components']) ]['caption'])) {\n Generator::forms_print(\"<option value ='\" . key($form['components']) . \"'>\" . $form['components'][key($form['components']) ]['caption'] . \"</option>\");\n }\n }\n next($form['components']);\n }\n Generator::forms_print(\"</select>\n\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t\t<br />\n\t\t\t\t</td>\n\t\t\t\t</tr>\");\n Generator::forms_print(\"</table><br />\\r\\n\");\n } else {\n /**\n * @see Browse\n */\n require_once \"library/kumbia/generator/browse.php\";\n Browse::formsBrowse($form);\n }\n //Todos los Labels\n Generator::forms_print(\"<script type='text/javascript'>\\nvar Labels = {\");\n $aLabels = \"\";\n foreach($form['components'] as $key => $com) {\n if (isset($com['caption'])) {\n $aLabels.= $key . \": '\" . $com['caption'] . \"',\";\n } else {\n $aLabels.= $key . \": '$key',\";\n }\n }\n $aLabels = substr($aLabels, 0, strlen($aLabels) - 1);\n Generator::forms_print(\"$aLabels};\\r\\n\");\n //Todos los campos\n Generator::forms_print(\"var Fields = [\");\n reset($form['components']);\n for ($i = 0;$i <= count($form['components']) - 1;$i++) {\n Generator::forms_print(\"'\" . key($form['components']) . \"'\");\n if ($i != (count($form['components']) - 1)) Generator::forms_print(\",\");\n next($form['components']);\n }\n Generator::forms_print(\"];\\r\\n\");\n //Campos que no pueden ser nulos\n Generator::forms_print(\"var NotNullFields = [\");\n reset($form['components']);\n $NotNullFields = \"\";\n for ($i = 0;$i <= count($form['components']) - 1;$i++) {\n if (!isset($form['components'][key($form['components']) ]['notNull'])) {\n $form['components'][key($form['components']) ]['notNull'] = false;\n }\n if (!isset($form['components'][key($form['components']) ]['primary'])) {\n $form['components'][key($form['components']) ]['primary'] = false;\n }\n if ($form['components'][key($form['components']) ]['notNull'] || $form['components'][key($form['components']) ]['primary']) {\n $NotNullFields.= \"'\" . key($form['components']) . \"',\";\n }\n next($form['components']);\n }\n $NotNullFields = substr($NotNullFields, 0, strlen($NotNullFields) - 1);\n Generator::forms_print(\"$NotNullFields];\\r\\n\");\n Generator::forms_print(\"var DateFields = [\");\n $dFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (isset($value['valueType'])) {\n if ($value['valueType'] == 'date') $dFields.= \"'\" . $key . \"',\";\n }\n }\n $dFields = substr($dFields, 0, strlen($dFields) - 1);\n Generator::forms_print(\"$dFields];\\r\\n\");\n //Campos que no son llave\n Generator::forms_print(\"var UFields = [\");\n $uFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (!$value['primary']) {\n $uFields.= \"'\" . $key . \"',\";\n }\n }\n $uFields = substr($uFields, 0, strlen($uFields) - 1);\n Generator::forms_print(\"$uFields];\\r\\n\");\n //Campos E-Mail\n Generator::forms_print(\"var emailFields = [\");\n $uFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (isset($value['valueType'])) {\n if ($value['valueType'] == 'email') {\n $uFields.= \"'\" . $key . \"',\";\n }\n }\n }\n $uFields = substr($uFields, 0, strlen($uFields) - 1);\n Generator::forms_print(\"$uFields];\\r\\n\");\n //Campos Time\n Generator::forms_print(\"var timeFields = [\");\n $uFields = \"\";\n foreach($form['components'] as $key => $value) {\n if ($value['type'] == 'time') {\n $uFields.= \"'\" . $key . \"',\";\n }\n }\n $uFields = substr($uFields, 0, strlen($uFields) - 1);\n Generator::forms_print(\"$uFields];\\r\\n\");\n //Campos Time\n Generator::forms_print(\"var imageFields = [\");\n $uFields = \"\";\n foreach($form['components'] as $key => $value) {\n if ($value['type'] == 'image') {\n $uFields.= \"'\" . $key . \"',\";\n }\n }\n $uFields = substr($uFields, 0, strlen($uFields) - 1);\n Generator::forms_print(\"$uFields];\\r\\n\");\n //Campos que son llave\n Generator::forms_print(\"var PFields = [\");\n $pFields = \"\";\n foreach($form['components'] as $key => $value) {\n if ($value['primary']) {\n $pFields.= \"'\" . $key . \"',\";\n }\n }\n $pFields = substr($pFields, 0, strlen($pFields) - 1);\n Generator::forms_print(\"$pFields];\\r\\n\");\n //Campos que son Auto Numericos\n Generator::forms_print(\"var AutoFields = [\");\n $aFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (isset($value['auto_numeric'])) {\n if ($value['auto_numeric']) {\n $aFields.= \"'\" . $key . \"',\";\n }\n }\n }\n $aFields = substr($aFields, 0, strlen($aFields) - 1);\n Generator::forms_print(\"$aFields];\\r\\n\");\n Generator::forms_print(\"var queryOnlyFields = [\");\n $rFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (!isset($value['valueType'])) {\n $value['valueType'] = \"\";\n }\n if (!isset($value['queryOnly'])) {\n $value['queryOnly'] = false;\n }\n if ($value['valueType'] != 'date') {\n if ($value['queryOnly']) {\n $rFields.= \"'\" . $key . \"',\";\n }\n }\n }\n $rFields = substr($rFields, 0, strlen($rFields) - 1);\n Generator::forms_print(\"$rFields];\\r\\n\");\n Generator::forms_print(\"var queryOnlyDateFields = [\");\n $rdFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (!isset($value['valueType'])) $value['valueType'] = \"\";\n if (!isset($value['queryOnly'])) $value['queryOnly'] = false;\n if ($value['valueType'] == 'date') {\n if ($value['queryOnly']) {\n $rdFields.= \"'\" . $key . \"',\";\n }\n }\n }\n $rdFields = substr($rdFields, 0, strlen($rdFields) - 1);\n Generator::forms_print(\"$rdFields];\\r\\n\");\n Generator::forms_print(\"var AddFields = [\");\n $aFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (!isset($value['auto_numeric'])) {\n $value['auto_numeric'] = false;\n }\n if (!isset($value['attributes']['value'])) {\n $value['attributes']['value'] = false;\n }\n if ((!$value['auto_numeric']) && (!$value['attributes']['value'])) {\n $aFields.= \"'\" . $key . \"',\";\n }\n }\n $aFields = substr($aFields, 0, strlen($aFields) - 1);\n Generator::forms_print(\"$aFields];\\r\\n\");\n Generator::forms_print(\"var AutoValuesFields = [\");\n $aFields = \"\";\n foreach($form['components'] as $key => $value) {\n if (!isset($value['auto_numeric'])) {\n $value['auto_numeric'] = false;\n }\n if ($value['auto_numeric']) {\n $aFields.= \"'\" . $key . \"',\";\n }\n }\n $aFields = substr($aFields, 0, strlen($aFields) - 1);\n Generator::forms_print(\"$aFields];\\r\\n\");\n Generator::forms_print(\"var AutoValuesFFields = [\");\n $aFields = \"\";\n if (!isset($db)) {\n $db = db::raw_connect();\n }\n foreach($form['components'] as $key => $value) {\n if (!isset($value['auto_numeric'])) $value['auto_numeric'] = false;\n if ($value['auto_numeric']) {\n ActiveRecord::sql_item_sanizite($key);\n ActiveRecord::sql_item_sanizite($form['source']);\n $q = $db->query(\"select max($key)+1 from \" . $form['source']);\n $row = $db->fetch_array($q);\n $aFields.= \"'\" . ($row[0] ? $row[0] : 1) . \"',\";\n }\n }\n $aFields = substr($aFields, 0, strlen($aFields) - 1);\n Generator::forms_print(\"$aFields];\\r\\n\");\n if (!isset($_REQUEST['param'])) {\n $_REQUEST['param'] = \"\";\n }\n Generator::forms_print(\"\\nnew Event.observe(window, \\\"load\\\", function(){\\n\");\n if ($controller->keep_action) {\n Generator::forms_print(\"\\tkeep_action('\" . $controller->keep_action . \"');\\n\");\n }\n Generator::forms_print(\"\\tregister_form_events()\\n})\\n</script>\\n\");\n if ($controller->view != 'browse') {\n Generator::forms_print(\"<center><input type='button' class='controlButton' id='aceptar' value='Aceptar' disabled='disabled' onclick='form_accept()' />&nbsp;\");\n Generator::forms_print(\"<input type='button' class='controlButton' id='cancelar' value='Cancelar' disabled='disabled' onclick='cancel_form()' />&nbsp;</center>\");\n Generator::forms_print(\"<input type='hidden' id='actAction' value='' />\\n\n\t\t\t\t</form>\n <form id='saveDataForm' method='post' action='' style='display:none' enctype=\\\"multipart/form-data\\\"></form>\");\n }\n }\n }", "protected function form()\n {\n $form = new Form(new Direction());\n\n $form->text('name', __(trans('hhx.name')));\n $form->text('intro', __(trans('hhx.intro')));\n $form->image('Img', __(trans('hhx.img')))->move('daily/direction')->uniqueName();\n $form->select('status', __(trans('hhx.status')))->options(config('hhx.status'));;\n $form->number('order_num', __(trans('hhx.order_num')));\n $form->hidden('all_num', __(trans('hhx.all_num')))->default(0.00);\n $form->decimal('stock', __(trans('hhx.stock')));\n\n return $form;\n }", "public function buildFormFields()\n {\n $this->addField(\n SharpFormTextField::make('title')\n ->setLabel('Title')\n )->addField(\n SharpFormUploadField::make('cover')\n ->setLabel('Cover')\n ->setFileFilterImages()\n ->setCropRatio('1:1')\n ->setStorageBasePath('data/service')\n )->addField(\n SharpFormNumberField::make('price')\n ->setLabel('Price')\n )->addField(\n SharpFormMarkdownField::make('description')->setToolbar([\n SharpFormMarkdownField::B, SharpFormMarkdownField::I,\n SharpFormMarkdownField::SEPARATOR,\n SharpFormMarkdownField::IMG,\n SharpFormMarkdownField::SEPARATOR,\n SharpFormMarkdownField::A,\n ])\n )->addField(\n SharpFormTagsField::make('tags',\n Tag::orderBy('label')->get()->pluck('label', 'id')->all()\n )->setLabel('Tags')\n ->setCreatable(true)\n ->setCreateAttribute('name')\n );\n }", "public function buildForm()\n {\n $this\n ->add(\n 'new_organization_group',\n 'collection',\n [\n 'type' => 'form',\n 'options' => [\n 'class' => 'App\\SuperAdmin\\Forms\\OrganizationGroupInformation',\n 'label' => false,\n ]\n ]\n )\n ->add(\n 'group_admin_information',\n 'collection',\n [\n 'type' => 'form',\n 'options' => [\n 'class' => 'App\\SuperAdmin\\Forms\\GroupAdmin',\n 'label' => false,\n ]\n ]\n )\n ->addSaveButton();\n }", "abstract protected function getFormTypeParams();", "public function buildFormFields()\n {\n $this->addFormField(\n SharpTextFormFieldConfig::create(\"titre\")\n ->setLabel(\"Titre\")\n );\n\n $this->addFormField(\n SharpTextFormFieldConfig::create(\"soustitre\")\n ->setLabel(\"Sous-titre\")\n );\n\n $this->addFormField(\n SharpTextFormFieldConfig::create(\"slug\")\n ->setLabel(\"Slug\")\n );\n\n $this->addFormField(\n SharpTextFormFieldConfig::create(\"url\")\n ->setLabel(\"URL du projet\")\n );\n\n $this->addFormField(\n SharpMarkdownFormFieldConfig::create(\"texte\")\n ->setLabel(\"Texte\")\n ->showToolbar(true)\n );\n\n $this->addFormField(\n SharpCheckFormFieldConfig::create(\"is_open_source\")\n ->setText(\"Projet Open-source\")\n );\n\n $this->addFormField(\n SharpPivotFormFieldConfig::create(\"technos\", SharpTechnoRepository::class)\n ->setLabel(\"Technologies\")\n ->setAddable(true)\n ->setSortable(true)\n ->setOrderAttribute(\"ordre\")\n ->setCreateAttribute(\"nom\")\n );\n\n $this->addFormField(\n SharpListFormFieldConfig::create(\"screenshots\")\n ->setLabel(\"Screenshots\")\n ->setSortable(true)->setOrderAttribute(\"ordre\")\n ->setAddable(true)->setAddButtonText(\"Ajouter un screenshot\")\n ->setRemovable(true)->setRemoveButtonText(\"Supprimer\")\n ->addItemFormField(\n SharpFileFormFieldConfig::create(\"fichier\")\n ->setFileFilterImages()\n ->setMaxFileSize(5)\n ->setThumbnail(\"100x100\")\n ->addGeneratedThumbnail(\"600x\"))\n ->addItemFormField(\n SharpTextFormFieldConfig::create(\"tag\")\n ->addAttribute(\"placeholder\", \"Tag\"))\n ->addItemFormField(\n SharpTextareaFormFieldConfig::create(\"legende\")\n ->setRows(3))\n ->setItemFormTemplate(\n SharpListItemFormTemplateConfig::create()\n ->addField(\"fichier\")\n ->addField(\"tag\")\n ->addField(\"legende\")\n )\n );\n\n $this->addFormTemplateColumn(\n SharpFormTemplateColumnConfig::create(7)\n ->addField(\"titre\")\n ->addField(\"soustitre\")\n ->addField([\"slug:5\", \"url:7\"])\n ->addField(\"technos\")\n ->addField(\"is_open_source\")\n\n )->addFormTemplateColumn(\n SharpFormTemplateColumnConfig::create(5)\n ->addField(\"texte\")\n ->addField(\"screenshots\")\n );\n }", "abstract public function getForm() : void;", "public function buildForm()\n {\n $this\n ->addMeasureList()\n ->addAscendingList()\n ->addTitles(['class' => 'indicator_title_title_narrative', 'narrative_true' => true])\n ->addDescriptions(['class' => 'indicator_description_title_narrative'])\n ->addCollection('reference', 'Activity\\Reference', 'reference', [], trans('elementForm.reference'))\n ->addAddMoreButton('add_reference', 'reference')\n ->addBaselines()\n ->addPeriods()\n ->addAddMoreButton('add_period', 'period')\n ->addRemoveThisButton('remove_indicator');\n }", "public function getFormFields() {\n $fields = array(\n 'shapes[]' => array(\n 'type' => 'select',\n 'multiplicate' => '5',\n 'values' => array(\n '-' => '-',\n 'cube' => 'cube',\n 'round' => 'round',\n )\n ),\n 'width[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Width'\n ),\n 'higth[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Higth'\n ),\n 'x_position[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'X position'\n ),\n 'y_position[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Y position'\n ),\n 'red[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color red',\n ),\n 'green[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color green',\n ),\n 'blue[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color blue',\n ),\n 'size[]' => array(\n 'type' => 'text',\n 'multiplicate' => '1',\n 'label' => 'Size holst'\n ),\n 'enable[]' => array(\n 'type' => 'checkbox',\n 'multiplicate' => '5',\n 'label' => 'enable'\n )\n );\n return $fields;\n }", "protected function _prepareForm() {\r\n\t $form = new Varien_Data_Form();\r\n\t $this->setForm($form);\r\n\t $fieldset = $form->addFieldset(\"reason_form\", array(\"legend\" => Mage::helper(\"mprmasystem\")->__(\"RMA Reason\")));\r\n\r\n\t\t\t$fieldset->addField(\"reason\", \"textarea\", array(\r\n\t\t\t\t\"label\" => Mage::helper(\"mprmasystem\")->__(\"Reason Provided\"),\r\n\t\t\t\t\"name\" => \"reason\",\r\n\t\t\t\t\"class\" => \"required-entry\",\r\n\t\t\t\t\"required\" => true\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t$fieldset->addField(\"status\", \"select\", array(\r\n\t\t\t\t\"label\" => Mage::helper(\"mprmasystem\")->__(\"Status\"),\r\n\t\t\t\t\"name\" \t\t=> \"status\",\r\n\t\t\t\t\"class\" => \"required-entry\",\r\n\t\t\t\t\"required\" => true,\r\n\t\t\t\t\"values\"\t=> array(\r\n\t\t\t\t\t\t\t\t\tarray(\"value\" => \"\",\"label\" => Mage::helper(\"mprmasystem\")->__(\"Please Select\")),\r\n\t\t\t\t\t\t\t\t\tarray(\"value\" => \"1\",\"label\" => Mage::helper(\"mprmasystem\")->__(\"Enable\")),\r\n\t\t\t\t\t\t\t\t\tarray(\"value\" => \"0\",\"label\" => Mage::helper(\"mprmasystem\")->__(\"Disable\"))\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t));\r\n\t\t\t\r\n\t if(Mage::registry(\"mprmareason_data\"))\r\n\t $form->setValues(Mage::registry(\"mprmareason_data\")->getData());\t\t\t\r\n\t return parent::_prepareForm();\r\n\t }", "public function editSettings() {\n $name = $this->schema->name();\n $form = new Fragment($name);\n\n if ($this->schema->newgroup()) { // définit dans la vue fields.php\n $form->hidden('type');\n // pour un nouveau groupe, il faut que le groupe soit créé avec le bon type\n // pour un groupe existant, inutile : on a déjà le bon type dans le schéma\n }\n\n $form->input('name')\n ->attribute('class', 'name')\n ->label(__('Nom du groupe', 'docalist-biblio'))\n ->description(__(\"Le nom du groupe doit être unique (ni un nom de champ, ni le nom d'un autre groupe).\", 'docalist-biblio'));\n\n $form->input('label')\n ->attribute('id', $name . '-label')\n ->attribute('class', 'label regular-text')\n ->label(__('Titre du groupe', 'docalist-biblio'))\n ->description(__(\"C'est le titre qui sera affiché dans la barre de titre du groupe et dans les options de l'écran de saisie. Valeur par défaut : type de la notice\", 'docalist-biblio'));\n\n $form->input('capability')\n ->attribute('id', $name . '-capability')\n ->attribute('class', 'capability regular-text')\n ->label(__('Droit requis', 'docalist-biblio'))\n ->description(__(\"Droit requis pour afficher ce groupe de champs. Ce groupe (et tous les champs qu'il contient) sera masqué si l'utilisateur ne dispose pas du droit indiqué. Si vous laissez vide, aucun test ne sera effectué.\", 'docalist-biblio'));\n\n $form->textarea('description')\n ->attribute('id', $name . '-description')\n ->attribute('class', 'description large-text')\n ->attribute('rows', 2)\n ->label(__(\"Texte d'introduction\", 'docalist-biblio'))\n ->description(__(\"Ce texte sera affiché entre la barre de titre et le premier champ du groupe. Vous pouvez utiliser cette zone pour donner des consignes de saisie ou toute autre information utile aux utilisateurs.\", 'docalist-biblio'));\n\n $form->select('state')\n ->attribute('id', $name . '-state')\n ->attribute('class', 'state')\n ->label(__(\"Etat initial du groupe\", 'docalist-biblio'))\n ->description(__(\"Dans l'écran de saisie, chaque utilisateur peut choisir comment afficher chacun des groupes : il peut replier ou déplier un groupe ou utiliser les options de l'écran de saisie pour masquer ou afficher certains groupes. Ce paramètre indique comment le groupe sera affiché initiallement (pour un nouvel utilisateur).\", 'docalist-biblio'))\n ->options([\n '' => __('Ouvert', 'docalist-biblio'),\n 'collapsed' => __('Replié', 'docalist-biblio'),\n 'hidden' => __('Masqué', 'docalist-biblio'),\n ])\n ->firstOption(false);\n\n $form->button(__('Supprimer ce groupe', 'docalist-biblio'))\n ->attribute('class', 'delete-group button right');\n\n return $form;\n }", "public function buildForm()\n {\n $this->add('organization_identifier_code', 'text', ['label' => trans('elementForm.organisation_identifier_code')])\n ->add('provider_activity_id', 'text', ['label' => trans('elementForm.provider_activity_id')])\n ->addSelect('type', $this->getCodeList('OrganisationType', 'Activity'), trans('elementForm.type'), $this->addHelpText('Activity_ParticipatingOrg-type'))\n ->addNarrative('provider_org_narrative')\n ->addAddMoreButton('add_provider_org_narrative', 'provider_org_narrative');\n }", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: save PHP/CSS code');\r\n\r\n $code[] =& $this->createElement('checkbox', 'P', null, 'PHP');\r\n $code[] =& $this->createElement('checkbox', 'C', null, 'CSS');\r\n $this->addGroup($code, 'phpcss', 'PHP and/or StyleSheet source code:');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('next','apply'));\r\n }", "function form_content()\r\n {\r\n $table = html_table($this->_width,0,4) ;\r\n $table->set_style(\"border: 0px solid\") ;\r\n\r\n $table->add_row($this->element_label($this->getUploadFileLabel()),\r\n $this->element_form($this->getUploadFileLabel())) ;\r\n\r\n $td = html_td(null, null, $this->element_form('Override Z0 Record Validation')) ;\r\n $td->set_tag_attribute('colspan', 2) ;\r\n $table->add_row($td) ;\r\n\r\n $this->add_form_block(null, $table) ;\r\n }", "function build_basic_form()\r\n {\r\n $this->addElement('select', LanguagePack :: PROPERTY_BRANCH, Translation :: get('Branch'), LanguagePack :: get_branch_options());\r\n \r\n \t$this->addElement('file', 'file', Translation :: get('FileName'));\r\n $allowed_upload_types = array('zip');\r\n $this->addRule('file', Translation :: get('OnlyZIPAllowed'), 'filetype', $allowed_upload_types);\r\n $this->addRule('file', Translation :: get('ThisFieldIsRequired', null, Utilities :: COMMON_LIBRARIES), 'required');\r\n \r\n // Submit button\r\n //$this->addElement('submit', 'user_settings', 'OK');\r\n $buttons[] = $this->createElement('style_submit_button', 'submit', Translation :: get('Import', null, Utilities :: COMMON_LIBRARIES), array('class' => 'positive'));\r\n $buttons[] = $this->createElement('style_reset_button', 'reset', Translation :: get('Reset', null, Utilities :: COMMON_LIBRARIES), array('class' => 'normal empty'));\r\n \r\n $this->addGroup($buttons, 'buttons', null, '&nbsp;', false);\r\n }", "protected function form()\n {\n $form = new Form(new BackPeopleInfo());\n\n $form->text('name', __('姓名'));\n $form->text('id_num', __('身份证号码'));\n $form->mobile('phone', __('手机号码'));\n $form->text('address', __('楼栋房号'));\n $form->text('originatin', __('始发地'));\n $form->date('back_date', __('返回日期'))->default(date('Y-m-d'));\n $form->date('isolate_date', __('隔离日期'))->default(date('Y-m-d'));\n $form->text('isolate_flag', __('解除隔离'))->default('否');\n $form->text('isolate_level', __('隔离等级'))->default('普通');\n $form->text('qrcode_flag', __('网格化管理'))->default('否');\n $form->text('vehicle_info', __('交通工具'));\n $form->text('remarks', __('备注'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Activity());\n\n $form->text('name', __('Name'));\n $form->image('image', __('Image'));\n $form->text('intro', __('Intro'));\n $form->UEditor('details', __('Details'));\n $form->datetime('start_at', __('Start at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('end_at', __('End at'))->default(date('Y-m-d H:i:s'));\n $form->text('location', __('Location'));\n $form->decimal('fee', __('Fee'))->default(0.00);\n $form->number('involves', __('Involves'));\n $form->number('involves_min', __('Involves min'));\n $form->number('involves_max', __('Involves max'));\n $form->switch('status', __('Status'));\n $form->text('organizers', __('Organizers'));\n $form->number('views', __('Views'));\n $form->switch('is_stick', __('Is stick'));\n\n return $form;\n }", "private function _set_fields()\n {\n @$this->form_data->survey_id = 0;\n $this->form_data->survey_title = '';\n $this->form_data->survey_description = '';\n $this->form_data->survey_status = 'open';\n $this->form_data->survey_anms = 'yes';\n $this->form_data->survey_expiry_date = '';\n $this->form_data->question_ids = array();\n\n $this->form_data->filter_survey_title = '';\n $this->form_data->filter_status = '';\n }", "protected function form()\n {\n $form = new Form(new Information);\n \n \n\n $form->text('name', __('项目名称'))->autofocus()->placeholder('例:上汽大众新能源汽车工厂项目')->required();\n $form->text('industry', __('行业类别'))->required();\n $form->currency('investment', __('投资金额'))->icon('fa-usd')->required(); \n $form->text('cont_name', __('资方联系人'))->placeholder('选填内容,可为空');\n $form->text('cont_phone', __('资方联系方式'))->placeholder('选填内容,可为空');\n $form->text('staff_name', __('工作人员姓名'));\n $form->text('staff_phone', __('工作人员电话'));\n $form->hidden('adminuser_id', __('adminuser_id'))->value(Admin::user()->id);\n $form->textarea('content', __('项目情况'))->required()->placeholder('请填写项目介绍(包括项目投资额度、产业类别等)、项目需求(如土地、排放、能耗等)、谈判进度等......');\n\n\n\n $form->tools(function (Form\\Tools $tools) {\n\n // 去掉`列表`按钮\n $tools->disableList();\n\n });\n\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n $footer->disableReset();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n $form->setAction('../admin/myinfo');\n\n return $form;\n }", "protected function _prepareForm()\n {\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create(\n [\n 'data' => [\n 'id' => 'edit_form',\n 'action' => $this->getUrl('reverbsync/reverbsync_field/save'),\n 'method' => 'post',\n\t\t\t\t\t'enctype' => 'multipart/form-data',\n ],\n ]\n );\n $form->setUseContainer(true);\n\t\t$model = $this->_coreRegistry->registry('reverbsync_field_mapping');\n\t\t$fieldset = $form->addFieldset(\n 'base_fieldset',\n array('legend' => __('Magento-Reverb Field Mapping'), 'class'=>'fieldset-wide')\n );\n\t\t\n\t\tif ($model->getMappingId()) {\n $fieldset->addField(\n\t\t\t\t'mapping_id',\n\t\t\t\t'hidden', \n\t\t\t\t['name' => 'mapping_id']\n\t\t\t);\n }\n\t\t$fieldset->addField(\n 'magento_attribute_code',\n 'select',\n [\n\t\t\t\t'name' => 'magento_attribute_code', \n\t\t\t\t'label' => __('Magento Attribute'), \n\t\t\t\t'title' => __('Magento Attribute Code'),\n\t\t\t\t'values' => $this->_productAttribute->toOptionArray(),\n\t\t\t\t'required' => true\n\t\t\t]\n );\n\t\t$fieldset->addField(\n 'reverb_api_field',\n 'text',\n [\n\t\t\t\t'name' => 'reverb_api_field', \n\t\t\t\t'label' => __('Reverb API Field'), \n\t\t\t\t'title' => __('Reverb API Field'), \n\t\t\t\t'required' => true\n\t\t\t]\n );\n\t\t$form->setValues($model->getData());\n $this->setForm($form);\n return parent::_prepareForm();\n }", "public function hookForm() {\n if ($this->isCompanyForm()) {\n $this->setDefaultExpDate();\n $this->makeBillingAreaRequired();\n }\n elseif ($this->isCompanyViewsMultiSearchForm()) {\n $this->form['company_name']['#type'] = 'textarea';\n $this->duplicateField('sort_by');\n }\n }", "protected function _prepareForm()\n {\n $form = new Varien_Data_Form(array(\n 'id' => 'add_form',\n 'action' => $this->getUrl('*/faq/save', array(\n 'ret' => Mage::registry('ret'),\n 'id' => $this->getRequest()->getParam('id')\n )\n ),\n 'method' => 'post'\n ));\n\n $fieldset = $form->addFieldset('faq_new_question', array(\n 'legend' => $this->__('New Question'),\n 'class' => 'fieldset-wide'\n ));\n\n $fieldset->addField('new_question', 'text', array(\n 'label' => Mage::helper('inchoo_faq')->__('New Question'),\n 'required' => true,\n 'name' => 'question'\n ));\n\n $fieldset->addField('new_answer', 'textarea', array(\n 'label' => Mage::helper('inchoo_faq')->__('Answer'),\n 'required' => false,\n 'name' => 'answer',\n 'style' => 'height:12em;',\n ));\n\n $form->setUseContainer(true);\n// $form->setValues();\n $this->setForm($form);\n\n// echo \"_prepareForm()\";\n\n return parent::_prepareForm();\n\n\n }", "public function init_form_fields() {\n\t\t$this->form_fields = array(\n\t\t\t'api_key' => array(\n\t\t\t\t'title' => __( 'API Key', PLUGIN_TXT ),\n\t\t\t\t'type' => 'text',\n\t\t\t\t'description' => __( 'Enter with your API Key. You can find this in \"User Profile\" drop-down (top right corner) > API Keys.', PLUGIN_TXT ),\n\t\t\t\t'desc_tip' => true,\n\t\t\t\t'default' => ''\n\t\t\t),\n\t\t\t'debug' => array(\n\t\t\t\t'title' => __( 'Debug Log', PLUGIN_TXT ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'label' => __( 'Enable logging', PLUGIN_TXT ),\n\t\t\t\t'default' => 'no',\n\t\t\t\t'description' => __( 'Log events such as API requests', PLUGIN_TXT ),\n\t\t\t),\n\t\t);\n\t}", "public function getSetupForm() {\n\n /**\n * @todo find a beter way to do this\n */\n\n if(!empty($_POST['nodeId'])){\n $this->id = $_POST['nodeId'];\n }\n\n if (empty($this->id)) {\n $table = new HomeNet_Model_DbTable_Nodes();\n $this->id = $table->fetchNextId($this->house);\n }\n // $this->id = 50;\n\n $form = new HomeNet_Form_Node();\n $sub = $form->getSubForm('node');\n $id = $sub->getElement('node');\n $id->setValue($this->id);\n \n $table = new HomeNet_Model_DbTable_Nodes();\n $rows = $table->fetchAllInternetNodes();\n\n $uplink = $sub->getElement('uplink');\n\n foreach($rows as $value){\n $uplink->addMultiOption($value->id, $value->id);\n }\n\n\n return $form;\n }", "protected function getConfigForm()\n {\n return array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n array(\n 'type' => 'radio',\n 'name' => 'ORDERREF_MODE',\n 'label' => $this->l('How to generate order references'),\n 'desc' => $this->l('Choose between generation methods'),\n 'values' => array(\n array(\n 'id' => 'ORDERREF_MODE_RANDOM',\n 'value' => self::ORDERREF_MODE_RANDOM,\n 'label' => $this->l('Random numbers'),\n ),\n array(\n 'id' => 'ORDERREF_MODE_CONSEQUENT',\n 'value' => self::ORDERREF_MODE_CONSEQUENT,\n 'label' => $this->l('Consequent'),\n ),\n array(\n 'id' => 'ORDERREF_MODE_PS',\n 'value' => self::ORDERREF_MODE_PS,\n 'label' => $this->l('Don\\'t change an order reference'),\n ),\n ),\n ),\n array(\n 'col' => 3,\n 'type' => 'text',\n 'name' => 'ORDERREF_LENGTH',\n 'label' => $this->l('Length of reference'),\n 'desc' => $this->l('Length of generated reference value'),\n 'required' => true,\n ),\n ),\n 'submit' => array(\n 'title' => $this->l('Save'),\n ),\n ),\n );\n }", "protected function form()\n {\n $form = new Form(new Member());\n\n $form->text('open_id', __('微信openid'));\n $form->image('head', __('头像'));\n $form->text('nickname', __('昵称'));\n $form->mobile('mobile', __('手机号码'));\n $form->text('email', __('邮箱'));\n $form->text('name', __('姓名'));\n $form->text('weixin', __('微信号'));\n $form->text('qq', __('qq'));\n $form->text('city', __('所在城市'));\n $form->text('yidudian', __('易读点'));\n $form->text('integral', __('积分'));\n $form->text('balance', __('余额'));\n $states = [\n 'on' => ['value' => 1, 'text' => '正常', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '冻结', 'color' => 'danger'],\n ];\n $form->switch('status', '是否使用')->states($states);\n return $form;\n }", "public function generateForm()\n {\n $form = \\Drupal::formBuilder()->getForm('\\Drupal\\demo\\Form\\DemoForm');\n \n $build = array();\n\n $build['enabled'] = array(\n '#type' => 'checkbox',\n '#title' => 'Activer'\n );\n\n $build['forms'] = array(\n 'form1' => $form,\n 'form2' => $form\n );\n\n return $build;\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}", "function process_form()\n {\n }", "function makeForm($request, $formOpts){\n\t\t#print_r ($request);\n\t\t$formDescriptor = array(\n\t\t\t'radioForm' => array(\n \t\t\t\t'type' => 'radio',\n \t\t\t\t'label' => 'Select a search type:',\n \t\t\t\t'options' => array( # The options available within the checkboxes (displayed => value)\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 0' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 1' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 2' => 2,\n\t\t\t\t\t\t\t\t\t\t\t),\n \t\t\t\t'default' => 0 # The option selected by default (identified by value)\n \t\t\t),\n 'textfield1' => array(\n\t\t\t\t\t\t\t\t'label' => 'textfield 1 label', # What's the label of the field\n\t\t\t\t\t\t\t\t'class' => 'HTMLTextField' # What's the input type\n\t\t\t\t\t\t\t\t),\n\t\t\t'textfield2' => array(\n\t\t\t\t\t'label' => 'textfield 2 label', # What's the label of the field\n\t\t\t\t\t'class' => 'HTMLTextField' # What's the input type\n\t\t\t\t\t), \t\t\t\t\n \t\t);\n\t\t\n\t\tswitch($formOpts){\n\t\t\tcase '1':\n\t\t\t\t$formDescriptor['textfield1']['label'] = 'textfield 1 label'; # What's the label of the field\n\t\t\t\t$formDescriptor['textfield2']['label'] = 'textfield 2 label'; # What's the label of the field\t\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\t#same as case 1\n\t\t\tdefault:\n\t\t}\n\n\t\t#Submit button structure and page callback. \n $htmlForm = new HTMLForm( $formDescriptor, $this->getContext(), 'myform'); # We build the HTMLForm object, calling the form 'myform'\n $htmlForm->setSubmitText( 'Submit button text' ); # What text does the submit button display\n\t\t\n\t\t/* We set a callback function */ \n\t\t#This code has no function to the special page. It used to produce red wiki text callback such as \"Try Again\" commented-out below under processInput function. \n\t\t$htmlForm->setSubmitCallback( array( 'specialpagetemplate', 'processInput' ) ); # Call processInput() in specialpagetemplate on submit\n $htmlForm->show(); # Displaying the form\n\t}", "function _todoist_config_form($form, &$form_state) {\n $form = array();\n\n $form['user_mail'] = array(\n '#type' => 'textfield',\n '#description' => t('Add Todoist user mail-id'),\n '#default_value' => variable_get('todoist_userid'),\n '#required' => TRUE,\n );\n\n $form['user_pass'] = array(\n '#type' => 'textfield',\n '#description' => t('Add Todoist user password'),\n '#default_value' => variable_get('user_pass'),\n '#required' => TRUE,\n );\n\n $form['user_token'] = array(\n '#type' => 'textfield',\n '#description' => t('Add Todoist user token'),\n '#default_value' => variable_get('user_token'),\n '#required' => TRUE,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n\n return $form;\n}", "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}", "function getFormHTML()\n\t{\n\t\tstatic $id_num = 1000;\n\n\t\t$type = $this->type;\n\t\t$name = $this->name;\n\t\t$value = $this->_getTypeValue($this->type, $this->value);\n\t\t$default = $this->_getTypeValue($this->type, $this->default);\n\t\t$column_name = 'extra_vars' . $this->idx;\n\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t$buff = array();\n\t\tswitch($type)\n\t\t{\n\t\t\t// Homepage\n\t\t\tcase 'homepage' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '\" value=\"' . $value . '\" class=\"homepage\" />';\n\t\t\t\tbreak;\n\t\t\t// Email Address\n\t\t\tcase 'email_address' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '\" value=\"' . $value . '\" class=\"email_address\" />';\n\t\t\t\tbreak;\n\t\t\t// Phone Number\n\t\t\tcase 'tel' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[0] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[1] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[2] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\tbreak;\n\t\t\t// textarea\n\t\t\tcase 'textarea' :\n\t\t\t\t$buff[] = '<textarea name=\"' . $column_name . '\" rows=\"8\" cols=\"42\">' . $value . '</textarea>';\n\t\t\t\tbreak;\n\t\t\t// multiple choice\n\t\t\tcase 'checkbox' :\n\t\t\t\t$buff[] = '<ul>';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$checked = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Temporary ID for labeling\n\t\t\t\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t\t\t\t$buff[] =' <li><input type=\"checkbox\" name=\"' . $column_name . '[]\" id=\"' . $tmp_id . '\" value=\"' . htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '\" ' . $checked . ' /><label for=\"' . $tmp_id . '\">' . $v . '</label></li>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</ul>';\n\t\t\t\tbreak;\n\t\t\t// single choice\n\t\t\tcase 'select' :\n\t\t\t\t$buff[] = '<select name=\"' . $column_name . '\" class=\"select\">';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$selected = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$selected = ' selected=\"selected\"';\n\t\t\t\t\t}\n\t\t\t\t\t$buff[] = ' <option value=\"' . $v . '\" ' . $selected . '>' . $v . '</option>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</select>';\n\t\t\t\tbreak;\n\t\t\t// radio\n\t\t\tcase 'radio' :\n\t\t\t\t$buff[] = '<ul>';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$checked = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Temporary ID for labeling\n\t\t\t\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t\t\t\t$buff[] = '<li><input type=\"radio\" name=\"' . $column_name . '\" id=\"' . $tmp_id . '\" ' . $checked . ' value=\"' . $v . '\" class=\"radio\" /><label for=\"' . $tmp_id . '\">' . $v . '</label></li>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</ul>';\n\t\t\t\tbreak;\n\t\t\t// date\n\t\t\tcase 'date' :\n\t\t\t\t// datepicker javascript plugin load\n\t\t\t\tContext::loadJavascriptPlugin('ui.datepicker');\n\n\t\t\t\t$buff[] = '<input type=\"hidden\" name=\"' . $column_name . '\" value=\"' . $value . '\" />'; \n\t\t\t\t$buff[] =\t'<input type=\"text\" id=\"date_' . $column_name . '\" value=\"' . zdate($value, 'Y-m-d') . '\" class=\"date\" />';\n\t\t\t\t$buff[] =\t'<input type=\"button\" value=\"' . Context::getLang('cmd_delete') . '\" class=\"btn\" id=\"dateRemover_' . $column_name . '\" />';\n\t\t\t\t$buff[] =\t'<script type=\"text/javascript\">';\n\t\t\t\t$buff[] = '//<![CDATA[';\n\t\t\t\t$buff[] =\t'(function($){';\n\t\t\t\t$buff[] =\t'$(function(){';\n\t\t\t\t$buff[] =\t' var option = { dateFormat: \"yy-mm-dd\", changeMonth:true, changeYear:true, gotoCurrent:false, yearRange:\\'-100:+10\\', onSelect:function(){';\n\t\t\t\t$buff[] =\t' $(this).prev(\\'input[type=\"hidden\"]\\').val(this.value.replace(/-/g,\"\"))}';\n\t\t\t\t$buff[] =\t' };';\n\t\t\t\t$buff[] =\t' $.extend(option,$.datepicker.regional[\\'' . Context::getLangType() . '\\']);';\n\t\t\t\t$buff[] =\t' $(\"#date_' . $column_name . '\").datepicker(option);';\n\t\t\t\t$buff[] =\t' $(\"#dateRemover_' . $column_name . '\").click(function(){';\n\t\t\t\t$buff[] =\t' $(this).siblings(\"input\").val(\"\");';\n\t\t\t\t$buff[] =\t' return false;';\n\t\t\t\t$buff[] =\t' })';\n\t\t\t\t$buff[] =\t'});';\n\t\t\t\t$buff[] =\t'})(jQuery);';\n\t\t\t\t$buff[] = '//]]>';\n\t\t\t\t$buff[] = '</script>';\n\t\t\t\tbreak;\n\t\t\t// address\n\t\t\tcase \"kr_zip\" :\n\t\t\t\tif(($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel , 'getKrzipCodeSearchHtml' ))\n\t\t\t\t{\n\t\t\t\t\t$buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// General text\n\t\t\tdefault :\n\t\t\t\t$buff[] =' <input type=\"text\" name=\"' . $column_name . '\" value=\"' . ($value ? $value : $default) . '\" class=\"text\" />';\n\t\t}\n\t\tif($this->desc)\n\t\t{\n\t\t\t$oModuleController = getController('module');\n\t\t\t$oModuleController->replaceDefinedLangCode($this->desc);\n\t\t\t$buff[] = '<p>' . htmlspecialchars($this->desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '</p>';\n\t\t}\n\t\t\n\t\treturn join(PHP_EOL, $buff);\n\t}", "public function form(){\n \t \tif($this->layoutWidgetInfo){\n \t\t$setting = json_decode($this->layoutWidgetInfo->setting, true);\n \t}\n\n \t//default option(type[text], cols[3-9], rows[1], label[$key], name[$key], value[$setting[$k]])\n \t//add option(class, id, stype, styleRow, required, placeholder, attr, [options, code])\n \t$settingForm = array(\n \t\t'layout_widget_id' \t=> array('type' => 'hidden', 'value' => $this->layoutWidgetInfo->layoutWidgetId),\n \t\t'widget_controller' => array('type' => 'hidden', 'value' => $this->widgetController),\n \t\t'header' \t=> array('type' => 'custom', 'value' => \"<h4 class='widget_header col-md-12'>{$this->widgetController}</h4>\", 'label' => ''),\n\n \t\t'title' => array(),\n \t\t'class'\t=> array(),\n 'bg_color'\t=> array('label' => 'Màu nền', 'class' => 'ColorPickerSliders',\n 'addElement' => '<a href=\"index.php?r=admin/help/view&helpId=4\" target=\"_blank\">Xem thêm</a>'),\n \t\t'category_id'\t=> array('type' => 'select_category', 'label' => 'Category', 'required' => true,\n \t\t\t\t'options' => CategoryExt::getCategoryList()),\n \t\t'style'\t=> array('type' => 'select', 'options' => $this->settingDefault['style']),\n \t\t'order_by' => array('type' => 'select', 'options' => $this->settingDefault['order_by']),\n \t\t'order_direction' => array('type' => 'select', 'options' => $this->settingDefault['order_direction']),\n \t);\n\n \t$settingAll = array(\n \t\t'cols' => '3-9'\n \t);\n\n \t//render setting from\n \tTemplateHelper::renderForm($settingForm, $setting, $settingAll);\n TemplateHelper::getTemplate('layout/_extra/add_setting.php', $setting);\n TemplateHelper::getTemplate('layout/_extra/color_picker.php');\n \t}", "public function buildForm()\n {\n $this\n ->add('group_name', 'text')\n ->add(\n 'organizations',\n 'choice',\n [\n 'choices' => $this->getOrganizationName(),\n 'attr' => ['style' => 'height:100px'],\n 'multiple' => true\n ]\n )\n ->add(\n 'group_identifier',\n 'text',\n [\n 'attr' => [\n 'id' => 'group_identifier'\n ],\n 'help_block' => [\n 'text' => \"Your group identifier will be used as a prefix for your organisation group. We recommend that you use a short abbreviation that uniquely identifies your organisation group. If your group identifier is 'abc' the username for the group created with this registration will be 'abc_group'.\",\n 'tag' => 'p',\n 'attr' => ['class' => 'help-block']\n ],\n 'label' => 'Group Identifier'\n ]\n );\n }", "protected function form()\n {\n $form = new Form(new Drug);\n\n $form->text('street_name', '«Уличное» название');\n $form->text('city', 'Город');\n $form->text('active_substance', 'Активное вещество');\n $form->text('symbol', 'Символ');\n $form->text('state', 'Состояние');\n $form->text('color', 'Цвет');\n $form->text('inscription', 'Надпись');\n $form->text('shape', 'Форма');\n $form->text('weight', 'Вес таблетки');\n $form->text('weight_active', 'Вес действующего вещества');\n $form->text('description', 'Описание');\n $form->text('negative_effect', 'Негативный эффект');\n $form->switch('confirm', 'Подтверждение');\n\n return $form;\n }", "function init_form_fields()\n {\n\n $this->form_fields = array(\n\n 'enabled' => array(\n 'title' => __('Enable'),\n 'type' => 'checkbox',\n 'description' => __('Enable this shipping.'),\n 'default' => 'yes'\n ),\n 'title' => array(\n 'title' => __('Title'),\n 'type' => 'text',\n 'description' => __('Title to be display on site'),\n 'default' => __('CDEK Shipping')\n ),\n 'priceSet' => array(\n 'title' => __('Delivery cost'),\n 'type' => 'text',\n 'description' => __('Default delivery cost'),\n 'default' => __('405')\n ),\n );\n }", "public function __construct($module = null, $fname = null, $group = null,\n $name = null, $title = null, $show = null, \n $disabled = null, $required = null, $type = null, \n $regex = null, $length = null, $min = null, \n $max = null, $selected = null, $checked = null, \n $value = null, $size = null, $cols = null,\n $rows = null, $source = null, $multiple = null,\n $btype = null, $text = null, $tclasses = null,\n $iclasses = null, $defines = null, $filters = null,\n $roles = null) {\n global $filelogger;\n\n $filelogger->debug(\"FormElement = [\".\n \" (%,%,%), (%,%,%), (%,%,%), (%,%,%), (%,%,%),\".\n \" (%,%,%), (%,%,%), (%,%,%), (%,%,%), (%,%,%),\".\n \" (%,%,%), (%,%,%), (%,%,%), (%,%,%), (%,%,%),\".\n \" (%,%,%), (%,%,%), (%,%,%), (%,%,%), (%,%,%),\".\n \" (%,%,%), (%,%,%), (%,%,%), (%,%,%), (%,%,%),\".\n \" (%,%,%), (%,%,%), (%,%,%) ]\",\n array(\n \"module\",$module,gettype($module),\"fname\",$fname,gettype($fname),\n \"group\",$group,gettype($group),\"btype\",$btype,gettype($btype),\n \"name\",$name,gettype($name),\"title\",$title,gettype($title),\n \"show\",$show,gettype($show),\"disabled\",$disabled,gettype($disabled),\n \"required\",$required,gettype($required),\"type\",$type,gettype($type),\n \"regex\",$regex,gettype($regex),\"length\",$length,gettype($length),\n \"min\",$min,gettype($min),\"max\",$max,gettype($max),\n \"selected\",$selected,gettype($selected),\"checked\",$checked,gettype($checked),\n \"value\",$value,gettype($value),\"size\",$size,gettype($size),\n \"cols\",$cols,gettype($cols),\"rows\",$rows,gettype($rows),\n \"source\",$source,gettype($source),\"multiple\",$multiple,gettype($multiple),\n \"text\",$text,gettype($text),\"tclasses\",$tclasses,gettype($tclasses),\n \"iclasses\",$iclasses,gettype($iclasses),\"defines\",$defines,gettype($defines),\n \"filters\",$filters,gettype($filters),\"roles\",$roles,gettype($roles)\n )\n ); \n \n $this->module = $module;\n $this->fname = $fname;\n $this->groupid = (Validator::equals($group,\"globals\") ? \"g\" : \"e\");\n $this->name = $name;\n $this->title = $title;\n $this->text = $text;\n\n $this->show = $show;\n $this->disabled = (Validator::equals($disabled,\"y\")\n ? \"disabled=\\\"disabled\\\"\" : \"\");\n $this->required = $required;\n\n $this->type = $type;\n $this->btype = $btype;\n\n $this->size = (Validator::matches($size,\"/^[1-9]{1}[0-9]*$/\")&&$size>0\n ? $size : 1);\n $this->length = (Validator::matches($length,\"/^[1-9]{1}[0-9]*$/\")&&$length>0\n ? $length : 254);\n $this->min = (Validator::matches($min,\"/^[1-9]{1}[0-9]*$/\")&&$min>0\n ? $min : 0);\n $this->max = (Validator::matches($max,\"/^[1-9]{1}[0-9]*$/\")&&$max>0\n ? $max : 100);\n\n $this->cols = (Validator::matches($cols,\"/^[1-9]{1}[0-9]*$/\")&&$cols>0\n ? $cols : 30);\n $this->rows = (Validator::matches($rows,\"/^[1-9]{1}[0-9]*$/\")&&$rows>0\n ? $rows : 3);\n\n $this->regex = $regex; // used to check values inserted on submit\n $this->value = $value;\n $this->source = $source;\n\n $this->selected = (Validator::equals($selected,\"y\")\n ? \"selected=\\\"selected\\\"\" : \"\");\n $this->checked = (Validator::equals($checked,\"y\")\n ? \"checked=\\\"checked\\\"\" : \"\");\n $this->multiple = (Validator::equals($multiple,\"y\")\n ? \"multiple=\\\"multiple\\\"\" : \"\");\n\n $this->tclasses = $tclasses;\n $this->iclasses = $iclasses;\n\n $this->defines = $defines; \n\n $this->filters = (Validator::matches($filters,\n \"/^[a-z]+(_{0,1}[a-z]+)*(,[a-z]+(_{0,1}[a-z]+)*)*$/\") \n ? $filters : \"string\"); \n $this->roles = (Validator::equals($roles,\"\") \n ? array(\"*\") : explode(\",\",$roles));\n\n }" ]
[ "0.7210571", "0.7209898", "0.71665543", "0.7095763", "0.68881524", "0.68881524", "0.6853783", "0.6790057", "0.67896426", "0.67896426", "0.6770245", "0.6731574", "0.67293286", "0.66824174", "0.66691154", "0.6665932", "0.6597495", "0.655978", "0.6554897", "0.65390325", "0.6524279", "0.6514578", "0.6513929", "0.65024734", "0.65010023", "0.6491699", "0.6485654", "0.64738435", "0.64609843", "0.6455135", "0.64523333", "0.6445414", "0.643269", "0.64325464", "0.64324975", "0.64269215", "0.6424119", "0.64215714", "0.6419172", "0.6405273", "0.6401154", "0.6400952", "0.6395145", "0.6380796", "0.6373009", "0.6370045", "0.63612294", "0.63605535", "0.63571364", "0.6354319", "0.63452536", "0.63235986", "0.63234866", "0.63203347", "0.6314424", "0.6313048", "0.63089514", "0.62994945", "0.6287718", "0.62876534", "0.6282547", "0.628096", "0.6280217", "0.627892", "0.627813", "0.6276287", "0.6275925", "0.6274082", "0.6267782", "0.62672853", "0.6259132", "0.625634", "0.62561315", "0.6251005", "0.6241686", "0.62371534", "0.62299645", "0.6226578", "0.6223176", "0.6217437", "0.6211431", "0.6210564", "0.6209502", "0.6205195", "0.620078", "0.6199172", "0.61975944", "0.61949426", "0.6194089", "0.619323", "0.61922896", "0.61921275", "0.61914414", "0.61899084", "0.6185868", "0.61748254", "0.61719394", "0.6168493", "0.61684096", "0.61620945", "0.6160643" ]
0.0
-1
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function create() {}", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315901", "0.6248427", "0.6241929", "0.6194334", "0.6081284", "0.6075819", "0.6069913", "0.60685146", "0.6055616", "0.6027874", "0.60132784", "0.60118896", "0.6011778", "0.5969603", "0.59618074", "0.5954538", "0.59404427", "0.59388787", "0.5929363", "0.5910562", "0.590651", "0.589658", "0.589658", "0.589658", "0.58692765", "0.58665586", "0.5866528", "0.58663124", "0.5852474", "0.5852405", "0.58442044", "0.58391577", "0.58154446", "0.58055794", "0.5795853", "0.5780188", "0.57653266", "0.57640004", "0.57584697", "0.575748", "0.5742612", "0.5739361", "0.5732979", "0.572247", "0.5701043", "0.5686879", "0.5685233", "0.56819254", "0.5675983", "0.56670785", "0.56606543", "0.5659307", "0.56567776", "0.56534046", "0.56343585", "0.56290466", "0.5626615", "0.56255764", "0.5608852", "0.5608026", "0.56063116", "0.56026554", "0.5599553", "0.5599351", "0.55640906", "0.55640906", "0.5561977", "0.5559745", "0.5555084", "0.5551485", "0.5544597", "0.55397296", "0.5529626", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908" ]
0.0
-1
Execute the console command.
public function handle() { $locations = file_get_contents(public_path().'/locations.json'); $locations = json_decode($locations, true); foreach ($locations as $location) { $this->info("ID: ". $location['id']); Location::insert($location); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.61484164", "0.6146793", "0.6139144", "0.61347336", "0.6131662", "0.61164206", "0.61144686", "0.61109483", "0.61082935", "0.6105106", "0.6103338", "0.6102162", "0.61020017", "0.60962653", "0.6095482", "0.6091584", "0.60885274", "0.6083864", "0.6082142", "0.6077832", "0.60766655", "0.607472", "0.60739267", "0.607275", "0.60699606", "0.6069931", "0.6068753", "0.6067665", "0.6061175", "0.60599935", "0.6059836", "0.605693", "0.60499364", "0.60418284", "0.6039709", "0.6031963", "0.6031549", "0.6027515", "0.60255647", "0.60208166", "0.6018581", "0.60179937", "0.6014668", "0.60145515", "0.60141796", "0.6011772", "0.6008498", "0.6007883", "0.60072047", "0.6006732", "0.60039204", "0.6001778", "0.6000803", "0.59996396", "0.5999325", "0.5992452", "0.5987503", "0.5987503", "0.5987477", "0.5986996", "0.59853584", "0.5983282", "0.59804505", "0.5976757", "0.5976542", "0.5973796", "0.5969228", "0.5968169", "0.59655035", "0.59642595", "0.59635514", "0.59619296", "0.5960217", "0.5955025", "0.5954439", "0.59528315", "0.59513766", "0.5947869", "0.59456027", "0.5945575", "0.5945031" ]
0.0
-1
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(ArchivoCotizacion $archivoCotizacion) { // }
{ "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(ArchivoCotizacion $archivoCotizacion) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, ArchivoCotizacion $archivoCotizacion) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(ArchivoCotizacion $archivoCotizacion) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Realiza o buffer dos dados
public function count() { $this->buffer(); // Armazena quantos registro possui o array $this->count = count($this->toArray()); // Retorna para o primeiro elemento $this->rewind(); // Retorna a quantidade de dados return $this->count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBuffer() {}", "public function buffered();", "public function startBuffer(): void {\n\t\tob_start();\n\t}", "private function clearDataBuffer( )\n {\n $this->data_buffer = array( );\n $this->err_message = '';\n }", "public function dumpBuffer()\n {/*{{{*/\n $data = $this->_putbackBuffer;\n $colLimit = 15;\n $col = 0;\n $length = count($data);\n for ($i=0; $i < $length; $i++) {\n printf('%02X ', $data[1]);\n if ($col==$colLimit) {\n $col=0;\n print PHP_EOL;\n } else {\n $col++;\n }\n }\n print PHP_EOL;\n }", "function openal_buffer_data($buffer, $format, $data, $freq)\n{\n}", "public function start_buffer() {\n\t\tob_start();\n\t}", "private function clearBuffer() {\r\n\t\t$this->buffer = '';\r\n\t}", "public function getOutputBuffer()\n {\n }", "private function load_buffered()\n {\n }", "public function startOutputBuffering() {}", "public function startBuffering(): void {}", "public function startBuffering(): void {}", "public function bufferStart() {\n\t\tob_start( array( $this, 'obCallback' ) );\n\t}", "private function readDataIntoBuffer()\n {\n $data = '';\n $read = [$this->socket];\n $write = $except = null;\n\n /* Note by DaveRandom:\n * This is a little odd. When I tested on Fedora, fread() was only returning\n * 1 byte at a time. Other systems (including another Fedora box) didn't do\n * this. This loop fixes the issue, and shouldn't negatively impact performance\n * too badly, as sane systems will only iterate once, all parsers are buffered.\n */\n do {\n $bytes = fread($this->socket, 8192);\n\n if ($bytes === false) {\n $this->log('Data read failed: ' . $this->getLastSocketError(), Loggable::LEVEL_ERROR);\n $this->trigger('error', $this, 'Data read failed');\n\n $this->disconnect();\n return;\n }\n\n $data .= $bytes;\n } while (stream_select($read, $write, $except, 0));\n\n $this->log('Got data from socket: ' . $data, Loggable::LEVEL_DEBUG);\n $this->buffer->write($data);\n }", "public static function resetBuffer()\r\n {\r\n while(@ob_end_clean());\r\n \r\n // create new empty buffer \r\n if (version_compare(PHP_VERSION, '5.4.0', '>=')) \r\n ob_start(null, 0, PHP_OUTPUT_HANDLER_STDFLAGS ^ PHP_OUTPUT_HANDLER_REMOVABLE);\r\n else \r\n ob_start(null, 0, false);\r\n }", "public function saveBuffer(): void {\n\t\t// Get content && update page content\n\t\t$this->setPageContent($this->readBuffer());\n\t}", "public function buffer()\n {\n if ($this->_disabled) {\n return;\n }\n\n if ($this->isTurbo()) {\n return;\n }\n\n ob_start();\n $this->output();\n $this->_html = ob_get_contents();\n ob_end_clean();\n }", "protected function _flushBuffer() {\n\t\t//@codingStandardsIgnoreStart\n\t\t@flush();\n\t\tif (ob_get_level()) {\n\t\t\t@ob_flush();\n\t\t}\n\t\t//@codingStandardsIgnoreEnd\n\t}", "public function flush()\n {\n unset($this->buffer);\n $this->buffer=array();\n }", "public function clearBuffer() {\n $this->buffer = '';\n }", "static function send_buffer()\n {\n self::log_debug('Start sending buffer ...');\n\n $requests_sent = 0;\n $buffer_file = self::$log_dir . self::$log_file_buffer;\n $buffer_file_tmp = self::$log_dir . self::$log_file_buffer . '.' . rand(1, 100000) . '.tmp';\n\n try {\n\n if (!is_file($buffer_file)) {\n self::log_debug('Buffer file does not exists, nothing found to sent.');\n return false;\n }\n\n // take the current buffer and put it inside a unique tmp buffer\n rename($buffer_file, $buffer_file_tmp);\n\n // read and process the tmp buffer\n $fh = fopen($buffer_file_tmp, \"r\");\n if ($fh) {\n while (!feof($fh)) {\n $data_serialized = fgets($fh);\n\n if ($data_serialized == false) {\n continue;\n }\n\n $data = unserialize($data_serialized);\n \n if (self::send($data['e'], $data['m'], $data['d'])) {\n $requests_sent++;\n }\n }\n fclose($fh);\n }\n unlink($buffer_file_tmp);\n\n self::log_debug('Queue was sent successfully! Sent ' . $requests_sent . ' requests.');\n } catch (Exception $e) {\n self::log_error($e->getMessage());\n }\n }", "public function write($buffer)\n {\n }", "protected function _prepareFlush() {\r\n\r\n }", "public function setBuffer($buffer)\n {\n $this->buffer = $buffer;\n }", "public function setBuffer($buffer)\n {\n $this->buffer = $buffer;\n }", "public function getBuffer($atOffset = true) {}", "public function closeBuffer(): void {\n\t\tob_end_clean();\n\t}", "public function getBuffer($atOffset = true);", "public function bufferEnd() {\n\t\tob_end_flush();\n\t}", "public function set_buffer(&$buffer)\r\n\t{\r\n\t\t$this->buffer = $buffer;\r\n\t\t$this->_isExternalBuffer = true;\r\n\t\t$this->buffer->register_var($this->sorting);\r\n\t\t$this->buffer->register_var($this->pagenum);\r\n\t\t$this->buffer->register_var($this->sortdir);\r\n\t}", "public function toBuffer()\n {\n $path = $this->toUrl();\n\n return Utils::streamFor($path);\n }", "public function toBuffered(): IResultAdapter;", "public function mapDataToBuffer(): self\n {\n // TODO: Implement mapDataToBuffer() method.\n return $this;\n }", "function obtenBuffer() {\n return $this->buffer;\n }", "public function get_buffer()\r\n\t{\r\n\t\treturn $this->buffer;\r\n\t}", "public function getBufferSize(): int;", "function cleanBufferOn()\n\t{\n\t\t$this->bCleanBuffer = true;\n\t}", "public function readBuffer() {\n\t\treturn ob_get_clean();\n\t}", "private function _setupBuffering()\n {\n // disable time limit\n @set_time_limit(0);\n \n // prevent buffering\n if (function_exists('apache_setenv')) {\n @apache_setenv('no-gzip', 1);\n }\n\n @ini_set('zlib.output_compression', 0);\n \n // turn on implicity flushing\n @ini_set('implicit_flush', true);\n while (@ob_get_level() !== 0) {\n @ob_end_flush();\n }\n\n @ob_implicit_flush(true);\n }", "public function getBuffer()\n {\n return $this->buffer;\n }", "public function getBuffer()\n {\n return $this->buffer;\n }", "function _newobj()\n\t\t{\n\t\t\t$this->n++;\n\t\t\t$this->offsets[$this->n]=strlen($this->buffer);\n\t\t\t$this->_out($this->n.' 0 obj');\n\t\t}", "function openal_buffer_destroy($buffer)\n{\n}", "public function __construct($buffer = '')\n {\n $this->buffer = $buffer;\n $this->pos = 0;\n }", "public function CapturaCalificacionDescargar()\n {\n $dbmi = $this->get(\"db_manager\");\n $dbm = new DbmControlescolar($dbmi->getEntityManager());\n $content = trim(file_get_contents(\"php://input\"));\n $decoded = json_decode($content, true);\n //$dataRaw=json_decode('',true);\n //*\n $decoded[\"showAsistencias\"] = ($decoded[\"showAsistencias\"] == true ? \"true\" : \"false\");\n $dataRaw = self::CCCapturaCalificacionGrupoProcess($dbmi, $decoded);\n $dataarray = &$dataRaw[2];\n $dataarray[\"arraydato\"] = $dataarray[\"arraydato\"][0];\n\n $ultimoperiodo = $dataarray[\"ultimoperiodo\"];\n $conjuntope = $ultimoperiodo->getConjuntoperiodoevaluacionid();\n $ciclo = $conjuntope->getCicloid();\n\n $arraymateria = $dataarray[\"arraymateria\"];\n $planestudio = $arraymateria->getPlanestudioid();\n $grado = $planestudio->getGradoid();\n $nivel = $grado->getNivelid();\n\n $omateria = $arraymateria->getMateriaid();\n $omateriaid = $omateria->getMateriaid();\n $omaterianame = $omateria->getNombre();\n\n $arraydato = &$dataarray[\"arraydato\"];\n $arraydato[\"ciclo\"] = $ciclo->getNombre();\n $arraydato[\"nivel\"] = $nivel->getNombre();\n $arraydato[\"grado\"] = $grado->getGrado();\n $arraydato[\"planestudio\"] = $planestudio->getNombre();\n unset($dataarray[\"arraymateria\"]);\n unset($dataarray[\"ultimoperiodo\"]);\n //echo json_encode($dataRaw);exit;\n //*/\n list($status, $code, $data) = $dataRaw;\n $header = $data[\"arraydato\"];\n $alumnos = $data[\"arrayalumno\"];\n $jtable = [];\n\n foreach ($alumnos as $ialumno) {\n $ialumnonum = \"\" . $ialumno['numerolista'];\n $ialumnoname = $ialumno['nombre'];\n $irowname = $ialumnonum . \" - \" . $ialumnoname;\n $iacalperiodo = $ialumno['calificacionperiodo'][0];\n $iscoreperiodo = $iacalperiodo['calificacionperiodo'];\n $iscoreaperiodo = $iacalperiodo['calificacionantesredondeo'];\n $iscoreperiodof = $iacalperiodo['calificacionfinal'];\n $iponderacionraw = $iacalperiodo['opcionperiodo']; //Ponderacion periodo\n $iponderacionfraw = $iacalperiodo['opcionfinal']; //Ponderacion final\n\n $iaponderacionraw = (!$iponderacionraw || is_array($iponderacionraw) || empty($iponderacionraw)\n ? null : $dbm->getPonderacionopcionById($iponderacionraw));\n $iaponderacionfraw = (!$iponderacionfraw || is_array($iponderacionfraw) || empty($iponderacionfraw)\n ? null : $dbm->getPonderacionopcionById($iponderacionfraw));\n\n $iaponderacion = ($iaponderacionraw ? $iaponderacionraw['opcion'] : null);\n $iaponderacionf = ($iaponderacionfraw ? $iaponderacionfraw['opcion'] : null);\n\n $isubmaterias = (isset($ialumno['submaterias']) && !empty($ialumno['submaterias'])\n ? $ialumno['submaterias'] : null);\n $imaterias = $isubmaterias;\n if (!$isubmaterias) {\n $ialumno['materiaid'] = $omateriaid;\n $ialumno['nombre'] = $omaterianame;\n $imaterias = [$ialumno];\n }\n $imi = 0;\n foreach ($imaterias as $imateria) {\n $imaterianame = $imateria[\"nombre\"];\n $irow1name = $imaterianame; //($isubmaterias ? $imaterianame : \"\");\n $jtable[] = $this->buildJTableCell(\"Matrícula\", $irowname, $irow1name, $ialumno['matricula']);\n $icriterios = $imateria['criterios'];\n $imcalperiodo = $imateria['calificacionperiodo'][0];\n foreach ($icriterios as $icriterio) {\n $icapturas = $icriterio['calificacioncaptura'];\n $icriterioname = $icriterio['aspecto'];\n $icriteriodata = $icriterio['porcentajecalificacion'] . \"% 0 a \" . $icriterio['puntajemaximo'];\n $totalCapturas = 0;\n foreach ($icapturas as $icaptura) {\n $totalCapturas = $totalCapturas + $icaptura['calificacion'];\n $jtable[] = $this->buildJTableCell($icriterioname, $irowname, $irow1name, $icaptura['calificacion'], $icriteriodata, \"\" . $icaptura['numerocaptura']);\n }\n\n $jtable[] = $this->buildJTableCell(\"Promedio \" . $icriterioname, $irowname, $irow1name, ($totalCapturas/count($icapturas)), \"\", \"\");\n $jtable[] = $this->buildJTableCell(\"Porcentaje \" . $icriterioname, $irowname, $irow1name, ((($totalCapturas/count($icapturas))*$icriterio['porcentajecalificacion'])/$icriterio['puntajemaximo']), \"\", \"\");\n }\n $imponderacionraw = $imcalperiodo['opcionperiodo'];\n $imaponderacionraw = (!$imponderacionraw || is_array($imponderacionraw) || empty($imponderacionraw)\n ? null : $dbm->getPonderacionopcionById($imponderacionraw));\n $imaponderacion = ($imaponderacionraw ? $imaponderacionraw['opcion'] : null);\n $iobservacion = (!isset($imcalperiodo['observacion']) || empty(trim($imcalperiodo['observacion']))\n ? null : trim($imcalperiodo['observacion']));\n if ($iobservacion) {\n $jtable[] = $this->buildJTableCell(\"Observaciones\", $irowname, $irow1name, $iobservacion);\n }\n if ($imaponderacion && $isubmaterias) {\n $jtable[] = $this->buildJTableCell(\"Evaluacion\", $irowname, $irow1name, $imaponderacion);\n }\n if($iscoreaperiodo){\n $jtable[] = $this->buildJTableCell(\"Calificación antes de redondeo\", $irowname, $irow1name, $iscoreaperiodo);\n }\n if ($iscoreperiodo) {\n $jtable[] = $this->buildJTableCell(\"Calificación periodo\", $irowname, $irow1name, $iscoreperiodo);\n }\n if ($iaponderacion) {\n $jtable[] = $this->buildJTableCell(\"Ponderacion periodo\", $irowname, $irow1name, $iaponderacion);\n }\n if ($iscoreperiodof && ENTORNO == 1) {\n $jtable[] = $this->buildJTableCell(\"Calificación final\", $irowname, $irow1name, $iscoreperiodof);\n }\n if ($iaponderacionf) {\n $jtable[] = $this->buildJTableCell(\"Ponderacion final\", $irowname, $irow1name, $iaponderacionf);\n }\n \n if($imateria[\"totalfaltas\"]){\n $jtable[] = $this->buildJTableCell(\"Faltas\", $irowname, $irow1name, $imateria[\"totalfaltas\"]);\n }else{\n if($imi == 0){\n $jtable[] = $this->buildJTableCell(\"Faltas\", $irowname, $irow1name, $ialumno[\"totalfaltas\"]);\n }\n \n }\n $imi++;\n }\n\n }\n $result = [\n \"header\" => $header,\n \"score\" => $jtable\n ];\n //echo json_encode($result);exit;\n\n\n $done = false;\n $name = \"R\" . rand();\n $report = \"ReporteCalificacionesDetalle\";\n $input = $output = \"ReporteCalificacionesDetalle_$name\";\n\n $pdf = new LDPDF($this->container, $report, $output, array('driver' => 'jsonql', 'jsonql_query' => '\"\"', 'data_file' => $input), [], ['xlsx']);\n $inputPath = $pdf->fdb_r;\n $outputPath = $pdf->output_r;\n\n $resultenc = json_encode($result);\n $file = LDPDF::fileRead($inputPath);\n LDPDF::fileWrite($file, $resultenc);\n LDPDF::fileClose($file);\n $toremove = [$inputPath];\n\n if (!$pdf->execute()) {\n $toremove[] = $outputPath;\n $done = true;\n }\n\n $reporteSize = filesize($outputPath);\n $reporte = file_get_contents($outputPath);\n foreach ($toremove as $i) {\n LDPDF::fileDelete($i);\n }\n return ($done ? new Response($reporte, 200, array(\n 'Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=utf-8',\n 'Content-Length' => $reporteSize\n )) : Api::Error(Response::HTTP_PARTIAL_CONTENT, \"La impresion no esta disponible.\"));\n }", "public function toUnbuffered(): IResultAdapter;", "public function getInputBuffer()\n {\n }", "public function buffer() {\n\t\treturn ob_get_contents();\n\t}", "function flush(){\n\t\tif(!$this->_OutputBuffer_Flush_Started){\n\t\t\t$this->_flushHeaders();\n\t\t}\n\n\t\tif($this->getContentLength()>0){\n\t\t\t$this->_OutputBuffer_Flush_Started = true;\n\t\t\t$this->_OutputBuffer->printOut();\n\t\t\t$this->_OutputBuffer->clear();\n\t\t}\n\t}", "public function flush()\n {\n $this->line($this->buffer);\n $this->buffer = \"\";\n }", "abstract public function prepareData();", "function flush() ;", "function flush() ;", "public function getBuffer()\n\t{\n\t\treturn self::$_buffer;\n\t}", "public function reset()\n {\n $this->cbuff = [];\n }", "protected function cleanBuffer()\n {\n if (ob_get_level() !== 0) {\n ob_clean();\n }\n }", "public function flush_buffer() {\n\t\techo(self::$core_display->buffer);\n\t\tself::$core_display->buffer = '';\n\t}", "private function _flushContent()\n {\n @ob_flush();\n @flush();\n }", "public function drain()\n {\n $data = $this->buffer;\n $this->buffer = '';\n\n return $data;\n }", "public function clear(): void\n {\n $this->bufferSize = 0;\n $this->buffer = array();\n }", "protected function _getData()\n {\n return\n substr(Transform::toUInt32BE($this->_bufferSize), 1, 3) .\n Transform::toInt8($this->_infoFlags) .\n Transform::toInt32BE($this->_offset);\n }", "public function completeFileStream()\n {\n $crc = hexdec(hash_final($this->hash_ctx));\n \n // convert the 64 bit ints to 2 32bit ints\n list($zlen_low, $zlen_high) = $this->int64Split($this->zlen);\n list($len_low, $len_high) = $this->int64Split($this->len);\n \n // build data descriptor\n $fields = [ // (from V.A of APPNOTE.TXT)\n ['V', 0x08074b50], // data descriptor\n ['V', $crc], // crc32 of data\n ['V', $zlen_low], // compressed data length (low)\n ['V', $zlen_high], // compressed data length (high)\n ['V', $len_low], // uncompressed data length (low)\n ['V', $len_high], // uncompressed data length (high)\n ];\n \n // pack fields and calculate \"total\" length\n $ret = $this->packFields($fields);\n \n // print header and filename\n $this->send($ret);\n \n // Update cdr for file record\n $this->current_file_stream[3] = $crc;\n $this->current_file_stream[4] = gmp_strval($this->zlen);\n $this->current_file_stream[5] = gmp_strval($this->len);\n $this->current_file_stream[6] += gmp_strval(gmp_add(gmp_init(strlen($ret)), $this->zlen));\n ksort($this->current_file_stream);\n \n // Add to cdr and increment offset - can't call directly because we pass an array of params\n call_user_func_array([$this, 'addToCdr'], $this->current_file_stream);\n }", "function flush(){\n\t\t$this->last_result = array();\n\t\t$this->col_info = null;\n\t\t$this->last_query = null;\n\t}", "function __flush(&$_)\n {\n if($this->field){\n $field = explode(',', $this->field);\n $field_format = ($this->field_format ? $this->field_format : '%s');\n\n foreach($field as $key => $param) {\n $param = explode(':', $param);\n\n /* if no record on server resultset send fields definition to client */\n if(!isset($_->webgets[$param[0]]->current_record)) $cfields[] = $field[$key];\n \n $field[$key] = &array_get_nested\n ($_->webgets[$param[0]]->current_record, $param[1]); \n }\n\n $src = vsprintf($field_format, $field); \n }\n \n else $src = $this->src;\n\n /* enable client field definition */\n if(isset($cfields)) $cfields = 'field=\"' . implode(',', $cfields) .\n '\" field_format=\"' . $field_format . '\" ';\n \n else $cfields = \"\";\n \n /* checks if the size of the image was given. If not, resets at the \n natural image dimensions */\n if(isset($this->boxing)) {\n if($this->boxing != 'false') {\n $boxing = explode(',', $this->boxing);\n $width = ($boxing[0] != \"\" ? $boxing[0] : '100%');\n $height = ($boxing[1] != \"\" ? $boxing[0] : '100%');\n }\n }\n \n if(is_file($src)){\n $imagesize = getimagesize($src);\n $width = ($boxing[0] != \"\" ? $width : $imagesize[0].\"px\");\n $height = ($boxing[1] != \"\" ? $height : $imagesize[1].\"px\");\n }\n\n /* builds syles */\n $css_style = $_->ROOT->boxing($this->boxing, $width, $height)\n . $_->ROOT->style_registry_add($this->style).$this->class;\n\n if($css_style!=\"\") $css_style = 'class=\"'.$css_style.'\" ';\n\n /* builds code */ \n $_->buffer[] = '<img wid=\"0020\" src=\"' . $src . '\" '\n . $_->ROOT->format_html_attributes($this)\n . $css_style\n . $cfields\n . '/>';\n }", "public function add_buffer( $str )\n\t{\n\t\t$this->buffer.= $str;\n\t}", "abstract function flush();", "function flush_buffers(){\n ob_end_flush();\n ob_flush();\n flush();\n ob_start();\n}", "public function flush(): void\n {\n $this->renderer->renderBuffer($this->getCellBuffer());\n\n $this->output->flush();\n }", "public function stdWrap_bytesDataProvider() {}", "public static function flushOutputBuffers() {}", "function processData() ;", "abstract public function flush();", "public function __construct($initial= '') {\n $this->buffer= $initial;\n }", "function flush()\n\t\t{\n\t\t\t// Get rid of these\n\t\t\t$this->last_result = null;\n\t\t\t$this->col_info = null;\n\t\t\t$this->last_query = null;\n\t\t\t$this->from_disk_cache = false;\n $this->setParamaters();\n\t\t}", "public function buffer(array $keys)\n {\n }", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public function flush();", "public static function getBufferSize() {}", "function flush()\n\t\t{\n\t\t\t// Get rid of these\n\t\t\t$this->last_result = null;\n\t\t\t$this->col_info = null;\n\t\t\t$this->last_query = null;\n\t\t\t$this->from_disk_cache = false;\n\t\t}", "public function initialise() {\n return $this->fillFileBuffer();\n }", "function writeDataChunks()\n {\n if ($this->dbg)\n echo (\"writeDataChunks \" . $this->bytesToSend . \" which is \" .\n $this->bytesToSend/$this->byteRateAdjusted . \" sec <br/>\");\n $fp = fopen($this->fileName, \"rb\");\n if (!$fp) die;\n $i = 0;\n while ($this->byteToSendStart >= $this->chunkSizeArray[$i])\n $this->byteToSendStart -= $this->chunkSizeArray[$i++];\n while ($this->bytesToSend)\n {\n $seekPos = $this->chunkPosArray[$i] + $this->byteToSendStart;\n if ($this->dbg)\n echo (\"fseek to \" . $seekPos . \" <br/>\");\n fseek($fp, $seekPos, SEEK_SET);\n $toSend = $this->bytesToSend;\n $maxSend = $this->chunkSizeArray[$i] - $this->byteToSendStart;\n if ($toSend > $maxSend)\n $toSend = $maxSend;\n $str = fread($fp, $toSend);\n if ($this->dbg)\n echo (\"read \" . $toSend . \" and got \" . strlen($str) . \" <br/>\");\n else\n echo ($str);\n $this->bytesToSend -= $toSend;\n $this->byteToSendStart = 0;\n $i++;\n }\n fclose($fp);\n if ($this->dbg) echo (\"finished writing from \" . $this->fileName . \"<br/>\");\n }", "public function packData($query=\"\")\n\t\t{\n\t\t\tif (strlen($query) > 0)\n\t\t\t{\n\t\t\t\t$data = $this->execQuery($query);\n\t\t\t\t$buffer = array();\n\n\t\t\t\twhile($look = mysqli_fetch_array($data))\n\t\t\t\t{\n\t\t\t\t\tarray_push($buffer, $look);\n\t\t\t\t}\n\n\t\t\t\treturn $buffer;\n\t\t\t}\n\t\t}", "public function clean()\n\t{\n\t\t$this->buffer = '';\t\t\n\t}", "function setBufferFile()\r\n\t {\r\n\t \t//$this->_bufferFile = '/tmp/fabrik_package-' . $this->label . '.xml';\r\n\t\t$this->_bufferFile = JPATH_SITE . \"/administrator/components/com_fabrik/fabrik_package-\". $this->label . '.xml';\r\n\t }" ]
[ "0.6636572", "0.6280948", "0.6265262", "0.6113599", "0.5974401", "0.59731996", "0.58970517", "0.5886489", "0.5856397", "0.5820174", "0.58147407", "0.5813713", "0.5813713", "0.5768977", "0.57487303", "0.57180756", "0.5679499", "0.56664276", "0.55921996", "0.5581137", "0.555707", "0.54672146", "0.5450989", "0.5444498", "0.54357827", "0.54357827", "0.54157954", "0.53926474", "0.5384048", "0.5383474", "0.5380715", "0.5376846", "0.53734297", "0.53707236", "0.5330973", "0.531852", "0.5317595", "0.53151274", "0.5301431", "0.52754956", "0.5271847", "0.5271847", "0.52535164", "0.52440065", "0.52234143", "0.52008116", "0.5182895", "0.51808393", "0.51626444", "0.51605064", "0.51305497", "0.5096476", "0.5090129", "0.5090129", "0.50850075", "0.50632524", "0.50354004", "0.50117296", "0.50015587", "0.4998919", "0.49938607", "0.49843317", "0.49813056", "0.49812803", "0.49794883", "0.49761227", "0.49632517", "0.49578285", "0.49569649", "0.49542218", "0.4949661", "0.49314255", "0.49306765", "0.49203232", "0.49082866", "0.49054396", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48992547", "0.48990744", "0.48980868", "0.48974124", "0.48884612", "0.48793727", "0.48601875", "0.48526177" ]
0.0
-1
Cuenta los articulos en el carrito
function CuentaUnidades($CardCode){ $Total_Articulos = 0; $Total_Pedido = 0; if($this->con->conectar()==true){ $Resultado = mysql_query("SELECT COUNT( * ) as NumItems FROM `Carrito` WHERE `CardCode` = '" .$CardCode. "'"); if($Resultado){ $Result = mysql_fetch_array($Resultado) ; $Total_Articulos = $Result["NumItems"]; } echo $Total_Articulos; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function articulos(){\n \n $articulos=Articulo::get();\n \n $pdf=PDF::loadview('pdf.articulos',compact('articulos'));\n return $pdf->stream('Articulos-SIS.pdf');\n }", "public function articulos()\n {\n return $this->hasMany('PlanificaMYPE\\Articulo', 'idMarca', 'idMarca');\n }", "function modelo_inmueble2($r)\n{\n for ($i = 0; $i < count($r); $i++) {\n $imagen = existeImagen(($r[$i]['foto1']));\n $codigo = str_ireplace(\"108-\", \"\", $r[$i]['Codigo_Inmueble']);\n $api = $r[$i];\n $descripcion = $api['descripcionlarga'];\n $limite_de_cadena = 90;\n // recortar cadena\n if (strlen($descripcion) >= $limite_de_cadena) {\n $descripcion = substr($descripcion, 0, $limite_de_cadena) . '...';\n } else {\n $descripcion = $descripcion . '<br>...';\n }\n echo '\n <div class=\"property-block col-12 col-sm-6 col-lg-4 col-xl-4\">\n <div class=\"inner-box\">\n <div class=\"image\">\n <a href=\"detalle-inmueble.php?co=' . $codigo . '\"><img src=\"' . $imagen . '\" alt=\"\"></a>\n <div class=\"sale\">' . $api['Gestion'] . ' </div>\n <div class=\"price\">$';\n if ($api['Gestion'] == 'Arriendo') {\n echo $api['Canon'];\n } else if ($api['Gestion'] == 'Venta') {\n echo $api['Venta'];\n } else {\n echo $api['Canon'] . '/ $' . $api['Venta'];\n }\n echo ' </div>\n </div>\n <div class=\"lower-content\">\n <div class=\"upper-box\" style=\"min-height: 9.3rem;\">\n <h3><a href=\"images/no_image.png\">' . $api['Tipo_Inmueble'] . '</a></h3>\n <div class=\"location\"><span class=\"icon flaticon-location-pin\"></span> ' . $api['Barrio'] . ', ' . $api['Ciudad'] . '</div>\n <div class=\"text-justify\">' . $descripcion . '</div>\n </div>\n <div class=\"lower-box clearfix\">\n <ul class=\"row justify-content-center\">\n <li class=\"col-auto\"><span class=\"icon flaticon-squares\"></span>' . $api['AreaConstruida'] . 'm<sup>2</li>\n <li class=\"col-auto\"><span class=\"icon flaticon-bed-1\"></span>' . $api['Alcobas'] . '</li>\n <li class=\"col-auto\"><span class=\"icon flaticon-bathtube-with-shower\"></span>' . $api['banios'] . '</li>\n <li class=\"col-auto\"><span class=\"icon flaticon-garage\"></span>' . $api['garaje'] . '</li>\n <li class=\"col-auto\">Codigo: ' . $codigo . '</li>\n </ul>\n </div>\n </div>\n </div>\n</div>\n ';\n }\n}", "public function afficher_musique($id)\n{\n\n $db = $this->_db;\n $requete = $db->prepare(\"SELECT * FROM musiques WHERE id=$id\");\n $requete->execute();\n $resultat = $requete->fetchall();\n\n foreach($resultat as $musique)\n {\n $titre = $musique['titre'];\n $artiste = $musique['artiste'];\n $album = $musique['album'];\n $image = $musique['image'];\n\n echo\n \"<div class='card' style='width: 18rem;'>\n <img class='card-img-top' src='images-auto/$image' alt='Album $album'>\n <div class='card-body'>\n <h5 class='card-title'>Artiste :</h5><p class = 'anim'>$artiste</p>\n <h5 class='card-title'>Album : </h5><p class = 'anim'>$album</p>\n <h5 class='card-title'>Titre :</h5><p class = 'anim'> $titre</p> \n </div>\n </div>\";\n \n}\n}", "function afficheArticle ($infosArticles) {\n\n foreach ($infosArticles as $key => $articles ) {\n\n if ($key === 0 or $key === 3) {\n $positionArticle = \"left\";\n }\n\n if ($key === 1 or $key === 4) {\n $positionArticle = \"center\";\n }\n\n if ($key === 2 or $key === 5) {\n $positionArticle = \"right\";\n }\n\n echo \"<div class='bloc_$positionArticle'>\";\n echo \"<div class='page_$positionArticle'>\";\n echo \"<div class='image_section_centrale'><img src=$articles[0] alt =$articles[1]></div>\";\n echo \"<div class='article_$positionArticle'>\";\n echo \"<h1 class='title_$positionArticle'>$articles[2]</h1>\";\n echo \"<p> $articles[3]<br> <a href=$articles[3]>$articles[4]</a></p>\";\n echo \"</div></div>\";\n echo \"<img src='../Images/logo_commitTree.png' class='logo_$positionArticle' alt='logo commit tree'>\";\n echo \"</div>\";\n\n }\n}", "public function imagenes() {\n return $imagenes = ImagenesProducto::where('fk_producto',$this->codigo) -> orderBy('featured','desc') -> get(); //para mostrar las imagenes ordenadas por las destacada\n }", "public function linea_colectivo();", "public function run()\n {\n $articles = [\n [\n 'title' => 'Utveckla konsten',\n 'body' => 'Intresset för att utveckla den offentliga konsten är stort. Spännande arbete pågår i stadsutvecklingsprocesser där kommunala, statliga och privata aktörer renoverar och bygger nya områden. Samtidigt arbetar många konstnärer med att omformulera vad den offentliga konsten kan vara. När vi på Statens konstråd producerar konst i gemensamma miljöer utvecklar vi löpande arbetet med konst och gestaltning. I våra pilotprojekt prövar vi nya metoder och olika sätt att arbeta. Projekten utgår oftast från en specifik situation och kan involvera allt från konst i planering, till sociala relationer eller visuella uttryck. Avgörande för utvecklingen är att olika aktörer kan inspirera varandra. Här vill vi därför dela med oss av våra erfarenheter och kunskaper för att stärka konstens roll i utformningen av våra gemensamma miljöer.',\n 'author' => 'Simon',\n 'media' => 'image.jpg'\n\n ],\n [\n 'title' => 'Tillfällig konst',\n 'body' => 'Konstnärer söker sig idag ofta till aktuella frågor om det gemensamma och om våra offentliga rum. Genom tillfälliga projekt får vi möjlighet att friare utforska olika format och samtidigt reflektera kring aktuella frågor. Vi utgår från dialogen mellan konstnär och curator och från den situation där verket tar form. Samtidigt fångar vi upp den utveckling som sker inom offentlig konst, både i Sverige och internationellt.',\n 'author' => 'Simon',\n 'media' => 'image.jpg'\n ],\n [\n 'title' => 'Hur går det till?',\n 'body' => 'Konstnären presenterar ett förslag på gestaltning efter att ha gjort en närmare undersökning av hela situationen, eller så utgår konstnären från en idé som sedan påverkar valet av plats. Alla delar i verket diskuteras med curatorn eller initiativtagaren till projektet. I arbetet med att ta fram en film kan processen till exempel ske i samarbete med boende på platsen. Konstnären tar del av deras berättelser om en situation eller hur de upplever platsen och skriver sedan ett filmmanus utifrån samtalen. Konstnären ansvarar för filminspelningen men utbyter idéer med deltagarna även under klipparbetet. Verket blir i det här fallet relevant genom att ge de boende en röst, en möjlighet att bli hörda.',\n 'author' => 'Simon',\n 'media' => 'image.jpg'\n ],\n [\n 'title' => 'Stadsutveckling',\n 'body' => 'Vad skapar en stad och dess miljöer? Vi utvecklar metoder för gestaltning av gemensamma miljöer genom samverkan mellan konstnärer, arkitekter, civilsamhälle, kommun och invånare. Genom att samla olika kompetenser kan vi arbeta för miljöer som både möter behov och väcker engagemang och känslor. Våra projekt där konstnärer medverkar i stadsutveckling omfattar allt från processer för medskapande och rätt till de offentliga rummen, till infrastruktur, stadsplanering och gestaltning.',\n 'author' => 'Simon',\n 'media' => 'image.jpg'\n ],\n [\n 'title' => 'Permanent konst',\n 'body' => 'Skulptur, rörlig bild, ljudverk och hela fasader… Vi producerar konst för nya och renoverade byggnader och miljöer i statlig verksamhet med utgångspunkten att konsten ska vara kvar, vara permanent. Den konstnärliga gestaltningen relaterar alltid till den specifika situationen eller verksamheten på platsen. Vi arbetar också med pilotprojekt där konstnärer kommer in tidigt i byggprocesser och därmed kan påverka hela miljöer.',\n 'author' => 'Simon',\n 'media' => 'image.jpg'\n ],\n [\n 'title' => 'Kunskapsnav offentlig konst',\n 'body' => 'Nu bygger vi upp ett kunskapsnav för offentlig konst. Målet med kunskapsnavet är att du ska kunna hitta konkret information i olika frågor som rör allt från hur man startar ett konstprojekt till hur man förverkligar det och hur man förvaltar det. Navet ska inspirera och stärka utvecklingen av offentlig konst i hela Sverige. Dessutom ska det hålla samtalet om den offentliga konstens roll i samhället levande. Det kommer att lyfta fram viktig kunskap som redan finns på olika håll i landet och ta fram ny kunskap som saknas. Kunskapsnav offentlig konst blir en samlande plattform för möten, erfarenheter och information. Här öppnas möjligheten att både få och ge kunskaper inom många olika områden och yrkesroller.',\n 'author' => 'Simon',\n 'media' => 'image.jpg'\n ]\n\n ];\n\n foreach($articles as $article){\n Article::create($article);\n }\n }", "function modelo_inmueble($r, $cantidad_inmuebles)\n{\n for ($i = 0; $i < $cantidad_inmuebles; $i++) {\n $imagen = existeImagen(($r[$i]['foto1']));\n $codigo = str_ireplace(\"108-\", \"\", $r[$i]['Codigo_Inmueble']);\n $api = $r[$i];\n $descripcion = $api['descripcionlarga'];\n $limite_de_cadena = 90;\n // recortar cadena\n if (strlen($descripcion) >= $limite_de_cadena) {\n $descripcion = substr($descripcion, 0, $limite_de_cadena) . '...';\n } else {\n $descripcion = $descripcion . '...';\n }\n echo '\n <div class=\"property-block col-12 col-sm-6 col-lg-4 col-xl-4\">\n <div class=\"inner-box\">\n <div class=\"image\">\n <a href=\"detalle-inmueble.php?co=' . $codigo . '\"><img src=\"' . $imagen . '\" alt=\"\"></a>\n <div class=\"sale\">' . $api['Gestion'] . '</div>\n <div class=\"price\">';\n if ($api['Gestion'] == 'Arriendo/venta') {\n echo '$' . $api['Canon'] . ' <br>$' . $api['Venta'];\n } else if ($api['Gestion'] == 'Arriendo') {\n echo '$' . $api['Canon'];\n } else {\n echo '$' . $api['Venta'];\n }\n echo ' </div>\n </div>\n <div class=\"lower-content\">\n <div class=\"upper-box\" style=\"min-height: 9.3rem;\">\n <h3><a href=\"images/no_image.png\">' . $api['Tipo_Inmueble'] . '</a></h3>\n <div class=\"location\"><span class=\"icon flaticon-location-pin\"></span> ' . $api['Barrio'] . ', ' . $api['Ciudad'] . '</div>\n <div class=\"text-justify\">' . $descripcion . '</div>\n </div>\n <div class=\"lower-box clearfix\">\n <ul class=\"row justify-content-center\">\n <li class=\"col-auto\"><span class=\"icon flaticon-squares\"></span>' . $api['AreaConstruida'] . 'm<sup>2</sup></li>\n <li class=\"col-auto\"><span class=\"icon flaticon-bed-1\"></span>' . $api['Alcobas'] . '</li>\n <li class=\"col-auto\"><span class=\"icon flaticon-bathtube-with-shower\"></span>' . $api['banios'] . '</li>\n <li class=\"col-auto\"><span class=\"icon flaticon-garage\"></span>' . $api['garaje'] . '</li>\n <li class=\"col-auto\">Codigo: ' . $codigo . '</li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n\n ';\n }\n}", "public function articulo()\n\t{\t\n\t\t$article = $this->uri->segment(3,'42');\n\n\t\t$columnas = array('title','image','content','counter','create_date');\n\n\t\t$articulo['modal'] = $this->dbsitio->getRow('article',$columnas,'id_article = \\'' . $article . '\\'');\n\n\n\n\t\tif (empty($articulo['modal'])){\n\n\t\t\t$datos['0'] = array('title'=>'Artículo No encontrado!',\n\t\t\t\t'image' => 'img/sitio/delete.png',\n\t\t\t\t'content' => 'El artículo que busca no existe!.',\n\t\t\t\t'counter'=>rand(123,9876),\n\t\t\t\t'create_date' => '1987-07-01 12:00:00');\n\t\t\t$articulo['modal'] = $datos;\t \t\t\n\t\t}\n\t\t$string = $this->load->view('modal',$articulo,TRUE);\n\t\t$this->rating($article,$articulo);\n\t\tprint $string; \n\n\t}", "public function catalogos() \n\t{\n\t}", "function getArtigosByBusca($busca){\n $BuscaDAO = new BuscaDAO();\n return $BuscaDAO->getArtigosByBusca($busca);\n }", "function artista($idArtista){\n\n \t$sql = 'SELECT * FROM musica WHERE id ='.$idArtista;\n\t$resultado = mysql_query($sql);\n\n\twhile($row = mysql_fetch_array($resultado)){\n\t\tshowArtista($row);\n \t}\n}", "public function articulos($id_compras_orden=false){\r\n\t\t$table \t\t\t\t= '';\r\n\t\t$accion \t\t\t= $this->tab['articulos'];\r\n\t\t$uso_interno\t\t= (!$id_compras_orden)?false:true;\r\n\t\t$id_compras_orden \t= (!$id_compras_orden)?$this->ajax_post('id_compras_orden'):$id_compras_orden;\r\n\t\t$detalle \t\t\t= $this->ordenes_model->get_orden_unico($id_compras_orden);\r\n\r\n\t\t$data_sql = array('id_compras_orden'=>$id_compras_orden);\r\n\t\t$data_listado=$this->db_model->db_get_data_orden_listado_registrado_unificado($data_sql);\r\n\t\t$moneda = $this->session->userdata('moneda');\r\n\t\tif(count($data_listado)>0){\r\n\t\t\t\t$style_table='display:block';\r\n\t\t\t\t$html='';\r\n\t\t\tfor($i=0;count($data_listado)>$i;$i++){\r\n\t\t\t\t// Lineas\r\n\t\t\t\t$peso_unitario = (substr($data_listado[$i]['peso_unitario'], strpos($data_listado[$i]['peso_unitario'], \".\" ))=='.000')?number_format($data_listado[$i]['peso_unitario'],0):$data_listado[$i]['peso_unitario'];\r\n\t\t\t\t$presentacion_x_embalaje = (substr($data_listado[$i]['presentacion_x_embalaje'], strpos($data_listado[$i]['presentacion_x_embalaje'], \".\" ))=='.000')?number_format($data_listado[$i]['presentacion_x_embalaje'],0):$data_listado[$i]['presentacion_x_embalaje'];\r\n\t\t\t\t$embalaje = ($data_listado[$i]['embalaje'])?$data_listado[$i]['embalaje'].' CON ':'';\r\n\r\n\t\t\t\t//print_debug($data_listado);\r\n\t\t\t\t$Data['consecutivo'] \t\t\t\t =\t ($i+1);\r\n\t\t\t\t$Data['id_compras_articulo_precios'] =\t $data_listado[$i]['id_compras_articulo_precios'];\r\n\t\t\t\t$Data['id_compras_articulo_presentacion'] =\t $data_listado[$i]['id_compras_articulo_presentacion'];\r\n\t\t\t\t$Data['id_compras_orden_articulo'] =\t $data_listado[$i]['id_compras_orden_articulo'];\r\n\t\t\t\t$Data['id_compras_articulo'] \t\t =\t $data_listado[$i]['id_compras_articulo'];\r\n\t\t\t\t$Data['id_articulo_tipo'] \t\t \t =\t $data_listado[$i]['id_articulo_tipo'];\r\n\t\t\t\t$Data['id_compras_um'] \t\t\t \t =\t $data_listado[$i]['id_compras_um'];\r\n\t\t\t\t$Data['um_x_embalaje'] \t\t\t \t =\t $data_listado[$i]['um_x_embalaje'];\r\n\t\t\t\t$Data['um_x_presentacion'] \t\t \t =\t $data_listado[$i]['um_x_presentacion'];\r\n\t\t\t\t$Data['unidad_minima'] \t\t\t \t =\t $data_listado[$i]['unidad_minima'];\r\n\t\t\t\t$Data['cl_um']\t\t\t\t\t \t =\t $data_listado[$i]['cl_um'];\r\n\t\t\t\t$Data['nombre_comercial']\t\t\t =\t $data_listado[$i]['nombre_comercial'];\r\n\t\t\t\t$Data['articulo']\t\t\t\t\t =\t $data_listado[$i]['articulo'].' - '.$data_listado[$i]['presentacion_detalle'];\r\n\t\t\t\t$Data['peso_unitario'] \t\t\t \t =\t $peso_unitario;\r\n\t\t\t\t$Data['upc'] \t\t\t\t\t\t =\t 'SKU:'.$data_listado[$i]['sku'].' UPC:'.$data_listado[$i]['upc'];\r\n\t\t\t\t$Data['presentacion_x_embalaje'] \t =\t $embalaje.$presentacion_x_embalaje;\r\n\t\t\t\t$Data['presentacion'] \t\t\t\t =\t $data_listado[$i]['presentacion'];\r\n\t\t\t\t$Data['costo_sin_impuesto'] \t\t =\t $data_listado[$i]['costo_sin_impuesto'];\r\n\t\t\t\t$Data['moneda'] \t\t\t\t\t =\t $moneda;\r\n\t\t\t\t$Data['cantidad'] \t\t\t\t\t =\t $data_listado[$i]['cantidad'];\r\n\t\t\t\t$Data['costo_x_cantidad'] \t\t\t =\t $data_listado[$i]['costo_x_cantidad'];\r\n\t\t\t\t$Data['descuento'] \t\t\t\t \t =\t $data_listado[$i]['descuento'];\r\n\t\t\t\t$Data['subtotal'] \t\t\t\t\t =\t $data_listado[$i]['subtotal'];\r\n\t\t\t\t$Data['impuesto_porcentaje'] \t\t =\t $data_listado[$i]['impuesto_porcentaje'];\r\n\t\t\t\t$Data['valor_impuesto']\t\t\t \t =\t $data_listado[$i]['valor_impuesto'];\r\n\t\t\t\t$Data['total'] \t\t\t\t\t \t =\t $data_listado[$i]['total'];\r\n\t\t\t\t$Data['number_costo_sin_impuesto'] =\t number_format($data_listado[$i]['costo_sin_impuesto'],2);\r\n\t\t\t\t$Data['number_cantidad'] \t\t\t =\t number_format($data_listado[$i]['cantidad'],0);\r\n\t\t\t\t$Data['number_costo_x_cantidad'] \t =\t number_format($data_listado[$i]['costo_x_cantidad'],2);\r\n\t\t\t\t$Data['number_descuento'] \t\t\t =\t number_format($data_listado[$i]['descuento'],0);\r\n\t\t\t\t$Data['number_subtotal']\t\t\t =\t number_format($data_listado[$i]['subtotal'],2);\r\n\t\t\t\t$Data['number_impuesto_porcentaje'] =\t number_format($data_listado[$i]['impuesto_porcentaje'],0);\r\n\t\t\t\t$Data['number_valor_impuesto']\t\t =\t number_format($data_listado[$i]['valor_impuesto'],2);\r\n\t\t\t\t$Data['number_total']\t\t\t\t =\t number_format($data_listado[$i]['total'],2);\r\n\r\n\t\t\t\t$url_listado_tpl = $this->modulo.'/'.$this->seccion.'/'.$this->submodulo.'/'.'entradas_recepcion_listado';\r\n\t\t\t\t$html.=$this->load_view_unique($url_listado_tpl ,$Data, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$style_table='display:none';\r\n\t\t\t$html='';\r\n\t\t}\r\n\t\t$data='';\r\n\t\t$proveedores = $this->ordenes_model->db_get_proveedores($data,$detalle[0]['id_proveedor']);\r\n\t\t$sucursales\t = $this->sucursales_model->get_orden_unico_sucursal($detalle[0]['id_sucursal']);\r\n\t\t$forma_pago\t = $this->formas_de_pago_model->get_orden_unico_formapago($detalle[0]['id_forma_pago']);\r\n\t\t$creditos\t = $this->creditos_model->get_orden_unico_credito($detalle[0]['id_credito']);\r\n\t\t$orden_tipo\t = $this->ordenes_model->db_get_tipo_orden($detalle[0]['id_orden_tipo']);\r\n\t\t\r\n\t\t$fec=explode('-',$detalle[0]['entrega_fecha']);\r\n\t\t$entrega_fecha=$fec[2].'/'.$fec[1].'/'.$fec[0];\r\n\t\t$fec2=explode('-',$detalle[0]['orden_fecha']);\r\n\t\t$orden_fecha=$fec2[2].'/'.$fec2[1].'/'.$fec2[0];\r\n\t\t$tabData['id_compras_orden']\t\t = $id_compras_orden;\r\n\t\t$tabData['orden_num'] \t\t\t = $this->lang_item(\"orden_num\",false);\r\n $tabData['proveedor'] \t \t\t\t = $this->lang_item(\"proveedor\",false);\r\n\t\t$tabData['sucursal'] \t\t\t = $this->lang_item(\"sucursal\",false);\r\n $tabData['orden_fecha'] \t\t = $this->lang_item(\"orden_fecha\",false);\r\n\t\t$tabData['entrega_fecha'] = $this->lang_item(\"entrega_fecha\",false);\r\n $tabData['observaciones'] \t = $this->lang_item(\"observaciones\",false);\r\n $tabData['forma_pago'] \t\t\t = $this->lang_item(\"forma_pago\",false);\r\n\t\t$tabData['articulo'] \t\t\t \t = $this->lang_item(\"articulo\",false);\r\n\t\t$tabData['costo_unitario']\t \t\t = $this->lang_item(\"costo_unitario\",false);\r\n\t\t$tabData['cantidad'] \t\t\t \t = $this->lang_item(\"cantidad\",false);\r\n\t\t$tabData['costo_cantidad'] \t = $this->lang_item(\"costo_cantidad\",false);\r\n\t\t$tabData['descuento'] \t\t\t \t = $this->lang_item(\"descuento\",false);\r\n\t\t$tabData['subtotal'] \t\t\t \t = $this->lang_item(\"subtotal\",false);\r\n\t\t$tabData['imp'] \t\t\t \t\t = $this->lang_item(\"imp\",false);\r\n\t\t$tabData['valor_imp'] \t\t\t \t = $this->lang_item(\"valor_imp\",false);\r\n\t\t$tabData['total'] \t\t\t \t\t = $this->lang_item(\"total\",false);\r\n\t\t$tabData['accion'] \t\t\t\t = $this->lang_item(\"accion\",false);\r\n\t\t$tabData['impuesto'] \t\t\t\t = $this->lang_item(\"impuesto\",false);\r\n\t\t$tabData['a_pagar'] \t\t\t\t = $this->lang_item(\"a_pagar\",false);\r\n\t\t$tabData['cerrar_orden'] \t\t \t = $this->lang_item(\"cerrar_orden\",false);\r\n\t\t$tabData['cancelar_orden']\t\t\t = $this->lang_item(\"cancelar_orden\",false);\r\n\t\t$tabData['presentacion']\t\t\t = $this->lang_item(\"embalaje\",false);\r\n\t\t$tabData['consecutivo']\t\t\t\t = $this->lang_item(\"consecutivo\",false);\r\n\t\t$tabData['moneda']\t\t\t\t \t = $moneda;\r\n\t\t$tabData['aceptar_orden']\t\t\t = $this->lang_item(\"aceptar_orden\",false);\r\n\t\t$tabData['devolucion_orden']\t\t = $this->lang_item(\"devolucion_orden\",false);\r\n\t\t$tabData['no_factura']\t\t \t\t = $this->lang_item(\"no_factura\",false);\r\n\t\t$tabData['fecha_factura']\t\t \t = $this->lang_item(\"fecha_factura\",false);\r\n\t\t$tabData['#']\t\t \t \t\t\t = $this->lang_item(\"#\",false);\r\n\t\t$tabData['costo_unitario']\t\t \t = $this->lang_item(\"costo_unitario\",false);\r\n\t\t$tabData['costo_cantidad']\t\t \t = $this->lang_item(\"costo_cantidad\",false);\r\n\t\t$tabData['valor_imp']\t\t \t \t = $this->lang_item(\"valor_imp\",false);\r\n\t\t$tabData['aceptar']\t\t \t \t\t = $this->lang_item(\"aceptar\",false);\r\n\t\t$tabData['comentarios_entrada']\t\t = $this->lang_item(\"comentarios_entrada\",false);\r\n\t\t$tabData['recibir_enetrada']\t\t = $this->lang_item(\"recibir_enetrada\",false);\r\n\t\t$tabData['rechazar_entrada']\t\t = $this->lang_item(\"rechazar_entrada\",false);\r\n\t\t$tabData['fecha_caducidad']\t\t \t = $this->lang_item(\"fecha_caducidad\",false);\r\n\t\t$tabData['acciones']\t\t \t \t = $this->lang_item(\"acciones\",false);\r\n\t\t$tabData['lote']\t\t \t \t \t = $this->lang_item(\"lote\",false);\r\n\t\t\r\n\r\n\t\t//DATA\r\n\t\t$tabData['orden_num_value']\t \t\t = $detalle[0]['orden_num'];\r\n\t\t$tabData['estatus']\t \t\t \t\t = $detalle[0]['estatus'];\r\n\t\t$tabData['observaciones_value']\t \t = $detalle[0]['observaciones'];\r\n\t\t$tabData['fecha_registro']\t \t \t = $detalle[0]['timestamp'];\r\n\t\t$tabData['list_sucursales']\t\t\t = $sucursales[0]['sucursal'];\r\n\t\t$tabData['orden_fecha_value']\t \t = $orden_fecha;\r\n\t\t$tabData['entrega_fecha_value']\t = $entrega_fecha;\r\n\t\t$tabData['list_forma_pago']\t\t\t = $forma_pago[0]['forma_pago'];\r\n\t\t$tabData['table']\t\t\t\t\t = $html;\r\n\t\t$tabData['style_table']\t\t\t\t = $style_table;\r\n\r\n\t\t$uri_view = $this->path.$this->submodulo.'/'.$accion;\r\n\t\tif(!$uso_interno){\r\n\t\t\techo json_encode( $this->load_view_unique($uri_view ,$tabData, true));\r\n\t\t}else{\r\n\t\t\t$includes['css'][] = array('name' => 'style.default', 'dirname' => '');\r\n\t\t\t$includes['css'][] = array('name' => 'estilos-custom', 'dirname' => '');\r\n\t\t\treturn $this->load_view_unique($uri_view ,$tabData, true, $includes);\r\n\t\t}\r\n\t}", "protected function marcarArticulosTemporales($articulos)\n {\n $venta_temporal = $this->getArrayTemporal(VentaTemporal::class);\n\n // Verifico los articulos que fueron seleccionados y los marco\n foreach ($articulos as $articulo_existente) {\n foreach ($venta_temporal as $articulo_a_vender) {\n if ($articulo_existente->DatosArticulo->codigo == $articulo_a_vender['codigo']\n && $articulo_existente->Talle->nombre == $articulo_a_vender['talle']\n && $articulo_existente->color == $articulo_a_vender['color']\n && $articulo_existente->DatosArticulo->Genero->nombre == $articulo_a_vender['genero']\n ) {\n $articulo_existente['seleccionado'] = true;\n $articulo_existente['cantidad_a_vender'] = $articulo_a_vender['cantidad'];\n\n $articulo_existente['subtotal'] =\n $articulo_a_vender['cantidad'] * $articulo_existente->DatosArticulo->precio;\n\n $articulo_existente['descuento'] = $articulo_a_vender['descuento'];\n\n\n // Si hay descuento, lo aplico\n if ($articulo_a_vender['descuento'] > 0) {\n $articulo_existente['subtotal'] =\n $articulo_existente['subtotal'] -\n $articulo_existente['subtotal'] * ($articulo_existente['descuento'] / 100);\n }\n }\n }\n }\n\n return $articulos;\n }", "public function obtenerArticulosPorTipo(){\n log_message('DEBUG', \"#TRAZA | #TRAZ-PROD-TRAZASOFT | Camion | obtenerArticulosPorTipo()\");\n $rsp = $this->Materias->listar('TODOS');\n if($rsp['status']){\n $materiasPrimas = json_decode($rsp['data']);\n $data['status'] = $rsp['status'];\n $data['data'] = selectBusquedaAvanzada(false, false, $materiasPrimas->articulos->articulo, 'arti_id', 'barcode',array('descripcion','um'));\n echo json_encode($data);\n }else{\n $rsp['msj'] = \"Fallo el servicio que obtiene los articulos tipo materia prima.\";\n json_encode($rsp);\n }\n }", "public function readProductosMarcas()\n {\n $sql = 'SELECT nombre, id_producto, imagen_producto,producto, descripcion, precio\n FROM producto INNER JOIN marca USING(id_marca)\n WHERE id_marca = ? \n ORDER BY producto';\n $params = array($this->nombre);\n return Database::getRows($sql, $params);\n }", "function logo ()\n {\n global $connection;\n $sql = \"SELECT * FROM slike_logo sl ORDER BY sl.putanja_logo DESC LIMIT 0,1\";\n $sum = $connection->query($sql)->fetchAll();\n foreach($sum as $item) :\n echo \"<a href='index.php?page=pocetna'><img src=$item->putanja_logo alt=$item->ime_slike title='NanoSoft DeLux' width='177' height='106'/></a>\";\n endforeach;\n }", "function Contenido($imagenlogo) {\n \t$this->SetMargins(10,10,151.5);\n\n \t//declaramos las fuentes a usar o tentativamente a usar ya que no sabemos cual es la original\n\t $this->AddFont('Gotham-B','','gotham-book.php');\n\t $this->AddFont('Gotham-B','B','gotham-book.php');\n\t $this->AddFont('Gotham-M','','gotham-medium.php');\n\t $this->AddFont('Helvetica','','helvetica.php');\n\n //variables locales\n $numero_de_presidiums=6;\n\n $presidium_orden=\"1\";\n $presidium_nombre=\"Cesar Gibran Cadena Espinosa de los Monteros\";\n $presidium_cargo=\"Dirigente de Redes y Enlaces \";\n\n \t//la imagen del PVEM\n \t$this->Image($imagenlogo, $this->GetX()+10, $this->GetY()+10, 100,40);\n\n \t//el primer espacio\n \t$this->Ln(3);\n $this->SetFillColor(231, 234,243); //color de fondo donde se va a rellenar los campos (como azul claro)\n $this->SetFont('Helvetica', '', 9); //font de cuando se va a rellenar la informacion\n $this->SetTextColor(0,0,0); //color gris para las letras\n $this->Cell(35, 5,utf8_decode(\"Distribución Logística:\"), 0,0, 'C', 1);\n\n $this->setY($this->GetY()+45);\n $this->Ln();\n $this->SetFillColor(231, 234,243); //color de fondo donde se va a rellenar los campos (como azul claro)\n $this->SetFont('Helvetica', '', 9); //font de cuando se va a rellenar la informacion\n $this->SetTextColor(0,0,0); //color gris para las letras\n $this->Cell(40, 5,utf8_decode(\"Presídium (Primera Fila):\"), 0,0, 'C', 1);\n\n $this->Ln(); \n $this->Ln(); \n\n $this->SetFillColor(160,68,68); //color de fondo donde se va a rellenar los campos (como azul claro)\n $this->SetTextColor(255); //color gris para las letras\n $tamano= ($numero_de_presidiums*7.5)/2;\n $this->setX((120/2)-$tamano);\n\n if ( ($numero_de_presidiums) % 2 ==1){ //es impar\n $candidato=($numero_de_presidiums/2)+.5;\n }else{\n $candidato=($numero_de_presidiums/2)+1;\n }\n\n for($i=0;$i<=$numero_de_presidiums;$i++){\n\n if ( ($i+1) == $candidato ){\n $this->Cell(7, 7,utf8_decode(\"*\"), 1, 0, 'C', 1);\n }else{\n $this->Cell(7, 7,utf8_decode(\"\"), 1, 0, 'C', 1); \n }\n }\n $this->Ln(); \n $this->Ln(5); \n\n\n //CONFIGURACION DE COLOR VERDE CON BLANCO\n $this->SetFont('Gotham-B','',6.5);\n $this->SetFillColor(73, 168, 63);\n $this->SetTextColor(255);\n $this->Cell(9, 5,utf8_decode(\"Orden\"), 'LR', 0, 'C', 1);\n $this->Cell(55, 5,utf8_decode(\"Nombre\"), 'LR', 0, 'C', 1);\n $this->Cell(0, 5,utf8_decode(\"Cargo\"), 'LR', 0, 'C', 1);\n\n\n $this->Ln(); \n\n\n //CONFIGURACION SIN COLOR de fondo\n $this->SetFont('Helvetica', '', 6.5); //font de cuando se va a rellenar la informacion\n $this->SetFillColor(255, 255, 255);\n $this->SetTextColor(0);\n\n\n //ESTO ES LO QUE IRIA EN UN FOR\n for($i=0;$i<=7;$i++){\n \n $this->Cell(9, 5,utf8_decode($presidium_orden), 1, 0, 'C', 1);\n $this->Cell(55, 5,utf8_decode($presidium_nombre), 1, 0, 'C', 1);\n $this->MultiCell(0, 5,utf8_decode($presidium_cargo), 1, 'C', 1);\n $this->Ln(1);\n } \n \n }", "public function especiais()\n {\n $metaTags = [\n 'title' => 'Displan Saúde - Planos empresariais',\n 'description' => 'Displan Seguros. Planos diferenciados para empresas, profissionais e individuais.',\n 'keywords' => 'Displan, Seguros, Preços'\n ];\n\n $dados = array(\n 'operadoras' => $this->operadoras->getByCategory('especiais'),\n 'categorias' => $this->categorias->all(),\n 'metaTags' => $metaTags,\n 'breadcrumb' => [\n ['title' => 'Home', 'url' => '/', 'class' => ''],\n ['title' => 'Planos para Profissionais', 'url' => 'planos-especiais/', 'class' => 'active']\n ]\n );\n\n $this->load->view('inc/header', $dados);\n $this->load->view('planos/especiais', $dados);\n $this->load->view('inc/footer');\n }", "public function run()\n {\n $artistas = array('Alan Rickman','Alejandro G. Iñárritu','Alfie Allen','Amy Adams','Anthony Hopkins','Anya Taylor-Joy','Arnold Schwarzenegger','Ben Affleck','Bill Camp','Billy Zane','Bonnie Bedelia','Bruce Willis','Carrie-Anne Moss','Chad Stahelski','Charlize Theron','Chloe Pirrie','Chris Hemsworth','Chris Pine','Christopher Nolan','Christopher Walken','Connie Nielsen','Dafne Keen','Daniel Stern','Djimon Hounsou','Edward Furlong','Edward Zwick','Elliot Page','Gal Gadot','Gary Sinise','George Miller','Giancarlo Esposito','Gina Carano','Harrison Ford','Helen Hunt','Henry Cavill','Hugh Jackman','James Cameron','James Mangold','Jason Momoa','Jennifer Connelly','Jim Carrey','Joaquin Phoenix','Joe Pesci','John Hughes','John McTiernan','Jon Favreau','Jonah Hill','Joseph Gordon-Levitt','Kate Winslet','Keanu Reeves','Kelley','Kenneth Branagh','Kristen Wiig','Lana Wachowski','Laurence Fishburne','Leonardo DiCaprio','Linda Hamilton','Macaulay Culkin','Margot Robbie','Martin Scorsese','Michael Biehn ','Michael Nyqvist','Natalie Portman','Nicholas Hoult','Patrick Stewart','Patty Jenkins','Paul Sanchez','Pedro Pascal','Ridley Scott','Robert De Niro','Robert Zemeckis','Robin Wright','Ron Howard','Russell Crowe','Rutger Hauer','Scott Frank','Sean Young','Steven Spielberg','Taylor Momsen','Todd Phillips','Tom Hanks','Tom Hardy','Will Poulter','Zack Snyder','Zazie Beetz');\n foreach ($artistas as $nomArtista) {\n $artista = new Artista();\n $artista->nombre = $nomArtista;\n $artista->save();\n }\n }", "public function lectureContenu ()\n {\n\n //$metadata = simplexml_load_file(\"xmoddledata/metadata.xml\");\n\n // on Vérifie si le cours existe\n\n /* @TODO Partie à décommenter lorsque le module de navigation sera intégré au reste de l'application */\n\n // $nbrCours = $metadata->attributes()->nbrCours;\n // $isFound = false;\n // $i = 0;\n // for ($i = 0; $i < $nbrCours; $i++) {\n // if ($metadata->cours[$i]->attributes()->title == $title && $metadata->cours[$i]->attributes()->id == $id) {\n // $isFound = true;\n // break;\n // }\n // }\n\n // if ($isFound) {\n //$cours = simplexml_load_file(\"xmoddledata/\" . $metadata->cours[$i]->attributes()->id . \"_\" . $metadata->cours[$i]->attributes()->title . \"/description.xml\"); \n\n $description = simplexml_load_file('xmoddledata/2_ModeleDeSupport2/description.xml');\n $notions = simplexml_load_file('xmoddledata/2_ModeleDeSupport2/descriptionNotions.xml');\n\n // Création d'un tableau associatif de notions avec l'id comme clé\n\n $notionsArray = $this->getNotions($notions);\n\n // Construction de la navigation\n $text_parties = \"\";\n $nav_parties = [];\n for ($i = 0; $i < $description->attributes()->nbrParties; $i++) {\n $text_parties = \"<div style='\";\n $text_parties .= $this->getStyle($description->partie[$i]->attributes());\n $text_parties .= \"'\";\n $text_parties .= \" id='\".$i.\"'>\";\n $nav_chapitres = [];\n $text_parties .= $description->partie[$i]->attributes()->title;\n $text_parties .= \"</div>\";\n $text_parties .= \"<br/><br/>\";\n $text_chapitres = \"\";\n for ($j = 0; $j < $description->partie[$i]->attributes()->nbrChapitres; $j++) {\n $text_chapitres .= \"<div style='\";\n $text_chapitres .= $this->getStyle($description->partie[$i]->chapitre[$j]->attributes());\n $text_chapitres .= \"'\";\n $text_chapitres .= \" id='\".$i.\"_\".$j.\"'>\";\n $nav_paragraphes = [];\n $text_chapitres .= $description->partie[$i]->chapitre[$j]->attributes()->title;\n $text_chapitres .= \"</div>\";\n $text_chapitres .= \"<br/><br/>\";\n $text_paragraphes = \"\";\n for ($k = 0; $k < $description->partie[$i]->chapitre[$j]->attributes()->nbrParagraphes; $k++) {\n // On renseigne le titre du paragraphe\n $text_paragraphes .= \"<div style='\";\n $text_paragraphes .= $this->getStyle($description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes());\n $text_paragraphes .= \"'\";\n // Ajout d'un ancre de navigation\n $text_paragraphes .= \" id='\".$i.\"_\".$j.\"_\".$k.\"'>\";\n $text_paragraphes .= $description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes()->title;\n $text_paragraphes .= \"</div>\";\n $text_paragraphes .= \"<br/>\";\n // Navigation avec paragraphes\n $nav_paragraphes[\"\".$i.\"_\".$j.\"_\".$k] = $description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes()->title;\n // On remplit les notions contenus dans le paragraphe\n for ($l = 0; $l < $description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes()->nbrNotions; $l++) {\n $text_paragraphes .= $notionsArray[\"\".$description->partie[$i]->chapitre[$j]->paragraphe[$k]->notion[$l]->attributes()->id];\n }\n }\n $text_chapitres .= $text_paragraphes;\n $nav_chapitres[\"\".$i.\"_\".$j] = $nav_paragraphes;\n }\n $text_parties .= $text_chapitres;\n $nav_parties[\"\".$i] = $nav_chapitres;\n }\n// dd($nav_parties);\n// dd($navigation);\n// dd($description);\n\n // Construction de la page web\n $titre = $description->attributes()->title;\n// dd($description);\n// forearch( $navigation->partie[] as $partie) {\n// dd($pantie);\n// }\n// dd($titre);\n\n\n // $notions = simplexml_load_file(\"../../../fichiersdestructuration/descriptionNotions.xml\");\n\n\n // $nbrNotions = $cours->attributes()->nbrNotions;\n // $notionsConvertis = array();\n // for ($i = 0; $i < $nbrNotions; $i++) {\n // $attributs = $cours->notion[$i]->attributes();\n // $style = \"\";\n // if ($attributs['font-weight'] != null) {\n // $style .= 'font-weight:' . $attributs['font-weight'] . \";\";\n // }\n // if ($attributs['font-size'] != null) {\n // $style .= 'font-size:' . $attributs['font-size'] . \";\";\n // }\n\n // if ($attributs['font-family'] != null) {\n // $style .= 'font-family:' . $attributs['font-family'] . \";\";\n // }\n\n // if ($attributs['color'] != null) {\n // $style .= 'color:' . $attributs['color'] . \";\";\n // }\n\n // if ($attributs['text-decoration'] != null) {\n // $style .= 'text-decoration:' . $attributs['text-decoration'] . \";\";\n // }\n\n // $text = \"\";\n // foreach ($cours->notion[$i]->children() as $child) {\n // $text .= $child->asXML();\n // }\n // $notionHtml = \"<div style='\";\n // $notionHtml .= $style;\n // $notionHtml .= \"'>\";\n // $notionHtml .= $text;\n // $notionHtml .= \"</div>\";\n\n\n // //dd(strval($text));\n // array_push($notionsConvertis, $notionHtml);\n\n // }\n // }else{\n // return view(\"/\");\n // }\n //$notions = $notionsConvertis;\n // return response()->json($notions,200);\n\n // return \"lecture cours\";\n return 0;\n }", "function pegaDadosEtiquetas()\n\t{\n\t\tif(!$this->layer){return \"erro\";}\n\t\t$itens = $this->layer->getmetadata(\"ITENS\");\n\t\t$itens = explode(\",\",$itens);\n\t\t$itensdesc = mb_convert_encoding($this->layer->getmetadata(\"ITENSDESC\"),\"UTF-8\",\"ISO-8859-1\");\n\t\t$itensdesc = explode(\",\",$itensdesc);\n\t\t$itenslink = $this->layer->getmetadata(\"ITENSLINK\");\n\t\t$itenslink = explode(\",\",$itenslink);\n\n\t\t$tips = $this->layer->getmetadata(\"TIP\");\n\n\t\t$res = array(\n\t\t\t\t\"itens\"=>$itens,\n\t\t\t\t\"itensdesc\"=>array_combine($itens,$itensdesc),\n\t\t\t\t\"itenslink\"=>array_combine($itens,$itenslink),\n\t\t\t\t\"tips\"=>explode(\",\",$tips),\n\t\t\t\t\"itembuscarapida\"=>$this->layer->getmetadata(\"itembuscarapida\")\n\t\t);\n\t\treturn($res);\n\t}", "function listar_producto_vendido(){\n\t\t$sql=\"SELECT SUM(cantidad_det) AS TotalVentas, claves_pro, categoria_pro, producto_det, detal_pro, mayor_pro, id_pro, id_pro AS directorio_image FROM producto, detalle_pedido WHERE producto_det=id_pro GROUP BY producto_det ORDER BY SUM(cantidad_det) DESC LIMIT 0 , 5\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$aux=\"\";\n\t\t\t$id_buscar=$resultado['id_pro'];\n\t\t\t$sql2=\"SELECT directorio_image FROM imagen WHERE galeria_image='$id_buscar'\";\n\t\t\t$buscar=mysql_query($sql2)\tor die(mysql_error());\n\t\t\t$resultados=mysql_fetch_array($buscar);\n\t\t\t$resultado['directorio_image']=$resultados['directorio_image'];\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$resultado['detal_pro']=$this->convertir_moneda($resultado['detal_pro']);\n\t\t\t$resultado['mayor_pro']=$this->convertir_moneda($resultado['mayor_pro']);\n\t\t\t\n\t\t\t$cat=$resultado['categoria_pro'];\n\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat'\";\n\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\t\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "function listar_producto_imagen2($localidad){\n\t\t$sql=\"SELECT * FROM producto, imagen WHERE categoria_pro='9' AND galeria_image=id_pro AND tabla_image='Producto' AND disponible_pro='1' AND \n\t\t\t(nombre_pro LIKE '%' '\".$localidad.\"' '%' OR \n\t descripcion_pro LIKE '%' '\".$localidad.\"' '%') \n\t\t\tGROUP BY id_pro ORDER BY RAND() ASC\";\n\t\t\n\t\t//echo $sql;\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\tsetlocale(LC_ALL, 'es_ES');\n\t\t\t//$resultado['nombre_pro']=ucwords(strtolower($resultado['nombre_pro']));\n\t\t\t$resultado['detal_pro']=$this->convertir_moneda($resultado['detal_pro']);\n\t\t\t$resultado['mayor_pro']=$this->convertir_moneda($resultado['mayor_pro']);\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat'\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t\n\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\n\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\tif($i<=12)\n\t\t\t\t\t$resultado['limite_pro'][]=$i;\n\t\t\t}\n\t\t\t$this->descripcion=$resultado['descripcion_pro'];\n\t\t\t$resultado['descripcion_pro']=strip_tags($resultado['descripcion_pro']);\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "function PintarListado($Img,$Tit,$Subt,$Creac,$Fact,$Client,$Rent,$Rep,$Cesta,$Destino){\n\t//$Tit -> es el titulo del negocio\n\t//$Subt -> es el subtitulo del negocio\n\t//$Creac -> es el año de creacion del negocio\n\t//$Fact -> es la facturacion del negocio\n\t//$Client -> son los clientes actuales del negocio\n\t//$Rent -> es el % rentabilidad del negocio\n\t//$Rep -> es el indice de repeticion de compra en el negocio\n\t//$Cesta -> es la cesta media del negocio\n\t//$Destino -> es el boton \"ver estadisticas\" que nos envia a la url detalle\n\t\n\t$color=array (\"#e6b0aa\",\"#af7ac5\",\"#1abc9c\",\"#2e86c1\",\"#cb4335\",\"#f1948a\",\"#f9e79f\",\"#82e0aa\",\"#f1c40f\",\"#28b463\",\"#f8c471\",\"#f0f3f4\",\"#95a5a6\",\"#229954\",\"#d7bde2\",\"#aeb6bf\",\"#5dade2\",\"#aed6f1\",\"#bb8fce\",\"#2e86c1\",\"#f5b041\",\"#f6ddcc\",\"#e5e8e8\",\"#808b96\",\"#616a6b\",\"#ba4a00\",\"#d1f2eb\",\"#f2d7d5\",\"#fadbd8\",\"#ebdef0\",\"#e8daef\",\"#d4e6f1\",\"#d6eaf8\",\"#d1f2eb\",\"#d0ece7\",\"#d4efdf\",\"#d5f5e3\",\"#fcf3cf\",\"#fdebd0\",\"#fae5d3\",\"#f6ddcc\",\"#f2f3f4\",\"#c0392b\",\"#e74c3c\",\"#9b59b6\",\"#3498db\",\"#16a085\",\"#27ae60\",\"#2ecc71\",\"#f39c12\",\"#e67e22\",\"#d35400\");\n\t$b= array_rand($color);\n\n\t$a='<div class=\"col-lg-4 col-sm-6 text-center\">';\n\t$a.='<div class=\"col-lg-4\" id=\"variables\">'.$valor.'</div>';\n\t$a.='<div style=\"background:'.$color[$b].';width: 200px;margin-left: auto;margin-right: auto;height: 200px;border-radius: 8em;\"></div>';\n\t$a.='<h3>'.$titulo.'</h3>';\n\t$a.='<p>'.$desc.'</p><br><b\n\tr>';\n\t$a.='</div>';\n\n\n\n\n\n/*\n\t <div class=\"row\">\n <div class=\"col-md-7\">\n <a href=\"#\">\n <img class=\"img-responsive img-thumbnail\" src=\"img/labiomania-logo.jpg\" alt=\"\">\n </a>\n </div>\n <div class=\"col-md-5\">\n <h3>Labiomanía</h3>\n <h4>Tienda de Tatuajes Labiales</h4>\n <ul class=\"b\">\n <li><strong>Año/Mes de Creación:</strong> xxx</li>\n <li><strong>Facturación:</strong> xxx</li>\n <li><strong>Clientes Actuales:</strong> xxx</li>\n <li><strong>% Rentabilidad:</strong> xxx</li>\n <li><strong>Índice de Repetición:</strong> xxx</li>\n <li><strong>Cesta Media:</strong> xxx</li> \n </ul>\n <p> \n </p>\n <a class=\"btn btn-primary\" href=\"#\">Ver Estadísticas <span class=\"glyphicon glyphicon-chevron-right\"></span></a>\n </div>\n </div>\n\n*/\n\n\n\n\n\techo $a;\n}", "function draw_singolo_ordine($id_prodotto, $nome_prodotto, $prezzo, $foto, $quantita)\n {\n echo \"<div class='col-md-9 col-xs-12 text-center' style='background-color:#F9F9F9; padding:5px; margin-bottom:5px;'>\";\n echo \" <div class='col-md-3 col-xs-12'>\";\n echo \" <a href='product_img/$foto'><img class='img-thumbnail' src='product_img/$foto' height='150px' width='150px'></a>\";\n echo \" </div>\";\n echo \" <div class='col-md-6 col-xs-12'>\";\n echo \" <div class='col-xs-12'>\";\n echo \" <h3 class='text-primary'> $nome_prodotto </h3>\";\n echo \" </div>\";\n echo \" </div>\";\n echo \" <div class='col-md-3 col-xs-12'>\";\n echo \" <div class='col-xs-12'>\";\n echo \" <h4>Prezzo</h4>\";\n echo \" <h3 style='color:green;'>€$prezzo</h3>\";\n echo \" </div>\";\n echo \" <div class='col-md-12'>\";\n echo \" <h5>Quantità:$quantita</h5>\";\n echo \" </div>\";\n echo \" </div>\";\n echo \"</div>\";\n }", "public function viewArt(){\r\n\t\t\r\n\t\t$strTabla= \"<table border='1' id='customers'><tr> <th>ID</th><th>Nombre </th><th>correo</th><th>saldo </th><th>Dar de alta </th></tr>\";\r\n\t\t\t$articulos = $this->db->query(\"select * from Cliente WHERE alta like '0';\");\r\n\t\t\t//recorro los arituclos y los introduzco en la tabla\r\n\t\t\tforeach ($articulos->result() as $row)\r\n\t\t\t{\r\n\t\t\t\t$strTabla.= \"<tr><td>\". $row->ID .\"</td> <td>\". $row->nombre .\"</td> <td>\". $row->correo .\"</td> <td>\". $row->saldo .\"</td> <td><a href=\". base_url(\"index.php/Tiendamerch/alta/\". $row->ID .\"\") .\">DAR DE ALTA</a></td> </tr>\";\r\n\t\t\t}\r\n\t\t\t$strTabla.= \"</table>\";\r\n\t\treturn $strTabla;\r\n\t\t\r\n\t}", "public function getArticulos() {\r\n\t\t$gerencia = $this->input->post('_gerencia');\r\n\t\techo json_encode($this->articulos_model->buscar(NULL, NULL, NULL, $gerencia, NULL));\r\n\t}", "public function recherche($_recherche){\n \n\n $db = $this->_db;\n \n \n if(!empty($_recherche)){\n $recherche = htmlspecialchars($_recherche);\n $requete = $db->prepare(\"SELECT * FROM musiques WHERE titre LIKE '$recherche%' ORDER BY id DESC\");\n $requete->execute();\n $resultat = $requete->fetchall();\n foreach ($resultat as $key) {\n $titre = $key['titre'];\n $id = $key['id'];\n $artiste = $key['artiste'];\n \n echo \"<div class = 'marge'>\";\n echo \"<img class = 'logoplay' src = 'images-auto/logoplay.png' alt = 'Logo lecture'/><a class = 'liens' href = element?id=$id>$titre</a><br>\";\n echo \"</div>\";\n }\n \n }else{\n echo \"Aucun resultat\";\n }\n \n }", "private static function showProdotti($id_magazzino, $categoria, $nome, $prezzo_min, $prezzo_max){\n if(!isset($id_magazzino)) $sql_id_magazzino=\"id_magazzino LIKE '%'\";\n else $sql_id_magazzino=\"id_magazzino=$id_magazzino\"; //possiible che devo trasformare il id in un nnumero??? con intval? Oppure i singoli apici....\n\n if(!isset($categoria)) $sql_nome_categoria=\"categorie.nome LIKE '%'\";\n else $sql_nome_categoria=\"categorie.nome='$categoria'\";\n\n if(!isset($nome)) $sql_nome_prodotto=\"prodotti.nome LIKE '%'\";\n else $sql_nome_prodotto= \"prodotti.nome LIKE '%$nome%'\";\n\n if(!isset($prezzo_min)) $sql_prezzo_min=\"prodotti.prezzo > -1\";\n else $sql_prezzo_min = \"prodotti.prezzo > $prezzo_min\";\n\n if(!isset($prezzo_max)) $sql_prezzo_max=\"prodotti.prezzo < 999999999\";\n else $sql_prezzo_max=\"prodotti.prezzo < $prezzo_max\";\n\n\n $items=\\Singleton::DB()->query(\"SELECT DISTINCT prodotti.id as id_prodotto , prodotti.nome as nome_prodotto, prodotti.descrizione as descrizione_prodotto, prodotti.info as info_prodotto, prodotti.prezzo as prezzo_prodotto, prodotti.valuta as valuta_prodotto, items_magazzino.quantita as quantita_prodotto , categorie.id as id_categoria, categorie.nome as nome_categoria, items_magazzino.id_magazzino as id_magazzino, comuni.nome as comune_magazzino, comuni.provincia as provincia_magazzino, comuni.CAP as cap_magazzino, indirizzi.via as via_magazzino, indirizzi.civico as civico_magazzino FROM prodotti,categorie,items_magazzino,magazzini, indirizzi, comuni WHERE $sql_id_magazzino AND items_magazzino.id_prodotto=prodotti.id AND prodotti.id_categoria=categorie.id AND $sql_nome_categoria AND $sql_nome_prodotto AND $sql_prezzo_min AND $sql_prezzo_max AND id_magazzino=magazzini.id AND magazzini.id_indirizzo=indirizzi.id AND indirizzi.id_comune=comuni.id ;\");\n while($r = mysqli_fetch_assoc($items)) {$rows[] = $r; }\n if(isset($rows)) echo json_encode($rows);\n else self::setSuccess(\"empty\");\n }", "public function todaInfoProductos(){\n\n for($i = 0; $i < count($this -> listProducto); $i++){\n $this -> listProducto[$i][0] -> getInfoBasic();\n }\n }", "function courtjus_objets_in_rubrique($id_rubrique) {\n\t// On va compter le nombre d'objet présent dans la rubrique\n\t$tables = courtjus_trouver_objet_rubrique();\n\n\t// on va compter le nombre d'objet qu'il y a dans la rubrique.\n\t$objets_in_rubrique = array();\n\n\t// On boucle sur tout les table qui pourrait être ratacher à une rubrique\n\tforeach ($tables as $table) {\n\t\t// Simplification des variables. On a besoin du titre pour trouver le num titre\n\t\tlist($table, $titre) = $table;\n\t\t// L'objet\n\t\t$objet = table_objet($table);\n\t\t// l'identifiant de l'objet\n\t\t$champs_id = id_table_objet($table);\n\t\t// Le champ qui contient la date\n\t\t$champ_date = objet_info($objet, 'date');\n\n\t\t// Les champs qui seront utilisé pour la requête.\n\t\t$champs = array(\n\t\t\t$champs_id,\n\t\t\t$titre,\n\t\t\t// Convertir la date de l'objet en timestamp, cela permettra une comparaison rapide\n\t\t\t'UNIX_TIMESTAMP('.$champ_date.') AS '.$champ_date\n\t\t);\n\n\t\t// Le where\n\t\t$where = array(\n\t\t\t'id_rubrique='.intval($id_rubrique),\n\t\t\t'statut='.sql_quote('publie')\n\t\t);\n\n\t\t// Est-ce qu'il faut prendre en compte la langue ?\n\t\tinclude_spip('formulaires/configurer_multilinguisme');\n\t\tif (table_supporte_trad($table)) {\n\t\t\t$where[] = 'lang='.sql_quote($GLOBALS['spip_lang']);\n\t\t}\n\n\t\t// On récupère les objets de la rubrique.\n\t\t$objets_rubrique = sql_allfetsel($champs, $table, $where);\n\n\t\t// On boucle sur les objets à l'intérique de la rubrique.\n\t\tforeach ($objets_rubrique as $objet_rubrique) {\n\n\t\t\t$num_titre = recuperer_numero($objet_rubrique['titre']);\n\n\t\t\t// On créer le tableau contenant les données de l'objet\n\t\t\t$objets_in_rubrique[] = array(\n\t\t\t\t'id_objet' => $objet_rubrique[$champs_id],\n\t\t\t\t'objet' => $objet,\n\t\t\t\t'num_titre' => $num_titre,\n\t\t\t\t'date' => $objet_rubrique[$champ_date]\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $objets_in_rubrique;\n}", "function buscar_recomendado($precio, $nombre, $id, $cat){\n\t\t$precio_inicial=$precio-50;\n\t\t$precio_final=$precio+50;\n\t\t$marcas=explode(\" \",$nombre);\n\t\t$sql=\"SELECT * FROM producto, imagen WHERE galeria_image=id_pro AND tabla_image='producto' AND id_pro!='$id' AND disponible_pro='1' AND categoria_pro!='10' AND nombre_image='portada' GROUP BY id_pro ORDER BY RAND() LIMIT 0,5\";\n\t\t//echo $sql;\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=\"si\";\n\t\t\t\t//calculando el URL\n\t\t\t\tsetlocale(LC_ALL, 'es_ES');\n\t\t\t\t//$resultado['nombre_pro']=ucwords(strtolower($resultado['nombre_pro']));\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat' GROUP BY id_cat\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\t\n\t\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\t\n\t\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\t\tif($i<=12) $resultado['limite_pro'][]=$i; else break;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$resultado['detal_pro']=$this->mostrar_precio($resultado['detal_pro']);\n\t\t\t\t$this->listado[] = $resultado;\n\t\t }\n\t}", "public function run()\n {\n $data = [\n [\n \"El mito de Naylamp\",\n \"Dicen los pobladores de Lambayeque que en tiempos muy antiguos, que no saben en qué año fue, vino al Perú con una gran flota de balsas un señor de mucho valor y prestigio llamado Naylamp, y trajo consigo una gran cantidad de gente.\",\n \"/img/naylamp.png\"\n ],\n [\n \"Los peces y los hombres\",\n \"Los peces habían sido seres humanos, como descendientes de una antiquísima raza de enanos que poblaba nuestras tierras en edades pretéritas. Vivían en ciudades lacustres y reverenciaban al mar, sus tormentas, sus arenas y sus conchas.\",\n \"/img/peces.png\"\n ],\n [\n \"El dios Pachacamac y Vichama\",\n \"En el principio no había comida suficiente para un hombre y una mujer que el dios Pachacamac había creado, por lo que murió de hambre el hombre y solo quedó la mujer.\",\n \"/img/pachacamac.png\"\n ],\n [\n \"El mito del origen del mochica y el algarrobo\",\n \"Luchaban por todo el universo los dos poderes eternos: el genio del Bien y el poder maligno. Cada uno buscaba establecer la supremacía de sus propios derechos y ambos rodaban por los diferentes mundos y los espacios siderales.\",\n \"/img/mochica.png\"\n ],\n [\n \"Somos herederos y guardianes de la Tierra\",\n \"En nuestro pueblo: Las piedras son memoria, hablan de la historia antigua. Las plantas son medicina, curan los males. Los animales son compañía alimentan y enseñan.\",\n \"/img/guardianes.png\"\n ],\n [\n \"Vamos a sembrar y cosechar con nuestras familias\",\n \"La agricultura, como actividad socioproductiva y fuente de sustento de las comunidades, debe considerar los factores de crecimiento de las plantas, sus ciclos de vida y los hábitats en los que se desarrollan.\",\n \"/img/sembrar.png\"\n ],\n ];\n foreach ($data as $item) {\n DB::table('stories')->insert([\n 'name' => $item[0],\n 'slug' => Str::of($item[0])->slug('-'),\n 'intro' => $item[1],\n 'image_url' => $item[2],\n ]);\n }\n\n }", "public function index()\n {\n //\n //$articulos = Articulo::all()->where('Visible', '1');\n $articulos = Articulo::where('Visible', 1)\n ->orderBy('Orden', 'asc')\n ->get();\n\n $parrafos = ArticuloParrafo::where('Visible', 1)\n ->orderBy('Orden', 'asc')\n ->get();\n\n $documentos_parrafos = ArticuloParrafo::\n selectRaw('articulo_parrafos.id, count(*) as cantidad_docs')\n ->join('articulo_documentos', 'articulo_documentos.id_parrafo', '=', 'articulo_parrafos.id')\n ->where('articulo_documentos.Visible', 1)\n ->groupBy('articulo_parrafos.id')\n ->get();\n\n $documentos_parrafo = ArticuloParrafo::\n select('articulo_parrafos.id', 'articulo_documentos.NombreDocumento', 'articulo_documentos.id_parrafo', 'articulo_documentos.Archivo', 'articulo_documentos.Link', 'articulo_documentos.FechaDocumento', 'articulo_documentos.FechaCorresponde', 'articulo_documentos.FechaAutoDoc' )\n ->join('articulo_documentos', 'articulo_documentos.id_parrafo', '=', 'articulo_parrafos.id')\n ->where('articulo_documentos.Visible', 1)\n ->get();\n\n //fecha en caso que sea auto\n $day = Carbon::now()->format('d');\n $mes = Carbon::now()->format('m');\n $meses = array(\"Enero\",\"Febrero\",\"Marzo\",\"Abril\",\"Mayo\",\"Junio\",\"Julio\",\"Agosto\",\"Septiembre\",\"Octubre\",\"Noviembre\",\"Diciembre\");\n if($day < 5)\n {\n $mes = $mes - 1;\n $mes2 = $mes - 1;\n $fecha_act = Carbon::now()->month($mes)->day(5)->format('Y-m-d');\n\n $fecha_corresponde = Carbon::now()->month($mes2)->day(5);\n $mes = $meses[($fecha_corresponde->format('n')) - 1];\n $fecha_corresponde = $mes . ' de ' . $fecha_corresponde->format('Y');\n\n }else{\n $mes2 = $mes - 1;\n $fecha_act = Carbon::now()->day(5)->format('Y-m-d');\n $fecha_corresponde = Carbon::now()->month($mes2)->day(5)->format('Y-m-d');\n }\n\n\n $incisos = ArticuloInciso::where('Visible', 1)->orderby('Id_Parrafo')->orderBy('Orden')->get();\n\n return view('web.transparencia', compact(['articulos', 'parrafos', 'documentos_parrafos', 'documentos_parrafo', 'incisos', 'fecha_act', 'fecha_corresponde']));\n }", "public function run()\n {\n // Uncomment the below to wipe the table clean before populating\n DB::table('Articulos')->delete();\n\n $articulos = array(\n //GORROS\n ['id' => 1, 'nombre' => 'Knox - aero', 'precio' => 9.99, 'stock' => 5, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime],\n ['id' => 2, 'nombre' => 'Knox - terra', 'precio' => 9.99, 'stock' => 5, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime],\n ['id' => 3, 'nombre' => 'Knox - fire', 'precio' => 9.99, 'stock' => 5, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime],\n ['id' => 4, 'nombre' => 'Knox - water', 'precio' => 9.99, 'stock' => 5, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime],\n\n ['id' => 5, 'nombre' => 'Performed - aero', 'precio' => 20.00, 'stock' => 10, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime],\n ['id' => 6, 'nombre' => 'Performed - terra', 'precio' => 20.00, 'stock' => 10, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime],\n ['id' => 7, 'nombre' => 'Performed - fire', 'precio' => 20.00, 'stock' => 20, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime],\n ['id' => 8, 'nombre' => 'Performed - water', 'precio' => 20.00, 'stock' => 20, 'tipo_id' => 1, 'created_at' => new DateTime, 'updated_at' => new DateTime],\n\n //GORRAS\n ['id' => 9, 'nombre' => 'Barrow - model 1', 'precio' => 30.00, 'stock' => 10, 'tipo_id' => 2, 'created_at' => new DateTime, 'updated_at' => new DateTime],\n ['id' => 10, 'nombre' => 'Barrow - model 2', 'precio' => 30.00, 'stock' => 10, 'tipo_id' => 2, 'created_at' => new DateTime, 'updated_at' => new DateTime],\n ['id' => 11, 'nombre' => 'Barrow - model 3', 'precio' => 30.00, 'stock' => 10, 'tipo_id' => 2, 'created_at' => new DateTime, 'updated_at' => new DateTime],\n\n ['id' => 12, 'nombre' => 'BUY IT - test model 1', 'precio' => 0.10, 'stock' => 100, 'tipo_id' => 2, 'created_at' => new DateTime, 'updated_at' => new DateTime],\n\n );\n\n // Uncomment the below to run the seeder\n DB::table('Articulos')->insert($articulos);\n }", "public function listar()\n {\n $Articulos_model = new Articulos_Model();\n session_start();\n //Le pedimos al modelo todos los Piezas\n $articulos = $Articulos_model->readAll();\n\n //Pasamos a la vista toda la información que se desea representar\n $variables = array();\n $usuario[\"usuario\"] = $_SESSION[\"usuario\"];\n $variables['articulos'] = $articulos;\n if (isset($_SESSION['cliente'])) {\n $usuario[\"cliente\"] = $_SESSION['cliente'];\n }\n //Finalmente presentamos nuestra plantilla\n $this->view->show(\"cabecera.php\");\n $this->view->show(\"plantilla_header.php\", $usuario);\n $this->view->show(RUTA_VISTAS . \"listar_header.php\");\n $this->view->show(RUTA_VISTAS . \"listar.php\", $variables);\n $this->view->show(\"plantilla_pie.php\");\n $this->view->show(\"pie.php\", $usuario);\n }", "public function RicercaPerIngredienti(){\n $pm = FPersistentManager::getInstance();\n $cibi = $pm->loadAllObjects();\n $view = new VRicerca();\n $view->mostraIngredienti($cibi);\n }", "public function run()\n {\n $about = [\n [\n 'title' => 'Quizás muchos pueden llegar a preguntarse como empezó a reunirse Centro Refugio Hefzi-bá.',\n \n 'content' => 'Pues aquí les cuento nuestros inicios. \n A principio del año 1998 en mi casa nos comenzamos a reunir mi esposa Nelly y yo con un grupo de\n hermanos a los cuales yo los había pastoreado un tiempo atrás, en una congregación de la localidad del\n Socorro en Valencia, Vzla. Pero debido que tenían tiempo que su congregación no funcionó mas, nos pidieron a\n Nelly y a mí si les podíamos pastorear, oramos a Dios y después de Él nos dió su respuesta de que si lo hiciéramos,\n empezamos a reunirnos.\n Después de varios días de reuniones, nos surgió la pregunta de como llamaríamos a la congregación que estaba\n naciendo. Dios nos llevó al libro de Isaías cap. 62 vers. 2 al 4 y allí nos decía que Él se deleitaba con la\n nueva congregación y por eso le debíamos poner HEFZI-BÁ, inmediatamente hubo la conexión divina de nosotros\n con el nombre que Dios nos había colocado como su pueblo que eramos.\n Is. 62,2-4: \"Entonces las naciones verán tu justicia,\n Y todos los reyes, tu gloria.\n Y te será dado un nombre nuevo,\n Que la boca de YHVH pronunciará.\n 3 Serás corona fúlgida en la mano de\n YHVH,\n Y diadema real en la palma de tu\n Dios.\n 4 Nunca más serás llamada la\n Desamparada,\n Ni tu tierra, la Desolada,\n Sino que serás llamada Hefzi-bá,° y\n tu país, Beula,°\n Porque el amor de YHVH estará\n contigo\n Y tu tierra tendrá marido,\"\n Así fueron nuestros inicios como congregación y ahora obedecemos a Dios y esperamos la segunda venida de\n nuestro Rey y Salvador Jesús.\n Mientras tanto hacemos su voluntad accionando en el ministerio de la reconciliación que Jesús nos dejo.\n ',\n \n 'img' => 'founder.jpg',\n \n 'url_video' => 'admin@admin',\n ],\n ];\n\n foreach ($about as $item) {\n Historyabout::create( $item );\n }\n }", "public function pruebaAction() {\n// $articulos = $mica->getArticles();\n// $incollections = $mica->getIncollections();\n// $inproceedings = $mica->getInproceedings();\n// $books = $mica->getBooks();\n// $longitud = $mica->getLengthList();\n// $age = $mica->getAge();\n// $annual = $mica->getAnnual();\n// echo \"Age:\" -> $age;\n// echo \"Annual:\" -> $annual;\n// echo \"Incollections: \" -> $incollections->count() -> \"\\n\";\n// echo \"Books: \" -> $books->count() -> \"\\n\";\n// echo \"Inproceedings:\" -> $inproceedings->count() -> \"\\n\";\n// echo \"Articles: \" -> $articulos->count() -> \"\\n\";\n// echo $longitud;\n// var_dump(sizeof($inproceedings->toArray()));\n\n $author = $this->get(\"doctrine_mongodb\")->getRepository('MongoBundle:ImportantAuthor')->findOneByName(\"se Erdogan\");\n $articulos = $author->getArticles();\n// return $this->render(\"MongoBundle:Queries:prueba->html->twig\", array(\"articles\" => $articulos, \"author\" => $mica, \"incollections\" => $incollections, \"inproceedings\" => $inproceedings, \"books\" => $books));\n return $this->render(\"MongoBundle:Queries:prueba->html->twig\", array(\"articles\" => $articulos, \"author\" => $author));\n }", "function listar_producto_nuevo(){\n\t\t$sql=\"SELECT claves_pro, categoria_pro, id_pro, detal_pro, mayor_pro, directorio_image, nombre_image, marca_pro, nombre_pro, limite_pro, descripcion_pro FROM producto, imagen WHERE galeria_image=id_pro AND tabla_image='Producto' AND disponible_pro='1' GROUP BY id_pro ORDER BY RAND() LIMIT 0 , 10\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$aux=\"\";\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$resultado['detal_pro']=$this->mostrar_precio($this->convertir_moneda($resultado['detal_pro']));\n\t\t\t$resultado['mayor_pro']=$this->mostrar_precio($this->convertir_moneda($resultado['mayor_pro']));\n\t\t\t$resultado['descripcion_pro']=strip_tags($resultado['descripcion_pro']);\n\t\t\t\n\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\n\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\tif($i<=12) $resultado['limite_pro'][]=$i; else break;\n\t\t\t}\n\t\t\t\n\t\t\t\t$cat=$resultado['categoria_pro'];\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat'\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "protected function entidades(){\n\t\tfor($i=1; $i < 6;$i++) $niveis[$i] = \"nivel de busca {$i}\";\n\t\t$this->visualizacao->nivel = VComponente::montar(VComponente::caixaCombinacao, 'nivel', isset($_POST['nivel']) ? $_POST['nivel'] : 1 ,null,$niveis);\n\t\t$this->visualizacao->filtro = isset($_POST['filtro']) ? $_POST['filtro'] : null;\n\t\t$this->visualizacao->listagens = false;\n\t\tif(!$this->visualizacao->filtro) return;\n\t\t$d = dir(\".\");\n\t\t$negocios = new colecao();\n\t\t$controles = new colecao();\n\t\twhile (false !== ($arquivo = $d->read())) {\n\t\t\tif( is_dir($arquivo) && ($arquivo{0} !== '.') ){\n\t\t\t\tif(is_file($arquivo.'/classes/N'.ucfirst($arquivo).'.php')){\n\t\t\t\t\t$negocio = 'N'.ucfirst($arquivo);\n\t\t\t\t\t$obNegocio = new $negocio();\n\t\t\t\t\tif( $obNegocio instanceof negocioPadrao ) {\n\t\t\t\t\t\t$ordem[$arquivo] = array(\n\t\t\t\t\t\t\t'nome'=>$obNegocio->pegarInter()->pegarNome(),\n\t\t\t\t\t\t\t'caminho'=>$arquivo.'/classes/N'.ucfirst($arquivo).'.php'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$negocios->$arquivo = $obNegocio;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$d->close();\n\t\tasort($ordem);\n\t\t$this->visualizacao->ordem = $ordem;\n\t\t$listagens = array();\n\t\tforeach($ordem as $idx => $arquivo){\n\t\t\t$obNegocio = $negocios->pegar($idx);\n\t\t\t$nome['controle'] = definicaoEntidade::controle($obNegocio, 'verPesquisa');\n\t\t\tif($this->exibirListagem($arquivo)){\n\t\t\t\t$colecao = $obNegocio->pesquisaGeral($this->pegarFiltro(),$this->pegarPagina(),isset($_POST['nivel']) ? $_POST['nivel'] : 1);\n\t\t\t\tcall_user_func_array(\"{$nome['controle']}::montarListagem\", array($this->visualizacao,$colecao,$this->pegarPagina(),$nome['controle']));\n\t\t\t\t$this->visualizacao->listagem->passarControle($nome['controle']);\n\t\t\t\tif($colecao->contarItens()){\n\t\t\t\t\t$listagens[$idx]['listagem'] = $this->visualizacao->listagem;\n\t\t\t\t\t$listagens[$idx]['ocorrencias'] = $colecao->contarItens();\n\t\t\t\t\t$listagens[$idx]['nome'] = $arquivo['nome'];\n\t\t\t\t\t$listagens[$idx]['controlePesquisa'] = $nome['controle'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tunset($this->visualizacao->listagem);\n\t\t$this->visualizacao->listagens = $listagens;\n\t}", "public function catalogo(){\n \n $inicio['recomendado'] = $this->carga_recomendado();\n $inicio['categorias'] = $this->carga_menu_categorias();\n $this->Plantilla(\"catalogo\", $inicio);\n \n }", "function loadArticulo(){\n\t\t\t$r = $this->ar->getArticuloById($this->id);\n\t\t\tif($r != -1){\n\t\t\t\t$this->id \t\t\t= $r['doa_id'];\n\t\t\t\t$this->alcance \t\t= $r['alc_id'];\n\t\t\t\t$this->documento \t= $r['doc_id'];\n\t\t\t\t$this->nombre \t\t= $r['doa_nombre'];\n\t\t\t\t$this->descripcion\t= $r['doa_descripcion'];\n\t\t\t}else{\n\t\t\t\t$this->id \t\t\t= \"\";\n\t\t\t\t$this->alcance \t\t= \"\";\n\t\t\t\t$this->documento \t= \"\";\n\t\t\t\t$this->nombre \t\t= \"\";\n\t\t\t\t$this->descripcion\t= \"\";\n\t\t\t}\n\t}", "function ChapterBody() {\n //$conn->SQL(\"select * from esquema.almacen_ubicacion\");\n\n\n\n\n //aqui metemos los parametros del contenido\n //$this->SetWidths(array(25,25,30,22,40,20));\n $this->SetWidths(array(10,30,22,22,25,21,23,25,32,20));\n //$this->SetAligns(array(\"C\",\"C\",\"C\",\"C\",\"C\",\"C\"));\n $this->SetAligns(array(\"C\",\"C\",\"C\",\"C\",\"C\",\"C\",\"C\",\"C\",\"C\",\"C\"));\n //$this->SetFillColor(232,232,232,232,232,232);\n $this->SetFillColor(232,232,232,232,232,232,232,232,232,232);\n // $cantidaditems = $this->array_movimiento[0][\"numero_item\"];\n\n $subtotal = 0;\n // for($i=0;$i<$cantidaditems;$i++) {\n // $this->SetLeftMargin(30);\n // $width = 5;\n // $this->SetX(14);\n // $this->SetFont('Arial','',7);\n\n // $this->Row(\n // array( $this->array_movimiento[$i][\"cod_item\"],\n // $this->array_movimiento[$i][\"descripcion1\"],\n // $this->array_movimiento[$i][\"cantidad_item\"]),1);\n\n // }\n $i = 0;\n foreach ($this->array_mercadeo as $key => $value) {\n $i++;\n $this->SetLeftMargin(30);\n $width = 7;\n $this->SetX(14);\n $this->SetFont('Arial','',9);\n $this->Row(\n array(//$value[\"fecha\"],\n $i,\n $value[\"COD\"],\n $value[\"nombre\"],\n //$value[\"precio\"],\n number_format($value[\"costo_unitario\"], 2, ',', ''),\n $value[\"costo_operativo\"],\n //number_format($value[\"costo_operativo\"], 2, ',', ''),\n number_format($value[\"costo_sin_iva\"], 2, ',', ''),\n //$value[\"costo_iva\"],\n number_format($value[\"costo_iva\"], 2, ',', ''),\n //$value[\"precio_sugerido\"],\n number_format($value[\"precio_sugerido\"], 2, ',', ''),\n $value[\"margen_ganancia\"],\n //number_format($value[\"margen_ganancia\"], 2, ',', ''),\n //$value[\"pvp\"]),\n number_format($value[\"pvp\"], 2, ',', '')),\n 1);\n //$this->SetX(14);\n /*if( $value[\"cantidad_item\"] != $value[\"c_esperada\"] && $this->array_mercadeo[0][\"tipo_movimiento_almacen\"]==3){\n $this->Cell(196,5,'Observacion : '.$value[\"observacion_dif\"],1,1,'L');\n }*/\n \n\n }\n\n }", "public function mostrarPeliculas()\n {\n $conexion = database::conexion();\n $consulta = 'SELECT * FROM peliculas';\n $consultaPreparada = $conexion->prepare($consulta);\n $consultaPreparada->execute();\n foreach ($resutado = $consultaPreparada->fetchAll(PDO::FETCH_ASSOC) as $fila) {\n echo '<div >';\n echo '<a href=\"peliculas_ficha.php?id=' . $fila['id'] . '\">';\n echo '<img class=\"ficha\" src=\"./imgs/peliculas/' . $fila['id'] . '.jpg\"/></a>';\n echo '<p >' . $fila['titulo'] . '</p>';\n echo '<a class=\"editar\" href=\"peliculas_form.php?id=' . $fila['id'] . '\">editar</a>';\n echo '<a class=\"borrado\" href=\"peliculas.php?idBorrar=' . $fila['id'] . '\">borrar</a>';\n echo '</div>';\n }\n }", "function keysist_home_about_array() {\n $keysist_home_about_contents_array = array();\n $bizlight_home_about_args = array(\n 'post_type' => 'caracteristica',\n 'posts_per_page' => 3,\n 'meta_query' => array(\n array(\n 'key' => 'mostrar',\n 'compare' => '=',\n 'value' => 1\n )\n ),\n 'meta_key' => 'orden',\n 'orderby' => 'meta_value',\n 'order' => 'ASC'\n );\n $keysist_home_about_contents_array = array();\n $bizlight_home_about_post_query = new WP_Query($bizlight_home_about_args);\n $i=0;\n if ($bizlight_home_about_post_query->have_posts()) :\n while ($bizlight_home_about_post_query->have_posts()) : $bizlight_home_about_post_query->the_post();\n $keysist_home_about_contents_array[$i]['keysist-home-caracteristica-title'] = get_the_title();\n $keysist_home_about_contents_array[$i]['keysist-home-caracteristica-content'] = bizlight_words_count( 30 ,get_the_content()) ;\n $keysist_home_about_contents_array[$i]['keysist-home-caracteristica-link'] = get_permalink();\n if(get_field('icono')>''):\n $keysist_home_about_contents_array[$i]['keysist-home-caracteristica-icon'] = get_field('icono');\n else:\n $keysist_home_about_contents_array[$i]['keysist-home-caracteristica-icon'] = 'fa-bullhorn';\n endif;\n $i++;\n endwhile;\n wp_reset_postdata();\n else:\n $keysist_home_about_contents_array[0]['keysist-home-caracteristica-title'] = __('Confiabilidad','bizlight');\n $keysist_home_about_contents_array[0]['keysist-home-caracteristica-content'] = __(\" Somos una empresa de servicios de TI especializada en la ejecución de proyectos de infraestructura y desarrollo de Software.\",'bizlight');\n $keysist_home_about_contents_array[0]['keysist-home-caracteristica-link'] = '#';\n $keysist_home_about_contents_array[0]['keysist-home-caracteristica-icon'] = 'fa-bullhorn';\n\n $keysist_home_about_contents_array[1]['keysist-home-caracteristica-title'] = __('Experiencia','bizlight');\n $keysist_home_about_contents_array[1]['keysist-home-caracteristica-content'] = __(\" Más de 400 proyectos puestos en producción durante los últimos 15 años demuestran el compromiso con nuestros clientes, certifican nuestra metodología y reflejan la capacidad de nuestro equipo de profesionales..\",'bizlight');\n $keysist_home_about_contents_array[1]['keysist-home-caracteristica-link'] = '#';\n $keysist_home_about_contents_array[1]['keysist-home-caracteristica-icon'] = 'fa-camera-retro';\n\n $keysist_home_about_contents_array[2]['keysist-home-caracteristica-title'] = __('Ejecución','bizlight');\n $keysist_home_about_contents_array[2]['keysist-home-caracteristica-content'] = __(\" Las organizaciones donde el uso de tecnología de la información es un factor determinante en la búsqueda de eficiencia operativa encontrarán en MicroGestion la mejor opción para llevar a cabo sus proyectos de manera eficaz y repetible..\",'bizlight');\n $keysist_home_about_contents_array[2]['keysist-home-caracteristica-link'] = '#';\n $keysist_home_about_contents_array[2]['keysist-home-caracteristica-icon'] = 'fa-cog';\n endif;\n \n \n \n return $keysist_home_about_contents_array;\n }", "public function readProductosMarca()\n {\n $sql = 'SELECT nombre, id_producto, imagen_producto, producto, descripcion, precio\n FROM producto INNER JOIN marca USING(id_marca)\n WHERE id_marca = ? \n ORDER BY producto';\n $params = array($this->nombre);\n return Database::getRows($sql, $params);\n }", "public function Listar($orden) { //Función para listar las pruebas\r\n\r\n\t\t\t\t$this->Pruebas=array(); //Hay que vaciar el array de objetos Pruebas\r\n\t\t\t \r\n\t\t\t\tif(!empty($orden)){ //Si el parámetro $orden no está vacío\r\n \r\n\t\t\t\t $consulta=\"select * from prueba order by \" . $orden; //Creo la consulta. En este caso no se puede hacer con consultas preparadas\r\n\t\t\t\t $param=array(); //Creo un array para pasarle parámetros\r\n\t\t\t\t\r\n\t\t\t\t $this->Consulta($consulta,$param); //Ejecuto la consulta\r\n\t\t\t\t \r\n\t\t\t\t\t\t \r\n\t\t\t\t foreach ($this->datos as $fila) //Recorro el array de la consulta\r\n\t\t\t\t {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t $pru = new Prueba(); //Creo un nuevo objeto\r\n\t\t\t\t\t\t\t\t\t\t\t //Le seteo las variables, y así me ahorro el constructor \r\n\t\t\t\t\t $pru->__SET(\"idPrueba\",$fila[\"idPrueba\"]);\r\n\t\t\t\t\t $pru->__SET(\"nombrePrueba\",$fila[\"nombrePrueba\"]);\r\n\t\t\t\t\t $pru->__SET(\"aparatosNecesarios\",$fila[\"aparatosNecesarios\"]);\r\n\t\t\t\t\t $pru->__SET(\"descripcion\",$fila[\"descripcion\"]);\r\n\t\t\t\t\t \r\n\t\t\t\t\t $this->Pruebas[]=$pru; //Meto la prueba en el array de Pruebas\r\n\t\t\t\t\t}\r\n \r\n\t\t\t\t}else{\r\n \r\n\t\t\t\t $consulta=\"select * from prueba\";\r\n\r\n\t\t\t\t $param=array(); //Creo un array para pasarle parámetros\r\n\t\t\t\t\r\n\t\t\t\t $this->Consulta($consulta,$param); //Ejecuto la consulta\r\n\t\t\t\t \r\n\t\t\t\t\t\t \r\n\t\t\t\t foreach ($this->datos as $fila) //Recorro el array de la consulta\r\n\t\t\t\t {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t $pru = new Prueba(); //Creo un nuevo objeto\r\n\t\t\t\t\t\t\t\t\t\t\t //Le seteo las variables, y así me ahorro el constructor \r\n\t\t\t\t\t $pru->__SET(\"idPrueba\",$fila[\"idPrueba\"]);\r\n\t\t\t\t\t $pru->__SET(\"nombrePrueba\",$fila[\"nombrePrueba\"]);\r\n\t\t\t\t\t $pru->__SET(\"aparatosNecesarios\",$fila[\"aparatosNecesarios\"]);\r\n\t\t\t\t\t $pru->__SET(\"descripcion\",$fila[\"descripcion\"]);\r\n\t\t\t\t\t \r\n\t\t\t\t\t $this->Pruebas[]=$pru; //Meto la prueba en el array de Pruebas\r\n \r\n\t\t\t\t}\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t}", "private function generar_lecturas($data)\n {\n \t$tipo = $data['tipo'];\n \t$dias = collect($data['dias']);\n \t$inicio = Carbon::createFromFormat('d/m/Y', $data['inicio']);\n\n\t $array_archivo = file(storage_path('app/' . $tipo . '.txt'));\n\n\t $array_lectura = array();\n\n\t if($tipo == 'variado')\n\t {\n\t \t$clase_anterior = 'epistola';\n\t \t\n\t \tfor($i = 0; $i < count($array_archivo); $i++)\n\t \t{\n\t \t\t/*\n\t\t \t* item : tiene la siguiente estructura\n\t \t\t* [0]\t=> clase (epistola, ley, historia, salmos, poesia, profecia, evangelio)\n\t \t\t* [1]\t=> libro_id\n\t \t\t* [2]\t=> numero_capitulo\n\t \t\t* [3]\t=> versiculo de inicio\n\t \t\t*/\n\t \t\t$cadena = trim($array_archivo[$i]);\n\t\t \t$item = explode(';', $cadena);\n\n\t\t \t//Nombre del Libro\n\t\t \t$libro = Libro::find(intval($item[1]));\n\n\t\t \t$libro_nombre = $libro->nombre;\n\n\t\t \t//Ultimo versiculo\n\t\t \t$ultimo_verso = Versiculo::where('libro_id', intval($item[1]))\n\t\t \t\t\t\t\t\t\t\t\t->where('numero_capitulo', intval($item[2]))\n\t\t \t\t\t\t\t\t\t\t\t->orderBy('numero_versiculo', 'DESC')\n\t\t \t\t\t\t\t\t\t\t\t->first();\n\n\t\t \t$ultimo = $ultimo_verso->numero_versiculo;\n\n\t\t \t//Verificamos por clase para cambiar de fecha\n\t\t \t$clase_actual = $item[0];\n\n\t\t \t//Si fecha pertenece a los dias seleccionados (Entraria solo la primera vez)\n\t\t \tif(!$dias->contains($inicio->dayOfWeek))\n\t\t \t{\n\t\t \t\twhile(!$dias->contains($inicio->dayOfWeek))\n\t\t \t\t{\n\t\t \t\t\t$inicio = $inicio->addDay();\n\t\t \t\t}\n\t\t \t}\n\n\t\t \t//Cuando cambia de clase => cambiar fecha\n\t\t \tif($clase_anterior != $clase_actual)\n\t\t \t{\n\t\t \t\t$inicio = $inicio->addDay();\n\t\t \t\tif(!$dias->contains($inicio->dayOfWeek))\n\t\t\t \t{\n\t\t\t \t\twhile(!$dias->contains($inicio->dayOfWeek))\n\t\t\t \t\t{\n\t\t\t \t\t\t$inicio = $inicio->addDay();\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \t$clase_anterior = $clase_actual;\n\t\t \t}\n\n\t\t \t$fecha = new Carbon($inicio);\n\t\t \t$fecha = $fecha->format('d/m/Y');\n\n\t\t \t$array_lectura[] = array(\n\t 'fecha' => $fecha,\n\t 'libro_id' => intval($item[1]),\n\t 'libro_nombre' => $libro_nombre,\n\t 'capitulo' => intval($item[2]),\n\t 'verso_inicio' => intval($item[3]),\n\t 'verso_final' => $ultimo\n\t );\n\t \t}\n\n\t }\n\t else\n\t {\n\t \t$dia = 1;\n\t\t $contador = 1;\n\t\t for ($i = 0; $i < count($array_archivo); $i++) \n\t\t {\n\t\t \t//Cada item debe tener 4 indices, si el ultimo esta vacio => \n\t\t \t//colocar el ultimo versiculo del capitulo\n\t\t \t$cadena = trim($array_archivo[$i]);\n\t\t \t$item = explode(';', $cadena);\n\n\t\t \tif(is_null($item[3]) || ($item[3] == '') )\n\t\t \t{\n\t\t \t\t$ultimo_verso = Versiculo::where('libro_id', intval($item[0]))\n\t\t \t\t\t\t\t\t\t\t\t->where('numero_capitulo', intval($item[1]))\n\t\t \t\t\t\t\t\t\t\t\t->orderBy('numero_versiculo', 'DESC')\n\t\t \t\t\t\t\t\t\t\t\t->first();\n\n\t\t \t\t$item[3] = $ultimo_verso->numero_versiculo;\n\t\t \t}\n\t\t \t$libro = Libro::find(intval($item[0]));\n\n\t\t \t$libro_nombre = $libro->nombre;\n\n\t\t \t//Si fecha pertenece a los dias seleccionados (Entraria solo la primera vez)\n\t\t \tif(!$dias->contains($inicio->dayOfWeek))\n\t\t \t{\n\t\t \t\twhile(!$dias->contains($inicio->dayOfWeek))\n\t\t \t\t{\n\t\t \t\t\t$inicio = $inicio->addDay();\n\t\t \t\t}\n\t\t \t}\t \t\n\n\t\t \t//Agregar solo tres capitulos por dia\n\t\t \tif($contador > 3)\n\t\t \t{\n\t\t \t\t$inicio = $inicio->addDay();\n\t\t \t\tif(!$dias->contains($inicio->dayOfWeek))\n\t\t\t \t{\n\t\t\t \t\twhile(!$dias->contains($inicio->dayOfWeek))\n\t\t\t \t\t{\n\t\t\t \t\t\t$inicio = $inicio->addDay();\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t \t\t$contador = 1;\n\n\t\t \t}\n\n\t\t \t$fecha = new Carbon($inicio);\n\t\t \t$fecha = $fecha->format('d/m/Y');\n\n\t\t \t$array_lectura[] = array(\n\t 'fecha' => $fecha,\n\t 'libro_id' => intval($item[0]),\n\t 'libro_nombre' => $libro_nombre,\n\t 'capitulo' => intval($item[1]),\n\t 'verso_inicio' => intval($item[2]),\n\t 'verso_final' => intval($item[3])\n\t );\n\n\t $contador++;\n\n\t\t }\n\t }\t \n\n\t return $array_lectura;\n\t \n }", "public function getArtigo() {\n return $this->artigo;\n }", "function showArticle($what)\n{\n\t$lim = 120;\n\tif(strlen($what[\"description\"])>$lim){\n\t\t$toto= \"\";\n\t\tfor($i=0;$i<$lim-1;$i++){\n\t\t\t$toto[$i]=$what[\"description\"][$i];\n\t\t}\n\t\t$toto[$lim]='.';\n $toto[$lim+1]='.';\n\t\t$toto[$lim+2]='.';\n\t\t$what[\"description\"]=$toto;\n\t}\necho \"<div id='articles'>\";\necho \"\t<table class='articleUniqueTab'>\n\n\t\t <tr>\n\t\t <td rowspan='2'><a href='singleArticle.php?ID=\" . $what['ID'] . \"'><img src='\".$what[\"photo\"].\"'width='100' height='100' style='float : left'/></a></td>\n\t\t <th class='articleDetail'><a href='singleArticle.php?ID=\" . $what['ID'] . \"' >\".$what[\"nom\"].\"</a></th>\n\t\t <td class='articleDetail'>prix : \".$what[\"prix\"].\"€</td>\n\t\t <td class='articleDetail'>note :\".$what[\"note\"].\"/5</td>\n\t\t <td class='articleDetail'>Quantité restante : \".$what['quantite'].\"</td>\n\t\t </tr>\n\n\t\t <tr>\n\t\t \t<td colspan='4'>\".$what[\"description\"].\"</td>\n\t\t </tr>\n\t\t</table> \";\necho \"</div>\";\n}", "public function accionPerfilArtista(){\n // (si es que hay alguno logueado)\n $sw = false;\n $codRole = 0;\n \n if(Sistema::app()->Acceso()->hayUsuario()){\n $sw = true;\n \n $nick = Sistema::app()->Acceso()->getNick();\n $codRole = Sistema::app()->ACL()->getUsuarioRole($nick);\n \n }\n \n // Si el usuario que intenta acceder es un restaurante, administrador\n // o simplemente no hay usuario validado, lo mando a una página de\n // error. Los artistas tienen el rol 5\n if(!$sw || $codRole != 5){\n Sistema::app()->paginaError(403, \"No tiene permiso para acceder a esta página.\");\n exit();\n }\n \n // Una vez comprobado que está accediendo un artista, procedo a\n // obtener los datos del artista\n $art = new Artistas();\n \n // El nick del usuario es el correo electrónico. Es un valor\n // único, por lo que puedo buscar al artista por\n // su dirección de correo\n if(!$art->buscarPor([\"where\"=>\"correo='$nick'\"])){\n \n Sistema::app()->paginaError(300,\"Ha habido un problema al encontrar tu perfil.\");\n return;\n \n }\n \n $imagenAntigua = $art->imagen;\n $nombre=$art->getNombre();\n \n // Si se modifican los datos del artista, esta variable\n // pasará a true para notificar a la vista\n $artistaModificado = false;\n if (isset($_POST[$nombre]))\n {\n $hayImagen = true;\n // Si ha subido una nueva imagen, recojo su nombre\n if($_FILES[\"nombre\"][\"name\"][\"imagen\"]!=\"\"){\n $_POST[\"nombre\"][\"imagen\"] = $_FILES[\"nombre\"][\"name\"][\"imagen\"];\n }\n else{\n $hayImagen = false;\n $_POST[\"nombre\"][\"imagen\"] = $art->imagen;\n }\n // El coreo es una clave foránea, así que tengo\n // que cambiar el correo en la tabla ACLUsuarios\n Sistema::app()->ACL()->setNick($nick, $_POST[\"nombre\"][\"correo\"]);\n \n $art->setValores($_POST[$nombre]);\n \n if ($art->validar())\n {\n // Si se ha guardado correctamente, actualizo la imagen de perfil\n // e inicio sesión con el nuevo correo automáticamente\n if ($art->guardar()){\n $artistaModificado = true;\n if($hayImagen){\n // Obtengo la carpeta destino de la imagen\n $carpetaDestino = $_SERVER['DOCUMENT_ROOT'].\"/imagenes/artistas/\";\n // Elimino la imagen antigua\n unlink($carpetaDestino.$imagenAntigua);\n \n // Y guardo la nueva\n move_uploaded_file($_FILES['nombre']['tmp_name']['imagen'], $carpetaDestino.$_POST[\"nombre\"][\"imagen\"]);\n }\n Sistema::app()->Acceso()->registrarUsuario(\n $_POST[\"nombre\"][\"correo\"],\n mb_strtolower($art->nombre),\n 0,\n 0,\n [1,1,1,1,1,0,0,0,0,0]);\n }\n \n }\n }\n \n $this->dibujaVista(\"perfilArtista\",\n [\"art\"=>$art, \"artistaModificado\"=>$artistaModificado],\n \"Perfil\");\n \n }", "function listar_producto_nuevo2(){\n\t\t$sql=\"SELECT claves_pro, categoria_pro, id_pro, detal_pro, mayor_pro, directorio_image, nombre_image, marca_pro, nombre_pro, limite_pro, descripcion_pro FROM producto, imagen WHERE categoria_pro!='4' AND galeria_image=id_pro AND tabla_image='Producto' AND disponible_pro='1' AND nombre_image='portada' GROUP BY id_pro ORDER BY categoria_pro DESC, RAND() LIMIT 0,4\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$aux=\"\";\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$resultado['detal_pro']=$this->mostrar_precio($this->convertir_moneda($resultado['detal_pro']));\n\t\t\t$resultado['mayor_pro']=$this->mostrar_precio($this->convertir_moneda($resultado['mayor_pro']));\n\t\t\t$resultado['descripcion_pro']=strip_tags($resultado['descripcion_pro']);\n\t\t\t\n\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\n\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\tif($i<=12) $resultado['limite_pro'][]=$i; else break;\n\t\t\t}\n\t\t\t\n\t\t\t\t$cat=$resultado['categoria_pro'];\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat'\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "public function producto()\n {\n $lista_prod=Producto::TraerLista_Producto_asc();\n //generacion de bloques de producto en fila y por columnas de 4\n $seccion_prod='<div class=\"row pb-2\">';\n foreach ($lista_prod as $indice => $obj) \n {\n $indice+=1;\n if ($indice%4==0)\n {\n $seccion_prod.='\n <div class=\"pb-2 col-md-3\">\n <div class=\"card pt-3\">\n <img class=\"mx-auto\" src=\"'.asset('img/producto/'.$obj->foto).'\" height=\"70px\" alt=\"producto\"> \n <div class=\"card-body\">\n <h6 class=\"card-title\">'.$obj->nombre.'</h6>\n <p class=\"card-text\">'.$obj->descripcion.'</p>\n </div>\n </div>\n </div>';\n $seccion_prod.='</div>';\n $seccion_prod.='<div class=\"row pb-2\">'; \n }\n else \n {\n $seccion_prod.='\n <div class=\"pb-2 col-md-3\">\n <div class=\"card pt-3\">\n <img class=\"mx-auto\" src=\"'.asset('img/producto/'.$obj->foto).'\" height=\"70px\" alt=\"producto\"> \n <div class=\"card-body\">\n <h6 class=\"card-title\">'.$obj->nombre.'</h6>\n <p class=\"card-text\">'.$obj->descripcion.'</p>\n </div>\n </div>\n </div>';\n } \n }\n $seccion_prod.='</div>';\n return view('web.producto',compact('seccion_prod'));\n }", "function eml_aff_contenu() {\n \n $bd = em_bd_connecter();\n \n echo '<main>';\n \n // génération des 3 derniers articles publiés\n $sql0 = 'SELECT arID, arTitre FROM article \n ORDER BY arDatePublication DESC \n LIMIT 0, 3';\n $tab0 = eml_bd_select_articles($bd, $sql0);\n eml_aff_vignettes('&Agrave; la Une', $tab0);\n \n // génération des 3 articles les plus commentés\n $sql1 = 'SELECT arID, arTitre \n FROM article\n LEFT OUTER JOIN commentaire ON coArticle = arID \n GROUP BY arID \n ORDER BY COUNT(coArticle) DESC, rand() \n LIMIT 0, 3';\n $tab1 = eml_bd_select_articles($bd, $sql1);\n eml_aff_vignettes('L\\'info brûlante', $tab1);\n \n // génération des 3 articles parmi les articles restants \n $sql2 = 'SELECT arID, arTitre FROM article\n WHERE arID NOT IN (' . join(',',array_keys($tab0)) . ',' . join(',',array_keys($tab1)) . ') \n ORDER BY rand() LIMIT 0, 3';\n $tab2 = eml_bd_select_articles($bd, $sql2);\n eml_aff_vignettes('Les incontournables', $tab2);\n \n // affichage de l'horoscope \n eml_aff_horoscope();\n \n mysqli_close($bd);\n \n echo '</main>';\n \n}", "function getAllFromProizvod(){\n\t\treturn $this->ime . \"&nbsp\" . $this->imeProizvođača . \"&nbsp\" \n\t\t. $this->prezimeProizvođača . \"&nbsp\" . $this->cijena;\n\t}", "function promedios_por_materia($vector){\n echo \"<hr> ############# Promedios por materia #############\";\n $calificacion1=0;\n $calificacion2=0;\n $calificacion3=0;\n $calificacion4=0;\n $calificacion5=0;\n $calificacion6=0;\n foreach ($vector as $key => $value) {\n $calificacion1=$calificacion1+$vector[$key][0];\n $calificacion2=$calificacion2+$vector[$key][1];\n $calificacion3=$calificacion3+$vector[$key][2];\n $calificacion4=$calificacion4+$vector[$key][3];\n $calificacion5=$calificacion5+$vector[$key][4];\n $calificacion6=$calificacion6+$vector[$key][5];\n }\n $prom=$calificacion1/10;\n echo \"<br> Promedio materia 1: \".$prom;\n $prom=$calificacion2/10;\n echo \"<br> Promedio materia 2: \".$prom;\n $prom=$calificacion3/10;\n echo \"<br> Promedio materia 3: \".$prom;\n $prom=$calificacion4/10;\n echo \"<br> Promedio materia 4: \".$prom;\n $prom=$calificacion5/10;\n echo \"<br> Promedio materia 5: \".$prom;\n $prom=$calificacion6/10;\n echo \"<br> Promedio materia 6: \".$prom;\n }", "function Michelin()\n{\n global $con;\n $get_pro = \"SELECT g.id_guma , g.id_marka, g.slika, g.cena, g.sirina, g.visina, g.opterecenje, g.precnik, g.indeks_brzine, id_sezona, m.marka from gume g \n JOIN marka m ON g.id_marka = m.id_marka WHERE g.id_marka=4\";\n\n $run_pro = mysqli_query($con, $get_pro);\n\n while ($row_pro = mysqli_fetch_array($run_pro)) {\n $id_guma = $row_pro ['id_guma'];\n $tire_brand = $row_pro ['marka'];\n $product_image = $row_pro ['slika'];\n $cena = $row_pro ['cena'];\n $sirina= $row_pro ['sirina'];\n $visina = $row_pro ['visina'];\n $opterecenje = $row_pro ['opterecenje'];\n $precnik = $row_pro ['precnik'];\n $indeks_brzine = $row_pro ['indeks_brzine'];\n $tire_season = $row_pro ['id_sezona'];\n\n\n\n\n echo \"\n <div class='col-xs-12 col-sm-4 col-md-4 products mr-0' style='padding: 60px;height:400px;border: 1px solid lightgrey'><br /><span> \n <img src='http://localhost/ProdajaGuma/product_images/$product_image' class='img-responsive'/></span> \n <h2 class='top-left' style='background-color: aqua;color:white;position: absolute;top:20px;left: 0px;width: 150px;font-size: 15px'>&nbsp SEZONA &nbsp<span style='color:blue'>\n <img src='http://localhost/ProdajaGuma/ikonice/snow.ico' width='35px' ></span></span></h2><br /><br /><span></span> \n <div style='background-color: white;position: relative;top: -130px'><hr style='border: 1px solid #31708f'></span><span>$tire_brand $visina/$sirina $precnik $tire_season $opterecenje $indeks_brzine</span><br /><br /><span style='color: #428bca'>Cena: $cena</span><br/>\n <span><br /><a href='details.php?id_guma=$id_guma'><button class='btn btn-primary btn-responsive' style='background-color:green;margin: auto;display: block; width: 150px;height: 40px; color: white;'>Detaljnije...</button></a>\n </span></div></div>\n \";\n\n }\n\n\n}", "function afficheFilms($films,$db){\n\t\t$changeColor = true;\n\n\t\tforeach ($films as $film) {\n\n\t\t/*if($changeColor) $class=\"rouge\";\n\t\telse $class=\"bleu\";\t*/\n\n\t\t\t//opérateur ternaire : si changeColor vaut true alors rouge sinon bleu\n\t\t$class = $changeColor ? \"rouge\" : \"bleu\";\n\n\t\t$changeColor = !$changeColor;\n\t\t\t\n\t\techo '<div class=\"film '.$class.'\">';\n\n\t\t\techo '<div class=\"image\">\n\t\t\t\t\t<img src=\"images/'.$film['films_affiche'].'\" \n\t\t\t\t\ttitle=\"'.$film['films_titre'].'\" \n\t\t\t\t\talt=\"'.$film['films_titre'].'\"/>\n\t\t\t\t </div>';\n\n\n\t\t\techo '<div class=\"contenu\">';\t \n\t\t\t\techo '<h2 class=\"titre\" >'.$film['films_titre'].'</h2><div class=\"annee\">'.$film['films_annee'].'</div>';\n\n\t\t\t\t/*********** GENRES **************/\n\t\t\t\t//récupération des genres pour le film courant grâce à l'identifiant du film\n\t\t\t\t$requete = $db->prepare('SELECT genres_nom FROM genres \n\t\t\t\t\tJOIN films_genres ON fg_genres_id=genres_id WHERE fg_films_id=:id ');\n\t\t\t\t//j'exécute la requête en passant la valeur pour le param :id, et \n\t\t\t\t//ensuite je récupère via le fetchAll() \n\t\t\t\t$requete->execute( array('id' => $film['films_id'] ) );\n\n\t\t\t\t$genres = $requete->fetchAll();\n\t\t\t\t$size = count($genres);\n\t\t\t\techo '<div>';\n\t\t\t\tforeach ($genres as $key=>$genre) {\n\t\t\t\t\techo $genre['genres_nom'];\n\t\t\t\t\tif($key < $size-1){\n\t\t\t\t\t\techo \" | \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo '</div>';\n\t\t\t\t//var_dump($genres);\t\t\t\t\t\n\n\t\t\t\t/*********** REALISATEUR ****************/\n\t\t\t\techo '<div> <label>Réalisateur : </label> '\n\t\t\t\t.$film['real_nom'].'</div>';\n\n\t\t\t\t/*********** ACTEURS **************/\n\t\t\t\t$requete = $db->prepare('SELECT acteurs_nom FROM acteurs \n\t\t\t\t\tJOIN films_acteurs ON fa_acteurs_id=acteurs_id WHERE fa_films_id=:poney ');\n\t\t\t\t//j'exécute la requête en passant la valeur pour le param :id, et \n\t\t\t\t//ensuite je récupère via le fetchAll() \n\t\t\t\t$requete->execute( array('poney' => $film['films_id'] ) );\n\n\t\t\t\t$acteurs = $requete->fetchAll();\n\t\t\t\t$size = count($acteurs);\n\t\t\t\techo '<div><label> Acteurs : </label>';\n\t\t\t\tforeach ($acteurs as $key=>$acteur) {\n\t\t\t\t\techo $acteur['acteurs_nom'];\n\t\t\t\t\tif($key < $size-1){\n\t\t\t\t\t\techo \", \";\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo \"...\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo '</div>';\n\n\n\t\t\t\t/*********** DUREE **************/\n\t\t\t\t$duree = $film['films_duree'];\n\t\t\t\t$heures = (int) ($duree/60);\n\t\t\t\t$minutes = $duree%60;\n\t\t\t\tif($minutes<10){\n\t\t\t\t\t$minutes = '0'.$minutes;\n\t\t\t\t}\n\t\t\t\techo '<div> <label>Durée : </label>'\n\t\t\t\t\t\t.$heures.'h'.$minutes.\n\t\t\t\t\t'</div>';\n\n\t\t\t\t/*********** RESUME **************/\t\n\t\t\t\techo '<div class=\"resume\">'.$film['films_resume'].'</div>';\n\t\t\techo '</div>';\t\n\n\n\t\techo '</div>';\n\t\t}\n}", "private function get_precios_articulo()\n {\n $this->template = 'ajax/nueva_compra_precios';\n \n $articulo = new articulo();\n $this->articulo = $articulo->get($_POST['referencia4precios']);\n }", "function showArtista($row){\n\t\techo '<div class=\"album\" id=\"album'.$row['id'].'\" onClick=\"eliminar('.$row['id'].')\">\n\t\t\t\t<div class=\"cover\">';\n\t\t//cover\n\t\tif ($row['cover'] == 'default'){\n\t\t\techo '<img class=\"imageCover\" src=\"images/album.png\" title=\"'.$row['artista'].'\">';\n\t\t}else{\n\t\t\techo '<img class=\"imageCover\" src=\"images/cover/'.$row['cover'].'\" title=\"'.$row['artista'].'\">';\n\t\t}\n\n\t\techo '</div>\n\t\t\t\t<div class=\"info\">\n\t\t\t\t\t<div class=\"contador\" id=\"contador'.$row['id'].'\">\n\t\t\t\t\t\t<span></span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"infosong\">\n\t\t\t\t\t\t<img src=\"images/disco.png\">';\n\t\t//artista\n\t\techo '<h2>'.$row['cancion'].'</h2>';\n\t\t//album\n\t\techo '<h3>'.$row['artista'].'</h3>';\n\n\t\techo '</div>\n\t\t\t\t\t<div class=\"infovotos\">\n\t\t\t\t\t\t<img src=\"images/like.png\">';\n\t\t//id para el jquery\n\t\techo '<img src=\"images/masDesactivo.png\" class=\"mas\" id=\"boton'.$row['id'].'\">';\n\t\t//votos\n\t\techo '<p id=\"votos'.$row['id'].'\">'.votos($row['id']).' votos</p>\n\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>';\n}", "function listar_materiales($objeto){\n\t\t$condicion.=(!empty($objeto['id']))?' AND p.id='.$objeto['id']:'';\n\t// Filtra por los IDs de los insumo si existe\n\t\t$condicion.=(!empty($objeto['ids']))?' AND p.id IN ('.$objeto['ids'].')':'';\n\n\t// Filtra por el nombre del insumo si existe\n\t\t$condicion.=(!empty($objeto['tipo_producto']))?' AND p.tipo_producto='.$objeto['tipo_producto']:'';\n\n\t\t$sql = \"SELECT\n\t\t\t\t\tp.id AS idProducto, p.nombre, IF(p.tipo_producto=4, ROUND(p.costo_servicio, 2), IFNULL(pro.costo,0)) AS costo,\n\t\t\t\t\tp.id_unidad_compra AS idunidadCompra, p.id_unidad_venta AS idunidad,\n\t\t\t\t\t(SELECT\n\t\t\t\t\t\tnombre\n\t\t\t\t\tFROM\n\t\t\t\t\t\tapp_unidades_medida uni\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tuni.id=p.id_unidad_venta) AS unidad,\n\t\t\t\t\t\t(SELECT\n\t\t\t\t\t\t\tclave\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tapp_unidades_medida uni\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tuni.id=p.id_unidad_venta) AS unidad_clave, p.codigo, u.factor, m.cantidad, m.opcionales AS opcionales\n\t\t\t\tFROM\n\t\t\t\t\tapp_productos p\n\t\t\t\tINNER JOIN\n\t\t\t\t\t\tapp_producto_material m\n\t\t\t\t\tON\n\t\t\t\t\t\tp.id=m.id_material\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tapp_unidades_medida u\n\t\t\t\t\tON\n\t\t\t\t\t\tu.id=p.id_unidad_compra\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tapp_costos_proveedor pro\n\t\t\t\t\tON\n\t\t\t\t\t\tpro.id_producto=p.id\n\t\t\t\tWHERE\n\t\t\t\t\tp.status=1\n\t\t\t\tAND\n\t\t\t\t\tm.id_producto = \".$objeto['id_receta'].\n\t\t\t\t$condicion;\n\t\t// return $sql;\n\t\t$result = $this->queryArray($sql);\n\n\t\treturn $result;\n\t}", "function grafico_1_3( $desde, $hasta, $ua ){\n\t// aclarar al cliente que debe setear campos bien definidos y NO PERMITIR AMBIGUEDADES\n\t\n\t$query = \"select actor.nombre, actor.apellido, actor.id_partido, actor.id_campo, count(noticiasactor.id_actor) as cantidad from noticiascliente \"\n\t\t. \"inner join noticiasactor on noticiascliente.id_noticia = noticiasactor.id_noticia \"\n\t\t. \"inner join noticias on noticiasactor.id_noticia = noticias.id \"\n\t\t. \"inner join actor on noticiasactor.id_actor = actor.id \"\n\t\t. \"where \"\n\t\t\t. \"noticiascliente.id_cliente = \" . $ua . \" and \"\n\t\t\t. \"noticiascliente.elim = 0 and \"\n\t\t\t. \"noticias.fecha between '\" . $desde . \" 00:00:01' and '\" . $hasta . \" 23:59:59' \"\n\t\t\t// SOLO QUIENES TIENEN 3 Y 4 COMO CAMPO\n\t\t\t// . \" and ( actor.id_campo like '%3%' or actor.id_campo like '%4%' ) \"\n\t\t. \"group by noticiasactor.id_actor order by cantidad desc\";\n\t//echo $query;\n\t$main = R::getAll($query);\n\t$ua_nombre = R::findOne(\"cliente\",\"id LIKE ?\",[$ua])['nombre'];\n\n\t//var_dump($main);\n\t$tabla = [];\n\t// unidad de analisis, actor, partido, cantidad de menciones\n\t$i = -1;\n\t$partidos = [];\n\t\n\t$children_partidos = [];\n\t$i_actor = 0;\n\tforeach($main as $k=>$v){\n\t\t// obtengo el/los partidos\n\t\t$partidos_array = json_decode( $v['id_partido'], true);\n\t\tif( ! is_array($partidos_array) ) continue;\n\t\t\n\t\tforeach($partidos_array as $p){\n\t\t\t$partido_nombre = R::findOne('attr_partido','id LIKE ?',[$p])['nombre'];\n\t\t\t$tabla[ ++$i ] = [\n\t\t\t\t'ua' => $ua_nombre,\n\t\t\t\t'actor' => $v['nombre'] . ' ' . $v['apellido'],\n\t\t\t\t'partido' => $partido_nombre,\n\t\t\t\t'cantidad' => $v['cantidad']\n\t\t\t\t];\n\t\t\t\t// agrego el partido y el grafico\n\t\t\t\tif(! in_array($partido_nombre,$partidos)){\n\t\t\t\t\t$partidos[] = $partido_nombre;\n\t\t\t\t\t$x = new StdClass(); // objeto vacio\n\t\t\t\t\t$x->name = $partido_nombre;\n\t\t\t\t\t$x->rank = 0;\n\t\t\t\t\t$x->weight = count($partidos); //'Yellow'; cargar desde JS\n\t\t\t\t\t$x->id = 1;\n\t\t\t\t\t$x->children = [];\n\t\t\t\t\t$children_partidos[] = $x;\n\t\t\t\t}\n\t\t\t\t// obtengo el indice del partido y lo inserto\n\t\t\t\t$index = array_search($partido_nombre,$partidos);\n\t\t\t\t$t = new StdClass(); // objeto vacio\n\t\t\t\t$t->name = $v['nombre'] . ' ' . $v['apellido'] . \" (\" . $v['cantidad'] . \")\";\n\t\t\t\t$t->rank = $v['cantidad'];\n\t\t\t\t$t->weight = $i_actor; //'Yellow'; cargar desde JS\n\t\t\t\t$t->id = 1;\n\t\t\t\t$t->children = [];\n\t\t\t\t// lo agrego al padre correspondiente\n\t\t\t\t$children_partidos[ $index ]->children[] = $t;\n\t\t\t\t$children_partidos[ $index ]->rank += 1;\n\t\t\t}\n\t\t\t++$i_actor;\n\t}\n\t// grafico\n\t/*$oficialismo = new StdClass(); // objeto vacio\n\t$oficialismo->name = 'Oficialismo';\n\t$oficialismo->rank = 0;\n\t$oficialismo->weight = 'Yellow';\n\t$oficialismo->id = 1;\n\t$oficialismo->children = [];*/\n\t\n\t// creo los objetos partidos\n\t\n\t/*foreach($partidos as $p){\n\t\t$x = new StdClass(); // objeto vacio\n\t\t$x->name = $p;\n\t\t$x->rank = 0;\n\t\t$x->weight = 0; //'Yellow'; cargar desde JS\n\t\t$x->id = 1;\n\t\t$x->children = [];\n\t}*/\n\t\n\t$objeto = new StdClass(); // objeto vacio\n\t$objeto->name = 'Partidos';\n\t$objeto->rank = 0;\n\t$objeto->weight = 'Gray';\n\t$objeto->id = 1;\n\t$objeto->children = $children_partidos;\n\t\n\t\n\t/*foreach($tabla as $v){\n\t\t$sub = new StdClass(); // objeto vacio\n\t\t$sub->name = $v['actor'] . ' (' . $v['cantidad'] . ')';\n\t\t$sub->rank = $v['cantidad'];\n\t\t// $sub->weight = 0;\n\t\t$sub->cantidad = $v['cantidad'];\n\t\t$sub->id = 1;\n\t\t$sub->children = [ ];\n\t\tif($v['campo'] == 'oposicion'){\n\t\t\t$i_op += 1;\n\t\t\t$sub->weight = 'Blue';\n\t\t\t$oposicion->children[] = $sub;\n\t\t}\n\t\telse{ \n\t\t\t$i_of += 1;\n\t\t\t$sub->weight = 'White';\n\t\t\t$oficialismo->children[] = $sub;\n\t\t}\n\t}*/\n\t\n\t\n\treturn [\n\t\t'tabla' => $tabla,\n\t\t'grafico' => $objeto\n\t\t// ,'temas' => $temas\n\t\t];\n}", "public function empresariais()\n { \n $metaTags = [\n 'title' => 'Displan Saúde - Planos empresariais',\n 'description' => 'Displan Seguros. Planos diferenciados para empresas, profissionais e individuais.',\n 'keywords' => 'Displan, Seguros, Preços'\n ];\n \n $dados = [\n 'operadoras' => $this->operadoras->getByCategory('empresariais'),\n 'categorias' => $this->categorias->all(),\n 'metaTags' => $metaTags,\n 'breadcrumb' => [\n ['title' => 'Home', 'url' => '/', 'class' => ''],\n ['title' => 'Planos empresariais', 'url' => 'planos-empresariais/', 'class' => 'active']\n \n ]\n ];\n\n $this->load->view('inc/header', $dados);\n $this->load->view('planos/empresariais', $dados);\n $this->load->view('inc/footer'); \n }", "function slideProjeto($categoria, $pasta, $quantidadeFotos){\n\t\t$qtd = $quantidadeFotos;\n\t\t\n\t\tfor($i = 1; $i <= $qtd; $i++): ?>\n\t\t\t<li><img src=\"imagens/fotos/<?=$categoria?>/<?=$pasta?>/<?=$i?>.jpg\"/></li>\n\t\t<?php endfor;\n\t}", "function preparatoriasBYInstitucionTiposEstudios_get(){\n $id=$this->get('id');\n if (count($this->get())>2) {\n $response = array(\n \"status\" => \"error\",\n \"status_code\" => 409,\n \"message\" => \"Demasiados datos enviados\",\n \"validations\" =>array(\n \"id\"=>\"Envia Id (get) para obtener un especifico articulo o vacio para obtener todos los articulos\"\n ),\n \"data\"=>null\n );\n }else{\n if ($id) {\n $data = $this->DAO->selectEntity('Vw_tipoEstudio',array('idInstitucion'=>$id),false);\n }\n else{\n $data = $this->DAO->selectEntity('Vw_tipoEstudio',null,false);\n }\n if ($data) {\n $response = array(\n \"status\" => \"success\",\n \"status_code\" => 201,\n \"message\" => \"Articulo Cargado correctamente\",\n \"validations\" =>null,\n \"data\"=>$data\n );\n }else{\n $response = array(\n \"status\" => \"error\",\n \"status_code\" => 409,\n \"message\" => \"No se recibio datos\",\n \"validations\" =>null,\n \"data\"=>null\n );\n }\n }\n $this->response($response,200);\n }", "public function listar()\n {\n $lin_pedidos_model = new Lineas_pedidos_Model();\n session_start();\n //Le pedimos al modelo todos los Piezas\n $lin_pedidos = $lin_pedidos_model->readAll();\n\n //Pasamos a la vista toda la información que se desea representar\n if (isset($_SESSION['cliente'])) {\n $usuario[\"cliente\"] = $_SESSION['cliente'];\n }\n $variables = array();\n $usuario[\"usuario\"] = $_SESSION[\"usuario\"];\n $variables['articulos'] = $lin_pedidos;\n\n //Finalmente presentamos nuestra plantilla\n $this->view->show(\"cabecera.php\");\n $this->view->show(\"plantilla_header.php\", $usuario);\n $this->view->show(RUTA_VISTAS . \"listar_header.php\");\n $this->view->show(RUTA_VISTAS . \"listar.php\", $variables);\n $this->view->show(\"plantilla_pie.php\");\n $this->view->show(\"pie.php\", $usuario);\n }", "public function articles_get(){\r\n if($this->dx_auth->is_logged_in())\r\n $__uri = $this->get(\"m_uri\");\r\n else\r\n $__uri=array(\"id\"=>0);\r\n\r\n // $art[\"domain\"] = $__uri[\"domain\"];\r\n $art[\"art\"] = $this->articles(\"\",\"\",$__uri[\"id\"]);\r\n\r\n foreach ($art[\"art\"] as $key => &$value) {\r\n $img=explode(\",\",$value[\"name\"]);\r\n $value[\"name\"]=site_url('application/assets/application/img/post/post_'.$__uri[\"id\"].'/'.$img[0]);\r\n $value[\"description\"]=strip_tags(html_entity_decode($value[\"description\"]),\"<p>\");\r\n $value[\"description\"]=substr(strip_tags(html_entity_decode($value[\"description\"])),0,150).(strlen(html_entity_decode($value[\"description\"]))>150?\"....\":\"\");\r\n //$value[\"video\"]=($value[\"video\"] ? html_entity_decode($value[\"video\"]) : \"\");\r\n // $value[\"url_title\"]=site_url($__uri[\"domain\"].\"/\".urls_amigables($value['category']).\"/$value[id]/\".urls_amigables($value['title']));\r\n //$value[\"url_cat\"]=site_url($__uri[\"domain\"].\"/\".urls_amigables($value['category']));\r\n \r\n }\r\n\r\n if(count($art[\"art\"])==0)\r\n $art=\"\";\r\n \r\n $_res = format_response($art,'success','ok',false);\r\n $this->response($_res,200); \r\n\r\n }", "function buscar_recomendado2($localidad){\n\t\t$sql=\"SELECT * FROM producto, imagen WHERE galeria_image=id_pro AND tabla_image='producto' AND disponible_pro='1' AND categoria_pro!='10' AND \n\t\t\t(nombre_pro LIKE '%' '\".$localidad.\"' '%' OR \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\tdescripcion_pro LIKE '%' '\".$localidad.\"' '%') GROUP BY id_pro ORDER BY RAND() LIMIT 0,5\";\n\t\t//echo $sql;\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=\"si\";\n\t\t\t\t//calculando el URL\n\t\t\t\tsetlocale(LC_ALL, 'es_ES');\n\t\t\t\t//$resultado['nombre_pro']=ucwords(strtolower($resultado['nombre_pro']));\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat' GROUP BY id_cat\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\t\n\t\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\t\n\t\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\t\tif($i<=12) $resultado['limite_pro'][]=$i; else break;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$resultado['detal_pro']=$this->mostrar_precio($resultado['detal_pro']);\n\t\t\t\t$this->listado[] = $resultado;\n\t\t }\n\t}", "public function titre()\n{\n\n $db = $this->_db;\n $requete = $db->prepare('SELECT titre FROM musiques');\n $requete->execute();\n $resultat = $requete->fetchall();\n\n foreach($resultat as $titre)\n {\n echo $titre['titre'];\n }\n\n}", "function mostrar_producto(){\n\t\tif (isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$sql=\"SELECT * FROM producto WHERE id_pro='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t$resultado = mysql_fetch_array($consulta);\n\t\t\t$this->id=$id;\n\t\t\t$this->codigo=$resultado['codigo_pro'];\n\t\t\tsetlocale(LC_ALL, 'es_ES');\n\t\t\t//$this->nombre=ucwords(strtolower($resultado['nombre_pro']));\n\t\t\t$this->nombre=$resultado['nombre_pro'];\n\t\t\t$this->principal=$resultado['principal_pro'];\n\t\t\t$this->suiche=false;\n\t\t\t$this->ruta=\"\"; $this->categoria=\"\";\n\t\t\t$this->buscar_ruta_nodo($resultado['categoria_pro']);\n\t\t\tfor($i=count($this->ruta)-1;$i>=0;$i--){\n\t\t\t\t$this->categoria.=\" &raquo; \".$this->ruta[$i]['nombre_cat'];\n\t\t\t}\n\t\t\t\n\t\t\t$this->id_cat=$resultado['categoria_pro'];\n\t\t\t$this->prioridad=$resultado['prioridad_pro'];\n\t\t\t$this->vistas=$resultado['vistas_pro'];\n\t\t\t$this->hotel=$resultado['hotel_pro'];\n\t\t\t$this->detal=$this->convertir_moneda($resultado['detal_pro']);\n\t\t\t$this->mayor=$this->convertir_moneda($resultado['mayor_pro']);\n\t\t\t\n\t\t\t$this->cantidad=$resultado['limite_pro'];\n\t\t\t$this->fecha=$this->convertir_fecha($resultado['fecha_pro']);\n\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t$this->limite2=$temp=10;\n\t\t\t//echo \"Numero: \".$temp;\n\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\tif($i<=12) $this->limite[]=$i; else break;\n\t\t\t}\n\t\t\t$this->descripcion=$resultado['descripcion_pro'];\n\t\t\t$this->claves=$resultado['claves_pro'];\n\t\t\t$this->marca=$resultado['marca_pro'];\n\t\t\n\t\t} \n\t}", "function mostrarTotsProductes(){\n $conn=connexioBD();\n $products=\"\";\n $sql=\"SELECT * FROM productes\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n if($resultado->num_rows>=0){\n while($productes=$resultado->fetch_assoc()){\n $idProducte=$productes[\"id\"];\n $imatges=mostrarImatgesPublica($idProducte);\n $categoria=getCategoria($idProducte);\n $products.=\"ID: \".$productes[\"id\"].\" Nom: \".$productes[\"nom\"].\" Descripcio: \".$productes[\"descripcio\"].\" Preu: \".$productes[\"preu\"].\" Categories: \".$categoria.\"<br>\".$imatges.\"<br>\".\"<br>\";\n }\n }\n return $products;\n $resultado->free();\n $conn->close();\n}", "function afficher_derniers_articles(){\n\t\tglobal $logger;\n\t\tif($logger){// si connecté, affiche article public et privé\n\t\t\t$requete = 'SELECT * FROM articles ORDER BY date DESC';\n\t\t}else{// sinon que public\n\t\t\t$requete = 'SELECT * FROM articles WHERE statut=\"0\" ORDER BY date DESC';\n\t\t}\n\t\t$donnees = connexion( $requete);\n\t\t$res = \"\";\n\t\t\n\t\tif(mysql_num_rows($donnees) < 1){\n\t\t\treturn \"<div>Aucun article récent trouvé</div>\";\n\t\t}else{\n\t\t\tfor($i =1; $i <= 4; $i++){\n\t\t\t\tif($ligne = mysql_fetch_assoc($donnees)){\n\t\t\t\t\t$res .= \"<article>\n\t\t\t\t\t\t\t\t<a href='index.php?where=article&amp;id={$ligne['id']}'><header>{$ligne['titre']}</header></a>\n\t\t\t\t\t\t\t\t<div class='article_auteur'>\n\t\t\t\t\t\t\t\t\t<img src='ressources/auteur.png' title='Auteur' alt='Auteur'>\n\t\t\t\t\t\t\t\t\tAuteur: <a href='index.php?where=profil&amp;id={$ligne['auteur']}'>\";\n\t\t\t\t\t$res .= \t\tnom_auteur($ligne[\"auteur\"]);\t\n\t\t\t\t\t$res .= \t'</a></div>\n\t\t\t\t\t\t\t<div class=\"article_date\">Le '.conversion_date($ligne['date']).'</div>\n\t\t\t\t\t\t\t<p>'.taille_description($ligne['text'], $ligne['id']).'</p>';\n\t\t\t\t\t$res .= \tarticle_statut($ligne['statut']);\n\t\t\t\t\t$res .= \"</article>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}", "public function getArtikel(){\n $top = Informasi::select(\"*\")->orderBy(\"created_at\", \"desc\")->take(1)->get();\n $artikels = Informasi::select(\"*\")->orderBy(\"created_at\", \"desc\")->skip(1)->take(2)->get();\n return view('welcome', ['top'=>$top], ['artikels'=>$artikels]);\n }", "function imagenes_disponibles_tipos($id_palabra,$with_pictcolor,$with_pictnegro,$with_imagenes,$with_cliparts) {\n\t\t\t\n\t\t$query = \"SELECT palabras.*, tipos_palabra.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename,\n\t\tpalabra_imagen.*\n\t\tFROM palabras, tipos_palabra, imagenes, palabra_imagen\n\t\tWHERE palabras.id_palabra = '$id_palabra'\n\t\tAND palabra_imagen.id_palabra = '$id_palabra'\n\t\tAND palabra_imagen.id_imagen = imagenes.id_imagen\n\t\tAND tipos_palabra.id_tipo_palabra=palabras.id_tipo_palabra\n\t\t$with_pictcolor\n\t\t$with_pictnegro\n\t\t$with_imagenes\n\t\t$with_cliparts\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\tmysql_close($connection);\n\t\treturn $result;\n\t}", "function graficos(){\n $professores = DB::table('professor')->get()->sortBy(\"nome\");\n //Pega os dados da disciplina no banco\n $disciplinas = DB::table('disciplina')->get()->sortBy(\"descricao\");\n\n //array professor disciplina\n $professor_disciplina = array();\n //String que vai receber os dados do grafico 1\n $string_grafico1 = \"\";\n\n //For rodando os dados de forma a pegar os dados dos professores do banco e contar quantas materias eles dão aula\n foreach($professores as $professor){\n $id = $professor->id;\n $nome = $professor->nome;\n //Comando para verificar atravez do id do professor, quantas materias eles dão aula\n $qtd_disciplina = Professor_Disciplina::Where('professor_id', $id)->count();\n\n //Comando para Adiciona os elementos no final do array\n array_push($professor_disciplina, $qtd_disciplina, $nome);\n\n //String recebe os dados formando json para o grafico\n $string_grafico1 .= \"{ 'professor' : '\" . $nome . \"', 'qtd' : \". $qtd_disciplina . \"}, \";\n \n }\n\n //array disciplina professor\n $disciplina_professor = array();\n //String que vai receber os dados do grafico 2\n $string_grafico2 = \"\";\n\n\n //For rodando os dados de forma a pegar os dados das disciplinas do banco e contar quantos professores ministram aquela disciplina\n foreach($disciplinas as $disciplina)\n {\n $id = $disciplina->id;\n $descricao = $disciplina->descricao;\n //Comando para verificar atravez do id da disciplina, quantos professores que ministram a disciplina\n $qtd_professor = Professor_Disciplina::Where('disciplina_id', $id)->count();\n //Comando para Adiciona os elementos no final do array\n array_push($disciplina_professor, $qtd_professor, $descricao);\n\n //String recebe os dados formando json para o grafico\n $string_grafico2 .=\"{ 'disciplina' : '\" . $descricao . \"', 'qtd' : \". $qtd_professor . \"}, \";\n }\n\n //retorna para view grafico, os dados de professores para grafico 1 e disciplinas para grafico 2\n return view('layouts.grafico', array('grafico2' => $string_grafico2), array('grafico' => $string_grafico1));\n }", "public function buscarArticulosSEA() {\n $rawData = array();\n $obj_con = new cls_Base();\n $conApp = $obj_con->conexionServidor();\n $sql = \"SELECT COD_ART,DES_COM,COD_LIN,COD_TIP,COD_MAR,EXI_TOT,PAUX_03,P_PROME,P_COSTO \"\n . \" FROM \" . $obj_con->BdServidor . \".IG0020 WHERE EST_LOG=1 AND EXI_TOT>0 \";\n $sentencia = $conApp->query($sql);\n //return $sentencia->fetch_assoc();\n if ($sentencia->num_rows > 0) {\n while ($fila = $sentencia->fetch_assoc()) {//Array Asociativo\n $rawData[] = $fila;\n }\n }\n return $rawData;\n }", "public function filtrar()\n {\n $Articulos_model = new Articulos_Model();\n session_start();\n\n $campo = (isset($_REQUEST['campo'])) ? $_REQUEST['campo'] : \"cod_articulo\";\n $filtro = (isset($_REQUEST['filtro'])) ? $_REQUEST['filtro'] : \"contiene\";\n $texto = (isset($_REQUEST['texto'])) ? $_REQUEST['texto'] : \"%\";\n\n //Le pedimos al modelo todos los Piezas\n $articulos = $Articulos_model->filterBy($campo, $filtro, $texto);\n\n if (isset($_SESSION['cliente'])) {\n $usuario[\"cliente\"] = $_SESSION['cliente'];\n }\n //Pasamos a la vista toda la información que se desea representar\n $varVistaFormFiltrar = [\"campo\" => $campo, \"filtro\" => $filtro, \"texto\" => $texto];\n $varVistaListar['articulos'] = $articulos;\n $usuario[\"usuario\"] = $_SESSION[\"usuario\"];\n //Finalmente presentamos nuestra plantilla\n $this->view->show(\"cabecera.php\");\n $this->view->show(\"plantilla_header.php\", $usuario);\n $this->view->show(RUTA_VISTAS . \"listar_header.php\");\n $this->view->show(RUTA_VISTAS . \"form_filtrar.php\", $varVistaFormFiltrar);\n $this->view->show(RUTA_VISTAS . \"listar.php\", $varVistaListar);\n $this->view->show(\"plantilla_pie.php\");\n $this->view->show(\"pie.php\", $usuario);\n }", "function listar_producto_categoria($lim){\n\t\t$sql=\"SELECT * FROM producto, imagen WHERE galeria_image=id_pro AND tabla_image='producto' AND categoria_pro='4' GROUP BY id_pro DESC ORDER BY categoria_pro DESC, prioridad_pro ASC LIMIT 0 , $lim\";\n\t\t\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$resultado['fecha_pro']=$this->convertir_fecha($resultado['fecha_pro']);\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "public function run()\n {\n DB::table('imagenes')->delete();\n \n Imagen::create([\n 'ruta' => 'https://i.gyazo.com/0c290535ad676a5ad5cc151b0b6f1871.png',\n 'objeto_id' => 1\n ]);\n Imagen::create([\n 'ruta' => 'https://i.gyazo.com/fc1f149de3e1b5f7b970919711a7cf5c.png',\n 'objeto_id' => 2\n ]);\n Imagen::create([\n 'ruta' => 'https://i.gyazo.com/1d2b05716e62c021b68a0f1466beb95a.jpg',\n 'objeto_id' => 3\n ]);\n Imagen::create([\n 'ruta' => 'https://i.gyazo.com/82528563d24646fee6660c0f45a627b1.png',\n 'objeto_id' => 4\n ]);\n Imagen::create([\n 'ruta' => 'https://i.gyazo.com/792a0bd97846eb35fca737edc7348707.png',\n 'objeto_id' => 5\n ]);\n Imagen::create([\n 'ruta' => 'https://i.gyazo.com/b7738557392b62abbd78221b75371f9a.png',\n 'objeto_id' => 6\n ]);\n Imagen::create([\n 'ruta' => 'https://i.gyazo.com/8ace2dbbf91208b5234fa99ae0b1ae71.png',\n 'objeto_id' => 7\n ]);\n Imagen::create([\n 'ruta' => 'https://i.gyazo.com/0c290535ad676a5ad5cc151b0b6f1871.png',\n 'objeto_id' => 8\n ]);\n Imagen::create([\n 'ruta' => 'https://i.gyazo.com/8ace2dbbf91208b5234fa99ae0b1ae71.png',\n 'objeto_id' => 9\n ]);\n }", "public function mostrarTeatros(){\n /**\n * @var object $objTeatro\n * @var array $colTeatro\n * @var string $strTeatros\n */\n $objTeatro = new Teatro();\n $colTeatro = $objTeatro->listar();\n $strTeatros = \"Teatros: \\n\";\n foreach($colTeatro as $teatro){\n $strTeatros.=\"* \\n\".$teatro;\n }\n return $strTeatros;\n }", "function Cordiant()\n{\n global $con;\n $get_pro = \"SELECT g.id_guma , g.id_marka, g.slika, g.cena, g.sirina, g.visina, g.opterecenje, g.precnik, g.indeks_brzine, id_sezona, m.marka from gume g \n JOIN marka m ON g.id_marka = m.id_marka WHERE g.id_marka=2\";\n\n $run_pro = mysqli_query($con, $get_pro);\n\n while ($row_pro = mysqli_fetch_array($run_pro)) {\n $id_guma = $row_pro ['id_guma'];\n $tire_brand = $row_pro ['marka'];\n $product_image = $row_pro ['slika'];\n $cena = $row_pro ['cena'];\n $sirina= $row_pro ['sirina'];\n $visina = $row_pro ['visina'];\n $opterecenje = $row_pro ['opterecenje'];\n $precnik = $row_pro ['precnik'];\n $indeks_brzine = $row_pro ['indeks_brzine'];\n $tire_season = $row_pro ['id_sezona'];\n\n\n\n\n echo \"\n <div class='col-xs-12 col-sm-4 col-md-4 products mr-0' style='padding: 60px;height:400px;border: 1px solid lightgrey'><br /><span> \n <img src='http://localhost/ProdajaGuma/product_images/$product_image' class='img-responsive'/></span> \n <h2 class='top-left' style='background-color: aqua;color:white;position: absolute;top:20px;left: 0px;width: 150px;font-size: 15px'>&nbsp SEZONA &nbsp<span style='color:blue'>\n <img src='http://localhost/ProdajaGuma/ikonice/snow.ico' width='35px' ></span></span></h2><br /><br /><span></span> \n <div style='background-color: white;position: relative;top: -130px'><hr style='border: 1px solid orange'></span><span>$tire_brand $visina/$sirina $precnik $tire_season $opterecenje $indeks_brzine</span><br /><br /><span style='color: #428bca'>Cena: $cena</span><br/>\n <span><br /><a href='details.php?id_guma=$id_guma'><button class='btn btn-primary btn-responsive' style='background-color:green;margin: auto;display: block; width: 150px;height: 40px; color: white;'>Detaljnije...</button></a>\n </span></div></div>\n \";\n\n }\n\n\n}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n // $resultat = $em->getRepository('MonBundle:Musicien')->findBy([], [], 10);\n $query = $em->createQuery( //creation de la requête\n \"SELECT m\n FROM MonBundle:Musicien m\n INNER JOIN MonBundle:Composer c WITH m = c.codeMusicien\n ORDER BY m.nomMusicien ASC\n \");\n $resultat = $query->getResult(); //variable qui récupère la requête\n\n return $this->render('MonBundle:musicien:index.html.twig', array(\n 'musiciens' => $resultat,\n ));\n }", "static function afficherArticles() \r\n {\r\n // TOUJOURS LA DATABASE blog\r\n // CREER UNE TABLE SQL article\r\n // COMME COLONNES\r\n // id INT INDEX=primary A_I (AUTO_INCREMENT)\r\n // titre VARCHAR(160)\r\n // image VARCHAR(160)\r\n // contenu TEXT\r\n // datePublication DATETIME\r\n // ... \r\n // ET AJOUTER QUELQUES LIGNES POUR LES ARTICLES... \r\n\r\n // AJOUTER LE CODE PHP\r\n // RECUPERER LA LISTE DES ARTICLES\r\n // CREER LE CODE HTML POUR CHAQUE ARTICLE\r\n // REQUETE SQL:\r\n // SELECT * FROM `article`\r\n $tabLigne = lireTable(\"article\", \"datePublication DESC\");\r\n\r\n // QUAND ON A UN TABLEAU ET ON VEUT TOUS LES ELEMENTS\r\n // => ON FAIT UNE BOUCLE\r\n foreach($tabLigne as $ligneAsso)\r\n {\r\n /*\r\n $titre = $ligneAsso[\"titre\"];\r\n $image = $ligneAsso[\"image\"];\r\n $contenu = $ligneAsso[\"contenu\"];\r\n $datePublication = $ligneAsso[\"datePublication\"];\r\n */\r\n // RACCOURCI SYMPA ;-p\r\n // https://www.php.net/manual/fr/function.extract.php\r\n // (ASTUCE: DONNER DES NOMS DE COLONNES SQL EN camelCase...)\r\n extract($ligneAsso);\r\n\r\n // ON CHANGE LE DOSSIER /upload/ EN /mini/ DANS LE CHEMIN\r\n $imageMini = str_replace(\"/upload/\", \"/mini/\", $image);\r\n\r\n // ON AFFICHE LE CODE HTML\r\n echo\r\n <<<codehtml\r\n \r\n <article>\r\n <h3><a href=\"article.php?id=$id\">$titre</a></h3>\r\n <img src=\"$imageMini\" alt=\"article1\">\r\n <p>$contenu</p>\r\n <p>publié le $datePublication</p>\r\n </article>\r\n\r\n codehtml;\r\n }\r\n }", "public function getDemonstrativos();", "public function obtener_colectivo();", "public function showAction(Musicien $musicien)\n {\n\n //Pour les $oeuvres\n $em = $this->getDoctrine()->getManager();\n\n\n $qbd = $em->createQueryBuilder('a');\n $qbd->select('a')\n ->from('MonBundle:Album', 'a')\n ->innerJoin('MonBundle:Disque', 'd', 'WITH', 'd.codeAlbum = a.codeAlbum')\n ->innerJoin('MonBundle:CompositionDisque', 'cd', 'WITH', 'cd.codeDisque = d.codeDisque')\n ->innerJoin('MonBundle:Enregistrement', 'e', 'WITH', 'e.codeMorceau = cd.codeMorceau')\n ->innerJoin('MonBundle:CompositionOeuvre', 'co', 'WITH', 'co.codeComposition = e.codeComposition')\n ->innerJoin('MonBundle:Composer', 'c', 'WITH', 'c.codeOeuvre = co.codeOeuvre')\n ->where('c.codeMusicien = :codeM' )\n ->setParameter('codeM',$musicien->getCodeMusicien())\n ->add('orderBy', 'a.titreAlbum ASC');\n $albums = $qbd->getQuery()->getResult();\n\n\n\n return $this->render('MonBundle:musicien:show.html.twig', array(\n 'musicien' => $musicien,\n 'oeuvres' => $albums,\n ));\n }", "public function tratarDados(){\r\n\t\r\n\t\r\n }", "private function getPrecosPorClientes($produtos)\n {\n\n $menus = [];\n $cursos = [];\n $precosCurso = [];\n $precosMenus = [];\n\n foreach ($produtos as $produto) {\n if ($produto->produto_tipo == BuscaConstants::BUSCA_TIPO_MENU) {\n $menus[] = $produto->produto_id;\n } else {\n $cursos[] = $produto->produto_id;\n }\n }\n\n if (count($menus) > 0) {\n $precosMenus = Query::fetch('Busca/QryBuscarPrecosMenus', ['id_menu' => $menus]);\n }\n\n if (count($cursos) > 0) {\n $precosCurso = Query::fetch('Busca/QryBuscarPrecosCursos', ['id_curso' => $cursos]);\n }\n\n $agrupadoPorIdMenu = [];\n $agrupadoPorIdCurso = [];\n\n foreach ($precosMenus as $precoMenu) {\n $agrupadoPorIdMenu[$precoMenu->id_menu][$precoMenu->qtd_minima_clientes] = $precoMenu->preco;\n }\n\n foreach ($precosCurso as $precoCurso) {\n $agrupadoPorIdCurso[$precoCurso->id_curso][$precoCurso->qtd_minima_clientes] = $precoCurso->preco;\n }\n\n foreach ($produtos as &$produto) {\n $preco = $produto->produto_preco;\n $precosFinais = [];\n $agrupadorLoop = null;\n $counter = 0;\n $ultimoQtdPessoas = 1;\n\n if ($produto->produto_tipo == BuscaConstants::BUSCA_TIPO_MENU && isset($agrupadoPorIdMenu[$produto->produto_id])) {\n $agrupadorLoop = $agrupadoPorIdMenu[$produto->produto_id];\n } else if ($produto->produto_tipo == BuscaConstants::BUSCA_TIPO_CURSO && isset($agrupadoPorIdCurso[$produto->produto_id])) {\n $agrupadorLoop = $agrupadoPorIdCurso[$produto->produto_id];\n }\n\n if (is_null($agrupadorLoop)) {\n continue;\n }\n\n foreach ($agrupadorLoop as $qtdPessoas => $valor) {\n $counter++;\n if ($qtdPessoas == 1) continue;\n $descricao = \"$ultimoQtdPessoas a \" . ($qtdPessoas - 1);\n\n if ($ultimoQtdPessoas == ($qtdPessoas - 1)) {\n $descricao = $ultimoQtdPessoas;\n }\n\n if ($counter == count($agrupadorLoop)) {\n if (empty($precosFinais)) {\n $precosFinais[] = ['preco' => $preco, 'qtd' => $descricao];\n } else {\n $precosFinais[] = ['preco' => $valor, 'qtd' => $descricao];\n }\n\n $precosFinais[] = ['preco' => $valor, 'qtd' => \"$qtdPessoas+\"];\n } else {\n $precosFinais[] = ['preco' => empty($precosFinais) ? $preco : $valor, 'qtd' => $descricao];\n }\n\n $ultimoQtdPessoas = $qtdPessoas;\n }\n\n $produto->precos = $precosFinais;\n\n }\n\n return $produtos;\n\n }", "function medicament($med){\n $don = json_decode($med);\n\n $this->SetFont('Arial','',15);\n $this->Cell(0,6,\"Tableau de consomation des medicaments \");\n $this->Ln();\n $this->SetFont('Times','B',12);\n $this->Cell(140,5,'Medicaments',1);\n $this->Cell(20,5,'Type',1,0,'C',0);\n $this->Cell(27,5,'Quantites',1,0,'C',0);\n $this->Ln(); \n\n $this->SetFont('Times','',12);\n foreach($don as $v){\n $this->Cell(140,5,utf8_decode($v->nom),1);\n $this->Cell(20,5,utf8_decode($v->types),1,0,'C',0);\n $this->Cell(27,5,$v->quantite,1,0,'C',0);\n $this->Ln(); \n }\n $this->Ln(); \n\n }", "public function recupereDonnees (){\n\t\t$req = $this->bdd->prepare('SELECT gratuit, image, invisibleAuteur, idModerateur, moderation, affiche , titre, idAuteur, idCategorie, corps, DATE_FORMAT(date_creation, \\'%d/%m/%Y à %Hh%i\\') AS date_creation_fr FROM `Article` WHERE id = ?');\n\t\t$req->execute(array($this->id));\n\t\t$donnees = $req->fetch();\n\t\t$req->closeCursor(); \n\n\t\t$this->titre = $donnees['titre'];\n\t\t$this->idAuteur = $donnees['idAuteur'];\n\t\t$this->idModerateur = $donnees['idModerateur'];\n\t\t$this->idCategorie = $donnees['idCategorie'];\n\t\t$this->corps = $donnees['corps'];\n\t\t$this->extrait = $this->creationExtrait($this->corps,15); // Fixé arbitrairement à 15 mots dans l'extrait pour le moment.\n\t\t$this->extraitLong = $this->creationExtrait($this->corps,35); // Fixé arbitrairement à 35 mots dans l'extrait pour le moment.\n\n\t\t$this->image = $donnees['image'];\n\t\t/*\n\t\tif (isset($donnees['image'])) {\n\t\t\t$this->image = $donnees['image'];\n\t\t}else{\n\t\t\t$this->image = \"default.jpg\";\n\t\t}\n\t\t*/\n\n\t\t$this->date_creation_fr = $donnees['date_creation_fr'];\n\t\tif ($donnees['moderation'] == 0){\n\t\t\t$this->moderation = false;\n\t\t} else {\n\t\t\t$this->moderation = true;\n\t\t}\n\n\t\tif ($donnees['affiche'] == 0){\n\t\t\t$this->affiche = false;\n\t\t} else {\n\t\t\t$this->affiche = true;\n\t\t}\n\t\tif ($donnees['invisibleAuteur'] == 0){\n\t\t\t//echo \"false\";\n\t\t\t$this->invisibleAuteur = false;\n\t\t} else {\n\t\t\t//echo \"true\";\n\t\t\t$this->invisibleAuteur = true;\n\t\t}\n\t\tif ($donnees['gratuit'] == 0){\n\t\t\t$this->gratuit = false;\n\t\t} else {\n\t\t\t$this->gratuit = true;\n\t\t}\n\n\t\t// Recuperer le nombre de commentaire liés à cet article\n\t\t$req = $this->bdd->prepare('SELECT COUNT(id) FROM `Commentaire` WHERE idArticle = ? AND affiche = ?');\n\t\t$req->execute(array($this->id, \"1\"));\n\t\t$donnees = $req->fetch();\n\t\t$req->closeCursor();\n\t\t$this->nbCommentaire = $donnees[0];\n\t}", "public function historico()\n {\n $pasientes = (new \\App\\Models\\Pasientes())->getAll(['pasientes.*, null AS ciudad']);\n\n # Busqueda de ciuidad\n foreach ($pasientes as $key => $pasiente){\n $ciudad = (new Ciudades())->getById($pasiente['id_ciudad']);\n $pasientes[$key]['ciudad'] = $ciudad['ciudad'];\n }\n\n View::set('pasientes', $pasientes);\n echo View::render('pasientes');\n }", "function RellenarIndice()\r\n {\r\n $this->AddPage();\r\n\r\n $this->Imprimir('2. Revisión y Análisis de las siguientes interrupciones:', 20, 10);\r\n\r\n $cont_causa500 = 1;\r\n $cont_imp = 1;\r\n $cont_pro = 1;\r\n\r\n foreach ($this->eventos as $evento)\r\n {\r\n if (Doctrine_Core::getTable('SAF_EVENTO_CONVOCATORIA')->getEventoConvocatoria($evento, $this->convocatoria)->getStatus() == 'analizado')\r\n {\r\n $this->ImprimirSubtituloIndice($evento, $cont_causa500, $cont_imp, $cont_pro);\r\n\r\n $fecha_evento = strftime(\"%A, %d/%m/%Y\", strtotime($evento->getFHoraIni()));\r\n $text = \"RI. \" . $evento->getCEventoD() . \" - Circuito \" . $evento->getCircuito() . \". \" . $fecha_evento . '. MVAmin: ' . $evento->getMvaMin();\r\n $this->Imprimir($text, 40, 10);\r\n }\r\n }\r\n }", "public function getProductos()\n\t{\n\t\t$productos = [];\n\t\t\n\t\tif($this->carro) {\n\t\t\t\n\t\t\t$productosCollection = Collect($this->carro->getCarro());\n\t\t\t$idDeProductos = [];\n\t\t\t$idYCantidad = [];\n\t\t\t//separamos los ids para luego consultarlos en la BBDD ademas realizamos otro arreglo en donde indexamos el id junto con la cantidad para luego cruzar los arreglos\n\t\t\t$productosCollection->map(function($item, $key) use(&$idDeProductos, &$idYCantidad){\n\t\t\t\tif($item['cantidad'] > 0) {\n\t\t\t\t\t$idDeProductos[] = $item['id'];\n\t\t\t\t\t$idYCantidad[] = ['id'=>$item['id'], 'cantidad'=>$item['cantidad']];\n\t\t\t\t\t\n\t\t\t\t}\t\t\n\t\t\t});\n\t\t\t//buscamos los productos en la BBDD en base a los id que estaban en el carro\n\t\t\t$productos = Producto::disponibles()->whereIn('id',$idDeProductos)->get();\n\t\t\t$productos = $productos->toArray();\n\t\t\t\n\t\t\t//cruzamos los array de cada producto que sacamos de la BBDD junto con la cantidad de cada producto que habia en el carro\n\t\t\t$iterador = 0;\n\t\t\tforeach ($productos as $producto) {\n\t\t\t\tforeach ($idYCantidad as $cantidad) { \n\t\t\t\t\tif($cantidad['id'] == $producto['id']) {\n\t\t\t\t\t\t$productos[$iterador]['cantidad'] = $cantidad['cantidad'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t++$iterador;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\treturn $productos;\n\t}", "function afficherIngredients($_idRecette){\n $connexion= my_connect();\n $requette_composant=\"SELECT Nomingredient,Quantitee,Unite FROM Compositions join Ingredients USING(Idingredient) JOIN Recettes USING(Idrecette) where Idrecette = $_idRecette \";\n $table_composant_resultat = mysqli_query($connexion,$requette_composant); \n if($table_composant_resultat){\n echo (\"Ingredients: <ul> \");\n while($ligne_composant=mysqli_fetch_object($table_composant_resultat)){\n if ($ligne_composant->Unite === \"unite\") {\n echo (\"<li>\".$ligne_composant->Quantitee.\" \".$ligne_composant->Nomingredient.\".</li>\");\n }\n else { \n echo (\"<li>\".$ligne_composant->Quantitee.\"<strong> \".$ligne_composant->Unite.\"</strong> de \".$ligne_composant->Nomingredient.\".</li>\");\n } \n }\n echo \"</ul>\";\n }else{\n echo \"<p>Erreur dans l'exécution de la requette</p>\";\n echo\"message de mysqli:\".mysqli_error($connexion);\n }\n mysqli_close($connexion);\n }", "public function articulos ($dia) {\n\t\t$this->load->model(\"Modgastosper\");\n\t\t$id_formulario = $this->session->userdata(\"id_formulario\");\n\t\t$id_persona = $this->session->userdata(\"id_persona\");\n\t\t$data = $this->Modgastosper->listadoArticulos($id_formulario, $id_persona, $dia);\n\t\techo json_encode($data);\n\t}", "function graficosProductosConsumo($anio) {\r\n\r\n\r\n\t$sql = \"select\r\n\t\t\t\r\n\t\t\t\tp.refcategorias, c.descripcion, coalesce(count(c.idcategoria),0)\r\n\t\t\r\n\t\t\t\t\tfrom dbventas v\r\n\t\t\t\t\tinner join tbtipopago tip ON tip.idtipopago = v.reftipopago\r\n\t\t\t\t\tinner join dbclientes cli ON cli.idcliente = v.refclientes\r\n\t\t\t\t\tinner join dbdetalleventas dv ON v.idventa = dv.refventas\r\n\t\t\t\t\tinner join dbproductos p ON p.idproducto = dv.refproductos\r\n\t\t\t\t\tinner join tbcategorias c ON c.idcategoria = p.refcategorias\r\n\t\t\t\t\twhere\tyear(v.fecha) = \".$anio.\" and c.esegreso = 0 and v.cancelado = 0\r\n\t\t\tgroup by p.refcategorias, c.descripcion\r\n\t\t\t\";\r\n\t\t\t\r\n\t$sqlT = \"select\r\n\t\t\t\r\n\t\t\t\tcoalesce(count(p.idproducto),0)\r\n\r\n\t\t\tfrom dbventas v\r\n\t\t\tinner join tbtipopago tip ON tip.idtipopago = v.reftipopago\r\n\t\t\tinner join dbclientes cli ON cli.idcliente = v.refclientes\r\n\t\t\tinner join dbdetalleventas dv ON v.idventa = dv.refventas\r\n\t\t\tinner join dbproductos p ON p.idproducto = dv.refproductos\r\n\t\t\tinner join tbcategorias c ON c.idcategoria = p.refcategorias\r\n\t\t\twhere\tyear(v.fecha) = \".$anio.\" and c.esegreso = 0 and v.cancelado = 0\";\r\n\t\t\t\r\n\t$sqlT2 = \"select\r\n\t\t\t\t\tcount(*)\r\n\t\t\t\tfrom dbproductos p\r\n\t\t\t\twhere p.activo = 1\r\n\t\t\t\";\r\n\r\n\t\r\n\t$resT = mysql_result($this->query($sqlT,0),0,0);\r\n\t$resR = $this->query($sql,0);\r\n\t\r\n\t$cad\t= \"Morris.Donut({\r\n element: 'graph2',\r\n data: [\";\r\n\t$cadValue = '';\r\n\tif ($resT > 0) {\r\n\t\twhile ($row = mysql_fetch_array($resR)) {\r\n\t\t\t$cadValue .= \"{value: \".((100 * $row[2])\t/ $resT).\", label: '\".$row[1].\"'},\";\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\t$cad .= substr($cadValue,0,strlen($cadValue)-1);\r\n $cad .= \"],\r\n formatter: function (x) { return x + '%'}\r\n }).on('click', function(i, row){\r\n console.log(i, row);\r\n });\";\r\n\t\t\t\r\n\treturn $cad;\r\n}", "function listar_producto_imagen($condicion){\n\t\tif (isset($_POST['buscar']))\n\t\t\t$_SESSION['buscar']=$_POST['buscar'];\n\t\t$cat=$_SESSION['categoria_actual'];\t\n\t\tif (isset($_SESSION['buscar']) && $_SESSION['buscar']!=\"\"){\t\n\t\t\t$this->buscar=$_SESSION['buscar'];\n\t\t\t$sql=\"SELECT * FROM producto, imagen WHERE \n\t\t\tcategoria_pro='$cat' AND galeria_image=id_pro AND tabla_image='Producto' AND disponible_pro='1' AND nombre_image='$condicion' AND \n\t\t\t(categoria_pro LIKE '%' '\".$_SESSION['buscar'].\"' '%' OR \n\t prioridad_pro LIKE '%' '\".$_SESSION['buscar'].\"' '%' OR\n\t\t\tnombre_pro LIKE '%' '\".$_SESSION['buscar'].\"' '%' OR \n\t\t\tmarca_pro LIKE '%' '\".$_SESSION['buscar'].\"' '%' OR \n\t\t\tcodigo_pro LIKE '%' '\".$_SESSION['buscar'].\"' '%' OR \n\t\t\tlimite_pro LIKE '%' '\".$_SESSION['buscar'].\"' '%' OR \n\t\t\tclaves_pro LIKE '%' '\".$_SESSION['buscar'].\"' '%') \n\t\t\tGROUP BY id_pro ORDER BY categoria_pro, prioridad_pro ASC\";\n\t\t}else{\n\t\t\t$sql=\"SELECT * FROM producto, imagen WHERE \n\t\t\tcategoria_pro='$cat' AND galeria_image=id_pro AND tabla_image='Producto' AND disponible_pro='1' AND nombre_image='$condicion' \n\t\t\tGROUP BY id_pro ORDER BY categoria_pro, prioridad_pro ASC\";\n\t\t\t\n\t\t}\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\tsetlocale(LC_ALL, 'es_ES');\n\t\t\t//$resultado['nombre_pro']=ucwords(strtolower($resultado['nombre_pro']));\n\t\t\t$resultado['detal_pro']=$this->convertir_moneda($resultado['detal_pro']);\n\t\t\t$resultado['mayor_pro']=$this->convertir_moneda($resultado['mayor_pro']);\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat'\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t\n\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\n\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\tif($i<=12)\n\t\t\t\t\t$resultado['limite_pro'][]=$i;\n\t\t\t}\n\t\t\t$this->descripcion=$resultado['descripcion_pro'];\n\t\t\t$resultado['descripcion_pro']=strip_tags($resultado['descripcion_pro']);\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "public function juego(array $datos=array()) {\r\n \r\n if(isset($_GET['p3'])){\r\n //$articulo_nombre = str_replace(\"-\", \" \", $_GET['p4']);\r\n //$articulo_nombre = mysql_escape_string($articulo_nombre);\r\n //printf(\"Escaped string: %s\\n\", $articulo_nombre);\r\n //print $articulo_nombre;\r\n //$clausulas['where'] = \" nombre like '%$articulo_nombre%' \";\r\n $clausulas['where'] = \" id like '%{$_GET['p3']}%' \";\r\n }\r\n if ( ! $filas = \\modelos\\Datos_SQL::select( $clausulas, self::$tabla)) {\r\n $datos['mensaje'] = 'El articulo seleccionado no se encuentra en nuestro catálogo de productos';\r\n \\core\\Distribuidor::cargar_controlador('mensajes', 'mensaje', $datos);\r\n return;\r\n }else{ \r\n $datos['articulo'] = $filas[0];\r\n \r\n //Usando articulo_id como FK\r\n $articulo_id = $filas[0]['id'];\r\n $clausulas['where'] = \" articulo_id like '%$articulo_id%' \";\r\n $clausulas['order_by'] = 'fecha_comentario desc';\r\n $datos[\"comentarios\"] = \\modelos\\Modelo_SQL::table(self::$tabla2)->select($clausulas);\r\n \r\n //Usando articulo_nombre como FK\r\n// $clausulas['where'] = \" articulo_nombre like '%$articulo_nombre%' \";\r\n// $clausulas['order_by'] = 'fecha_comentario desc';\r\n// $datos[\"comentarios\"] = \\modelos\\Modelo_SQL::table(self::$tabla2)->select($clausulas);\r\n }\r\n \r\n //Mostramos los datos a modificar en formato europeo. Convertimos el formato de MySQL a europeo para su visualización\r\n self::convertir_formato_mysql_a_ususario($datos['articulo']);\r\n self::convertir_formato_mysql_a_ususario($datos['comentarios']);\r\n\r\n $datos['view_content'] = \\core\\Vista::generar(__FUNCTION__, $datos);\r\n $http_body = \\core\\Vista_Plantilla::generar('DEFAULT', $datos);\r\n \\core\\HTTP_Respuesta::enviar($http_body);\r\n\r\n }" ]
[ "0.6288305", "0.6101461", "0.605242", "0.5989452", "0.59774977", "0.59338975", "0.5855319", "0.5849439", "0.5820192", "0.57838005", "0.5783316", "0.5770013", "0.57577187", "0.57519597", "0.571835", "0.56858397", "0.5685137", "0.5681337", "0.56791395", "0.5637577", "0.56313723", "0.5623918", "0.5622043", "0.561923", "0.56045216", "0.5585", "0.5577917", "0.5575101", "0.5572414", "0.55567986", "0.5520996", "0.5519449", "0.5511226", "0.55051833", "0.549688", "0.5486013", "0.54736656", "0.5472248", "0.5468655", "0.5466256", "0.5456979", "0.54466355", "0.5443411", "0.5438688", "0.54341376", "0.5423189", "0.54124516", "0.5407342", "0.5400865", "0.5398842", "0.539628", "0.5395151", "0.53882855", "0.5380985", "0.5376719", "0.53713495", "0.5365878", "0.53605276", "0.5348206", "0.5345685", "0.5342979", "0.5335625", "0.53324676", "0.53311527", "0.53187037", "0.53158885", "0.53053844", "0.5305384", "0.530373", "0.53035504", "0.5301184", "0.5298019", "0.52973336", "0.5296758", "0.5296182", "0.52947575", "0.529017", "0.5289153", "0.5288647", "0.5284918", "0.5277763", "0.5274414", "0.52689624", "0.52686226", "0.5268329", "0.52615607", "0.52605504", "0.52598155", "0.52592975", "0.5259021", "0.5257081", "0.5255359", "0.52536184", "0.5246643", "0.5239784", "0.52362174", "0.5234804", "0.52298003", "0.5229762", "0.52288175", "0.52237904" ]
0.0
-1
obtiene los datos del articulo a insertar en el rutero
function ConsultaDatosdeArituclo($CodArticulo){ try{ if($this->con->conectar()==true){ $NumPaginas ; $TotalFinalas; $result = mysql_query("SELECT * FROM `Articulos` where ItemCode='".$CodArticulo."'"); return $result; } } catch(Exception $e){ echo $e;} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertArticulo($etiqueta){\r\n\t$nombreimg = $_FILES[\"imagen\"]['name'];\r\n\t\r\n\t$articulo = new Articulo;\r\n\t$material = getMaterial($etiqueta->material);\r\n\t$acabado = getAcabado($etiqueta->acabado);\r\n\t\r\n\t$articulo->articuloId = getUltimoArticulo()+1;\r\n\t$articulo->nombre = $etiqueta->nombre;\r\n\t$articulo->categoria = 1;\r\n\t$articulo->grupo = $etiqueta->grupo;\r\n\t$articulo->descripcion = ' sobre '.$material['material'].', de '.$etiqueta->ancho.'mm. x '.$etiqueta->alto.'mm. impresa en '.getTextTinta($etiqueta->colores).' con '.$etiqueta->cambios.' cambios, acabado: '.$acabado['tipo_acabado'].'. '.$etiqueta->nombre.' '.$etiqueta->descripcion.'.';;\r\n\t$articulo->formatoprecio = 1;\r\n\t$articulo->cantidad = $etiqueta->cantidad;\r\n\t$articulo->imagen = 'impresas/'.$nombreimg;\r\n\t$articulo->oferta = 0;\r\n\t$articulo->coste = $etiqueta->coste;\r\n\t$articulo->visible = 1;\r\n\t$articulo->stock = 0;\r\n\t\r\n\t$query = sprintf('INSERT INTO articulos\r\n\t(articuloId, nombre, categoria, grupo, descripcion, formatoPrecio, cantidad, imagen, oferta, coste, visible, stock)\r\n\tVALUES (%d, \"%s\", %d, \"%s\", \"%s\", %d, %d, \"%s\", %d, %f, %d, %d)',\r\n\t$articulo->articuloId,\r\n\t$articulo->nombre,\r\n\t$articulo->categoria,\r\n\t$articulo->grupo,\r\n\t$articulo->descripcion,\r\n\t$articulo->formatoprecio,\r\n\t$articulo->cantidad,\r\n\t$articulo->imagen,\r\n\t$articulo->oferta,\r\n\t$articulo->coste,\r\n\t$articulo->visible,\r\n\t$articulo->stock);\r\n\t\t\r\ninsert_db($query);\r\nreturn $articulo->articuloId;}", "public function insert($datos_){\n $id=$datos_->getId();\n$nombre_proyecto=$datos_->getNombre_proyecto();\n$nombre_actividad=$datos_->getNombre_actividad();\n$modalidad_participacion=$datos_->getModalidad_participacion();\n$responsable=$datos_->getResponsable();\n$fecha_realizacion=$datos_->getFecha_realizacion();\n$producto=$datos_->getProducto();\n$semillero_id=$datos_->getSemillero_id()->getId();\n\n try {\n $sql= \"INSERT INTO `datos_`( `id`, `nombre_proyecto`, `nombre_actividad`, `modalidad_participacion`, `responsable`, `fecha_realizacion`, `producto`, `semillero_id`)\"\n .\"VALUES ('$id','$nombre_proyecto','$nombre_actividad','$modalidad_participacion','$responsable','$fecha_realizacion','$producto','$semillero_id')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "public function persist (){\n \n $this->query = \"INSERT INTO libros(titulo,autor,editorial) VALUES (:titulo, :autor, :editorial)\";\n\n // $this->parametros['id']=$user_data[\"id\"];\n $this->parametros['titulo']=$this->titulo;\n $this->parametros['autor']=$this->autor;\n $this->parametros['editorial']=$this->editorial;\n \n $this->get_results_from_query();\n\n\n $this->mensaje = \"Libro agregado exitosamente\";\n \n }", "public function insert(){\n $bd = Database::getInstance();\n $bd->query(\"INSERT INTO canciones(artista, ncancion, idGen, album) VALUES (:art, :nca, :gen, :alb);\",\n [\":art\"=>$this->artista,\n \":gen\"=>$this->idGen,\n \":alb\"=>$this->album,\n \":nca\"=>$this->ncancion]);\n }", "public function insert($otros_votos);", "public function insertarProducto($datos){\n $con= new conectar();\n $conexion= $con->conexion();\n $sql= \"INSERT INTO producto(nombre, descripcion, imagen, codigo_categoria, stock, precio)\n values('$datos[0]','$datos[1]','$datos[2]','$datos[3]','$datos[4]','$datos[5]')\"; \n return $result= mysqli_query($conexion, $sql); \n }", "public static function guardar($datos){\n $producto = new Producto($datos['producto']);\n $producto->categoria = $producto->srtCategoria($datos['categorias']);\n $producto->save();\n $producto->categorias()->attach($datos['categorias']);\n $idsDimensiones = $producto->arrDimensiones($datos);\n $articulos = $producto->arrArticulos($datos['colores'], $idsDimensiones, $producto->id);\n DB::table('articulos')->insert($articulos);\n }", "public function insert($producto);", "public function insert($titulos){\n// $id=$titulos->getId();\n$descripcion=$titulos->getDescripcion();\n$universidad_id=$titulos->getUniversidad_id();\n$docente_id=$titulos->getDocente_id()->getId();\n\n try {\n $sql= \"INSERT INTO `titulos`( `descripcion`, `universidad`, `docente_id`)\"\n .\"VALUES ('$descripcion','$universidad_id','$docente_id')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "public function productosInsert($nombre, $preciounitario, $preciopaquete, $unidadesporpaquete, $unidadesenstock, $categoria, $proveedor,$foto)\n {\n $sql = \"INSERT INTO productos (nombreproducto,preciounitario,preciopaquete,unidadesporpaquete,unidadesenstock,idcategoria,idproveedor,foto) VALUES ('$nombre',$preciounitario,$preciopaquete,$unidadesporpaquete,$unidadesenstock,'$categoria','$proveedor','$foto')\";\n \nmysqli_query($this->open(), $sql) or die('Error. ' . mysqli_error($sql));\n $this->productosSelect();\n }", "public function inserirDados()\n\t\t{\n\t\t\t$insertIdoso = \"INSERT INTO idoso(logradouro,\n\t\t\t\t\t\t\t\t\t\ttipo_logradouro,\n\t\t\t\t\t\t\t\t\t\tnumero,\n\t\t\t\t\t\t\t\t\t\tcomplemento,\n\t\t\t\t\t\t\t\t\t\tbaiiro,\n\t\t\t\t\t\t\t\t\t\tcidade,\n\t\t\t\t\t\t\t\t\t\tuf,\n\t\t\t\t\t\t\t\t\t\tusuario_id_usuario)\n\t\t\t\t\t\t\t\tVALUES(:logradouro,\n\t\t\t\t\t\t\t\t\t\t:tipo_logradouro,\n\t\t\t\t\t\t\t\t\t\t:numero,\n\t\t\t\t\t\t\t\t\t\t:complemento,\n\t\t\t\t\t\t\t\t\t\t:baiiro,\n\t\t\t\t\t\t\t\t\t\t:cidade,\n\t\t\t\t\t\t\t\t\t\t:uf,\n\t\t\t\t\t\t\t\t\t\t:usuario_id_usuario)\";\n\n\t\t\t$stmt->pdo->prepare($insertIdoso);\n\t\t\t$stmt->bindParam(':logradouro', $this->logradouro);\n\t\t\t$stmt->bindParam(':tipo_logradouro', $this->tipo_logradouro);\n\t\t\t$stmt->bindParam(':numero', $this->numero);\n\t\t\t$stmt->bindParam(':complemento', $this->complemento);\n\t\t\t$stmt->bindParam(':bairro', $this->baiiro);\n\t\t\t$stmt->bindParam(':cidade', $this->cidade);\n\t\t\t$stmt->bindParam(':uf', $this->uf);\n\t\t\t$stmt->bindParam(':usuario_id_usuario', $this->buscarTodosDados());\n\n\t\t\tif($stmt->execute()) {\n\t\t\t\theader(\"Location: localhost:8001/contato\");\n\t\t\t} else {\n\t\t\t\tdie('Erro ao cadastrar');\n\t\t\t}\n\t\t}", "public function insertar($imagen, $imagen2, $imagen3, $nombre)\n\t{\n\t\t$db = DB::conectar();\n\n\t\t$select = $db->prepare('SELECT * FROM puntoturistico WHERE nombre=:nombre');\n\t\t$select->bindValue('nombre', $nombre);\n\t\t$select->execute();\n\t\t$registro = $select->fetch();\n\t\t$id = $registro['id'];\n\n\t\techo $id;\n\n\n\t\t$insert = $db->prepare(\"INSERT INTO imagen (nombre, direccion, extencion,idPuntoTuristico,categoria) \n\t\t\tVALUES(:nombre, :direccion, :extencion, $id , 1),\t\t\t\n\t\t\t\t (:nombre2, :direccion2, :extencion2, $id , 2),\n\t\t\t\t (:nombre3, :direccion3, :extencion3, $id , 2)\");\n\t\t$insert->bindValue('nombre', $imagen->getNombre());\n\t\t$insert->bindValue('direccion', $imagen->getDireccion());\n\t\t$insert->bindValue('extencion', $imagen->getExtencion());\n\n\t\t$insert->bindValue('nombre2', $imagen2->getNombre());\n\t\t$insert->bindValue('direccion2', $imagen2->getDireccion());\n\t\t$insert->bindValue('extencion2', $imagen2->getExtencion());\n\n\t\t$insert->bindValue('nombre3', $imagen3->getNombre());\n\t\t$insert->bindValue('direccion3', $imagen3->getDireccion());\n\t\t$insert->bindValue('extencion3', $imagen3->getExtencion());\n\n\t\t$insert->execute();\n\t}", "public function insertarDataInicialEnSchema(){\n $sql = \"INSERT INTO moto_market.usuarios (usuario, password, email, nombre, apellido, ruta_avatar) VALUES ('Valen13', '$2y$10\\$qf6VYsFmsKP5jnbuMonYMeYkNXXDU1Rhz2FHS7ayYpO/82ATX/x5S', '[email protected]', 'Valentin', 'Mariño', 'C:\\xampp\\htdocs\\Prueba\\ProyectoConFuncionesAgregadas/images/perfiles/5b3dad65b6e90.jpg');\n INSERT INTO moto_market.usuarios (usuario, password, email, nombre, apellido, ruta_avatar) VALUES ('monty15', '$2y$10\\$rYwEXX3AjtZYYbWb9HjsT.V5sBiDmi3bb7ldCPbvqOhGdA8VRWJY6', '[email protected]', 'Monty', 'Hola', 'C:\\xampp\\htdocs\\Prueba\\ProyectoConFuncionesAgregadas/images/perfiles/5b3dad959ec8b.jpg');\";\n\n $this->db->prepare($sql)->execute();\n }", "public function insertar()\n {\n\n $nameanimal = $this->request->getPost(\"nameanimal\");\n $ageanimal = $this->request->getPost(\"ageanimal\");\n $time = $this->request->getPost(\"time\");\n $foodanimal = $this->request->getPost(\"foodanimal\");\n $description = $this->request->getPost(\"description\");\n $typeanimal = $this->request->getPost(\"typeanimal\");\n $photoanimal = $this->request->getPost(\"photoanimal\");\n\n //2. Organizar los datos que llegan de las vistas\n // en un arreglo asociativo \n //(las claves deben ser iguales a los campos o atributos de la tabla en BD)\n $datosEnvio = array(\n \"nameanimal\" => $nameanimal,\n \"ageanimal\" => $ageanimal,\n \"time\" => $time,\n \"foodanimal\" => $foodanimal,\n \"description\" => $description,\n \"typeanimal\" => $typeanimal,\n \"photoanimal\" => $photoanimal\n );\n\n //3. Utilizar el atributo this-> validate del controlador para validar datos\n if ($this->validate('animalPOST')) {\n $id = $this->model->insert($datosEnvio);\n\n return $this->respond($this->model->find($id));\n } else {\n $validation = \\Config\\Services::validation();\n return $this->respond($validation->getErrors());\n }\n }", "public function cadastrar(){\r\n //DEFINIR A DATA DE CADASTRO\r\n $this->cadastro = date('Y-m-d H:i:s');\r\n\r\n $db = new Database('cartao');\r\n $this->id = $db->insert([\r\n 'bandeira' => $this->bandeira,\r\n 'numero' => $this->numero,\r\n 'doador' => $this->doador,\r\n ]);\r\n\r\n }", "public function insert() {\n $conexion = StorianDB::connectDB();\n $insercion = \"INSERT INTO cuento (titulo, contenido, autor) VALUES (\\\"\".$this->titulo.\"\\\", \\\"\".$this->contenido.\"\\\", \\\"\".$this->autor.\"\\\")\";\n $conexion->exec($insercion);\n }", "public function insert($tarConvenio);", "public function add_data()\n {\n try\n {\n if($this->id_producto!=NULL) //Identificar si llega un ID nulo o declarado\n {\n $sql=\"UPDATE productos set proveedores_id_proveedor=?,categoria_id_Categoria=?,nom_producto=?,pre_producto=?,can_producto=? WHERE id_producto = ?\";\n \n }else{\n $sql=\"INSERT into productos Values(0,?,?,?,?,?)\";\n }\n $consulta = $this->con->prepare($sql);\n $consulta->bindParam(1,$this->proveedores_id_proveedor);\n $consulta->bindParam(2,$this->categoria_id_Categoria);\n $consulta->bindParam(3,$this->nom_producto);\n $consulta->bindParam(4,$this->pre_producto);\n $consulta->bindParam(5,$this->can_producto); \n if($this->id_producto!=null)//Se asigna el valor del ID si esta declarado\n {\n $consulta->bindParam(6,$this->id_producto); \n }\n $consulta->execute();\n $this->con=null; \n }catch(PDOException $e)//mensaje de error en caso de fallo\n {\n print \"Error: \".$e->getMessage(); \n } \n }", "public function insertArtista(){\n\t\tif($this->autenticado(/* parametro? */)){\n\t\t\t$this->actualizarArtista($this->getCamposArtista(NULL), true, false, '');\n\t\t}else{\n\t\t\techo \"Directory access is forbidden.\";\n\t\t}\n\t}", "public function insert($fisicasuelo);", "public function insertar($objeto){\r\n\t}", "public function insert($datos){\r\n try{\r\n $query = $this->db->connect()->prepare('INSERT INTO PRODUCTO (ID_PRODUCTO, NOMBRE, DESCRIPCION, PRECIO, FOTO, STOCK, CATEGORIA) VALUES(:id_producto, :nombre, :descripcion,:precio, :foto, :stock, :categoria)');\r\n $query->execute(['id_producto' => $datos['id_producto'], 'nombre' => $datos['nombre'], 'descripcion' => $datos['descripcion'], 'precio' => $datos['precio'], 'foto' => $datos['foto'], 'stock' => $datos['stock'], 'categoria' => $datos['categoria']]);\r\n return true;\r\n }catch(PDOException $e){\r\n //echo $e->getMessage();\r\n //echo \"Ya existe esa matrícula\";\r\n return false;\r\n }\r\n \r\n }", "function InsertarAlRutero($CodArticulo,$CardCode){\n\t\t\n\t\t\n\t\t //consulta todos los datos del articulo\n\t\t $result=$this->ConsultaDatosdeArituclo($CodArticulo);\n\t\t if( $result)\n\t\t {\n\t\t while( $DatoRutero = mysql_fetch_array($result) )\n\t\t {\n\t\t\t //inserta los datos al rutero\n\t\t \n\t\t$this->AgregalineaARutero($DatoRutero[\"ItemCode\"],$DatoRutero[\"codbarras\"],$DatoRutero[\"ItemName\"],$DatoRutero[\"existencia\"],$DatoRutero[\"lotes\"],$DatoRutero[\"Unidad\"],$DatoRutero[\"precio\"], $DatoRutero[\"PrchseItem\"],$DatoRutero[\"SellItem\"],$DatoRutero[\"InvntItem\"],$DatoRutero[\"AvgPrice\"],$DatoRutero[\"Price\"],$DatoRutero[\"frozenFor\"],$DatoRutero[\"SalUnitMsr\"], $DatoRutero[\"VATLiable\"], $DatoRutero[\"lote\"],$DatoRutero[\"U_Grupo\"], $DatoRutero[\"SalPackUn\"], $DatoRutero[\"FAMILIA\"], $DatoRutero[\"CATEGORIA\"],$DatoRutero[\"MARCA\"], $DatoRutero[\"CardCode\"], $DatoRutero[\"Disponible\"],$DatoRutero[\"U_Gramaje\"], $DatoRutero[\"DETALLE 1\"],$DatoRutero[\"LISTA A DETALLE\"],$DatoRutero[\"LISTA A SUPERMERCADO\"],$DatoRutero[\"LISTA A MAYORISTA\"],$DatoRutero[\"LISTA A + 2% MAYORISTA\"],$DatoRutero[\"PANALERA\"],$DatoRutero[\"SUPERMERCADOS\"],$DatoRutero[\"MAYORISTAS\"],$DatoRutero[\"HUELLAS DORADAS\"],$DatoRutero[\"ALSER\"],$DatoRutero[\"COSTO\"],$DatoRutero[\"PRECIO SUGERIDO\"],$DatoRutero[\"PuntosWeb\"],$DatoRutero[\"Ranking\"],$CardCode);\n\t\t\t \n\t\t\t}\n\t\t }\n\t\t\n\t\t \n\t\t }", "public function inserta_cartas($datos){\n\t\t\t//Solo es para acegurarse que se estan enviando los archivos\n\t\t /*echo \"<pre>\";\n\t\t print_r($datos);\n\t\t print_r($files);\n\t\t echo 'Desde Controller';\n\t\t echo \"</pre>\";\n\t\t die();*/\n\t\t\t//Conexion con Posision el cual continene a Modelo y Conexion\n\t\t\t//$pais=new Pais();\n\n\t\t\t$this->set_descripcion($datos['descripcion_cartas']);\n\t\t\t$this->set_tipo($datos['tipo_cartas']);\n\n\n\t\t\t//Verificar si existen errores\n\t\t\tif(count ($this->errores)>0){\n\t\t\t\t$this->muestra_errores=true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->muestra_exito=true;\n\t\t\t\t//Insertar en la Base de datos\n\t\t\t\t$this->inserta($this->get_atributos());\n\t\t\t}\n\t\t\t//Detener un script *die();\n\n\t\t}", "function subir($nombre,$id){\n // creamo el array que mandaremos a la base de datos\n \t$datos = array(\n 'titulo' => 'Titulo',\n 'imagen' => $nombre,\n 'idAlbum' => $id,\n \t );\n // por ultimo mandamos los datos con un insert a la base datos utilizando el active record de CI\n \t$this->db->insert('imagenes',$datos);\n\n \t}", "public function insertar($data){\n\t\t\t$this->db->insert('tareas',array(\n\t\t\t\t'titulo'=>$data['titulo'],\n\t\t\t\t'descripcion'=>$data['descripcion'],\n\t\t\t\t'id_estado'=>1,\n\t\t\t\t'fecha_alta'=>date('Y-m-d H:i:s'),\n\t\t\t\t'fecha_modificacion'=>date('Y-m-d H:i:s'),\n\t\t\t\t'fecha_baja'=>null\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function setEgresos($data){\n $query = $this->db->insert('ingreso_egreso', $data);\n return $query;\n }", "function insertarArticulo( $arrayArticulo , $arrayFiles , $ruta_subida ){\n \n $titulo = addslashes ( $arrayArticulo['titulo'] );\n $subtitulo = addslashes ($arrayArticulo['subtitulo'] );\n $contenido = addslashes ($arrayArticulo['contenido'] );\n $autor_id = $arrayArticulo['autor_id'];\n $genero_id = $arrayArticulo['genero_id'];\n $activo = 1;\n\n //manejo de la imagen\n $imagen_1 = $arrayFiles['imagen']['name'];\n if( !move_uploaded_file($arrayFiles['imagen']['tmp_name'], $ruta_subida . $imagen_1) ){\n $imagen_1 = \"NULL\"; \n }\n\n $sql = \"INSERT INTO articulo \n ( `titulo`, `contenido`, `imagen_1`, `autor_id`,`subtitulo`, `genero_id`, `activo` )\n VALUES \n ( '$titulo' , '$contenido' , '$imagen_1' , '$autor_id' , '$subtitulo' , '$genero_id' , $activo)\"; \n \n if( $id = ejecutarConsulta($sql) ){ \n return getArticulo( $id );\n }else{\n return false;\n }\n \n \n\n }", "public function Insertistorique() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n\n if (isset($_REQUEST['data'])) {\n $idSociete = $_REQUEST['data']['idSociete'];\n $idUser = $_REQUEST['data']['idUser'];\n $idObjet = $_REQUEST['data']['idObjet'];\n $typeHisto = $_REQUEST['data']['typeHisto'];\n $typeAction = $_REQUEST['data']['typeAction'];\n $data = $_REQUEST['data']['data'];\n $dateAction = $_REQUEST['data']['dateAction'];\n\n\n // Input validations\n if (!empty($idSociete)) {\n\n try {\n $sql = $this->db->prepare(\"INSERT INTO historique (idUser, idObjet, typeHisto, typeAction, data, dateAction, idSociete )\"\n . \"VALUES(:idUser, :idObjet, :typeHisto, :typeAction, :data, :dateAction, :idSociete)\");\n\n $sql->bindParam('idUser', $idUser, PDO::PARAM_INT);\n $sql->bindParam('idObjet', $idObjet, PDO::PARAM_STR);\n $sql->bindParam('typeHisto', $typeHisto, PDO::PARAM_STR);\n $sql->bindParam('typeAction', $typeAction, PDO::PARAM_INT);\n $sql->bindParam('data', $data, PDO::PARAM_STR);\n $sql->bindParam('dateAction', $dateAction, PDO::PARAM_STR);\n $sql->bindParam('idSociete', $idSociete, PDO::PARAM_INT);\n\n $sql->execute();\n\n if ($sql) {\n $success = array('status' => \"Success\", \"msg\" => \"Successfully inserted\");\n $this->response($this->json($success), 200);\n }\n } catch (Exception $ex) {\n $this->response('', $ex->getMessage()); // If no records \"No Content\" status\n }\n }\n }\n\n // If invalid inputs \"Bad Request\" status message and reason\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid param\");\n $this->response($this->json($error), 400);\n }", "public function createRecord(array $data){\n $query = \"INSERT INTO articolo (titolo, contenuto, autore, data) VALUES(:titolo, :contenuto, :autore, :data)\";\n $this->postQueries($query, $data);\n }", "public function insertaPedido($pedido) {\n $codPedido = $pedido->getId();\n $mesa = $pedido->getMesa();\n $estado = $pedido->getEstado();\n $fecha = $pedido->getFecha();\n $elementos = $pedido->getElementos();\n\n /* Imprimir Datos */\n// echo \"- Pedido: \".$codPedido.\"<br>\";\n// echo \"- Mesa: \".$mesa.\"<br>\";\n// echo \"- Estado: \".$estado.\"<br>\";\n// echo \"- Fecha: \".$fecha.\"<br>\";\n// echo \"- Numero de elementos: \".count($elementos).\"<br><br>\";\n\n /* Insercion de los datos del pedido */\n $sql1 = \"INSERT INTO pedido VALUES($codPedido,$mesa,$estado,$fecha)\";\n $result1 = $this->bd->query($sql1);\n\n /* Para cada pedido, inserto los datos de sus elementos */\n for($i=0 ; $i<count($elementos); $i++) {\n /* Informacion del elemento del pedido */\n $codElem = $elementos[$i]->getId();\n $comentario = $elementos[$i]->getComentario();\n $estadoElem = $elementos[$i]->getEstado();\n $elemCarta = $elementos[$i]->getElemento();\n $codElemCarta = $elemCarta->getId();\n\n /* Imprimir Datos */\n// echo \"--- Elemento Pedido: \".$codElem.\"<br>\";\n// echo \"--- Comentario: \".$comentario.\"<br>\";\n// echo \"--- Estado: \".$estadoElem.\"<br>\";\n// echo \"--- Elemento Carta: \".$codElemCarta.\"<br><br>\";\n\n /* Insercion de los datos del elemento del pedido */\n $sql2 = \"INSERT INTO elementoPedido VALUES($codElem,$estadoElem,\\\"$comentario\\\")\";\n $result2 = $this->bd->query($sql2);\n $sql3 = \"INSERT INTO tieneElemento VALUES($codElem,$codPedido)\";\n $result3 = $this->bd->query($sql3);\n \n /* Insercion de los datos del elemento de la carta*/\n if(get_class($elemCarta) == \"ElementoPlato\") {\n $sql4 = \"INSERT INTO elementoColaCocina VALUES($codElem)\";\n $result4 = $this->bd->query($sql4);\n $sql5 = \"INSERT INTO asociaPlato VALUES($codElem,$codElemCarta)\";\n $result5 = $this->bd->query($sql5);\n }\n else if(get_class($elemCarta) == \"ElementoBebida\") {\n $sql4 = \"INSERT INTO elementoColaBar VALUES($codElem)\";\n $result4 = $this->bd->query($sql4);\n $sql5 = \"INSERT INTO asociaBebida VALUES($codElem,$codElemCarta)\";\n $result5 = $this->bd->query($sql5);\n }\n }\n }", "public function insertar(){\n $mysqli = new mysqli(Config::BBDD_HOST, Config::BBDD_USUARIO, Config::BBDD_CLAVE, Config::BBDD_NOMBRE);\n //Arma la query\n $sql = \"INSERT INTO tipo_domicilios ( \n tipo,\n nombre\n ) VALUES (\n '\" . $this->tipo .\"', \n '\" . $this->nombre .\"'\n );\";\n //Ejecuta la query\n if (!$mysqli->query($sql)) {\n printf(\"Error en query: %s\\n\", $mysqli->error . \" \" . $sql);\n }\n //Obtiene el id generado por la inserción\n $this->idtipo = $mysqli->insert_id;\n //Cierra la conexión\n $mysqli->close();\n }", "function crearDetalle($db, $data) {\n //Crea el detalle vinculado al pedido en la tabla carrito\n \n $query = \"INSERT INTO carrito (idpedido, idproducto, cantidad, precio, subtotal) \n VALUES (\".$data[\"idpedido\"].\", \".$data[\"idproducto\"].\", \".$data[\"cantidad\"].\", \".$data[\"precio\"].\", \".$data[\"subtotal\"].\")\";\n //echo $query;die;\n // Ejecutamos el query.\n // Como la consulta es un INSERT, mysqli_query retorna\n // true o false.\n return mysqli_query($db, $query);\n}", "function insertarProceso(){\n global $conexion, $data;\n $slug = $data[\"slug\"];\n $hashtag = $data[\"hashtag\"];\n $dec_org_id = $data[\"decidim_organization_id\"];\n $created_at = $data[\"created_at\"];\n $updated_at = $data[\"updated_at\"];\n $title = '{\"en\": \"'.$data[\"title\"].'\", \"es\":\"'.$data[\"title\"].'\"}';\n $subtitle = '{\"en\": \"'.$data[\"subtitle\"].'\", \"es\":\"'.$data[\"subtitle\"].'\"}';\n $sh_description = '{\"en\": \"'.$data[\"description\"].'\", \"es\":\"'.$data[\"description\"].'\"}';\n $description = '{\"en\": \"'.$data[\"description\"].'\", \"es\":\"'.$data[\"description\"].'\"}';\n $hero_image = $data[\"hero_image\"];\n $banner_image = $data[\"banner_image\"];\n $promoted = true;\n $published_at = $data[\"published_at\"];\n $developer_group= '{\"en\": \"'.$data[\"developer_group\"].'\", \"es\":\"'.$data[\"developer_group\"].'\"}';\n $end_date = $data[\"end_date\"];\n $meta_scope = '{\"en\": \"'.$data[\"meta_scope\"].'\", \"es\":\"'.$data[\"meta_scope\"].'\"}';\n $local_area = '{\"en\": \"'.$data[\"local_area\"].'\", \"es\":\"'.$data[\"local_area\"].'\"}';\n $target = '{\"en\": \"'.$data[\"target\"].'\", \"es\":\"'.$data[\"target\"].'\"}';\n $par_scope = '{\"en\": \"'.$data[\"participatory_scope\"].'\", \"es\":\"'.$data[\"participatory_scope\"].'\"}';\n $par_structure = '{\"en\": \"'.$data[\"participatory_structure\"].'\", \"es\":\"'.$data[\"participatory_structure\"].'\"}';\n $dec_scope_id = (int)$data[\"decidim_scope_id\"];\n $pro_group_id = (int)$data[\"decidim_participatory_process_group_id\"];\n $show_statistics= true;\n $announcement = null;\n $scopes_enabled = false;\n $start_date = $data[\"start_date\"];\n $private_space = false;\n $reference = $data[\"reference\"];\n $resultado = pg_query($conexion, \"INSERT INTO decidim_participatory_processes (slug, hashtag, decidim_organization_id, created_at, updated_at, title, subtitle, short_description, description, hero_image, banner_image, promoted, published_at, developer_group, end_date, meta_scope, local_area, target, participatory_scope, participatory_structure, decidim_scope_id, decidim_participatory_process_group_id, show_statistics, announcement, scopes_enabled, start_date, private_space, reference) VALUES ('$slug', '$hashtag', '$dec_org_id', '$created_at', '$updated_at', '$title', '$subtitle', '$sh_description', '$description', '$hero_image', '$banner_image', '$promoted', '$published_at', '$developer_group', '$end_date', '$meta_scope', '$local_area', '$target', '$par_scope', '$par_structure', '$dec_scope_id', '$pro_group_id', true, null, false, '$start_date', false, '$reference') RETURNING id, slug \");\n validarErrorPG($resultado);\n }", "public function Insertar($datos){\n\t\t\t#1. Convertir de array a Datos\n\t\t\t#2. Crear el SQL\n\n\t\t}", "function inserir($cidade, $bairro, $rua, $numeroTerreno, $quantidadeCasa, $valor, $idUsuario) #Funcionou\n {\n $conexao = new conexao();\n $sql = \"insert into terreno( Cidade, Bairro, Rua, NumeroTerreno, QuantidadeCasa, Valor, idUsuario) \n values('$cidade', '$bairro', '$rua', '$numeroTerreno', '$quantidadeCasa', '$valor', $idUsuario )\";\n mysqli_query($conexao->conectar(), $sql);\n echo \"<p> Inserido </p>\";\n }", "public function inserir_anuncio(){\n if(!isset($_SESSION))session_start();\n\n $cliente = unserialize($_SESSION['cliente']);\n\n $id_veiculo = $_POST['cb_veiculos'];\n $data_inicial = $_POST['data_inicial'];\n $data_final = $_POST['data_final'];\n $hora_inicial = $_POST['hora_inicial'];\n $hora_final = $_POST['hora_final'];\n $descricao = $_POST['descricao'];\n $valor_hora = $_POST['valor_hora'];\n $id_cliente = $cliente->getId();\n\n $anuncio = new Anuncio();\n $anuncio->setDescricao($descricao)\n ->setIdClienteLocador($id_cliente)\n ->setIdVeiculo($id_veiculo)\n ->setHorarioInicio($hora_inicial)\n ->setHorarioTermino($hora_final)\n ->setDataInicial($data_inicial)\n ->setDataFinal($data_final)\n ->setValor($valor_hora);\n\n\n $this->anunciosDAO->insert($anuncio);\n\n }", "public function insertForosComentarios(){\n\t\tif($this->get_request_method() != \"POST\") $this->response('', 406);\n\n\t\t//get data sent\n\t\t$data = file_get_contents(\"php://input\");\n\t\t$parametros = $this->jsonDecode($data);\n\t\t$user = $parametros->user;\n\t\t$ses_id = $parametros->ses_id;\n\t\t$id_tema = $parametros->id_tema;\n\t\t$comentario = $parametros->comentario;\n\t\t$id_comentario_respuesta = $parametros->id_comentario_respuesta;\n\n\n\t\t// Session validation\n\t\tif ($this->checkSesId($ses_id, $user)){\n\t\t\t$foro = new foro();\n\t\t\tif ($foro->InsertComentario($id_tema,\n\t\t\t\t\t\t\t\t$comentario,\n\t\t\t\t\t\t\t\t$user,\n\t\t\t\t\t\t\t\tESTADO_COMENTARIOS_FORO,\n\t\t\t\t\t\t\t\t$id_comentario_respuesta)){\n\t\t\t\t$msg = array('status' => \"ok\", \"msg\" => \"Mensaje insertado\");\n\t\t\t\t$this->response($this->json($msg), 200);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Error al insertar\");\n\t\t\t\t$this->response($this->json($error), 400);\t\t\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Sesion incorrecta\");\n\t\t\t$this->response($this->json($error), 400);\t\t\n\t\t}\n\t}", "function inserirAgencia(){\n\n $banco = abrirBanco();\n //declarando as variáveis usadas na inserção dos dados\n $nomeAgencia = $_POST[\"nomeAgencia\"];\n $cidadeAgencia = $_POST[\"cidadeAgencia\"];\n\n //a consulta sql\n $sql = \"INSERT INTO Agencias(nomeAgencia,cidadeAgencia) VALUES ('$nomeAgencia','$cidadeAgencia')\";\n \n //executando a inclusão\n $banco->query($sql);\n //fechando a conexao com o banco\n $banco->close();\n voltarIndex();\n\n }", "public static function insertNewProduct($data)\n {\n //Compruebas si existe\n $consulta = DataBase::consulta(\"\n select * from productos where producto = \\\"\".$data[\"saveNameProduct\"].\"\\\"\n \");\n //Segunda parte\n //Adquirir el id de la empresa\n $idEmpresa = DataBase::consulta(\n \"select idEmpresa from empresa\n inner join persona on empresa.idEmpresa = persona.empresa\n inner join user on user.idUser = persona.idPersona\n where idUser = \".$_SESSION[\"userLogin\"][0][\"idUser\"]\n );\n //Tercera Parte\n //Insertamos el producto y detalles de producto\n if(count($consulta) == 0 && $idEmpresa > 0) {\n DataBase::insertar('insert into productos (producto, categoria) values (\"'.$data[\"saveNameProduct\"].'\", '.$data[\"listCategory\"].')');\n $idProducto = DataBase::consulta(\n \"select idProducto from productos\n where producto = \\\"\".$data[\"saveNameProduct\"].\"\\\"\n \");\n DataBase::insertar('\n insert into productosEmpresa (idproducto, idempresa, precio, stock, plazoEntrega, imagen, comprar, iva, referencia, precioCoste)\n values ('.$idProducto[0][\"idProducto\"].', '.$idEmpresa[0][\"idEmpresa\"].', '.$data[\"savePrecioProduct\"].', '.$data[\"saveStockProduct\"].', '.$data[\"saveDeliveryProduct\"].',\n \"'.$data[\"imagenProducto\"].'\",'.$data[\"checkEnambleBuy\"].', '.$data[\"listIVA\"].', \"'.$data[\"saveRefProduct\"].'\", \"'.$data[\"savePriceCostProduct\"].'\")\n ');\n //existe la empresa y el producto\n } else if ($idEmpresa > 0) {\n DataBase::insertar('\n insert into productosEmpresa (idproducto, idempresa, precio, stock, plazoEntrega, imagen, comprar, iva, referencia, precioCoste)\n values ('.$consulta[0][\"idProducto\"].', '.$idEmpresa[0][\"idEmpresa\"].', '.$data[\"savePrecioProduct\"].', '.$data[\"saveStockProduct\"].', '.$data[\"saveDeliveryProduct\"].',\n \"'.$data[\"imagenProducto\"].'\",'.$data[\"checkEnambleBuy\"].', '.$data[\"listIVA\"].', \"'.$data[\"saveRefProduct\"].'\", \"'.$data[\"savePriceCostProduct\"].'\")\n ');\n }\n }", "public function insert($perifericos);", "public function insert($contenido);", "public function insertEstudiante_post() {\n\t\t$nombre = $this->input->post(\"txtNombre\");\n\t\t$apellido = $this->input->post(\"txtApellido\");\n\t\t$carrera = $this->input->post(\"txtCarrera\");\n $carnet = $this->input->post(\"txtCarnet\");\n $pass = $this->input->post(\"txtPassword\");\n\n\t\t//mandar los input a arreglo y campos de la bd\n\t\t$data = array(\n\t\t\t'nombre' => $nombre ,\n\t\t\t'apellido' => $apellido ,\n\t\t\t'carrera'=>$carrera,\n 'carnet'=>$carnet,\n 'password'=>$pass,\n\t\t );\n\n if($this->EstudianteModel->insertEstudiante($data))\n $this->response(array('status' => 'exito'));\n else \n $this->response(array('status' => 'fallo'));\n }", "function insertarSustanciaQuimica($idAsignacion)\n {\n $datosSustanciaQuimica = json_decode($this->input->post('datosSustanciaQuimica'));\n\n foreach ($datosSustanciaQuimica as $key => $value)\n {\n //INSERT\n $arraySustanciaQuimica = array(\n 'nombreSustancia' => $value->sustanciaQuimica,\n 'cantidadReporte' => $value->cantidadReporte,\n 'sitioAlmacenamiento' => $value->sitioAlmacenamiento,\n 'usoSustancia' => $value->usoSustancia,\n 'hojaSeguridad' => $value->hojaSeguridad,\n 'idAsignacion' => $idAsignacion\n );\n\n //RETORNA ID PRIMARIA REGISTRADA\n $nuevaIdPrimaria = $this->analisisRiesgo->insertarDatosSustaciaQuimica($arraySustanciaQuimica);\n\n foreach ($nuevaIdPrimaria as $key3 =>$val)\n echo($val['LAST_INSERT_ID()']);\n\n }\n }", "function insertarFase(){\n global $conexion, $data;\n $title = '{\"en\": \"'.$data[\"title\"].'\", \"es\":\"'.$data[\"title\"].'\"}';\n $description = '{\"en\": \"'.$data[\"description\"].'\", \"es\":\"'.$data[\"description\"].'\"}';\n $start_date = $data[\"start_date\"];\n $end_date = $data[\"end_date\"];\n $procces_id = $data[\"proceso_id\"];\n $created_at = $data[\"created_at\"];\n $updated_at = $data[\"updated_at\"];\n $active = $data[\"active\"];\n $position = $data[\"position\"];\n $resultado = pg_query($conexion, \"INSERT INTO decidim_participatory_process_steps (title, description, start_date, end_date, decidim_participatory_process_id, created_at, updated_at, active, position) VALUES ('$title', '$description', '$start_date', '$end_date', '$procces_id', '$created_at', '$updated_at', '$active', '$position') RETURNING id \");\n validarErrorPG($resultado);\n }", "public function insertarProductoCompra($datos){\n $con= new conectar();\n $conexion= $con->conexion();\n $sql= \"INSERT INTO producto_comprar(id_cliente, id_producto,nombre,precio,compro,fecha)\n values('$datos[0]','$datos[1]','$datos[2]','$datos[3]','$datos[4]','$datos[5]')\"; \n return $result= mysqli_query($conexion, $sql); \n }", "public function insert($cargo){\n $id=$cargo->getId();\n$fecha_ingreso=$cargo->getFecha_ingreso();\n$empresa_idempresa=$cargo->getEmpresa_idempresa()->getIdempresa();\n$area_empresa_idarea_emp=$cargo->getArea_empresa_idarea_emp()->getIdarea_emp();\n$cargo_empreso_idcargo=$cargo->getCargo_empreso_idcargo()->getIdcargo();\n$puesto_idpuesto=$cargo->getPuesto_idpuesto()->getIdpuesto();\n\n try {\n $sql= \"INSERT INTO `cargo`( `id`, `fecha_ingreso`, `empresa_idempresa`, `area_empresa_idarea_emp`, `cargo_empreso_idcargo`, `puesto_idpuesto`)\"\n .\"VALUES ('$id','$fecha_ingreso','$empresa_idempresa','$area_empresa_idarea_emp','$cargo_empreso_idcargo','$puesto_idpuesto')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "public static function inserirProdutoCarrinho(){\n if(isset($_SESSION['user'])){\n //USUARIO LOGADO COM CARRINHO\n if(isset($_SESSION['user']['carrinhoId'])){\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $expPro = explode(';',self::$carrinho->produto_id);\n $expQuant = explode(';',self::$carrinho->quantidade);\n\n $expPro[] = self::$produto['produto_id'];\n $expQuant[] = self::$produto['quantidade'];\n\n $impPro = implode(';',$expPro);\n $impQuant = implode(';',$expQuant);\n\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $query = \"UPDATE carrinhos SET produto_id=:idp, quantidade=:qnt, idCliente=:idC WHERE id=:id\";\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,$impPro);\n $stmt->bindValue(2,$impQuant);\n $stmt->bindValue(3,$_SESSION['user']['id']);\n $stmt->bindValue(4,self::$carrinho->id);\n $stmt->execute();\n\n //USUARIO LOGADO SEM CARRINHO\n }else{\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $query = \"INSERT INTO carrinhos(produto_id,quantidade,idCliente) VALUES (:prodId, :qnt, :idCliente)\";\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,self::$produto['produto_id']);\n $stmt->bindValue(2,self::$produto['quantidade']);\n $stmt->bindValue(3,$_SESSION['user']['id']);\n $stmt->execute();\n if($stmt->rowCount()){\n return true;\n }throw new \\Exception(\"Nao Foi Possivel adicionar produto ao carrinho\");\n }\n\n //USUARIO NAO LOGADO\n }else{\n //USUARIO NAO LOGADO COM CARRINHO\n if(isset($_SESSION['carrinho'])){\n $expPro = explode(';',$_SESSION['carrinho']['produto_id']);\n $expQuant = explode(';',$_SESSION['carrinho']['quantidade']);\n $expPro[] = self::$produto['produto_id'];\n $expQuant[] = self::$produto['quantidade'];\n $impPro = implode(';',$expPro);\n $impQuant = implode(';',$expQuant);\n $_SESSION['carrinho'] = array('produto_id'=>$impPro,'quantidade'=>$impQuant);\n return true;\n //USUARIO NAO LOGADO SEM CARRINHO\n }else{\n $_SESSION['carrinho'] = array('produto_id'=>self::$produto['produto_id'],'quantidade'=>self::$produto['quantidade']);\n return true;\n \n }\n \n }\n }", "public function insertarDatosCompra($datos){\n $con= new conectar();\n $conexion= $con->conexion();\n $sql= \"INSERT INTO compras_realizadas(idLog, fecha,nombre,precio)\n values('$datos[0]','$datos[1]','$datos[2]','$datos[3]')\"; \n return $result= mysqli_query($conexion, $sql); \n }", "function entrada_por_traspaso(){\n\t\t$e= new Entrada();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cproveedores_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}", "public function guardarDatos($datos){\n \n $inscripto = new InscriptosPadronSisa();\n $inscripto->id = $this->convertirEnTexto($datos->id); \n $inscripto->codigosisa = $this->convertirEnTexto($datos->codigoSISA);\n $inscripto->identificadorenaper = $this->convertirEnTexto($datos->identificadoRenaper);\n $inscripto->padronsisa = $this->convertirEnTexto($datos->PadronSISA);\n $inscripto->tipodocumento = $this->convertirEnTexto($datos->tipoDocumento);\n $inscripto->nrodocumento = $this->convertirEnTexto($datos->nroDocumento);\n $inscripto->apellido = $this->convertirEnTexto($datos->apellido);\n $inscripto->nombre = $this->convertirEnTexto($datos->nombre);\n $inscripto->sexo = $this->convertirEnTexto($datos->sexo);\n $inscripto->fechanacimiento = $this->convertirEnTexto($datos->fechaNacimiento);\n $inscripto->estadocivil = $this->convertirEnTexto($datos->estadoCivil);\n $inscripto->provincia = $this->convertirEnTexto($datos->provincia);\n $inscripto->departamento = $this->convertirEnTexto($datos->departamento);\n $inscripto->localidad = $this->convertirEnTexto($datos->localidad);\n $inscripto->domicilio = $this->convertirEnTexto($datos->domicilio);\n $inscripto->pisodpto = $this->convertirEnTexto($datos->pisoDpto);\n $inscripto->codigopostal = $this->convertirEnTexto($datos->codigoPostal);\n $inscripto->paisnacimiento = $this->convertirEnTexto($datos->paisNacimiento);\n $inscripto->provincianacimiento = $this->convertirEnTexto($datos->provinciaNacimiento);\n $inscripto->localidadnacimiento = $this->convertirEnTexto($datos->localidadNacimiento);\n $inscripto->nacionalidad = $this->convertirEnTexto($datos->nacionalidad);\n $inscripto->fallecido = $this->convertirEnTexto($datos->fallecido);\n $inscripto->fechafallecido = $this->convertirEnTexto($datos->fechaFallecido);\n $inscripto->donante = $this->convertirEnTexto($datos->donante);\n try {\n $inscripto->save();\n unset($inscripto);\n return TRUE;\n } catch (QueryException $e) {\n return json_encode($e);\n } \n }", "static public function mdlIngresarRegistro($tabla,$datos){\n\t\t$sql = \"INSERT INTO $tabla (product_id, client_id, quantity, sale_id, price) VALUES (:product_id, :client_id, :quantity, :sale_id, :price)\";\n\t\t$pdo= Conexion::conectar()->prepare($sql);\n\t\tif ($pdo->execute([\n\t\t\t'product_id' => $datos['product_id'],\n\t\t\t'client_id' => $datos['client_id'],\n\t\t\t'quantity' => $datos['quantity'],\n\t\t\t'sale_id' => $datos['sale_id'],\n\t\t\t'price' => $datos['price']\n\t\t])) {\n\t\t\treturn \"ok\";\n\t\t} else {\n\t\t\treturn \"error\";\n\t\t}\n\t\t\n\n\n\t\t$pdo -> close();\n\t\t$pdo = null;\n\t}", "public function insertar(){\n $pdo=Conexion::conectar();\n $sentencia = $pdo->prepare(\"INSERT INTO empleado (id, nombre, apellido,direccion,telefono,email,estado,firma,jefe,id_cargo,id_departamento) VALUES (:id, :nombre, :apellido,:direccion,:telefono,:email,:estado,:firma,:jefe,:id_cargo,:id_departamento)\");\n $sentencia->bindParam(':id', $id);\n $sentencia->bindParam(':nombre', $nombre);\n $sentencia->bindParam(':apellido', $apellido);\n $sentencia->bindParam(':direccion', $direccion);\n $sentencia->bindParam(':telefono', $telefono);\n $sentencia->bindParam(':email', $email);\n $sentencia->bindParam(':estado', $estado);\n $sentencia->bindParam(':firma', $firma);\n $sentencia->bindParam(':jefe', $jefe);\n $sentencia->bindParam(':id_cargo', $id_cargo);\n $sentencia->bindParam(':id_departamento', $id_departamento);\n \n // estos los valores de los input\n $id=\"0700950454\";\n $nombre=\"aaa\";\n $apellido=\"ssss\";\n $direccion=\"sss\";\n $telefono=23323232;\n $email=\"[email protected]\";\n $estado=1;\n $firma=\"NULL\";\n $jefe=\"0706430980\";\n $id_cargo=3;\n $id_departamento=16;\n $sentencia->execute();\n \n \n //CUANDO NO TIENE JEFE--=EL EMPLEADO ES JEFE (NO ENVIAR EL PARAMETRO JEFE,LA BDD AUTOMTICAMENTE PONE NULL)\n $pdo=Conexion::conectar();\n $sentencia = $pdo->prepare(\"INSERT INTO empleado (id, nombre, apellido,direccion,telefono,email,estado,firma,id_cargo,id_departamento) VALUES (:id, :nombre, :apellido,:direccion,:telefono,:email,:estado,:firma,:id_cargo,:id_departamento)\");\n $sentencia->bindParam(':id', $id);\n $sentencia->bindParam(':nombre', $nombre);\n $sentencia->bindParam(':apellido', $apellido);\n $sentencia->bindParam(':direccion', $direccion);\n $sentencia->bindParam(':telefono', $telefono);\n $sentencia->bindParam(':email', $email);\n $sentencia->bindParam(':estado', $estado);\n $sentencia->bindParam(':firma', $firma);\n $sentencia->bindParam(':id_cargo', $id_cargo);\n $sentencia->bindParam(':id_departamento', $id_departamento);\n \n // estos los valores de los inputs\n $id=\"0700950454\";\n $nombre=\"aaa\";\n $apellido=\"ssss\";\n $direccion=\"sss\";\n $telefono=23323232;\n $email=\"[email protected]\";\n $estado=1;\n $firma=\"NULL\";\n $id_cargo=3;\n $id_departamento=16;\n $sentencia->execute();\n \n \n\n \n }", "public function save_linea(){\n $sql=\"select LAST_INSERT_ID() as 'pedido' \";\n\n $query = $this->db->query($sql);\n\n //convierte a un objeto\n //ahora le pasamos el dato de pedido\n $pedido_id=$query->fetch_object()->pedido;\n\n // va recorrer el carrito y va guardar cada elemento en la variable elemento como array\n foreach($_SESSION['carrito'] as $elemento){\n //aca e cada arrray guarda los valores a una variable que contenera los valores de los producto por comprar\n $producto =$elemento['producto'];\n\n $insert =\"insert into lineas_pedidos values(NULL,{$pedido_id},{$producto->id},{$elemento['unidades']})\";\n\n //ejecutamos el query para que guarde los elementos en la base de datos\n $save=$this->db->query($insert);\n \n // var_dump($producto);\n // var_dump($insert);\n // var_dump($save);\n // echo $this->db->error;\n // die();\n }\n $result = false; //este es el resultado por defecto\n //si el $save da true (en otras palabras no esta vacio y los datos se llenaron correctamente)\n if($save){\n $result=true;\n }\n return $result;\n\n }", "public function insert($aluno) {\n\t}", "public function inserir()\n {\n }", "public function insertarDatosSQL(){\n $this->comentario->insertarComentario(\n \t$this->idUser,\n \t$this->date,\n \t$this->comentarioText,\n \t$this->producto);\n }", "function insertardatos($c){\n $temp=\"\";\n //RUTA DEL FICHERO QUE CONTIENE LA CREACION DE TABLAS\n $ruta_fichero_sql = 'mysql_script/datos.sql';\n \n \n //CON EL COMANDO FILE,VOLCAMOS EL CONTENIDO DEL FICHERO EN OTRA VARIABLE\n $datos_fichero_sql = file($ruta_fichero_sql);\n //LEEMOS EL FICHERO CON UN BUCLE FOREACH\n foreach($datos_fichero_sql as $linea_a_ejecutar){\n //QUITAMOS LOS ESPACIOS DE ALANTE Y DETRÁS DE LA VARIABLE\n $linea_a_ejecutar = trim($linea_a_ejecutar); \n \n //GUARDAMOS EN LA VARIABLE TEMP EL BLOQUE DE SENTENCIAS QUE VAMOS A EJECUTAR EN MYSQL\n $temp .= $linea_a_ejecutar.\" \";\n //COMPROBAMOS CON UN CONDICIONAL QUE LA LINEA ACABA EN ;, Y SI ES ASI LA EJECUTAMOS\n if(substr($linea_a_ejecutar, -1, 1) == ';'){\n mysqli_query($c,$temp);\n \n //REINICIAMOS LA VARIABLE TEMPORAL\n $temp=\"\";\n \n }//FIN IF BUSCAR SENTENCIA ACABADA EN ;\n else{\n //echo\"MAL\".$temp.\"<br><br>\";\n }\n \n }//FIN FOREACH\n \n \n }", "function insertar($bd);", "function Insert($datos)\n { \n\t\t// si el id_fichero es nulo, se busca el siguiente que le corresponde \n\t\tif(is_null($datos['id_fichero']))\n\t\t{\t\n\t\t\t// Se obtiene el último id insertado\n\t\t\t$sql_atribs = \"SELECT max(id_fichero) as ultimo_id FROM ficheros_inmuebles WHERE inmueble='\".$datos['inmueble'].\"'\";\n\t\t\t$atribs = $this->Execute($sql_atribs) or die($this->ErrorMsg());\n\t\t\t$num_atribs = $atribs->RecordCount();\n\t\t\t$atrib = $atribs->FetchRow();\n\t\t\n\t\t\tif(is_null($atrib['ultimo_id']))\n\t\t\t{\n\t\t\t\t$id_fichero=1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$id_fichero = $atrib['ultimo_id']+1;\n\t\t\t}\n\t\t}\n\t\t// Se inserta los valores de los datos\n\t\t$insertSQL = sprintf(\"INSERT INTO ficheros_inmuebles (id_fichero, inmueble, fichero, texto_fichero, tipo_fichero) VALUES (%s, %s, %s, %s, %s)\", \n\t\t\t\t GetSQLValueString($id_fichero, \"int\"),\n\t\t\t\t GetSQLValueString($datos['inmueble'], \"text\"),\n\t\t\t\t GetSQLValueString($datos['fichero'], \"text\"),\n\t\t\t\t GetSQLValueString($datos['texto_fichero'], \"text\"),\n\t\t\t\t GetSQLValueString($datos['tipo_fichero'], \"text\"));\n\t\treturn $this->Execute($insertSQL) or die($this->ErrorMsg());\n }", "function insertarProducto($con,$user,$foto1,$foto2,$foto3,$nombre,$precio,$descripcion,$peso,$dimension,$marca,$color,$envase,$categoria,$estado){\n\n $fecha = new DateTime();\n\n $fechaImagen = $fecha->format('dmYHis');\n\n //URL UPLOADS \n $link = \"http://localhost/TiendaPHP-Ajax/uploads/\";\n\n //VARIABLE OBTIENE ID DEL USUARIO QUE ESTA EN LA SESSION\n $idUsuario = selectSessionId($con,$user);\n\n //llenamos los valores a insertar\n $valor1 = 0;\n\n $valor2 = $link.$fechaImagen.$foto1;\n\n if ($foto2 === \"\") {\n \n $valor3 = $link.$foto2;\n\n }else{\n\n $valor3 = $link.$fechaImagen.$foto2;\n }\n\n if ($foto3 === \"\") {\n\n $valor4 = $link.$foto3;\n \n }else{\n\n $valor4 = $link.$fechaImagen.$foto3;\n\n }\n\n $valor5 = $nombre;\n\n $valor6 = $precio;\n\n $valor7 = $descripcion;\n\n $valor8 = $peso;\n\n $valor9 = $dimension;\n\n $valor10 = $marca;\n\n $valor11 = $color;\n\n $valor12 = $envase;\n\n $valor13 = $categoria;\n\n $valor14 = $estado;\n\n $valor15 = $fecha->format('d-m-Y');\n\n $valor16 = 0;\n\n $valor17 = $idUsuario;\n\n $sql = \"INSERT INTO `producto`(`id`, `imagen_front`, `imagen_back`,`imagen_left`, `nombre`, `precio`, `descripcion`, `peso`, `dimension`, `marca`, `color`, `envase`, `categoria`, `estado`, `fecha`,`numero_visitas`, `id_cliente`)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n\n $consultaPreparada = $con->prepare($sql);\n\n $consultaPreparada->bind_param(\"issssdsssssssssii\",$valor1,$valor2,$valor3,$valor4,$valor5,$valor6,$valor7,$valor8,$valor9,$valor10,$valor11,$valor12,$valor13,$valor14,$valor15,$valor16,$valor17);\n\n /* VALIDAMOS PARA ENVIAR MENSAJE DE INSERCION O NO INSERCION DEL PRODUCTO */\n if($consultaPreparada->execute()){\n\n $directorio = \"../uploads/\";\n\n $fichero1 = $directorio.basename($fechaImagen.$_FILES['image1']['name']);\n \n $fichero2 = $directorio.basename($fechaImagen.$_FILES['image2']['name']);\n \n $fichero3 = $directorio.basename($_FILES['image3']['name']); \n \n /* AQUI MOVEMOS EL ARCHIVO AL SERVIDOR */\n move_uploaded_file($_FILES['image1']['tmp_name'],$fichero1);\n \n move_uploaded_file($_FILES['image2']['tmp_name'],$fichero2);\n\n move_uploaded_file($_FILES['image3']['tmp_name'],$fichero3);\n\n $error['result']=\"true\";\n\n echo json_encode($error);\n\n }else{\n\n $error['result']=\"false\";\n\n echo json_encode($error);\n }\n}", "function inserirContato($dadosContato) {\n require_once('../modulo/config.php');\n\n //Import do arquivo de função para conectar no BD \n require_once('conexaoMysql.php');\n\n if(!$conex = conexaoMysql())\n {\n echo(\"<script> alert('\".ERRO_CONEX_BD_MYSQL.\"'); </script>\");\n //die; //Finaliza a interpretação da página\n }\n \n $nome = (string) null;\n $celular = (string) null;\n $email = (string) null;\n $estado = (int) null;\n $dataNascimento = (string) null;\n $sexo = (string) null;\n $obs = (string) null;\n $foto = \"noImage.png\";\n\n\n $nome = $dadosContato['nome'];\n $celular = $dadosContato['celular'];\n $email = $dadosContato['email'];\n $estado = $dadosContato['estado'];\n $dataNascimento =$dadosContato['dataNascimento'];\n\n $sexo = $dadosContato['sexo'];\n $obs = $dadosContato['obs'];\n //$foto = uploadFoto($_FILES['fleFoto']);\n\n\n\n // var_dump($arquivoUpload);\n\n $sql = \"insert into tblcontatos \n (\n nome, \n celular, \n email, \n idEstado, \n dataNascimento, \n sexo, \n obs,\n foto,\n statusContato\n )\n values\n (\n '\". $nome .\"',\n '\". $celular .\"',\n '\". $email .\"', \n \".$estado.\",\n '\". $dataNascimento .\"',\n '\". $sexo .\"', \n '\". $obs .\"',\n '\" . $foto . \"',\n 1\n )\n \";\n // Executa no BD o Script SQL\n\n if (mysqli_query($conex, $sql))\n \n return convertJson($dadosContato);\n else\n return false; \n \n}", "public function addtrajet(Trajet $trajet)\r\n{\r\n\t try\r\n {\r\n $stmt = $this->_db->prepare(\"INSERT INTO Trajet(Type,Num_Ville1,Num_Ville2,Date_aller,Date_retour,Heure_aller,Heure_retour,Prix,Nombre_place,ID_conducteur,Description) \r\n VALUES(:type, :num_ville1, :num_ville2, :date_aller, :date_retour, :heure_aller, :heure_retour, :prix, :nombre_place,:id_conducteur,:description)\");\r\n\t\t $stmt->bindValue(\":type\", $trajet->type());\r\n\t\t $stmt->bindValue(\":num_ville1\", $trajet->num_ville1());\r\n $stmt->bindValue(\":num_ville2\", $trajet->num_ville2());\r\n $stmt->bindValue(\":date_aller\",$trajet->date_aller()); \r\n\t\t $stmt->bindValue(\":date_retour\",$trajet->date_retour());\r\n $stmt->bindValue(\":heure_aller\", $trajet->heure_aller());\r\n $stmt->bindValue(\":heure_retour\",$trajet->heure_retour());\r\n\t\t $stmt->bindValue(\":prix\",$trajet->prix());\r\n\t\t $stmt->bindValue(\":nombre_place\",$trajet->nombre_place());\r\n\t\t $stmt->bindValue(\":id_conducteur\",$trajet->id_conducteur()); \r\n\t\t $stmt->bindValue(\":description\",$trajet->description()); \r\n $stmt->execute(); \r\n\t\t $trajet->hydrate(array('num_trajet' => $this->_db->lastInsertId()));\r\n \r\n return true; \r\n }\r\n catch(PDOException $e)\r\n {\r\n echo $e->getMessage();\r\n } \r\n }", "public function insertarAsistencia($idDocente,$nombre,$apellidos,$hora,$tipo,$fecha,$grupo,$salon){\n\t\t$sql = \" INSERT INTO asistencia (id_docente, nombre, apellidos, hora, tipo, fecha, grupo, salon) VALUES ('$idDocente' , '$nombre' , '$apellidos' , '$hora' , '$tipo' , '$fecha' , '$grupo' , '$salon' ) \";\n\n\t\t$resultado = $this->db->query($sql);\n\n\t\t$sql2 = \" SELECT hora_entrada FROM empleados WHERE id = '$idDocente' LIMIT 1 \";\n\t\t$resultado2 = $this->db->query($sql2);//ejecutando la consulta con la conexión establecida\n\n\t\t$row = $resultado2->fetch(PDO::FETCH_ASSOC);\n\n\t\t//Conviertiendo hora de llegada establecida a segundos\n\t\t$string = implode(\":\", $row);\n\t\t$entrada = strtotime($string);\n\n\t\t$llega = strtotime($hora); //Hora en la que llegó el empleado a segundos\n\n\t\t$nombreCompleto = $nombre.\" \".$apellidos;\n\n\n\t\tif($llega > $entrada){\n\t\t\t$sql3 = \" INSERT INTO incidencias (nombre, hora_inicio, llego_tarde) VALUES ('$nombreCompleto' , '$hora' , 1) \";\n\t\t\t$resultado3 = $this->db->query($sql3);\t\n\t\t}\t\t\n\t\t\t\n\t\theader(\"Location: principal.php?c=controlador&a=muestraRegistros\");\n\t\t\t\n\t}", "public function store()\n\t{\n\t\t$importador = new ImportadorProyecto('/uploads/proyectos/temp.txt');\n\t\t$importador->extraer();\n\n\t\t$urg = Urg::whereUrg($importador->urg)->get(array('id'));\n\t\t$fondo = Fondo::whereFondo($importador->fondo)->get(array('id'));\n\n\t\t$arr_inicio = explode(\"/\", $importador->inicio);\n\t\t$arr_fin = explode(\"/\", $importador->fin);\n\n\t\t$proyecto = new Proyecto();\n\t\t$proyecto->proyecto = $importador->proy;\n\t\t$proyecto->d_proyecto = $importador->d_proyecto;\n\t\t$proyecto->monto = $importador->monto_proy;\n\t\t$proyecto->urg_id = $urg[0]->id;\n\t\t$proyecto->tipo_proyecto_id = 1;\n\t\t$proyecto->aaaa = $importador->aaaa;\n\t\t$proyecto->inicio = $arr_inicio[2].\"-\".$arr_inicio[1].\"-\".$arr_inicio[0];\n\t\t$proyecto->fin = $arr_fin[2].\"-\".$arr_fin[1].\"-\".$arr_fin[0];\n\t\t$proyecto->save();\n\n\t\t//Inserta datos @fondo_proyecto\n\t\t$proyecto->fondos()->attach($fondo[0]->id);\n\n\t\t$arr_objetivos = array();\n\t\tforeach($importador->arr_recursos as $partida => $val){\n\t\t\t//Buscar objetivo en key del arreglo\n\t\t\t$objetivo_id = array_search($val['objetivo'], $arr_objetivos);\n\n\t\t\t//Si no se encuentra\n\t\t\tif( empty($objetivo_id) ) {\n\t\t\t\t$objetivo = new Objetivo();\n\t\t\t\t$objetivo->objetivo = $val['objetivo'];\n\t\t\t\t$objetivo->d_objetivo = $val['d_objetivo'];\n\t\t\t\t$objetivo->save();\n\t\t\t\t$objetivo_id = $objetivo->id;\n\t\t\t\t$arr_objetivos[$objetivo->id] = $val['objetivo'];\n\t\t\t}\n\n\t\t\t$cog = Cog::whereCog($val['cog'])->get();\n\t\t\t$rm = new Rm();\n\t\t\t$rm->rm = $partida;\n\t\t\t$rm->proyecto_id = $proyecto->id;\n\t\t\t$rm->objetivo_id = $objetivo_id;\n\t\t\t$rm->actividad_id = 1;\n\t\t\t$rm->cog_id = $cog[0]->id;\n\t\t\t$rm->fondo_id = $fondo[0]->id;\n\t\t\t$rm->monto = $val['monto'];\n\t\t\t$rm->d_rm = \"\";\n\t\t\t$rm->save();\n\t\t}\n\n\t\treturn redirect()->action('ProyectosController@index');\n\t}", "public function registrarArticulo($idUsuario,$nombre,$descripcion,$precio,$creado,$foto_articulo,$cantidad){\n $sql = \"INSERT INTO inventario (inv_iden, usu_iden, inv_nomb, inv_desc, inv_prec, inv_fech, inv_foto, inv_cant, inv_esta) VALUES (:inv_iden, :usu_iden, :inv_nomb, :inv_desc, :inv_prec, :inv_fech, :inv_foto, :inv_cant, :inv_esta)\";\n\n $datos = array( 'inv_iden' => '', 'usu_iden'=>$idUsuario , 'inv_nomb' => $nombre,'inv_desc' => $descripcion,'inv_prec'=>$precio,'inv_fech'=>$creado,'inv_foto'=>$foto_articulo,'inv_cant'=>$cantidad,'inv_esta'=>'0');\n\n $consulta = $this->ejecutarConsulta($sql,$datos);\n if($consulta){\n $sessData['estado']['type'] = 'success';\n $sessData['estado']['msg'] = 'Se ha subido correctamente el articulo, tienes que esperar a que el administrador lo apruebe.';\n }else{\n $sessData['estado']['type'] = 'error';\n $sessData['estado']['msg'] = 'Ha ocurrido algún problema, por favor intente de nuevo.';\n }\n echo json_encode($sessData);\t\n}", "public function insertarPersonal($datos){\n $c= new conectar();\n $conexion=$c->conexion();\n\n $sql=\"INSERT INTO personal(nombres,ape_pat,ape_mat,dni,celular,correo)\n values('$datos[0]','$datos[1]','$datos[2]','$datos[3]','$datos[4]','$datos[5]')\";\n\n return $result=mysqli_query($conexion,$sql);\n }", "public function insert($maeMedico);", "public static function registrar($datos,$idEmpleado)\n {\n\n//convertimos a tipo date\n$date = new DateTime($datos->fecha);\n\n\nDB::table('recibonomina')->insert(array(\n 'idDocente' => $idEmpleado,\n 'fecha'=> $date->format('Y-m-d'),\n \t'mes_a_Pagar' => $datos->mes,\n 'totalPago'=> $datos->total,\n \t'descuentos' => $datos->valorDescuento,\n 'bonos'=> $datos->valorAdicional,\n \t'observaciones' =>$datos->Observaciones\n )); \n }", "function insertarInterfaz() {\n \n // se obtiene los valores de las variables que bienen por post\n\n $nombre = $this->input->post('nombre');\n $desc = $this->input->post('descripcion');\n $tipo = $this->input->post('tipo');\n $detalleTipo = $this->input->post('detalleT');\n $preoceso = $this->input->post('proceso');\n //se guardan en un array esas variables\n $params['nombre'] = $nombre;\n $params['descripcion'] = $desc;\n $params['tipo'] = $tipo;\n $params['detalle_tipo'] = $detalleTipo;\n $params['proceso'] = $preoceso;\n\n /*\n * invoca al metodo de agregar interfaz que esta en la clase modelo, para guardar la informacion en la base de datos\n */\n // se invova al modelo para hacer la insercion de los datos en laBD\n $result = $this->Interfaz_model->agregarInterfaz($params);\n \n echo json_encode($result); //Comentar para la prueba unitaria\n //return json_encode($result); \n }", "function insert(){\n\t\t\t$result = $this->consult();\n\t\t\tif(count($result) > 0){\n\t\t\t\t$this->form_data[\"id_paciente\"] = $result[0]->id_paciente;\n\t\t\t\t$this->id_paciente = $result[0]->id_paciente;\n\t\t\t\treturn $this->update();\n\t\t\t}\n\n\t\t\ttry{\n\t\t\t\t$this->db->trans_start();\n\t\t\t\t$this->db->insert('paciente', $this->form_data);\n\t\t\t\t$this->db->trans_complete();\n\t\t\t\treturn array(\"message\"=>\"ok\");\n\t\t\t} catch (Exception $e){\n\t\t\t\treturn array(\"message\"=>\"error\");\n\t\t\t}\n\t\t}", "public function save()\n {\n $ins = $this->valores();\n unset($ins[\"idInscription\"]);\n\n $ins['idUser'] = $this->userO->idUser;\n unset($ins[\"userO\"]);\n\n $ins['idProject'] = $this->project->idProject;\n unset($ins[\"project\"]);\n\n if (empty($this->idInscription)) {\n $this->insert($ins);\n $this->idInscription = self::$conn->lastInsertId();\n } else {\n $this->update($this->idInscription, $ins);\n }\n }", "public function insert($cotizacion);", "function inserir() {\n\t\t$this->sql = mysql_query(\"INSERT INTO suporte (user_cad, data_cad, id_regiao, exibicao, tipo, prioridade, assunto, mensagem, arquivo, status, status_reg,suporte_pagina)\n\t\t\t\t\t VALUES\t('$this->id_user_cad ','$this->data_cad','$this->id_regiao', '$this->exibicao', '$this->tipo','$this->prioridade', '$this->assunto', '$this->menssagem', '$this->tipo_arquivo','1','1','$this->pagina');\") or die(mysql_error());\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\n\t\t}", "public function insertarContenedores(){\n\t\t\t#try{\n\t\t\t\n\t\t\t\t$PDOmysql = consulta();\n\t\t\t\t$PDOmysql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n\t\t\t\t#Itera entre el array Contenedores, para insertarlo uno por uno.\n\t\t\t\tforeach ($this->contenedores as $contenedor) {\n\t\t\t\t\n\t\t\t\t\t#Se comprueba si el contenedor esta en la base de datos.\n\t\t\t\t\t$sql = 'select idContenedor from Contenedor where idContenedor = :contenedor';\n\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id());\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\t#La variable respuesta comprueba si existe o no el contendor.\n\t\t\t\t\t$respuesta = $stmt->rowCount() ? true : false;\n\t\t\t\t\t#Si respuesta es que no existe el contenedor aun en la base de datos.\n\t\t\t\t\tif(! $respuesta){\n\t\t\t\t\t\t#Inserta el contenedor.\n\t\t\t\t\t\t$sql = 'insert into Contenedor(idContenedor,Tipo) values(:contenedor, :tipo);';\n\t\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id()); #get_id() y get_tipo()\n\t\t\t\t\t\t$stmt->bindParam(':tipo', $contenedor->get_tipo());\t\t#son metodos de la clase contenedor.\n\t\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t}\n\n\t\t\t\t\t$sql = 'SELECT Flete_idFlete, Contenedor \n\t\t\t\t\t\t\tfrom Contenedor_Viaje \n\t\t\t\t\t\t\twhere \n\t\t\t\t\t\t\tFlete_idFlete = :flete\n\t\t\t\t\t\t\tand\n\t\t\t\t\t\t\tContenedor = :contenedor';\n\n\n\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id());\n\t\t\t\t\t$stmt->bindParam(':flete', $this->flete);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\t#La variable respuesta comprueba si existe o no el contendor.\n\t\t\t\t\t$respuesta = $stmt->rowCount() ? true : false;\n\n\t\t\t\t\tif(! $respuesta){\n\t\t\t\t\t\t#Incicializa el viaje para el flete, asignando contenedores al flete.\n\t\t\t\t\t\t$sql = 'insert into Contenedor_Viaje(WorkOrder,Booking,Flete_idFlete, Contenedor) values(:workorder, :booking, :flete, :contenedor);';\n\t\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t\t$stmt->bindParam(':workorder', $contenedor->get_workorder());\n\t\t\t\t\t\t$stmt->bindParam(':booking', $contenedor->get_booking());\n\t\t\t\t\t\t$stmt->bindParam(':flete', $contenedor->get_flete());\n\t\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id());\n\t\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t\t\t\t//Cada contenedor tiene un objeto ListaSellos.\n\t\t\t\t\t\t\t\t#Se manda a llamar al objeto, y este llama a su metodo insertar, para\n\t\t\t\t\t\t\t\t#añadir los sellos a la base de datos.\n\t\t\t\t\t\t\t\t#Esto se puede ya que cada contenedor conoce el flete al que pertenece.\n\t\t\t\t\t}\n\n\t\t\t\t\telse{\n\t\t\t\t\t\t$update = new Update;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$camposUpdate = array(\"statusA\" => 'Activo');\n\t\t\t\t\t\t$camposWhereUpdate = array(\"Flete_idFlete\" => $this->flete, \"Contenedor\" => $contenedor );\n\n\t\t\t\t\t\t$update->prepareUpdate(\"Contenedor_Viaje\", $camposUpdate, $camposWhereUpdate);\n\t\t\t\t\t\t$update->createUpdate();\n\t\t\t\t\t}\n\n\t\t\t\t\t$listaSellos = $contenedor->get_sellos();\n\t\t\t\t\tif($listaSellos){\n\t\t\t\t\t\t$listaSellos->insertar_sellos();\n\t\t\t\t\t}\t\t\n\n\t\t\t\t}\n\t\t\t#}catch(Exception $e){\n\n\t\t\t#}\n\n\t\t}", "public function insert($usuario_has_hojaruta);", "function insertarPremios($premio,$aciertos) {\r\n$sql = \"insert into tbpremios(idpremio,premio,aciertos)\r\nvalues ('','\".($premio).\"',\".$aciertos.\")\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}", "public function saveEntidad(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_entidades SET entidad = \"%s\" WHERE entidad_id = %d',\n $this->entidad,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_entidades(entidad) VALUES (\"%s\")',\n $this->usuario);\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }", "public function insertar($idordencompra, $nrofactura, $idproveedor, $idpersonal, $idsucursal, $idformapago, $idtipodoc, $iddeposito, \n $fecha_hora, $obs, $monto_compra, $idmercaderia, $cantidad, $precio, $total_exenta, $total_iva5, $total_iva10, $liq_iva5, $liq_iva10, $cuota){\n\n $sql = \"INSERT INTO compras (idordencompra, nrofactura, idproveedor, idpersonal, idsucursal, idformapago, idtipodocumento, iddeposito, fecha, obs, monto, cuotas, estado) \n VALUES ('$idordencompra', '$nrofactura', '$idproveedor', '$idpersonal', '$idsucursal', '$idformapago', '$idtipodoc', '$iddeposito', '$fecha_hora', '$obs', '$monto_compra', '$cuota', '1')\";\n \n $idcompranew = ejecutarConsulta_retornarID($sql);\n\n $num_elementos=0;\n $sw=true;\n\n while($num_elementos < count($idmercaderia)){\n\n $sql_detalle = \"INSERT INTO compras_detalle (idcompra, idmercaderia, cantidad, precio) \n VALUES ('$idcompranew', '$idmercaderia[$num_elementos]', '$cantidad[$num_elementos]', '$precio[$num_elementos]')\";\n ejecutarConsulta($sql_detalle) or $sw = false;\n\n $num_elementos =$num_elementos + 1;\n }\n\n //aca realimazamos la insercion en la tabla libro compras\n\n $sql2 = \"INSERT INTO libro_compras (idcompra, idproveedor, fecha, montoexenta, montoiva5, montoiva10, grabiva5, grabiva10, montopagado) \n VALUES ('$idcompranew', '$idproveedor', '$fecha_hora', '$total_exenta', '$total_iva5', '$total_iva10', '$liq_iva5', '$liq_iva10', '$monto_compra')\";\n\n ejecutarConsulta($sql2);\n\n //aca realizamos la insercion en la tabla cuentas a pagar \n\n if($idformapago == 1){\n $formaPago = 'CONTADO';\n }else{\n $formaPago = 'CREDITO';\n }\n\n $monto_cuota = $monto_compra / $cuota;\n\n $fecha = strtotime($fecha_hora);\n $fecha = date('Y-m-d H:i:s', $fecha);\n $cont = 0;\n\n for ($i=1; $i <= $cuota ; $i++) { \n\n if($i >= 2){\n $cont = $cont + 1;\n $fecha = date(\"Y-m-d H:i:s\", strtotime($fecha_hora. \"+ {$cont} month\"));\n }\n\n if($cuota == 1){\n $concepto = \"Cuota Nro. \". $i .\"/\". $cuota .\" \". $formaPago;\n }else{\n $concepto = \"Cuota Nro. \". $i .\"/\". $cuota .\" \". $formaPago .\" \". $cuota .\" MESES\";\n }\n\n $sql3 = \"INSERT INTO cuentas_a_pagar (idcompra, idproveedor, nrofactura, idnotacredidebi, totalcuota, nrocuota, montocuota, fechavto, obs, estado) \n VALUES ('$idcompranew', '$idproveedor', '$nrofactura', '0', '$cuota', '$i', '$monto_cuota', '$fecha','$concepto', '1')\";\n\n ejecutarConsulta($sql3);\n\n }\n\n $sql4 = \"UPDATE orden_compras SET estado = '2' WHERE idordencompra = '$idordencompra'\";\n ejecutarConsulta($sql4);\n\n return $sw;\n\n }", "static public function mdlGuardarDetalleIngreso($tabla,$datos){\n\n\t\t$sql=\"INSERT INTO $tabla (\n\t\t\t\t\t\t\t\t\t\t\ttipo,\n\t\t\t\t\t\t\t\t\t\t\tdocumento,\n\t\t\t\t\t\t\t\t\t\t\ttaller,\n\t\t\t\t\t\t\t\t\t\t\tfecha,\n\t\t\t\t\t\t\t\t\t\t\tarticulo,\n\t\t\t\t\t\t\t\t\t\t\tcantidad,\n\t\t\t\t\t\t\t\t\t\t\talmacen,\n\t\t\t\t\t\t\t\t\t\t\tidcierre\n\t\t\t\t\t\t\t\t\t\t) \n\t\t\t\t\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t:tipo,\n\t\t\t\t\t\t\t\t\t\t\t:documento,\n\t\t\t\t\t\t\t\t\t\t\t:taller,\n\t\t\t\t\t\t\t\t\t\t\t:fecha,\n\t\t\t\t\t\t\t\t\t\t\t:articulo,\n\t\t\t\t\t\t\t\t\t\t\t:cantidad,\n\t\t\t\t\t\t\t\t\t\t\t:almacen,\n\t\t\t\t\t\t\t\t\t\t\t:idcierre\n\t\t\t\t\t\t\t\t\t\t\t)\";\n\n\t\t$stmt=Conexion::conectar()->prepare($sql);\n\n $stmt->bindParam(\":tipo\",$datos[\"tipo\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":documento\",$datos[\"documento\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":taller\",$datos[\"taller\"],PDO::PARAM_STR);\n $stmt->bindParam(\":fecha\",$datos[\"fecha\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":articulo\",$datos[\"articulo\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":cantidad\",$datos[\"cantidad\"],PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":almacen\",$datos[\"almacen\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":idcierre\",$datos[\"idcierre\"],PDO::PARAM_INT);\n\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\n\t\t}\n\n\t\t$stmt=null;\n\t}", "public function insertar($data)\n {\n //~ $result = $this->db->where('cirif =', $datos['cirif']);\n //~ $result = $this->db->get('cliente');\n\n\t\t$result = $this->db->insert(\"pago_proveedores\", $data);\n\t\t//~ $result = $this->db->insert(\"cliente\", $data);\n\t\treturn $result;\n \n }", "public function cadastrar()\n{\n //DEFINIR A DATA\n $this->data = date('Y-m-d H:i:s');\n\n //INSERIR A VAGA NO BANCO\n $obDatabase = new Database('vagas');\n $obDatabase->insert([\n 'titulo' => $this->titulo,\n 'descricao' => $this->descricao,\n 'ativo' => $this->ativo,\n 'data' => $this->data\n ]);\n //echo \"<pre>\"; print_r($obDatabase); echo \"</pre>\"; exit;\n\n\n //ATRIBUIR O ID DA VAGA NA INSTANCIA\n\n //RETORNAR SUCESSO\n}", "public function insertar($idproveedor, $idusuario, $tipo_comprobante, $serie_comprobante, $num_comprobante, $fecha_hora, $impuesto, $total_compra, $idarticulo, $cantidad, $precio_compra, $precio_venta)\n {\n $sql = \"INSERT INTO ingreso(idproveedor,idusuario,tipo_comprobante,serie_comprobante,num_comprobante,fecha_hora,impuesto,total_compra,estado)\" .\n \" VALUES('$idproveedor','$idusuario','$tipo_comprobante','$serie_comprobante','$num_comprobante','$fecha_hora','$impuesto','$total_compra','ACEPTADO');\";\n// return ejecutarConsulta($sql);\n $idIngreso = ejecutarConsulta_retornarID($sql);\n $num_elementos = 0;\n $sw = true;\n while ($num_elementos < count($idarticulo)) {\n $sql_detalle = \"INSERT INTO detalle_ingreso(idIngreso, idarticulo,cantidad,precio_compra,precio_venta)\"\n . \" VALUES('$idIngreso', '$idarticulo[$num_elementos]','$cantidad[$num_elementos]','$precio_compra[$num_elementos]','$precio_venta[$num_elementos]');\";\n ejecutarConsulta($sql_detalle) or $sw = false;\n $num_elementos++;\n }\n return $sw;\n }", "function insertar(){\n $nombre=$_POST[\"nombre\"];\n $apellido=$_POST[\"apellido\"];\n $edad=$_POST[\"edad\"];\n $curso=$_POST[\"curso\"];\n $correo=$_POST[\"correo\"];\n $consulta=\"INSERT INTO usuarios (Nombre, Apellido, Edad, Curso, Correo) VALUES('\".$nombre.\"', '\".$apellido.\"', '\".$edad.\"', '\".$curso.\"', '\".$correo.\"')\";\n echo $consulta. \"<br>\";\n \n $conexion->consulta($consulta);\n //$resultado = $conector->query($consulta);\n mostrarListado();\n\n }", "public function insertar($data){\n $stm = Conexion::conector()->prepare(\"INSERT INTO tareas VALUES(null,:A,:B)\");\n $stm->bindParam(\":A\",$data[\"nombre\"]); //definir q es A y de donde lo obtengo\n $stm->bindParam(\":B\",$data[\"descripcion\"]);\n return $stm->execute();\n }", "public function setInsert() {\n //monta um array com os dados do formulario de inclusao\n $agenda = array('nome' => $this->input->post('nome'),\n 'email' => $this->input->post('email'),\n 'telefone' => $this->input->post('telefone'),\n 'CELULAR' => $this->input->post('CELULAR'));\n //salva os registro no banco de dados \n if ($this->AgendaModel->save($agenda)){\n echo json_encode(array('success'=>true));\n } else {\n echo json_encode(array('msg'=>'Ocorreio um erro, ao incluir o registro.'));\n }\n }", "function insertar(){\n $conexion = mysqli_connect(\"localhost\",\"root\",\"\",'dynasoft');\n $query= \"INSERT INTO Material (Id_Material,NOMBRE_MATERIAL,UNIDAD_MEDIDA,CANTIDAD_MATERIAL,DESCRIPCION,Fecha_Vencido)\n VALUES ('$this->id_material','$this->nombre','$this->unidad','$this->cantidad','$this->descripcion','$this->fecha_vencido')\";\n $resultado = mysqli_query($conexion,$query);\n\n mysqli_close($conexion);\n }", "public function insertar() {\n $this->consultaValores->id=null;\n return $this->ejecutarConsulta('insertar');\n }", "private function _fill_insert_data() {\n $data = array();\n $data['numero_ticket'] = $this->_generate_numero_ticket();\n $data['descripcion'] = $this->post('descripcion');\n $data['soporte_categoria_id'] = $this->post('soporte_categoria_id');\n $data['persona_id'] = get_persona_id();\n $data['created_at'] = date('Y-m-d H:i:s');\n $data['status'] = 1;\n return $data;\n }", "public function save(){\n\t\t$bd=baseDatos::getInstance();\n\t\t$bd=new baseDatos(BD_USUARIO, BD_CONTRASENA, BD_NOMBRE_BD, BD_SERVIDOR);\n\t\t$bd->connect();\n\t\tif($this->id<>null){\n\t\t$columnas= array('idHotel','nombre','descripcion','cantidadEstrellas','ciudad','direccion','telefono','email','ubicacionFotografia');\n\t\t$valores = array($this->id,$this->nombre, $this->descripcion, $this->cantidadEstrellas, $this->ciudad, $this->direccion, $this->telefono, $this->email, $this->ubicacionFotografia);\n\t\t$filtros=array('idHotel'=>$this->id!= null);\n\t\tif (is_numeric($this->id) && $this->id > 0) {\n\t\t\t$bd->update(self::$tabla, $columnas, $valores, $filtros);\n\t\t} else {\n\t\t\t$bd->insert(self::$tabla, $columnas, $valores);\n\t\t}\n\t\t}else{\n\t\t\t$columnas= array('nombre','descripcion','cantidadEstrellas','ciudad','direccion','telefono','email','ubicacionFotografia');\n\t\t\t$valores = array($this->nombre, $this->descripcion, $this->cantidadEstrellas, $this->ciudad, $this->direccion, $this->telefono, $this->email, $this->ubicacionFotografia);\n\t\t\t$filtros=array('idHotel'=>$this->id!= null);\n\t\t\tif (is_numeric($this->id) && $this->id > 0) {\n\t\t\t\t$bd->update(self::$tabla, $columnas, $valores, $filtros);\n\t\t\t} else {\n\t\t\t\t$bd->insert(self::$tabla, $columnas, $valores);\n\t\t\t}\n\t\t}$bd->disconnect();\n\n\t}", "function insertarPagosFacturas($refpago,$reffactura,$refestatu) { \r\n$sql = \"insert into dbpagosfacturas(idpagofactura,refpago,reffactura,refestatu) \r\nvalues ('',\".$refpago.\",\".$reffactura.\",\".$refestatu.\")\"; \r\n$res = $this->query($sql,1); \r\nreturn $res; \r\n}", "public function inserir() {\n $query = '\n insert into tb_atividade(\n id_evento, nome, qntd_part, inscricao, valor, tipo, carga_hr, data_inicio, data_fim\n ) values ( \n :id_evento, \n :nome, \n :qntd_part, \n :inscricao, \n :valor, \n :tipo, \n :carga_hr, \n :data_inicio, \n :data_fim\n )';\n\n $stmt = $this->conexao->prepare($query);\n $stmt->bindValue(':id_evento', $this->atividade->__get('id_evento'));\n $stmt->bindValue(':nome', $this->atividade->__get('nome'));\n $stmt->bindValue(':qntd_part', $this->atividade->__get('qntd_part'));\n $stmt->bindValue(':inscricao', $this->atividade->__get('inscricao'));\n $stmt->bindValue(':valor', $this->atividade->__get('valor'));\n $stmt->bindValue(':tipo', $this->atividade->__get('tipo'));\n $stmt->bindValue(':carga_hr', $this->atividade->__get('carga_hr'));\n $stmt->bindValue(':data_inicio', $this->atividade->__get('data_inicio'));\n $stmt->bindValue(':data_fim', $this->atividade->__get('data_fim'));\n\n return $stmt->execute();\n }", "function save(){\r\n $sql = \"INSERT INTO artista (nombre, apellido, id_pais, apodo, biografia, id_genero, imagen) VALUES ('\".$this->nombre.\"','\".$this->apellido.\"','\".$this->id_pais.\"','\".$this->apodo.\"','\".$this->biografia.\"','\".$this->id_genero.\"', '\".$this->imagen.\"');\";\r\n $link = connect();\r\n if ($link->query($sql) === TRUE) {\r\n $id_artista = mysqli_insert_id($link);\r\n $this->id_artista = $id_artista;\r\n return $this;\r\n } else {\r\n echo \"Error: \" . $sql . \"<br>\" . $conn->error;\r\n return false;\r\n }\r\n }", "function recuperarDatos(){\r\n\t\t\t\t$this->objFunc=$this->create('MODEmpresa');\r\n\t\t\t\t$objetoFuncion = $this->create('MODEmpresa');\r\n\t\t\t\t$this->res=$this->objFunc->insertarEmpresa($this->objParam);\t//esta bien\t\t\t\r\n\t\t\t\t$this->res->imprimirRespuesta($this->res->generarJson());\r\n\t\t}", "function addPedido($dni, $nombre, $apellido, $ubicacion, $telefono, $imagen, $claseVehiculo, $franjaHoraria)\n {\n\n //si está seteada, quiere decir que hay una imagen en la carpeta temporal de php.\n if (isset($imagen[\"fileTemp\"])) {\n move_uploaded_file($imagen[\"fileTemp\"], $imagen[\"filePath\"]);\n $imagen = $imagen[\"filePath\"];\n } else {\n $imagen = null;\n }\n\n $sentencia = $this->db->prepare(\"INSERT INTO pedido(usuario_asignado, nombre, apellido, ubicacion, telefono, foto, clase_vehiculo ,franja_horaria) VALUES(?,?,?,?,?,?,?,?)\");\n $sentencia->execute(array($dni, $nombre, $apellido, $ubicacion, $telefono, $imagen, $claseVehiculo, $franjaHoraria));\n }", "function insertar_temporada_producto(){\t\t\n\t\t$this->accion=\"Insertar Nueva Temporada\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\"){\n\t\t\t$this->asignar_valores2();\n\t\t\t$this->desde=$this->convertir_fecha($this->desde);\n\t\t\t$this->hasta=$this->convertir_fecha($this->hasta);\n\t\t\t\n\t\t\t$sql=\"INSERT INTO temporadas2 VALUES ('', '$this->id', '$this->mostrar', '$this->prioridad', 'Por Fecha', '0', '$this->desde', '$this->hasta', '0', '0', '$this->alternativo', '0', '0', '$this->titulo', 'NULL', '$this->paxadicional', 'NULL', '$this->desde_a', '$this->hasta_a', '$this->precio_a', '0', 'NULL', '$this->desde_b', '$this->hasta_b', '$this->precio_b', '0', 'NULL', '0', '0', '0', '0', 'NULL')\";\n\t\t\t$id=$this->id;\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/producto/detalle.php?id=$id#next\");\n\t\t\texit();\n\t\t}\n\t}", "function agregar_nueva_poliza($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion){\n\t\n\t//VEO SI SE HA HECHO CLICK EN EL BOTON GUARDAR\n\tif(isset($_POST['btnGuardar'])) {\n\t\t\n\t\t\t$id_ef_cia = base64_decode($_GET['id_ef_cia']);\t\n\t\t \n\t\t\t//SEGURIDAD\n\t\t\t$num_poliza = $conexion->real_escape_string($_POST['txtPoliza']);\n\t\t\t$fecha_ini = $conexion->real_escape_string($_POST['txtFechaini']);\n\t\t\t$fecha_fin = $conexion->real_escape_string($_POST['txtFechafin']);\n\t\t\t$producto = $conexion->real_escape_string($_POST['txtProducto']);\n\t\t\t//GENERAMOS EL ID CODIFICADO UNICO\n\t\t\t$id_new_poliza = generar_id_codificado('@S#1$2013');\t\t\t\t\t\n\t\t\t//METEMOS LOS DATOS A LA BASE DE DATOS\n\t\t\t$insert =\"INSERT INTO s_poliza(id_poliza, no_poliza, fecha_ini, fecha_fin, producto, id_ef_cia) \"\n\t\t\t\t .\"VALUES('\".$id_new_poliza.\"', '\".$num_poliza.\"', '\".$fecha_ini.\"', '\".$fecha_fin.\"', '\".$producto.\"', '\".$id_ef_cia.\"')\";\n\t\t\t\n\t\t\t\n\t\t\t//VERIFICAMOS SI HUBO ERROR EN EL INGRESO DEL REGISTRO\n\t\t\tif($conexion->query($insert)===TRUE){\n\t\t\t\t\t\t\t\t\n\t\t\t\t$mensaje=\"Se registro correctamente los datos del formulario\";\n\t\t\t header('Location: index.php?l=des_poliza&var='.$_GET['var'].'&listarpolizas=v&id_ef_cia='.$_GET['id_ef_cia'].'&entidad='.$_GET['entidad'].'&compania='.$_GET['compania'].'&id_ef='.base64_encode($_GET['id_ef']).'&producto_nombre='.$_GET['producto_nombre'].'&producto_code='.$_GET['producto_code'].'&op=1&msg='.base64_encode($mensaje));\n\t\t\t exit;\n\t\t\t} else {\n\t\t\t\t$mensaje=\"Hubo un error al ingresar los datos, consulte con su administrador \".$conexion->errno.\": \".$conexion->error;\n\t\t\t header('Location: index.php?l=des_poliza&var='.$_GET['var'].'&listarpolizas=v&id_ef_cia='.$_GET['id_ef_cia'].'&entidad='.$_GET['entidad'].'&compania='.$_GET['compania'].'&id_ef='.base64_encode($_GET['id_ef']).'&producto_nombre='.$_GET['producto_nombre'].'&producto_code='.$_GET['producto_code'].'&op=2&msg='.base64_encode($mensaje));\n\t\t\t\texit;\n\t\t\t}\n\t\t\n\t}else {\n\t\t//MUESTRO EL FORM PARA CREAR UNA CATEGORIA\n\t\tmostrar_crear_poliza($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion);\n\t}\n}", "public function saveDatosPrevios(Request $request)\n \n {\n\n \n $apellidos = $request->input('apellido');\n $nombres = $request->input('nombre');\n $experiencias = $request->input('experiencia'); \n\n\n\n for($i = 0; $i<count($apellidos); $i++){\n\n Socio::create([\n 'nombre' => $nombres[$i],\n 'apellidos' => $apellidos[$i],\n 'experiencia' => $experiencias[$i],\n 'id_plan_empresa' => $request->input('plan')\n\n ]);\n\n }\n\n \n\n\n DatosPrevios::create([\n 'nombre_empresa' => $request->input('empresa'),\n 'origen_idea' => $request->input('origen'),\n 'id_plan_empresa' => $request->input('plan'),\n 'elementos_identificativos' => $request->input('elementos'),\n \n ]);\n\n\n return redirect('/home');\n }", "public function addRecordInDB($data, $numero_posti, $id_sede, $id_tipologia_prenotazione, $id_utente_registrato){\r\n include_once './db_functions.php';\r\n $db = new DB_Functions();\r\n //Escaping\r\n $data = DB_Functions::esc($data);\r\n $numero_posti = DB_Functions::esc($numero_posti);\r\n $id_sede = DB_Functions::esc($id_sede);\r\n $id_tipologia_prenotazione = DB_Functions::esc($id_tipologia_prenotazione);\r\n $id_utente_registrato = DB_Functions::esc($id_utente_registrato);\r\n $query = \"INSERT INTO PRENOTAZIONE (DATA, NUMERO_POSTI, ID_SEDE, ID_TIPOLOGIA_PRENOTAZIONE, ID_UTENTE_REGISTRATO)\r\n\t VALUES ($data, $numero_posti, $id_sede, $id_tipologia_prenotazione, $id_utente_registrato)\";\r\n $resQuery1 = $db->executeQuery($query);\r\n // Se la query ha esito positivo\r\n if ($resQuery1[\"state\"]) {\r\n //Salva valore ID del record creato\r\n $query = \"SELECT max(ID_PRENOTAZIONE) FROM PRENOTAZIONE;\";\r\n $resQuery2 = $db->executeQuery($query);\r\n $this->id_prenotazione = $resQuery2[\"response\"][0][0];\r\n $this->data = $data;\r\n $this->numero_posti = $numero_posti;\r\n $this->id_sede = $id_sede;\r\n $this->id_tipologia_prenotazione = $id_tipologia_prenotazione;\r\n $this->id_utente_registrato = $id_utente_registrato;\r\n }\r\n return $resQuery1;\r\n }", "public function insertItem(Request $request)\n {\n\n error_log($request->get('precioCompraDefecto'));\n //error_log($request);\n $item = new articulo();\n $item = new articulo([\n 'nombre' => $request->get('nombre'),\n 'descripcion' => $request->get('descripcion'),\n 'imagen' => $request->get('imagen'),\n 'codigo' => $request->get('codigo'),\n 'stockMinimo' => $request->get('stockMinimo'),\n 'precioCompraDefecto' => $request->get('precioCompraDefecto'),\n 'precioVentaDefecto' => $request->get('precioVentaDefecto'),\n 'idCategoria' => $request->get('idCategoria'),\n 'idMedida' => $request->get('idMedida'),\n 'idLugarServir' => $request->get('idLugarServir'),\n ]);\n\n if (strpos($item->imagen, 'storage') !== false) {\n $item->imagen = \"/storage/images/categorias/nada.png\";\n } else {\n $item->imagen = \"/storage/images/categorias/\" . $item->imagen;\n }\n\n if ($item->stockMinimo == null) {\n $item->stockMinimo = 0;\n }\n\n if ($item->precioCompraDefecto == null) {\n\n $item->precioCompraDefecto = 0.00;\n\n }\n if ($item->precioVentaDefecto == null) {\n\n $item->precioVentaDefecto = 0.00;\n }\n\n if ($item->precioVentaDefecto != null) {\n\n $item->precioVentaDefecto = floatval($item->precioVentaDefecto);\n }\n if ($item->precioCompraDefecto != null) {\n\n $item->precioCompraDefecto = floatval($item->precioCompraDefecto);\n }\n\n if ($item->idCategoria == null) {\n $item->idCategoria = 1;\n }\n if ($item->idMedida == null) {\n $item->idMedida = 1;\n }\n\n $item->estado = true;\n $item->save();\n\n error_log('[articulo]Nueva ');\n return response()->json('Agregado exitosamente');\n }", "public function cadastrar(){\n\t\n\t\t$dados['nome'] = $this->input->post('nome');\n\t\t$dados['email'] = $this->input->post('email');\n\t\t$dados['id_artigo'] = $this->input->post('id_artigo');\n\t\t$dados['nome_artigo'] = $this->input->post('nome_artigo');\n\t\t$dados['comentario'] = $this->input->post('comentario');\n\t\t$dados['data'] = $this->input->post('data');\n\t\t$this->Comentarios->do_insert($dados);\n\t\n\t\tredirect(base_url().\"id/v/\".$dados['id_artigo'] = $this->input->post('id_artigo'));\n\t}" ]
[ "0.7235588", "0.7226794", "0.7207851", "0.71735936", "0.7156793", "0.71288794", "0.71061295", "0.70772624", "0.7052133", "0.7041039", "0.70211124", "0.6915088", "0.68896836", "0.688191", "0.6879282", "0.6879005", "0.68634254", "0.6849441", "0.6838387", "0.6830991", "0.6786887", "0.6753878", "0.6719805", "0.6710342", "0.6706806", "0.67064476", "0.6675901", "0.6666932", "0.66566616", "0.6648259", "0.66463345", "0.6639969", "0.66365546", "0.6628485", "0.6601256", "0.6586255", "0.6574559", "0.6569015", "0.65688574", "0.6567512", "0.6561414", "0.6549028", "0.6542189", "0.6527956", "0.6525357", "0.6522927", "0.65134", "0.651141", "0.6505263", "0.6503019", "0.6500017", "0.6499677", "0.64985913", "0.6493476", "0.6489469", "0.64891964", "0.6488755", "0.64816004", "0.6479169", "0.6475705", "0.6467637", "0.64659345", "0.6463506", "0.6460508", "0.6455721", "0.6452943", "0.645041", "0.6450089", "0.64480793", "0.64472544", "0.64459556", "0.6436165", "0.64348745", "0.6434418", "0.6434078", "0.6427596", "0.642039", "0.64194685", "0.641569", "0.6415471", "0.641534", "0.64103675", "0.6409778", "0.64075905", "0.64050156", "0.64046735", "0.6397156", "0.63926315", "0.63915044", "0.63876545", "0.6387087", "0.6384497", "0.63840765", "0.6375344", "0.6374079", "0.6371334", "0.6369358", "0.6367383", "0.6367203", "0.6364036", "0.63604873" ]
0.0
-1
cuando le dan enviar al pedido , se insertara el articulo al turero del cliente
function InsertarAlRutero($CodArticulo,$CardCode){ //consulta todos los datos del articulo $result=$this->ConsultaDatosdeArituclo($CodArticulo); if( $result) { while( $DatoRutero = mysql_fetch_array($result) ) { //inserta los datos al rutero $this->AgregalineaARutero($DatoRutero["ItemCode"],$DatoRutero["codbarras"],$DatoRutero["ItemName"],$DatoRutero["existencia"],$DatoRutero["lotes"],$DatoRutero["Unidad"],$DatoRutero["precio"], $DatoRutero["PrchseItem"],$DatoRutero["SellItem"],$DatoRutero["InvntItem"],$DatoRutero["AvgPrice"],$DatoRutero["Price"],$DatoRutero["frozenFor"],$DatoRutero["SalUnitMsr"], $DatoRutero["VATLiable"], $DatoRutero["lote"],$DatoRutero["U_Grupo"], $DatoRutero["SalPackUn"], $DatoRutero["FAMILIA"], $DatoRutero["CATEGORIA"],$DatoRutero["MARCA"], $DatoRutero["CardCode"], $DatoRutero["Disponible"],$DatoRutero["U_Gramaje"], $DatoRutero["DETALLE 1"],$DatoRutero["LISTA A DETALLE"],$DatoRutero["LISTA A SUPERMERCADO"],$DatoRutero["LISTA A MAYORISTA"],$DatoRutero["LISTA A + 2% MAYORISTA"],$DatoRutero["PANALERA"],$DatoRutero["SUPERMERCADOS"],$DatoRutero["MAYORISTAS"],$DatoRutero["HUELLAS DORADAS"],$DatoRutero["ALSER"],$DatoRutero["COSTO"],$DatoRutero["PRECIO SUGERIDO"],$DatoRutero["PuntosWeb"],$DatoRutero["Ranking"],$CardCode); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insertForosComentarios(){\n\t\tif($this->get_request_method() != \"POST\") $this->response('', 406);\n\n\t\t//get data sent\n\t\t$data = file_get_contents(\"php://input\");\n\t\t$parametros = $this->jsonDecode($data);\n\t\t$user = $parametros->user;\n\t\t$ses_id = $parametros->ses_id;\n\t\t$id_tema = $parametros->id_tema;\n\t\t$comentario = $parametros->comentario;\n\t\t$id_comentario_respuesta = $parametros->id_comentario_respuesta;\n\n\n\t\t// Session validation\n\t\tif ($this->checkSesId($ses_id, $user)){\n\t\t\t$foro = new foro();\n\t\t\tif ($foro->InsertComentario($id_tema,\n\t\t\t\t\t\t\t\t$comentario,\n\t\t\t\t\t\t\t\t$user,\n\t\t\t\t\t\t\t\tESTADO_COMENTARIOS_FORO,\n\t\t\t\t\t\t\t\t$id_comentario_respuesta)){\n\t\t\t\t$msg = array('status' => \"ok\", \"msg\" => \"Mensaje insertado\");\n\t\t\t\t$this->response($this->json($msg), 200);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Error al insertar\");\n\t\t\t\t$this->response($this->json($error), 400);\t\t\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Sesion incorrecta\");\n\t\t\t$this->response($this->json($error), 400);\t\t\n\t\t}\n\t}", "public static function inserirProdutoCarrinho(){\n if(isset($_SESSION['user'])){\n //USUARIO LOGADO COM CARRINHO\n if(isset($_SESSION['user']['carrinhoId'])){\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $expPro = explode(';',self::$carrinho->produto_id);\n $expQuant = explode(';',self::$carrinho->quantidade);\n\n $expPro[] = self::$produto['produto_id'];\n $expQuant[] = self::$produto['quantidade'];\n\n $impPro = implode(';',$expPro);\n $impQuant = implode(';',$expQuant);\n\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $query = \"UPDATE carrinhos SET produto_id=:idp, quantidade=:qnt, idCliente=:idC WHERE id=:id\";\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,$impPro);\n $stmt->bindValue(2,$impQuant);\n $stmt->bindValue(3,$_SESSION['user']['id']);\n $stmt->bindValue(4,self::$carrinho->id);\n $stmt->execute();\n\n //USUARIO LOGADO SEM CARRINHO\n }else{\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $query = \"INSERT INTO carrinhos(produto_id,quantidade,idCliente) VALUES (:prodId, :qnt, :idCliente)\";\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,self::$produto['produto_id']);\n $stmt->bindValue(2,self::$produto['quantidade']);\n $stmt->bindValue(3,$_SESSION['user']['id']);\n $stmt->execute();\n if($stmt->rowCount()){\n return true;\n }throw new \\Exception(\"Nao Foi Possivel adicionar produto ao carrinho\");\n }\n\n //USUARIO NAO LOGADO\n }else{\n //USUARIO NAO LOGADO COM CARRINHO\n if(isset($_SESSION['carrinho'])){\n $expPro = explode(';',$_SESSION['carrinho']['produto_id']);\n $expQuant = explode(';',$_SESSION['carrinho']['quantidade']);\n $expPro[] = self::$produto['produto_id'];\n $expQuant[] = self::$produto['quantidade'];\n $impPro = implode(';',$expPro);\n $impQuant = implode(';',$expQuant);\n $_SESSION['carrinho'] = array('produto_id'=>$impPro,'quantidade'=>$impQuant);\n return true;\n //USUARIO NAO LOGADO SEM CARRINHO\n }else{\n $_SESSION['carrinho'] = array('produto_id'=>self::$produto['produto_id'],'quantidade'=>self::$produto['quantidade']);\n return true;\n \n }\n \n }\n }", "public function insertaPedido($pedido) {\n $codPedido = $pedido->getId();\n $mesa = $pedido->getMesa();\n $estado = $pedido->getEstado();\n $fecha = $pedido->getFecha();\n $elementos = $pedido->getElementos();\n\n /* Imprimir Datos */\n// echo \"- Pedido: \".$codPedido.\"<br>\";\n// echo \"- Mesa: \".$mesa.\"<br>\";\n// echo \"- Estado: \".$estado.\"<br>\";\n// echo \"- Fecha: \".$fecha.\"<br>\";\n// echo \"- Numero de elementos: \".count($elementos).\"<br><br>\";\n\n /* Insercion de los datos del pedido */\n $sql1 = \"INSERT INTO pedido VALUES($codPedido,$mesa,$estado,$fecha)\";\n $result1 = $this->bd->query($sql1);\n\n /* Para cada pedido, inserto los datos de sus elementos */\n for($i=0 ; $i<count($elementos); $i++) {\n /* Informacion del elemento del pedido */\n $codElem = $elementos[$i]->getId();\n $comentario = $elementos[$i]->getComentario();\n $estadoElem = $elementos[$i]->getEstado();\n $elemCarta = $elementos[$i]->getElemento();\n $codElemCarta = $elemCarta->getId();\n\n /* Imprimir Datos */\n// echo \"--- Elemento Pedido: \".$codElem.\"<br>\";\n// echo \"--- Comentario: \".$comentario.\"<br>\";\n// echo \"--- Estado: \".$estadoElem.\"<br>\";\n// echo \"--- Elemento Carta: \".$codElemCarta.\"<br><br>\";\n\n /* Insercion de los datos del elemento del pedido */\n $sql2 = \"INSERT INTO elementoPedido VALUES($codElem,$estadoElem,\\\"$comentario\\\")\";\n $result2 = $this->bd->query($sql2);\n $sql3 = \"INSERT INTO tieneElemento VALUES($codElem,$codPedido)\";\n $result3 = $this->bd->query($sql3);\n \n /* Insercion de los datos del elemento de la carta*/\n if(get_class($elemCarta) == \"ElementoPlato\") {\n $sql4 = \"INSERT INTO elementoColaCocina VALUES($codElem)\";\n $result4 = $this->bd->query($sql4);\n $sql5 = \"INSERT INTO asociaPlato VALUES($codElem,$codElemCarta)\";\n $result5 = $this->bd->query($sql5);\n }\n else if(get_class($elemCarta) == \"ElementoBebida\") {\n $sql4 = \"INSERT INTO elementoColaBar VALUES($codElem)\";\n $result4 = $this->bd->query($sql4);\n $sql5 = \"INSERT INTO asociaBebida VALUES($codElem,$codElemCarta)\";\n $result5 = $this->bd->query($sql5);\n }\n }\n }", "public function EntregarPedidos()\n\t{\n\t\tself::SetNames();\n\t\t\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" cocinero = ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $cocinero);\n\t\t$stmt->bindParam(2, $codventa);\n\t\t\n\t\t$cocinero = strip_tags(\"0\");\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$sala = strip_tags(base64_decode($_GET[\"nombresala\"]));\n\t\t$mesa = strip_tags(base64_decode($_GET[\"nombremesa\"]));\n\t\t$stmt->execute();\n\t\t\n echo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-check-square-o'></span> EL PEDIDO DE LA \".$sala.\" Y \".$mesa.\" FUE ENTREGADO EXITOSAMENTE </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\t\n }", "function Inserir() {\n if($this->GetClienteCPF($this->getCli_cpf())>0):\n echo '<div class=\"alert alert-danger\" id=\"erro_mostra\">Este CPF já esta cadastrado ';\n Sistema::VoltarPagina();\n echo '</div>';\n exit();\n endif;\n \n //se for maior que zero significa que exite algum email igual----------------------\n if($this->GetClienteEmail($this->getCli_email())>0):\n echo '<div class=\"alert alert-danger\" id=\"erro_mostra\">Este Email já esta cadastrado ';\n Sistema::VoltarPagina();\n echo '</div>';\n exit();\n endif;\n //Caso passou na verificação os dados serão gravados no banco-------------------------\n $query = \"INSERT INTO \".$this->prefix.\"clientes (cli_nome,\n cli_sobrenome,\n cli_data_nasc,\n cli_rg,\n cli_cpf,\n cli_ddd,\n cli_fone,\n cli_celular,\n cli_endereco,\n cli_numero,\n cli_bairro,\n cli_cidade,\n cli_uf,\n cli_cep,\n cli_email,\n cli_data_cad,\n cli_hora_cad,\n cli_pass) VALUES (:cli_nome,\n :cli_sobrenome,\n :cli_data_nasc,\n :cli_rg,\n :cli_cpf,\n :cli_ddd,\n :cli_fone,\n :cli_celular,\n :cli_endereco,\n :cli_numero,\n :cli_bairro,\n :cli_cidade,\n :cli_uf,\n :cli_cep,\n :cli_email,\n :cli_data_cad,\n :cli_hora_cad,\n :cli_senha)\";\n \n $params = array(\n ':cli_nome'=> $this->getCli_nome(),\n ':cli_sobrenome'=> $this->getCli_sobrenome(),\n ':cli_data_nasc'=> $this->getCli_data_nasc(),\n ':cli_rg'=> $this->getCli_rg(),\n ':cli_cpf'=> $this->getCli_cpf(),\n ':cli_ddd'=> $this->getCli_ddd(),\n ':cli_fone'=> $this->getCli_fone(),\n ':cli_celular'=> $this->getCli_celular(),\n ':cli_endereco'=> $this->getCli_endereco(),\n ':cli_numero'=> $this->getCli_numero(),\n ':cli_bairro'=> $this->getCli_bairro(),\n ':cli_cidade'=> $this->getCli_cidade(),\n ':cli_uf'=> $this->getCli_uf(),\n ':cli_cep'=> $this->getCli_cep(),\n ':cli_email'=> $this->getCli_email(),\n ':cli_data_cad'=> $this->getCli_data_cad(),\n ':cli_hora_cad'=> $this->getCli_hora_cad(),\n ':cli_senha'=> $this->getCli_senha(),\n \n \n );\n //echo $query;\n $this->ExecuteSQL($query, $params);\n \n \n }", "function guardaoe(){\n\t\t$m = intval($_POST['totalitem']);\n\t\t$t = 0;\n\t\t// calcula el total de\n\t\tfor ( $i=0; $i < $m; $i++ ){\n\t\t\t$t += $_POST['cana_'.$i];\n\t\t}\n\t\tif ( $t <= 0 ) {\n\t\t\techo \"No hay pedido\";\n\t\t\treturn;\n\t\t}\n\n\t\t// Crea encabezado\n\t\t$numero = $this->datasis->fprox_numero('nprdo');\n\t\t$data['numero'] = $numero;\n\t\t$data['fecha'] = date('Y-m-d');\n\t\t$data['almacen'] = $_POST['almacen'];\n\t\t$data['status'] = 'A';\n\t\t$data['usuario'] = $this->secu->usuario();\n\t\t$data['estampa'] = date('Ymd');\n\t\t$data['hora'] = date('H:i:s');\n\n\t\t$data['instrucciones'] = $_POST['instrucciones'];\n\n\t\t$this->db->insert('prdo',$data);\n\n\t\t// Crea Detalle\n\t\t$ids = '';\n\t\tfor ( $i=0; $i < $m; $i++ ){\n\t\t\t$cana = $_POST['cana_'.$i];\n\t\t\tif ( $cana > 0 ){\n\t\t\t\t// Guarda\n\t\t\t\t$id = intval($_POST['idpfac_'.$i]);\n\t\t\t\t$mSQL = \"\n\t\t\t\tINSERT INTO itprdo (numero, pedido, codigo, descrip, cana, ordenado, idpfac )\n\t\t\t\tSELECT '${numero}' numero, a.numa pedido, a.codigoa codigo, a.desca descrip, a.cana, ${cana} ordenado, ${id} idpfac\n\t\t\t\tFROM itpfac a JOIN pfac b ON a.numa = b.numero\n\t\t\t\tWHERE a.id= ${id}\";\n\t\t\t\t$this->db->query($mSQL);\n\t\t\t}\n\t\t}\n\n\t\t// Crea totales\n\t\t$mSQL = \"\n\t\tINSERT INTO itprdop ( numero, codigo, descrip, ordenado, producido)\n\t\tSELECT '${numero}' numero, codigo, descrip, sum(ordenado) ordenado, 0 producido\n\t\tFROM itprdo\n\t\tWHERE numero = '${numero}'\n\t\tGROUP BY codigo\";\n\t\t$this->db->query($mSQL);\n\n\t}", "function agregar_nueva_poliza($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion){\n\t\n\t//VEO SI SE HA HECHO CLICK EN EL BOTON GUARDAR\n\tif(isset($_POST['btnGuardar'])) {\n\t\t\n\t\t\t$id_ef_cia = base64_decode($_GET['id_ef_cia']);\t\n\t\t \n\t\t\t//SEGURIDAD\n\t\t\t$num_poliza = $conexion->real_escape_string($_POST['txtPoliza']);\n\t\t\t$fecha_ini = $conexion->real_escape_string($_POST['txtFechaini']);\n\t\t\t$fecha_fin = $conexion->real_escape_string($_POST['txtFechafin']);\n\t\t\t$producto = $conexion->real_escape_string($_POST['txtProducto']);\n\t\t\t//GENERAMOS EL ID CODIFICADO UNICO\n\t\t\t$id_new_poliza = generar_id_codificado('@S#1$2013');\t\t\t\t\t\n\t\t\t//METEMOS LOS DATOS A LA BASE DE DATOS\n\t\t\t$insert =\"INSERT INTO s_poliza(id_poliza, no_poliza, fecha_ini, fecha_fin, producto, id_ef_cia) \"\n\t\t\t\t .\"VALUES('\".$id_new_poliza.\"', '\".$num_poliza.\"', '\".$fecha_ini.\"', '\".$fecha_fin.\"', '\".$producto.\"', '\".$id_ef_cia.\"')\";\n\t\t\t\n\t\t\t\n\t\t\t//VERIFICAMOS SI HUBO ERROR EN EL INGRESO DEL REGISTRO\n\t\t\tif($conexion->query($insert)===TRUE){\n\t\t\t\t\t\t\t\t\n\t\t\t\t$mensaje=\"Se registro correctamente los datos del formulario\";\n\t\t\t header('Location: index.php?l=des_poliza&var='.$_GET['var'].'&listarpolizas=v&id_ef_cia='.$_GET['id_ef_cia'].'&entidad='.$_GET['entidad'].'&compania='.$_GET['compania'].'&id_ef='.base64_encode($_GET['id_ef']).'&producto_nombre='.$_GET['producto_nombre'].'&producto_code='.$_GET['producto_code'].'&op=1&msg='.base64_encode($mensaje));\n\t\t\t exit;\n\t\t\t} else {\n\t\t\t\t$mensaje=\"Hubo un error al ingresar los datos, consulte con su administrador \".$conexion->errno.\": \".$conexion->error;\n\t\t\t header('Location: index.php?l=des_poliza&var='.$_GET['var'].'&listarpolizas=v&id_ef_cia='.$_GET['id_ef_cia'].'&entidad='.$_GET['entidad'].'&compania='.$_GET['compania'].'&id_ef='.base64_encode($_GET['id_ef']).'&producto_nombre='.$_GET['producto_nombre'].'&producto_code='.$_GET['producto_code'].'&op=2&msg='.base64_encode($mensaje));\n\t\t\t\texit;\n\t\t\t}\n\t\t\n\t}else {\n\t\t//MUESTRO EL FORM PARA CREAR UNA CATEGORIA\n\t\tmostrar_crear_poliza($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion);\n\t}\n}", "function evt__enviar(){\n if($this->dep('datos')->tabla('mesa')->esta_cargada()){\n $m = $this->dep('datos')->tabla('mesa')->get();\n // print_r($m);\n $m['estado'] = 2;//Cambia el estado de la mesa a Enviado\n $this->dep('datos')->tabla('mesa')->set($m);\n // print_r($m['id_mesa']);\n $this->dep('datos')->tabla('mesa')->sincronizar();\n // $this->dep('datos')->tabla('mesa')->resetear();\n \n $m = $this->dep('datos')->tabla('mesa')->get_listado($m['id_mesa']);\n if($m[0]['estado'] == 2){//Obtengo de la BD y verifico que hizo cambios en la BD\n //Se enviaron correctamente los datos\n toba::notificacion()->agregar(utf8_decode(\"Los datos fueron enviados con éxito\"),\"info\");\n }\n else{\n //Se generó algún error al guardar en la BD\n toba::notificacion()->agregar(utf8_decode(\"Error al enviar la información, verifique su conexión a internet\"),\"info\");\n }\n }\n \n }", "protected function fijarSentenciaInsert(){}", "public function insertarContenedores(){\n\t\t\t#try{\n\t\t\t\n\t\t\t\t$PDOmysql = consulta();\n\t\t\t\t$PDOmysql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n\t\t\t\t#Itera entre el array Contenedores, para insertarlo uno por uno.\n\t\t\t\tforeach ($this->contenedores as $contenedor) {\n\t\t\t\t\n\t\t\t\t\t#Se comprueba si el contenedor esta en la base de datos.\n\t\t\t\t\t$sql = 'select idContenedor from Contenedor where idContenedor = :contenedor';\n\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id());\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\t#La variable respuesta comprueba si existe o no el contendor.\n\t\t\t\t\t$respuesta = $stmt->rowCount() ? true : false;\n\t\t\t\t\t#Si respuesta es que no existe el contenedor aun en la base de datos.\n\t\t\t\t\tif(! $respuesta){\n\t\t\t\t\t\t#Inserta el contenedor.\n\t\t\t\t\t\t$sql = 'insert into Contenedor(idContenedor,Tipo) values(:contenedor, :tipo);';\n\t\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id()); #get_id() y get_tipo()\n\t\t\t\t\t\t$stmt->bindParam(':tipo', $contenedor->get_tipo());\t\t#son metodos de la clase contenedor.\n\t\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t}\n\n\t\t\t\t\t$sql = 'SELECT Flete_idFlete, Contenedor \n\t\t\t\t\t\t\tfrom Contenedor_Viaje \n\t\t\t\t\t\t\twhere \n\t\t\t\t\t\t\tFlete_idFlete = :flete\n\t\t\t\t\t\t\tand\n\t\t\t\t\t\t\tContenedor = :contenedor';\n\n\n\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id());\n\t\t\t\t\t$stmt->bindParam(':flete', $this->flete);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\t#La variable respuesta comprueba si existe o no el contendor.\n\t\t\t\t\t$respuesta = $stmt->rowCount() ? true : false;\n\n\t\t\t\t\tif(! $respuesta){\n\t\t\t\t\t\t#Incicializa el viaje para el flete, asignando contenedores al flete.\n\t\t\t\t\t\t$sql = 'insert into Contenedor_Viaje(WorkOrder,Booking,Flete_idFlete, Contenedor) values(:workorder, :booking, :flete, :contenedor);';\n\t\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t\t$stmt->bindParam(':workorder', $contenedor->get_workorder());\n\t\t\t\t\t\t$stmt->bindParam(':booking', $contenedor->get_booking());\n\t\t\t\t\t\t$stmt->bindParam(':flete', $contenedor->get_flete());\n\t\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id());\n\t\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t\t\t\t//Cada contenedor tiene un objeto ListaSellos.\n\t\t\t\t\t\t\t\t#Se manda a llamar al objeto, y este llama a su metodo insertar, para\n\t\t\t\t\t\t\t\t#añadir los sellos a la base de datos.\n\t\t\t\t\t\t\t\t#Esto se puede ya que cada contenedor conoce el flete al que pertenece.\n\t\t\t\t\t}\n\n\t\t\t\t\telse{\n\t\t\t\t\t\t$update = new Update;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$camposUpdate = array(\"statusA\" => 'Activo');\n\t\t\t\t\t\t$camposWhereUpdate = array(\"Flete_idFlete\" => $this->flete, \"Contenedor\" => $contenedor );\n\n\t\t\t\t\t\t$update->prepareUpdate(\"Contenedor_Viaje\", $camposUpdate, $camposWhereUpdate);\n\t\t\t\t\t\t$update->createUpdate();\n\t\t\t\t\t}\n\n\t\t\t\t\t$listaSellos = $contenedor->get_sellos();\n\t\t\t\t\tif($listaSellos){\n\t\t\t\t\t\t$listaSellos->insertar_sellos();\n\t\t\t\t\t}\t\t\n\n\t\t\t\t}\n\t\t\t#}catch(Exception $e){\n\n\t\t\t#}\n\n\t\t}", "public function inserir_anuncio(){\n if(!isset($_SESSION))session_start();\n\n $cliente = unserialize($_SESSION['cliente']);\n\n $id_veiculo = $_POST['cb_veiculos'];\n $data_inicial = $_POST['data_inicial'];\n $data_final = $_POST['data_final'];\n $hora_inicial = $_POST['hora_inicial'];\n $hora_final = $_POST['hora_final'];\n $descricao = $_POST['descricao'];\n $valor_hora = $_POST['valor_hora'];\n $id_cliente = $cliente->getId();\n\n $anuncio = new Anuncio();\n $anuncio->setDescricao($descricao)\n ->setIdClienteLocador($id_cliente)\n ->setIdVeiculo($id_veiculo)\n ->setHorarioInicio($hora_inicial)\n ->setHorarioTermino($hora_final)\n ->setDataInicial($data_inicial)\n ->setDataFinal($data_final)\n ->setValor($valor_hora);\n\n\n $this->anunciosDAO->insert($anuncio);\n\n }", "function insertarSolicitudCompletaMenor()\r\n {\r\n $cone = new conexion();\r\n $link = $cone->conectarpdo();\r\n $copiado = false;\r\n try {\r\n $link->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n $link->beginTransaction();\r\n\r\n /////////////////////////\r\n // inserta cabecera de la solicitud de compra\r\n ///////////////////////\r\n\r\n //Definicion de variables para ejecucion del procedimiento\r\n $this->procedimiento = 'adq.f_solicitud_modalidades_ime';\r\n $this->transaccion = 'ADQ_SOLMODAL_INS';\r\n $this->tipo_procedimiento = 'IME';\r\n\r\n //Define los parametros para la funcion\r\n $this->setParametro('estado_reg', 'estado_reg', 'varchar');\r\n $this->setParametro('id_solicitud_ext', 'id_solicitud_ext', 'int4');\r\n $this->setParametro('presu_revertido', 'presu_revertido', 'varchar');\r\n $this->setParametro('fecha_apro', 'fecha_apro', 'date');\r\n $this->setParametro('estado', 'estado', 'varchar');\r\n $this->setParametro('id_moneda', 'id_moneda', 'int4');\r\n $this->setParametro('id_gestion', 'id_gestion', 'int4');\r\n $this->setParametro('tipo', 'tipo', 'varchar');\r\n $this->setParametro('num_tramite', 'num_tramite', 'varchar');\r\n $this->setParametro('justificacion', 'justificacion', 'text');\r\n $this->setParametro('id_depto', 'id_depto', 'int4');\r\n $this->setParametro('lugar_entrega', 'lugar_entrega', 'varchar');\r\n $this->setParametro('extendida', 'extendida', 'varchar');\r\n $this->setParametro('numero', 'numero', 'varchar');\r\n $this->setParametro('posibles_proveedores', 'posibles_proveedores', 'text');\r\n $this->setParametro('id_proceso_wf', 'id_proceso_wf', 'int4');\r\n $this->setParametro('comite_calificacion', 'comite_calificacion', 'text');\r\n $this->setParametro('id_categoria_compra', 'id_categoria_compra', 'int4');\r\n $this->setParametro('id_funcionario', 'id_funcionario', 'int4');\r\n $this->setParametro('id_estado_wf', 'id_estado_wf', 'int4');\r\n $this->setParametro('fecha_soli', 'fecha_soli', 'date');\r\n $this->setParametro('id_proceso_macro', 'id_proceso_macro', 'int4');\r\n $this->setParametro('id_proveedor', 'id_proveedor', 'int4');\r\n $this->setParametro('tipo_concepto', 'tipo_concepto', 'varchar');\r\n $this->setParametro('fecha_inicio', 'fecha_inicio', 'date');\r\n $this->setParametro('dias_plazo_entrega', 'dias_plazo_entrega', 'integer');\r\n $this->setParametro('precontrato', 'precontrato', 'varchar');\r\n $this->setParametro('correo_proveedor', 'correo_proveedor', 'varchar');\r\n\r\n $this->setParametro('nro_po', 'nro_po', 'varchar');\r\n $this->setParametro('fecha_po', 'fecha_po', 'date');\r\n\r\n $this->setParametro('prioridad', 'prioridad', 'integer');\r\n\r\n $this->setParametro('tipo_modalidad', 'tipo_modalidad', 'varchar');\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $stmt = $link->prepare($this->consulta);\r\n $stmt->execute();\r\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n //recupera parametros devuelto depues de insertar ... (id_solicitud)\r\n $resp_procedimiento = $this->divRespuesta($result['f_intermediario_ime']);\r\n if ($resp_procedimiento['tipo_respuesta'] == 'ERROR') {\r\n throw new Exception(\"Error al ejecutar en la bd\", 3);\r\n }\r\n\r\n $respuesta = $resp_procedimiento['datos'];\r\n\r\n $id_solicitud = $respuesta['id_solicitud'];\r\n\r\n //////////////////////////////////////////////\r\n //inserta detalle de la solicitud de compra\r\n /////////////////////////////////////////////\r\n\r\n\r\n //decodifica JSON de detalles\r\n $json_detalle = $this->aParam->_json_decode($this->aParam->getParametro('json_new_records'));\r\n\r\n //var_dump($json_detalle)\t;\r\n foreach ($json_detalle as $f) {\r\n\r\n $this->resetParametros();\r\n //Definicion de variables para ejecucion del procedimiento\r\n $this->procedimiento = 'adq.f_solicitud_det_ime';\r\n $this->transaccion = 'ADQ_SOLD_INS';\r\n $this->tipo_procedimiento = 'IME';\r\n //modifica los valores de las variables que mandaremos\r\n $this->arreglo['id_centro_costo'] = $f['id_centro_costo'];\r\n $this->arreglo['descripcion'] = $f['descripcion'];\r\n $this->arreglo['precio_unitario'] = $f['precio_unitario'];\r\n $this->arreglo['id_solicitud'] = $id_solicitud;\r\n $this->arreglo['id_orden_trabajo'] = $f['id_orden_trabajo'];\r\n $this->arreglo['id_concepto_ingas'] = $f['id_concepto_ingas'];\r\n $this->arreglo['precio_total'] = $f['precio_total'];\r\n $this->arreglo['cantidad_sol'] = $f['cantidad_sol'];\r\n $this->arreglo['precio_ga'] = $f['precio_ga'];\r\n $this->arreglo['precio_sg'] = $f['precio_sg'];\r\n\r\n $this->arreglo['id_activo_fijo'] = $f['id_activo_fijo'];\r\n $this->arreglo['codigo_act'] = $f['codigo_act'];\r\n $this->arreglo['fecha_ini_act'] = $f['fecha_ini_act'];\r\n $this->arreglo['fecha_fin_act'] = $f['fecha_fin_act'];\r\n\r\n\r\n //Define los parametros para la funcion\r\n $this->setParametro('id_centro_costo', 'id_centro_costo', 'int4');\r\n $this->setParametro('descripcion', 'descripcion', 'text');\r\n $this->setParametro('precio_unitario', 'precio_unitario', 'numeric');\r\n $this->setParametro('id_solicitud', 'id_solicitud', 'int4');\r\n $this->setParametro('id_orden_trabajo', 'id_orden_trabajo', 'int4');\r\n $this->setParametro('id_concepto_ingas', 'id_concepto_ingas', 'int4');\r\n $this->setParametro('precio_total', 'precio_total', 'numeric');\r\n $this->setParametro('cantidad_sol', 'cantidad_sol', 'int4');\r\n $this->setParametro('precio_ga', 'precio_ga', 'numeric');\r\n $this->setParametro('precio_sg', 'precio_sg', 'numeric');\r\n\r\n $this->setParametro('id_activo_fijo', 'id_activo_fijo', 'varchar');\r\n $this->setParametro('codigo_act', 'codigo_act', 'varchar');\r\n $this->setParametro('fecha_ini_act', 'fecha_ini_act', 'date');\r\n $this->setParametro('fecha_fin_act', 'fecha_fin_act', 'date');\r\n\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $stmt = $link->prepare($this->consulta);\r\n $stmt->execute();\r\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n //recupera parametros devuelto depues de insertar ... (id_solicitud)\r\n $resp_procedimiento = $this->divRespuesta($result['f_intermediario_ime']);\r\n if ($resp_procedimiento['tipo_respuesta'] == 'ERROR') {\r\n throw new Exception(\"Error al insertar detalle en la bd\", 3);\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n //si todo va bien confirmamos y regresamos el resultado\r\n $link->commit();\r\n $this->respuesta = new Mensaje();\r\n $this->respuesta->setMensaje($resp_procedimiento['tipo_respuesta'], $this->nombre_archivo, $resp_procedimiento['mensaje'], $resp_procedimiento['mensaje_tec'], 'base', $this->procedimiento, $this->transaccion, $this->tipo_procedimiento, $this->consulta);\r\n $this->respuesta->setDatos($respuesta);\r\n } catch (Exception $e) {\r\n $link->rollBack();\r\n $this->respuesta = new Mensaje();\r\n if ($e->getCode() == 3) {//es un error de un procedimiento almacenado de pxp\r\n $this->respuesta->setMensaje($resp_procedimiento['tipo_respuesta'], $this->nombre_archivo, $resp_procedimiento['mensaje'], $resp_procedimiento['mensaje_tec'], 'base', $this->procedimiento, $this->transaccion, $this->tipo_procedimiento, $this->consulta);\r\n } else if ($e->getCode() == 2) {//es un error en bd de una consulta\r\n $this->respuesta->setMensaje('ERROR', $this->nombre_archivo, $e->getMessage(), $e->getMessage(), 'modelo', '', '', '', '');\r\n } else {//es un error lanzado con throw exception\r\n throw new Exception($e->getMessage(), 2);\r\n }\r\n\r\n }\r\n\r\n return $this->respuesta;\r\n }", "function entrada_por_traspaso(){\n\t\t$e= new Entrada();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cproveedores_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}", "function cocinar_registro_cliente() {\n\t\tglobal $bd;\n\t\tglobal $x_idcliente;\n\t\tglobal $x_idpedido;\n\n\t\t\n\t\t// $x_arr_cliente = $_POST['p_cliente'];\n\t\t// $datos_cliente = $x_arr_cliente['cliente'];\n\t\t$datos_cliente = $_POST['p_cliente'];\n\n\t\t$nomclie=$datos_cliente['nombres'];\n\t\t$idclie=$datos_cliente['idcliente'];\n\t\t$num_doc=$datos_cliente['num_doc'];\n\t\t$direccion=$datos_cliente['direccion'];\n\t\t$f_nac=$datos_cliente['f_nac'];\n\t\t// $idpedidos=$x_arr_cliente['i'] == '' ? $x_idpedido : $x_arr_cliente['i'];\n\n\t\tif($idclie==''){\n\t\t\tif($nomclie==''){//publico general\n\t\t\t\t$idclie=0;\n\t\t\t}else{\n\t\t\t\t$sql=\"insert into cliente (idorg,nombres,direccion,ruc,f_nac)values(\".$_SESSION['ido'].\",'\".$nomclie.\"','\".$direccion.\"','\".$num_doc.\"','\".$f_nac.\"')\";\n\t\t\t\t$idclie=$bd->xConsulta_UltimoId($sql);\n\t\t\t}\n\t\t} else {\n\t\t\t// update cliente\n\t\t\t$sql=\"update cliente set nombres='\".$nomclie.\"',ruc='\".$num_doc.\"',direccion='\".$direccion.\"' where idcliente = \".$idclie;\n\t\t\t$bd->xConsulta_NoReturn($sql);\n\t\t}\n\n\t\t// $bd->xConsulta_NoReturn($sql);\n\t\t// $sql=\"update pedido set idcliente=\".$idclie.\" where idpedido in (\".$idpedidos.\")\";\n\t\t\n\t\t$x_idcliente = $idclie;\n\t\t$x_idpedido = $idpedidos;\n\n\t\techo $idclie;\n\n\t\t// $rptclie = json_encode(array('idcliente' => $idclie));\n\t\t// print $rptclie.'|';\n\n\t\t// 031218 // cambio: ahora se graba primero el cliente se devuelve el idcliete, \n\n\t\t// $GLOBALS['x_idcliente'] = $idclie;\n\t\t// return $x_idcliente;\n\t\t// echo $idclie;\n\t}", "public function add(){\n if (isset($_SESSION['identity'])) {// Comprobamos que hay un usuario logueado\n $usuario_id = $_SESSION['identity']->id;// Obtenemos el ID del Usuario logueado\n $sProvincia = isset($_POST['province']) ? $_POST['province'] : false;\n $sLocalidad = isset($_POST['location']) ? $_POST['location'] : false;\n $sDireccion = isset($_POST['address']) ? $_POST['address'] : false;\n\n $stats = Utils::statsCarrito();\n $coste = $stats['total'];// Obtenemos el coste total del pedido\n\n\n if ($sProvincia && $sLocalidad && $sDireccion){\n // Guardar datos en bd\n $oPedido = new Pedido();\n $oPedido->setUsuarioId($usuario_id);\n $oPedido->setProvincia($sProvincia);\n $oPedido->setLocalidad($sLocalidad);\n $oPedido->setDireccion($sDireccion);\n $oPedido->setCoste($coste);\n\n $save = $oPedido->savePedido();// Insertamos el Pedido en BD\n\n // Guardar Linea Pedido\n $save_linea = $oPedido->save_linea();\n\n if ($save && $save_linea){// Comprobamos que La inserccion a sido correcta\n $_SESSION['pedido'] = \"complete\";\n }else{\n $_SESSION['pedido'] = \"failed\";\n }\n }else{\n $_SESSION['pedido'] = \"failed\";\n\n }\n header(\"Location:\" . base_url .'pedido/confirmado');\n }else{\n // Redirigir al Index\n header(\"Location:\" . base_url);\n }\n }", "function alta_transferencia(){\n\t\t$u= new Cl_pedido();\n\t\t$u->empresas_id=$GLOBALS['empresa_id'];\n\t\t$u->cclientes_id=$GLOBALS['empresa_id'];\n\t\t$u->fecha_alta=date(\"Y-m-d H:i:s\");\n\t\t//Sincronizar con fecha de salida&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->ccl_estatus_pedido_id=2;\n\t\t$u->corigen_pedido_id=3;\n\t\t$u->ccl_tipo_pedido_id=2;\n\t\t// save with the related objects\n\t\tif($_POST['id']>0){\n\t\t\t$u->get_by_id($_POST['id']);\n\t\t\t$insert_traspaso_salida=0;\n\t\t} else {\n\t\t\t$insert_traspaso_salida=1;\n\t\t}\n\t\t$u->trans_begin();\n\t\tif($u->save()) {\n\t\t\t$cl_pedido_id=$u->id;\n\t\t\tif($insert_traspaso_salida==1) {\n\t\t\t\t//Dar de alta el traspaso\n\t\t\t\t$t= new Traspaso();\n\t\t\t\t$t->cl_pedido_id=$cl_pedido_id;\n\t\t\t\t$t->traspaso_estatus=1;\n\t\t\t\t$t->ubicacion_entrada_id=$_POST['ubicacion_entrada_id'];\n\t\t\t\t$t->ubicacion_salida_id=$_POST['ubicacion_salida_id'];\n\t\t\t\t$t->trans_begin();\n\t\t\t\t$t->save();\n\t\t\t\tif ($t->trans_status() === FALSE) {\n\t\t\t\t\t// Transaction failed, rollback\n\t\t\t\t\t$t->trans_rollback();\n\t\t\t\t\t$u->trans_rollback();\n\t\t\t\t\t// Add error message\n\t\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\t\techo '<button type=\"submit\" style=\"display:none;\" id=\"boton1\">Intentar de nuevo</button><br/>';\n\t\t\t\t\techo \"El alta del traspaso no pudo registrarse, intente de nuevo\";\n\t\t\t\t} else {\n\t\t\t\t\t// Transaction successful, commit\n\t\t\t\t\t$u->trans_commit();\n\t\t\t\t\t$t->trans_commit();\n\t\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\t\techo '<p id=\"response\">Capturar los detalles del pedido</p><button type=\"submit\" id=\"boton1\" style=\"display:none;\" id=\"boton1\">';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//Actualisar unicamente la tabla de los detalles\n\t\t\t\t$u->trans_commit();\n\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\techo '<p id=\"response\">Capturar los detalles del pedido</p><button type=\"submit\" id=\"boton1\" style=\"display:none;\" id=\"boton1\">';\n\t\t\t}\n\t\t} else {\n\t\t\t$u->trans_rollback();\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "function insertarCliente(){\n\t\t$this->procedimiento='rec.ft_cliente_ime';\n\t\t$this->transaccion='REC_CLI_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('genero','genero','varchar');\n\t\t$this->setParametro('ci','ci','varchar');\n\t\t$this->setParametro('email','email','varchar');\n\t\t$this->setParametro('email2','email2','varchar');\n\t\t$this->setParametro('direccion','direccion','varchar');\n\t\t$this->setParametro('celular','celular','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('lugar_expedicion','lugar_expedicion','varchar');\n\t\t$this->setParametro('apellido_paterno','apellido_paterno','varchar');\n\t\t$this->setParametro('telefono','telefono','varchar');\n\t\t$this->setParametro('ciudad_residencia','ciudad_residencia','varchar');\n\t\t$this->setParametro('id_pais_residencia','id_pais_residencia','int4');\n\t\t$this->setParametro('nacionalidad','nacionalidad','varchar');\n\t\t$this->setParametro('barrio_zona','barrio_zona','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('apellido_materno','apellido_materno','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public static function guardar(){\n // Almacena la cita y devuelve el id\n $cita = new Cita($_POST);\n $resultado = $cita->guardar();\n\n $id = $resultado['id'];// Id de la cita creada\n\n // Almacena la cita y el servicio\n $idServicios = explode(\",\", $_POST['servicios']);\n // Iteramos egun el numero de servicios elegidos y le ponemos la misma citaId\n foreach($idServicios as $idServicio){\n $args = [\n 'citaId' => $id,\n 'servicioId' => $idServicio\n ];\n $citaServicio = new CitaServicio($args); // Creamos el objeto para tabla 'citasservicios'(Pivote)\n $citaServicio->guardar(); // Guardamos en tabla 'citasservicios'\n }\n echo json_encode(['resultado' => $resultado]);\n }", "function addPedido($dni, $nombre, $apellido, $ubicacion, $telefono, $imagen, $claseVehiculo, $franjaHoraria)\n {\n\n //si está seteada, quiere decir que hay una imagen en la carpeta temporal de php.\n if (isset($imagen[\"fileTemp\"])) {\n move_uploaded_file($imagen[\"fileTemp\"], $imagen[\"filePath\"]);\n $imagen = $imagen[\"filePath\"];\n } else {\n $imagen = null;\n }\n\n $sentencia = $this->db->prepare(\"INSERT INTO pedido(usuario_asignado, nombre, apellido, ubicacion, telefono, foto, clase_vehiculo ,franja_horaria) VALUES(?,?,?,?,?,?,?,?)\");\n $sentencia->execute(array($dni, $nombre, $apellido, $ubicacion, $telefono, $imagen, $claseVehiculo, $franjaHoraria));\n }", "public function GenerarPedidoCrecer($refVenta)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$fechaConfirmacion=date(\"m/d/Y h:m:s\" );\r\n\t\t\t\r\n\t\t\t//ACTUALIZAMOS EL ESTADO DE PEDIDO WEB A CONFIRMADO Y AGREGAMOS LA FECHA DE CONFIRMACION\r\n\t\t\t//$recordSett = &$this->conexion->conectarse()->Execute(\"\tUPDATE PedidoWeb\r\n\t\t\t//SET FechaRespuesta ='\".$fechaConfirmacion.\"', Estado = 1\r\n\t\t\t//WHERE (CodigoTransaccion = '\".$refVenta.\"' AND Estado = 3)\");\t\r\n\t\t\t\r\n\t\t\t//CREAMOS EL PEDIDO EN CRECER\r\n\t\t\t//1.OBTENEMOS LA INFORMACION DEL PEDIDO DESDE LA TABLA TEMPORAL\r\n\t\t\t\r\n\t\t\t//Id--0\r\n\t\t\t//CodigoTransaccion--1\r\n\t\t\t//IdPoliza--2\r\n\t\t\t//FechaCreacion--3\r\n\t\t\t//FechaRespuesta--4\r\n\t\t\t//NombreTitularFactura--5\r\n\t\t\t//DocumentoTitularFactura--6\r\n\t\t\t//DireccionTitularFactura--7\r\n\t\t\t//TelefonoTitularFactura--8\r\n\t\t\t//EmailTitularFactura--9\r\n\t\t\t//TelefonoContacto--10\r\n\t\t\t//TelefonoMovilContacto--11\r\n\t\t\t//DireccionContacto--12\r\n\t\t\t//NombreContactoEmergencia--13\r\n\t\t\t//ApellidoContactoEmergencia--14\r\n\t\t\t//TelefonoContactoEmergencia--15\r\n\t\t\t//EmailContactoEmergencia--16\r\n\t\t\t//Estado--17\r\n\t\t\t//FechaInicio--18\r\n\t\t\t//FechaFin--19\r\n\t\t\t//Precio--20\r\n\t\t\t//Region--21\r\n\t\t\t//TrmIata--22\t\t\t\r\n\t\t\t\r\n\t\t\t$pedidoWeb = &$this->conexion->conectarse()->Execute(\"SELECT Id, CodigoTransaccion, IdPoliza, FechaCreacion, FechaRespuesta, NombreTitularFactura, DocumentoTitularFactura, DireccionTitularFactura, TelefonoTitularFactura, EmailTitularFactura, TelefonoContacto, TelefonoMovilContacto, DireccionContacto, \r\n\t\t\tNombreContactoEmergencia, ApellidoContactoEmergencia, TelefonoContactoEmergencia, EmailContactoEmergencia,\r\n\t\t\t Estado, FechaInicio, FechaFin, Precio, Region, TrmIata \r\n\t\t\t FROM dbo.PedidoWeb\t\tWHERE CodigoTransaccion= '\".$refVenta.\"'\");\t\t\r\n\r\n\t\t\t//2.VALIDAMOS EL CLIENTE SI NO EXISTE CREAMOS EL CLIENTE Y SU CONTACTO.\t\t\t\r\n\t\t\t$existeCliente = &$this->conexion->conectarse()->Execute(\"SELECT DISTINCT Identificacion,Id FROM dbo.Empresas\r\n\t\t\tWHERE Identificacion='\".$pedidoWeb->fields[6].\"' \");\t\r\n\t\t\t\r\n\t\t\t$IdCliente=\"\";\r\n\t\t\t//CREAMOS EL CLIENTE NUEVO \r\n\t\t\tif($existeCliente->fields[0]==\"\"){\r\n\t\t\t\t\r\n\t\t\t\techo \"Entramos a creacion\";\r\n\t\t\t\t\r\n\t\t\t\t$IdCliente=$this->fun->NewGuid();\r\n\t\t\t\t$IdContacto=$this->fun->NewGuid();\r\n\t\t\t\t$IdPedido=$this->fun->NewGuid();\r\n\t\t\t\t$IdProductoCotizacion=$this->fun->NewGuid();\r\n\t\t\t\t$IdFactura=$this->fun->NewGuid();\t\t\t\t\r\n\t\t\t\t$grupo=2;//ASESORES\r\n\t\t\t\t$prioridad=2;\r\n\t\t\t\t$seguimiento=\"Creado desde el portal web \". $fechaConfirmacion.\"\\n\";\r\n\t\t\t\t$moneda=2;//DOLARES\r\n\t\t\t\t$viaContacto=2;//WEB\r\n\t\t\t\t$formaPago=1;\r\n\t\t\t\t//CREAMOS LA EMPRESA\r\n\t\t\t\t$crearCliente = &$this->conexion->conectarse()->Execute( \"INSERT INTO Empresas\r\n (Id, TipoEmpresa, Identificacion, Dv, RazonSocial, Antiguedad, Telefono, Fax, Direccion, Mail, Url, Ciudad, Departamento, Pais, Aniversario, TieneAniversario, \r\n FechaIngreso, IdActividadEconomica, Movil, Observaciones, SeguimientoHistorico, Estado, IdAsesor, RepresentanteLegal, IdTipoMonedaImportacion, \r\n TipoNacionalidad, IdEmpleadoModif, Imagen)\r\n\t\t\t\t\t\tVALUES ('\".$IdCliente.\"','N/A','\".$pedidoWeb->fields[6].\"','N','\".$pedidoWeb->fields[5].\"','0',\r\n\t\t\t\t\t\t'\".$pedidoWeb->fields[8].\"','0','\".$pedidoWeb->fields[7].\"','\".$pedidoWeb->fields[9].\"','-',NULL,NULL,\r\n\t\t\t\t\t\tNULL,NULL,NULL,'\".$fechaConfirmacion.\"',\r\n\t\t\t\t\t\tNULL,'\".$pedidoWeb->fields[11].\"','Ninguna',\r\n\t\t\t\t\t\tNULL,'0',NULL,'Ninguno',\r\n\t\t\t\t\t\t'2','false',NULL,\r\n\t\t\t\t\t\tNULL)\");\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL CLIENTE\r\n\t\t\t\t$crearCliente = &$this->conexion->conectarse()->Execute( \"INSERT INTO Clientes\r\n (Id, Ingreso, Inicio, Fin, CodigoSwift, IdTipoCliente, IdActividadEconomica)\r\n\t\t\t\tVALUES ('\".$IdCliente.\"','\".$fechaConfirmacion.\"','\".$fechaConfirmacion.\"',NULL,'0',NULL,'0')\");\r\n\t\t\t\t\r\n\t\t\t\t//NOTIFICAMOS DE LA COMPRA AL TITLULAR DE LA FACTURA\r\n\t\t\t\t/////////$this->fun->SendMailConfirmacionPago($pedidoWeb->fields[9], $pedidoWeb->fields[5], $pedidoWeb->fields[6]);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL CONTACTO.\t\t\t\t\r\n\t\t\t\t$crearContacto= &$this->conexion->conectarse()->Execute(\"INSERT INTO Contactos(Id, Descripcion, Cargo, Direccion, Telefono, Extension, Celular, Fax, EmailEmpresa, EmailPersonal, Observacion, Cumpleanno, TieneCumpleanno, Estado)\r\n\t\t\t\tVALUES ('\".$IdContacto.\"','\".$pedidoWeb->fields[13].\" \".$pedidoWeb->fields[14].\"',NULL,NULL,'\".$pedidoWeb->fields[15].\"',NULL,NULL,NULL,'\".$pedidoWeb->fields[16].\"','\".$pedidoWeb->fields[16].\"',NULL,NULL,NULL,'true')\");\r\n\t\t\t\t\r\n\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\tVALUES ('\".$IdCliente.\"','\".$IdContacto.\"')\");\r\n\r\n\t\t\t\t//CREAMOS EL PEDIDO\r\n\t\t\t\t\r\n\t\t\t\t\t$crearPedido = &$this->conexion->conectarse()->Execute(\"INSERT INTO OrdenCompraCliente\r\n (Id, FechaElaboracion, IdCliente, IdPaisOrigen, IdSedeCliente, IdRegionDestino, IdContactoEmergencia, FechaSalida, FechaRegreso, CantidadPasajeros, IdContacto, \r\n Codigo, IdAutor, IdEmpleado, FechaModificacion, SubtotalSinDto, Subtotal, ValorIva, Total, Trm_dia, UtilidadSobreCosto, Estado, GrupoAsignado, Prioridad, \r\n Probabilidad, Observaciones, SeguimientoHistorico, FechaRecepcion, Moneda, FormaPago, TiempoEntrega, TiempoVigencia, Instalacion, \r\n IdEmpleadoModif, IdViadeContacto)\r\n\t\t\t\t\t\t\tVALUES ('\".$IdPedido.\"','\".$fechaConfirmacion.\"','\".$IdCliente.\"','1',\r\n\t\t\t\t\t\t\t'00000000-0000-0000-0000-000000000000','\".$pedidoWeb->fields[21].\"',\r\n\t\t\t\t\t\t\t'\".$IdContacto.\"','\".$pedidoWeb->fields[18].\"','\".$pedidoWeb->fields[19].\"','0','\".$IdContacto.\"','',\r\n\t\t\t\t\t\t\t'7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','\".$fechaConfirmacion.\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"','0','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[22].\"',\r\n\t\t\t\t\t\t\t'true','1','\".$grupo.\"','\".$prioridad.\"','100',NULL,'\".$seguimiento.\"',\r\n\t\t\t\t\t\t\t'\".$fechaConfirmacion.\"','\".$moneda.\"','\".$formaPago.\"',NULL,NULL,'false','00000000-0000-0000-0000-000000000000','\".$viaContacto.\"')\");\r\n\t\t\t\t\t//CREAMOS EL PRODUCTO COTIZACION.\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\t// OBTENEMOS LA CANTIDAD DE PASAJEROS.\t\t\t\t\t\t\r\n\t\t\t\t\t\t$cantidadPasajeros = &$this->conexion->conectarse()->Execute(\"SELECT COUNT(*) AS Expr1\r\n\t\t\t\t\t\tFROM PasajerosPedido\r\n\t\t\t\t\t\tWHERE (IdPedido = '\".$pedidoWeb->fields[0].\"')\");\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$productoCotizacion = &$this->conexion->conectarse()->Execute(\"INSERT INTO ProductosCotizacion\r\n (Id, IdProducto, IdReferencia, Cantidad, ValorVenta, SubtotalSinDescuento, ValorVentaCliente, IVA, AplicarIva, IdFormaEnvio, TipoTrasporte, UtilidadGlobal, Utilidad, \r\n UtilidadEnPorcentaje, UtilidadDespuesCosto, Arancel, ComicionProveedor, IdEmpleado, FechaModificacion, FechaElaboracion, Moneda, ComentarioAdicional, \r\n Descuento, Aumento)\r\n\t\t\t\t\t\t\tVALUES ('\".$IdProductoCotizacion.\"','\".$pedidoWeb->fields[2].\"','\".$IdPedido.\"','\".$cantidadPasajeros->fields[0].\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"',\r\n\t\t\t\t\t\t\t'0','true','0','0','0','0','true','false','0',\r\n\t\t\t\t\t\t\t'0','7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','\".$fechaConfirmacion.\"','\".$fechaConfirmacion.\"','4','','0','0')\");\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL PASAJERO PRODUCTO COTIZACION.\r\n\t\t\t\t\t\t//CONSULTAMOS LOS PASAJEROS ASOCIADOS AL PEDIDO\t\t\t\t\t\t\r\n\t\t\t\t\t\t$pedidoPasajero = &$this->conexion->conectarse()->Execute(\"SELECT Id, IdPedido, Nombre, Apellido, Documento, Email, FechaNacimiento\r\n\t\t\t\t\t\t\tFROM PasajerosPedido \r\n\t\t\t\t\t\t\tWHERE (IdPedido = '\".$pedidoWeb->fields[0].\"')\");\t\t\r\n\t\t\t\t\t\tforeach($pedidoPasajero as $k => $row) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$idPasajero=\"\";\r\n\t\t\t\t\t\t\t$numeroPoliza=\"\";// ACA DEBO LLAMAR EL WEBSERVICE\r\n\t\t\t\t\t\t\t$idPasajeroProducto=$this->fun->NewGuid();\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$existePasajero = &$this->conexion->conectarse()->Execute(\"SELECT Id\r\n\t\t\t\t\t\t\t\tFROM Pasajero\r\n\t\t\t\t\t\t\t\tWHERE (Identificacion = '\". $row[4].\"')\");\t\t\t\t\t\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\t\t//NOTIFICAMOS A LOS PASAJEROS DE LA COMPRA\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t///////////$this->fun->SendMailConfirmacionPago($row[5], $row[2], $row[3]);\r\n\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($existePasajero->fields[0]==\"\"){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//CREAMOS PASAJERO\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$idPasajero=$this->fun->NewGuid();\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$existePasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\tINSERT INTO Pasajero\r\n \t\t(Id, Nombre, Apellido, Identificacion, FechaNacimiento, Telefono, Celular, Email, Estado, Direccion, Observaciones, SeguimientoHistorico)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$row[2].\"','\".$row[3].\"','\".$row[4].\"','\".$row[6].\"','\".$pedidoWeb->fields[10].\"','\".$pedidoWeb->fields[11].\"','\".$row[5].\"','true','\".$pedidoWeb->fields[12].\"','-','\".$seguimiento.\"')\");\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//ASOCIAMOS EL CONTACTO DE EMERGENCIA\r\n\t\t\t\t\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$IdContacto.\"')\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//ASOCIAMOS AL PASAJERO PRODUCTO COTIZACION\t\r\n\t\t\t\t\t\t\t\t$asociamospasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\t\tINSERT INTO PasajerosProductosCotizacion (Id, IdPasajero, IdProductoCotizacion, Poliza, Estado, Aumento, Descuento, ValorUnitario)\r\n\t\t\t\t\t\t\t\t\tVALUES ('\".$idPasajeroProducto.\"','\".$idPasajero.\"','\".$IdProductoCotizacion.\"','\".$numeroPoliza.\"','true','0','0','0')\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if($existePasajero->fields[0]!=\"\"){\r\n\t\t\t\t\t\t\t//\techo \"Entramos al caso cuando el pasajero ya existe\";\r\n\t\t\t\t\t\t\t\t$idPasajero=$existePasajero->fields[0];\t\t\r\n\t\t\t\t\t\t\t\t\t//ASOCIAMOS EL CONTACTO DE EMERGENCIA\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$IdContacto.\"')\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t//ASOCIAMOS AL PASAJERO PRODUCTO COTIZACION\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociamospasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\t\tINSERT INTO PasajerosProductosCotizacion (Id, IdPasajero, IdProductoCotizacion, Poliza, Estado, Aumento, Descuento, ValorUnitario)\r\n\t\t\t\t\t\t\t\t\tVALUES ('\".$idPasajeroProducto.\"','\".$idPasajero.\"','\".$IdProductoCotizacion.\"','\".$numeroPoliza.\"','true','0','0','0')\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS FACTURA.\t\t\t\t\r\n\t\t\t\t//CREAMOS FACTURA ORDEN COMPRA.\t\t\t\t\r\n\t\t\t\t//CREAMOS ALERTAS FACTURACION.\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t//EL CLIENTE YA EXISTE - ASOCIAMOS TODO EL PEDIDO\r\n\t\t\telse if($existeCliente->fields[0]!=\"\") {\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$IdCliente=$existeCliente->fields[1];\t\t\t\t\t\t\r\n\t\t\t\t$IdContacto=$this->fun->NewGuid();\r\n\t\t\t\t$IdPedido=$this->fun->NewGuid();\r\n\t\t\t\t$IdProductoCotizacion=$this->fun->NewGuid();\r\n\t\t\t\t$IdFactura=$this->fun->NewGuid();\t\t\t\t\r\n\t\t\t\t$grupo=2;//ASESORES\r\n\t\t\t\t$prioridad=2;\r\n\t\t\t\t$seguimiento=\"Creado desde el portal web \". $fechaConfirmacion.\"\\n\";\r\n\t\t\t\t$moneda=2;//DOLARES\r\n\t\t\t\t$viaContacto=2;//WEB\r\n\t\t\t\t$formaPago=1;\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL CONTACTO.\t\t\t\t\r\n\t\t\t\t$crearContacto= &$this->conexion->conectarse()->Execute(\"INSERT INTO Contactos(Id, Descripcion, Cargo, Direccion, Telefono, Extension, Celular, Fax, EmailEmpresa, EmailPersonal, Observacion, Cumpleanno, TieneCumpleanno, Estado)\r\n\t\t\t\tVALUES ('\".$IdContacto.\"','\".$pedidoWeb->fields[13].\" \".$pedidoWeb->fields[14].\"',NULL,NULL,'\".$pedidoWeb->fields[15].\"',NULL,NULL,NULL,'\".$pedidoWeb->fields[16].\"','\".$pedidoWeb->fields[16].\"',NULL,NULL,NULL,'true')\");\r\n\t\t\t\t\r\n\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\tVALUES ('\".$IdCliente.\"','\".$IdContacto.\"')\");\r\n\r\n\t\t\t\t//CREAMOS EL PEDIDO\r\n\t\t\t\t\r\n\t\t\t\t$crearPedido = &$this->conexion->conectarse()->Execute(\"INSERT INTO OrdenCompraCliente\r\n (Id, FechaElaboracion, IdCliente, IdPaisOrigen, IdSedeCliente, IdRegionDestino, IdContactoEmergencia, FechaSalida, FechaRegreso, CantidadPasajeros, IdContacto, \r\n Codigo, IdAutor, IdEmpleado, FechaModificacion, SubtotalSinDto, Subtotal, ValorIva, Total, Trm_dia, UtilidadSobreCosto, Estado, GrupoAsignado, Prioridad, \r\n Probabilidad, Observaciones, SeguimientoHistorico, FechaRecepcion, Moneda, FormaPago, TiempoEntrega, TiempoVigencia, Instalacion, \r\n IdEmpleadoModif, IdViadeContacto)\r\n\t\t\t\t\t\t\tVALUES ('\".$IdPedido.\"','\".$fechaConfirmacion.\"','\".$IdCliente.\"','1',\r\n\t\t\t\t\t\t\t'00000000-0000-0000-0000-000000000000','\".$pedidoWeb->fields[21].\"',\r\n\t\t\t\t\t\t\t'\".$IdContacto.\"','\".$pedidoWeb->fields[18].\"','\".$pedidoWeb->fields[19].\"','0','\".$IdContacto.\"','',\r\n\t\t\t\t\t\t\t'7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','\".$fechaConfirmacion.\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"','0','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[22].\"',\r\n\t\t\t\t\t\t\t'true','1','\".$grupo.\"','\".$prioridad.\"','100',NULL,'\".$seguimiento.\"',\r\n\t\t\t\t\t\t\t'\".$fechaConfirmacion.\"','\".$moneda.\"','\".$formaPago.\"',NULL,NULL,'false','00000000-0000-0000-0000-000000000000','\".$viaContacto.\"')\");\r\n\t\t\t\t //CREAMOS EL PRODUCTO COTIZACION.\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\t// OBTENEMOS LA CANTIDAD DE PASAJEROS.\t\t\t\t\t\t\r\n\t\t\t\t\t\t$cantidadPasajeros = &$this->conexion->conectarse()->Execute(\"SELECT COUNT(*) AS Expr1\r\n\t\t\t\t\t\tFROM PasajerosPedido\r\n\t\t\t\t\t\tWHERE (IdPedido = '\".$pedidoWeb->fields[0].\"')\");\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$productoCotizacion = &$this->conexion->conectarse()->Execute(\"INSERT INTO ProductosCotizacion\r\n (Id, IdProducto, IdReferencia, Cantidad, ValorVenta, SubtotalSinDescuento, ValorVentaCliente, IVA, AplicarIva, IdFormaEnvio, TipoTrasporte, UtilidadGlobal, Utilidad, \r\n UtilidadEnPorcentaje, UtilidadDespuesCosto, Arancel, ComicionProveedor, IdEmpleado, FechaModificacion, FechaElaboracion, Moneda, ComentarioAdicional, \r\n Descuento, Aumento)\r\n\t\t\t\t\t\t\tVALUES ('\".$IdProductoCotizacion.\"','\".$pedidoWeb->fields[2].\"','\".$IdPedido.\"','\".$cantidadPasajeros->fields[0].\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"',\r\n\t\t\t\t\t\t\t'0','true','0','0','0','0','true','false','0',\r\n\t\t\t\t\t\t\t'0','7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','\".$fechaConfirmacion.\"','\".$fechaConfirmacion.\"','4','','0','0')\");\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL PASAJERO PRODUCTO COTIZACION.\r\n\t\t\t\t\t\t//CONSULTAMOS LOS PASAJEROS ASOCIADOS AL PEDIDO\t\t\t\t\t\t\r\n\t\t\t\t\t\t$pedidoPasajero = &$this->conexion->conectarse()->Execute(\"SELECT Id, IdPedido, Nombre, Apellido, Documento, Email, FechaNacimiento\r\n\t\t\t\t\t\t\tFROM PasajerosPedido \r\n\t\t\t\t\t\t\tWHERE (IdPedido = '\".$pedidoWeb->fields[0].\"')\");\t\t\r\n\t\t\t\t\t\tforeach($pedidoPasajero as $k => $row) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$idPasajero=\"\";\r\n\t\t\t\t\t\t\t$numeroPoliza=\"\";// ACA DEBO LLAMAR EL WEBSERVICE\r\n\t\t\t\t\t\t\t$idPasajeroProducto=$this->fun->NewGuid();\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$existePasajero = &$this->conexion->conectarse()->Execute(\"SELECT Id\r\n\t\t\t\t\t\t\t\tFROM Pasajero\r\n\t\t\t\t\t\t\t\tWHERE (Identificacion = '\". $row[4].\"')\");\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t//NOTIFICAMOS A LOS PASAJEROS DE LA COMPRA\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t///////////\t$this->fun->SendMailConfirmacionPago($row[5], $row[2], $row[3]);\r\n\t\t\t\r\n\t\t\t\t\t\t\tif($existePasajero->fields[0]==\"\"){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//CREAMOS PASAJERO\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$idPasajero=$this->fun->NewGuid();\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$existePasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\tINSERT INTO Pasajero\r\n \t\t(Id, Nombre, Apellido, Identificacion, FechaNacimiento, Telefono, Celular, Email, Estado, Direccion, Observaciones, SeguimientoHistorico)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$row[2].\"','\".$row[3].\"','\".$row[4].\"','\".$row[6].\"','\".$pedidoWeb->fields[10].\"','\".$pedidoWeb->fields[11].\"','\".$row[5].\"','true','\".$pedidoWeb->fields[12].\"','-','\".$seguimiento.\"')\");\t\r\n\t\t\t\t\t\t\t\t//ASOCIAMOS EL CONTACTO DE EMERGENCIA\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$IdContacto.\"')\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//ASOCIAMOS AL PASAJERO PRODUCTO COTIZACION\t\r\n\t\t\t\t\t\t\t\t$asociamospasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\t\tINSERT INTO PasajerosProductosCotizacion (Id, IdPasajero, IdProductoCotizacion, Poliza, Estado, Aumento, Descuento, ValorUnitario)\r\n\t\t\t\t\t\t\t\t\tVALUES ('\".$idPasajeroProducto.\"','\".$idPasajero.\"','\".$IdProductoCotizacion.\"','\".$numeroPoliza.\"','true','0','0','0')\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if($existePasajero->fields[0]!=\"\"){\r\n\t\t\t\t\t\t\t//\techo \"Entramos al caso cuando el pasajero ya existe\";\r\n\t\t\t\t\t\t\t\t$idPasajero=$existePasajero->fields[0];\t\t\r\n\t\t\t\t\t\t\t\t\t//ASOCIAMOS EL CONTACTO DE EMERGENCIA\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$IdContacto.\"')\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t//ASOCIAMOS AL PASAJERO PRODUCTO COTIZACION\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociamospasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\t\tINSERT INTO PasajerosProductosCotizacion (Id, IdPasajero, IdProductoCotizacion, Poliza, Estado, Aumento, Descuento, ValorUnitario)\r\n\t\t\t\t\t\t\t\t\tVALUES ('\".$idPasajeroProducto.\"','\".$idPasajero.\"','\".$IdProductoCotizacion.\"','\".$numeroPoliza.\"','true','0','0','0')\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\techo 'Caught exception: ', $e->getMessage(), \"\\n\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function insertar(){\n $this -> Conexion -> abrir();\n $this -> Conexion -> ejecutar( $this -> ClienteDAO -> insertar());\n $res = $this -> Conexion -> filasAfectadas();\n $this -> Conexion -> cerrar();\n return $res;\n }", "function inserirAgencia(){\n\n $banco = abrirBanco();\n //declarando as variáveis usadas na inserção dos dados\n $nomeAgencia = $_POST[\"nomeAgencia\"];\n $cidadeAgencia = $_POST[\"cidadeAgencia\"];\n\n //a consulta sql\n $sql = \"INSERT INTO Agencias(nomeAgencia,cidadeAgencia) VALUES ('$nomeAgencia','$cidadeAgencia')\";\n \n //executando a inclusão\n $banco->query($sql);\n //fechando a conexao com o banco\n $banco->close();\n voltarIndex();\n\n }", "public function save_linea(){\n $sql=\"select LAST_INSERT_ID() as 'pedido' \";\n\n $query = $this->db->query($sql);\n\n //convierte a un objeto\n //ahora le pasamos el dato de pedido\n $pedido_id=$query->fetch_object()->pedido;\n\n // va recorrer el carrito y va guardar cada elemento en la variable elemento como array\n foreach($_SESSION['carrito'] as $elemento){\n //aca e cada arrray guarda los valores a una variable que contenera los valores de los producto por comprar\n $producto =$elemento['producto'];\n\n $insert =\"insert into lineas_pedidos values(NULL,{$pedido_id},{$producto->id},{$elemento['unidades']})\";\n\n //ejecutamos el query para que guarde los elementos en la base de datos\n $save=$this->db->query($insert);\n \n // var_dump($producto);\n // var_dump($insert);\n // var_dump($save);\n // echo $this->db->error;\n // die();\n }\n $result = false; //este es el resultado por defecto\n //si el $save da true (en otras palabras no esta vacio y los datos se llenaron correctamente)\n if($save){\n $result=true;\n }\n return $result;\n\n }", "function insertarmovimiento($idempleado,$description,$categoria,$idencargado, $dinero, $caja){\r\n\t$idemp = substr($idempleado, 1);\r\n\t$onoma=$caja->nameUser($idemp);\r\n\t$idMov=$caja->insert_movimiento(\"credito\",0,$onoma.\": \".$description,$categoria,$idencargado);\r\n\t$caja->insert_mov_credito($idMov,$dinero,$idemp,0,\"HR\");\r\n\t//$response = loadtickets($caja,$idemp);\t\r\n\t$response = loadmovimientos($caja,$idemp);\r\n\t$totalTickets=$caja->total_cuenta($idemp);\r\n\t$response[\"TotalTickets\"]=$totalTickets;\r\n\treturn $response;\t\r\n}", "public function saveEntidad(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_entidades SET entidad = \"%s\" WHERE entidad_id = %d',\n $this->entidad,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_entidades(entidad) VALUES (\"%s\")',\n $this->usuario);\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }", "public function enviarPeticion( $comando ) {\n\t\n SocketClass::client_reply($comando);\n\n }", "public function registrarArticulo($idUsuario,$nombre,$descripcion,$precio,$creado,$foto_articulo,$cantidad){\n $sql = \"INSERT INTO inventario (inv_iden, usu_iden, inv_nomb, inv_desc, inv_prec, inv_fech, inv_foto, inv_cant, inv_esta) VALUES (:inv_iden, :usu_iden, :inv_nomb, :inv_desc, :inv_prec, :inv_fech, :inv_foto, :inv_cant, :inv_esta)\";\n\n $datos = array( 'inv_iden' => '', 'usu_iden'=>$idUsuario , 'inv_nomb' => $nombre,'inv_desc' => $descripcion,'inv_prec'=>$precio,'inv_fech'=>$creado,'inv_foto'=>$foto_articulo,'inv_cant'=>$cantidad,'inv_esta'=>'0');\n\n $consulta = $this->ejecutarConsulta($sql,$datos);\n if($consulta){\n $sessData['estado']['type'] = 'success';\n $sessData['estado']['msg'] = 'Se ha subido correctamente el articulo, tienes que esperar a que el administrador lo apruebe.';\n }else{\n $sessData['estado']['type'] = 'error';\n $sessData['estado']['msg'] = 'Ha ocurrido algún problema, por favor intente de nuevo.';\n }\n echo json_encode($sessData);\t\n}", "public function agregar($idproveedor,$idusuario,$tipo_comprobante,\n $serie_comprobante,$num_comprobante,$fecha_hora,$impuesto,\n $total_compra,$idarticulo,$cantidad,$precio_compra,$precio_venta){\n $conectar = Conectar::conexion();\n $sql = \"insert into ingreso values(null,?,?,?,?,?,?,?,?,'Aceptado')\";\n $sql = $conectar->prepare($sql);\n $sql->bindValue(1,$_POST[\"idproveedor\"]);\n $sql->bindValue(2,$_SESSION[\"idusuario\"]);\n $sql->bindValue(3,$_POST[\"tipo_comprobante\"]);\n $sql->bindValue(4,$_POST[\"serie_comprobante\"]);\n $sql->bindValue(5,$_POST[\"num_comprobante\"]);\n $sql->bindValue(6,$_POST[\"fecha_hora\"]);\n $sql->bindValue(7,$_POST[\"impuesto\"]);\n $sql->bindValue(8,$_POST[\"total_compra\"]);\n $sql->execute();\n\n //$resultado = $sql->fetch();\n //return $resultado;\n\n $idingresonew = $conectar->lastInsertId();\n $num_elementos= 0;\n $sw=true;\n $id=$_POST[\"idarticulo\"];\n $cant=$_POST[\"cantidad\"];\n $prec=$_POST[\"precio_compra\"];\n $prev=$_POST[\"precio_venta\"];\n\n while ($num_elementos < count($_POST[\"idarticulo\"])) {\n\n $sql_detalle = \"insert into detalle_ingreso(idingreso,idarticulo,cantidad,precio_compra,precio_venta)\n values('$idingresonew','$id[$num_elementos]','$cant[$num_elementos]','$prec[$num_elementos]','$prev[$num_elementos]')\";\n $sql_detalle = $conectar->prepare($sql_detalle);\n $sql_detalle->execute() or $sw=false;\n $num_elementos = $num_elementos + 1;\n }\n return $sw;\n }", "public function insertar($idproveedor, $idusuario, $tipo_comprobante, $serie_comprobante, $num_comprobante, $fecha_hora, $impuesto, $total_compra, $idarticulo, $cantidad, $precio_compra, $precio_venta)\n {\n $sql = \"INSERT INTO ingreso(idproveedor,idusuario,tipo_comprobante,serie_comprobante,num_comprobante,fecha_hora,impuesto,total_compra,estado)\" .\n \" VALUES('$idproveedor','$idusuario','$tipo_comprobante','$serie_comprobante','$num_comprobante','$fecha_hora','$impuesto','$total_compra','ACEPTADO');\";\n// return ejecutarConsulta($sql);\n $idIngreso = ejecutarConsulta_retornarID($sql);\n $num_elementos = 0;\n $sw = true;\n while ($num_elementos < count($idarticulo)) {\n $sql_detalle = \"INSERT INTO detalle_ingreso(idIngreso, idarticulo,cantidad,precio_compra,precio_venta)\"\n . \" VALUES('$idIngreso', '$idarticulo[$num_elementos]','$cantidad[$num_elementos]','$precio_compra[$num_elementos]','$precio_venta[$num_elementos]');\";\n ejecutarConsulta($sql_detalle) or $sw = false;\n $num_elementos++;\n }\n return $sw;\n }", "public function persist (){\n \n $this->query = \"INSERT INTO libros(titulo,autor,editorial) VALUES (:titulo, :autor, :editorial)\";\n\n // $this->parametros['id']=$user_data[\"id\"];\n $this->parametros['titulo']=$this->titulo;\n $this->parametros['autor']=$this->autor;\n $this->parametros['editorial']=$this->editorial;\n \n $this->get_results_from_query();\n\n\n $this->mensaje = \"Libro agregado exitosamente\";\n \n }", "function insertar_productos($id,$id_dep,$id_dep_destino=0,$es_pedido_material=0,$id_licitacion=-1,$nrocaso=-1)\r\n{\r\nglobal $db,$_ses_user;\r\n\r\n$db->StartTrans();\r\n\r\n if($es_pedido_material)\r\n { $titulo_material=\"Pedido de Material\";\r\n //traemos el id del tipo de reserva\r\n $query=\"select id_tipo_reserva from tipo_reserva where nombre_tipo='Reserva Para Pedido de Material'\";\r\n $res=sql($query,\"<br>Error al traer el id de la reserva del pedido<br>\") or fin_pagina();\r\n $tipo_reserva=$res->fields[\"id_tipo_reserva\"];\r\n }\r\n else\r\n { $titulo_material=\"Movimiento de Material\";\r\n //traemos el id del tipo de reserva\r\n $query=\"select id_tipo_reserva from tipo_reserva where nombre_tipo='Reserva Para Movimiento de Material'\";\r\n $res=sql($query,\"<br>Error al traer el id de la reserva del pedido<br>\") or fin_pagina();\r\n $tipo_reserva=$res->fields[\"id_tipo_reserva\"];\r\n }\r\n\r\n //traemos las filas que estan en la BD\r\n $items_en_bd=get_items_mov($id);\r\n //traemos los items que estan en la tabla\r\n $items=get_items_mov();\r\n//print_r($items);\r\n$fecha=date(\"Y-m-d H:i:s\",mktime());\r\n$usuario=$_ses_user[\"name\"];\r\n\r\n //primero borramos los productos que se borraron en la tabla\r\n $a_borrar=\"\";\r\n $cantidades_acum=0;\r\n for($j=0;$j<$items_en_bd['cantidad'];$j++)\r\n {\r\n for($i=0;$i<$items['cantidad'];$i++)\r\n {\r\n //si el id es igual al de la bd,\r\n //entonces esta insertada de antes\r\n if($items[$i]['id_detalle_movimiento']==$items_en_bd[$j]['id_detalle_movimiento'])\r\n {//controlamos si las cantidad en la fila difiere de la que esta guardada.\r\n //si lo hace debemos actualizar la cantidad reservada\r\n if($items[$i]['id_prod_esp']!=\"\" && $items[$i]['cantidad']!=$items_en_bd[$j]['cantidad'])\r\n {\r\n \t //no se puede cambiar la cantidad de la fila\r\n \t die(\"Error: No se puede cambiar las cantidades de la fila.\");\r\n }//de if($items[$i]['id_producto']!=\"\" && $items[$i]['cantidad']!=$items_en_bd[$j]['cantidad'])\r\n \t break;\r\n }//de if($items[$i]['id_detalle_movimiento']==$items_en_bd[$j]['id_detalle_movimiento'])\r\n }//de for($i=0;$i<$items['cantidad'];$i++)\r\n\r\n //si $i==$items['cantidad'] significa que la fila se borro, y\r\n //hay que eliminarla de la BD\r\n if($i==$items['cantidad'])\r\n {\r\n \t $a_borrar.=$items_en_bd[$j]['id_detalle_movimiento'].\",\";\r\n $cantidades_acum+=$items_en_bd[$j]['cantidad'];\r\n $cantidades.=$items_en_bd[$j]['cantidad'].\",\";\r\n $id_prod_esp_a_borrar.=$items_en_bd[$j]['id_prod_esp'].\",\";\r\n\r\n }\r\n //si habia un producto y se borro, hay que eliminar la fila\r\n //(este caso extremo falla si no se agrega este if\r\n if($i==0 && $items['cantidad']==1 && $items[$i]['id_prod_esp']==\"\")\r\n {\r\n $a_borrar.=$items_en_bd[$j]['id_detalle_movimiento'].\",\";\r\n $cantidades_acum+=$items_en_bd[$j]['cantidad'];\r\n $cantidades.=$items_en_bd[$j]['cantidad'].\",\";\r\n $id_prod_esp_a_borrar.=$items_en_bd[$j]['id_prod_esp'].\",\";\r\n }\r\n\r\n }//de for($j=0;$j<$items_en_bd['cantidad'];$j++)\r\n\r\n //si hay filas de movimiento a borrar, eliminamos las reservas\r\n //y luego la fila del movimiento insertar_recibidos_mov\r\n\r\n /*\r\n echo \"<br>\";\r\n echo \"a borrar : *** \";\r\n print_r($a_borrar);\r\n echo \" **** \";\r\n */\r\n if($a_borrar!=\"\"){\r\n $a_borrar=substr($a_borrar,0,strlen($a_borrar)-1);\r\n $filas_borrar=split(\",\",$a_borrar);\r\n $cantidades=substr($cantidades,0,strlen($cantidades)-1);\r\n $cantidades_b=split(\",\",$cantidades);\r\n $tam=sizeof($filas_borrar);\r\n $array_id_prod_esp=split(\",\",$id_prod_esp_a_borrar);\r\n for($g=0;$g<$tam;$g++)\r\n cancelar_reserva($array_id_prod_esp[$g],$cantidades_b[$g],$id_dep,\"Se cancelo el $titulo_material Nº $id\",9,\"\",$filas_borrar[$g]);\r\n\r\n //luego borramos todas las filas que haya que borrar, del\r\n $query=\"delete from detalle_movimiento where id_detalle_movimiento in ($a_borrar)\";\r\n sql($query) or fin_pagina(\"<br>Error al borrar los productos del movimiento <br>$query\");\r\n }//de if($a_borrar!=\"\")\r\n else\r\n $filas_borrar=array();\r\n\r\n $tam_filas_borrar=sizeof($filas_borrar);\r\n //luego insertamos los productos nuevos\r\n for($i=0;$i<$items['cantidad'];$i++) {\r\n //si el id de detalle_movimiento es vacio, entonces hay que insertarlo\r\n if($items[$i]['id_detalle_movimiento']==\"\")\r\n {\r\n if($items[$i]['id_prod_esp']!=\"\")\r\n {\r\n $query=\"select nextval('detalle_movimiento_id_detalle_movimiento_seq') as id_detalle_movimiento\";\r\n $id_det=sql($query)or fin_pagina();\r\n \t $query=\"insert into detalle_movimiento(id_detalle_movimiento,id_movimiento_material,id_prod_esp,descripcion,cantidad,precio)\r\n values(\".$id_det->fields['id_detalle_movimiento'].\",$id,\".$items[$i]['id_prod_esp'].\",'\".$items[$i]['descripcion'].\"',\".$items[$i]['cantidad'].\",\".(($items[$i]['precio']!=\"\")?$items[$i]['precio']:0).\")\r\n \";\r\n \t sql($query) or fin_pagina(\"<br>Error al insertar el producto $i del movimiento <br>$query\");\r\n \t //si la cantidad ya reservada para la fila es vacia, ingresamos una nueva reserva por la cantidad de la fila\r\n \t if ($items[$i][\"cantidad_res\"]==\"\" || $items[$i][\"cantidad_res\"]==0)\r\n \t {\treservar_stock($items[$i]['id_prod_esp'],$items[$i]['cantidad'],$id_dep,\"Reserva de Productos para $titulo_material Nº $id\",6,$tipo_reserva,\"\",$id_det->fields['id_detalle_movimiento'], $id_licitacion);\r\n \t }\r\n\t\t\t\t\t\t //en cambio, si la cantidad reservada es mayor que cero, en caso de tener que reservar mas, desde el stock disponible\r\n\t\t\t\t\t\t //lo que se hace es agregar a la reserva ya hecha, los nuevos productos,\r\n\t\t\t\t\t\t //(PORQUE SOLO PUEDE HABER UN DETALLE RESERVA POR FILA DE PM O DE OC)\r\n\t\t\t\t\t\t //Ademas se corrigen en consecuencia las\r\n\t\t\t\t\t\t //cantidades disponibles y reservadas de ese producto en ese stock, si es necesario.\r\n else if ($items[$i][\"cantidad_res\"]>0){\r\n\t\t\t\t\t\t\tif ($nrocaso) {\r\n\r\n\t\t\t\t\t\t \t$consulta=\"select id_detalle_reserva,id_en_stock,cantidad_reservada\r\n\t\t\t\t\t\t\t\t\t from stock.en_stock\r\n\t\t\t\t\t\t\t\t\t join stock.detalle_reserva using (id_en_stock)\r\n\t\t\t\t\t\t\t\t\t where nrocaso='$nrocaso'\r\n\t\t\t\t\t\t\t\t\t and id_prod_esp=\".$items[$i]['id_prod_esp'].\"\r\n\t\t\t\t\t\t\t\t\t and id_deposito=2 and id_detalle_movimiento isnull\r\n\t\t\t\t\t\t\t\t\t order by cantidad_reservada ASC\";\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t \telse{\r\n\t\t\t\t\t\t \t$consulta=\"select id_detalle_reserva,id_en_stock,cantidad_reservada\r\n\t\t\t\t\t\t\t\t\tfrom stock.en_stock\r\n\t\t\t\t\t\t\t\t\t\tjoin stock.detalle_reserva using (id_en_stock)\r\n\t\t\t\t\t\t\t\t\twhere id_licitacion= $id_licitacion\r\n\t\t\t\t\t\t\t\t\t\tand id_prod_esp=\".$items[$i]['id_prod_esp'].\"\r\n\t\t\t\t\t\t\t\t\t\tand id_deposito=2 and id_detalle_movimiento isnull\r\n\t\t\t\t\t\t\t\t\torder by cantidad_reservada ASC\r\n\t\t\t\t\t\t\t\t\";\r\n\t\t\t\t\t\t }\r\n\r\n\r\n\t\t\t\t\t\t\t$rta_consulta=sql($consulta, \"c311\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t//en la primera entrada viene la reserva de mayor cantidad, que es la que afectaremos mas abajo\r\n\t\t\t\t\t\t\t// por lo tanto la saltamos\r\n\t\t\t\t\t\t\t$cantidad_primer_reserva=$rta_consulta->fields[\"cantidad_reservada\"];\r\n\t\t\t\t\t\t\t$id_primer_reserva=$rta_consulta->fields[\"id_detalle_reserva\"];\r\n\t\t\t\t\t\t\t$rta_consulta->MoveNext();\r\n\t\t\t\t\t\t\t//luego acumulamos las demas cantidades de las reservas restantes, si es que hay\r\n\t\t\t\t\t\t\t$acum_otras_reservas=0;$index=0;\r\n\t\t\t\t\t\t\t//y creamos un arreglo con los id de detalle reserva que debemos descontar, y sus respectivas cantidades actuales\r\n\t\t\t\t\t\t\t$reservas_a_bajar=array();\r\n \t\t\t\t\t\t\twhile (!$rta_consulta->EOF)\r\n \t\t\t\t\t\t\t{\r\n \t\t\t\t\t\t\t $acum_otras_reservas+=$rta_consulta->fields[\"cantidad_reservada\"];\r\n \t\t\t\t\t\t\t $reservas_a_bajar[$index]=array();\r\n \t\t\t\t\t\t\t $reservas_a_bajar[$index][\"id\"]=$rta_consulta->fields[\"id_detalle_reserva\"];\r\n \t\t\t\t\t\t\t $reservas_a_bajar[$index][\"cantidad_reservada\"]=$rta_consulta->fields[\"cantidad_reservada\"];\r\n \t\t\t\t\t\t\t $index++;\r\n\r\n \t\t\t\t\t\t\t $rta_consulta->MoveNext();\r\n \t\t\t\t\t\t\t}//de while(!$rta_consulta->EOF)\r\n \t\t\t\t\t\t\t$rta_consulta->Move(0);\r\n\r\n\t\t\t\t\t\t\t $id_en_stock=$rta_consulta->fields[\"id_en_stock\"];\r\n\t\t\t\t\t\t\t\t//si la cantidad de la fila es mayor que la reservada, entonces se necesita reservar la diferencia\r\n\t\t\t\t\t\t\t\t//desde el stock disponible. Para eso aumentamos la cantidad de la reserva ya presente y movemos\r\n\t\t\t\t\t\t\t\t//las cantidades de la tabla en_stock, como corresponda\r\n\r\n\t\t\t\t\t\t\t\tif($items[$i]['cantidad']>$items[$i][\"cantidad_res\"]){\r\n\r\n\t\t\t\t\t\t\t\t\t$cantidad_aumentar=$items[$i]['cantidad']-$items[$i][\"cantidad_res\"];\r\n\t\t\t\t\t\t\t\t\t$nueva_reserva_pm=0;\r\n\t\t\t\t\t\t\t\t\t$sacar_de_stock_disp=1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//si la cantidad de la fila es menor que la reservada\r\n\t\t\t\t\t\t\t\telse if($items[$i]['cantidad']<$items[$i][\"cantidad_res\"]){\r\n\r\n\t\t\t\t\t\t\t\t\t$cantidad_aumentar=$items[$i]['cantidad'];\r\n\t\t\t\t\t\t\t\t\t//indicamos que solo se debe usar parte de la reserva del producto hecha desde OC, por lo que\r\n\t\t\t\t\t\t\t\t\t//solo se resta esa cantidad. Y ademas, se debe generar una nueva reserva para esos productos\r\n\t\t\t\t\t\t\t\t\t//que se van a usar para este PM\r\n\t\t\t\t\t\t\t\t\t$nueva_reserva_pm=1;\r\n\t\t\t\t\t\t\t\t\t$sacar_de_stock_disp=0;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$cantidad_aumentar=0;\r\n\t\t\t\t\t\t\t\t\t$nueva_reserva_pm=0;\r\n\t\t\t\t\t\t\t\t\t$sacar_de_stock_disp=0;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t//Si hay una sola reserva hecha y si la cantidad a usar para la fila del PM es menor que la reservada, significa que solo se usa una\r\n\t\t\t\t\t\t\t\t//parte de dicha reserva, entonces....\r\n\t\t\t\t\t\t\t\tif($acum_otras_reservas==0 && $nueva_reserva_pm)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t//Solo se descuenta de la reserva atada a la licitacion para ese producto, generada por la OC,\r\n\t\t\t\t\t\t\t\t\t//la cantidad que se va a utilizar.\r\n\t\t\t\t\t\t\t\t\t//Primero se descuenta de la cantidad reservada de la tabla en_stock\r\n\t\t\t\t\t\t\t\t\t$query=\"update stock.en_stock set cant_reservada=cant_reservada-$cantidad_aumentar\r\n\t\t\t\t\t\t\t\t\t\t where id_en_stock=$id_en_stock\";\r\n\t\t\t\t\t\t\t\t\tsql($query,\"<br>Error al actualizar cantidades del stock para reserva de productos<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t//luego se decrementa la cantidad de la reserva asociada a la licitacion de ese producto\r\n\t\t\t\t\t\t\t\t\t$consulta=\"update stock.detalle_reserva set cantidad_reservada=cantidad_reservada-$cantidad_aumentar\r\n\t\t\t\t\t\t\t\t\t where id_detalle_reserva=$id_primer_reserva\";\r\n\t\t\t\t\t\t\t\t\tsql($consulta, \"<br>c317: Error al actualizar la reserva para licitacion de la fila<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t$query=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Se utilizaron los productos reservados para OC o para Movimiento de material'\";\r\n\t\t\t\t\t\t\t\t\t$tipo_mov=sql($query,\"<br>Error al traer el tipo de movimiento<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\tif($tipo_mov->fields[\"id_tipo_movimiento\"]!=\"\")\r\n\t\t\t\t\t\t\t \t\t $id_tipo_movimiento=$tipo_mov->fields[\"id_tipo_movimiento\"];\r\n\t\t\t\t\t\t\t \t\telse\r\n\t\t\t\t\t\t\t \t\t die(\"Error Interno PM485: no se pudo determinar el tipo de movimiento de stock. Consulte a la División Software<br>\");\r\n\r\n\t\t\t\t\t\t\t\t\t//luego registramos el cambio en el log de movimientos de stock\r\n\t\t\t\t\t\t\t\t\t//(se utilizan esos productos de la reserva hecha por la OC)\r\n\t\t\t\t\t\t\t\t\t$campos=\" id_en_stock,id_tipo_movimiento,cantidad,fecha_mov,usuario_mov,comentario\";\r\n\t\t\t\t\t\t\t\t $values=\" $id_en_stock,$id_tipo_movimiento,$cantidad_aumentar,'$fecha','$usuario','Utilización de los productos para $titulo_material Nº $id'\";\r\n\t\t\t\t\t\t\t\t $sql=\"insert into log_movimientos_stock ($campos) values ($values)\";\r\n\t\t\t\t\t\t\t\t sql($sql,\"<br>Error al insetar en el log de movimientos de stock (insertar488)<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t//Y luego se genera una nueva reserva, para la fila del pedido de material actual, con esa cantidad,\r\n\t\t\t\t\t\t\t\t\t//que se desconto de la reserva hecha por la OC\r\n\t\t\t\t\t\t\t\t\treservar_stock($items[$i]['id_prod_esp'],$cantidad_aumentar,$id_dep,\"Reserva de Productos para $titulo_material\",6,$tipo_reserva,\"\",$id_det->fields['id_detalle_movimiento'], $id_licitacion);\r\n\r\n\t\t\t\t\t\t\t\t\t//como la funcion reservar_stock descuenta de la cantidad disponible\r\n\t\t\t\t\t\t\t\t\t//y agrega a la cantidad reservada del stock la cantidad pasada como parametro, es necesario volver\r\n\t\t\t\t\t\t\t\t\t//a incrementar la cantidad disponible para compensar,\r\n\t\t\t\t\t\t\t\t\t// debido a que los productos que ahora estan reservados para el PM antes lo estaban para la OC,\r\n\t\t\t\t\t\t\t\t\t// por lo que los productos ya fueron descontados de stock disponibles y agregados a la cantidad reservada\r\n\t\t\t\t\t\t\t\t\t//cuando se hizo la reserva desde la OC al recibir los productos\r\n\t\t\t\t\t\t\t\t\t$query=\"update stock.en_stock set cant_disp=cant_disp+$cantidad_aumentar\r\n\t\t\t\t\t\t\t\t\t where id_en_stock=$id_en_stock\r\n\t\t\t\t\t\t\t\t\t \";\r\n\t\t\t\t\t\t\t\t\tsql($query,\"<br>Error al compensar las cantidades del stock<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t}//de if($nueva_reserva_pm)\r\n\t\t\t\t\t\t\t\telse//no se hace una nueva reserva y el PM pasara a tener toda la reserva generada desde la OC\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t//si no hay nada que sacar del stock disponible entonces ponemos esa cantidad en cero\r\n \t\t\t\t\t\t\t\t if($sacar_de_stock_disp==0)\r\n\t\t\t\t\t\t\t\t\t $cantidad_aumentar=0;\r\n\r\n\t\t\t\t\t\t\t\t\t //agregamos a la reserva actual hecha para la licitacion, los productos disponibles necesarios para\r\n\t\t\t\t\t\t\t\t\t//completar la cantidad que requiere la fila de PM (si es necesario),\r\n\t\t\t\t\t\t\t\t\t// y le sacamos la relacion que tenia con la fila de OC\r\n\t\t\t\t\t\t\t\t\t$consulta=\"update stock.detalle_reserva set cantidad_reservada=cantidad_reservada+$cantidad_aumentar,\r\n\t\t\t\t\t\t\t\t\t id_detalle_movimiento=\".$id_det->fields['id_detalle_movimiento'].\",\r\n\t\t\t\t\t\t\t\t\t id_fila=null,id_tipo_reserva=$tipo_reserva\r\n\t\t\t\t\t\t\t\t\t where id_detalle_reserva=$id_primer_reserva\";\r\n\t\t\t\t\t\t\t\t\tsql($consulta, \"<br>c516: Error al actualizar la reserva de la fila<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t//luego actualizamos las cantidades disponibles y reservadas en stock, si la cantidad a aumentar es mayor que cero\r\n\t\t\t\t\t\t\t\t\tif($cantidad_aumentar>0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t\t\t\t\t//restamos los productos que se reservan de la cantidad disponible y los sumamos a la cantidad\r\n\t\t\t\t\t\t\t\t\t\t//reservada\r\n\t\t\t\t\t\t\t\t\t\t$query=\"update stock.en_stock set cant_disp=cant_disp-$cantidad_aumentar,\r\n\t\t\t\t\t\t\t\t\t\t cant_reservada=cant_reservada+$cantidad_aumentar\r\n\t\t\t\t\t\t\t\t\t\t where id_en_stock=$id_en_stock\";\r\n\t\t\t\t\t\t\t\t\t\tsql($query,\"<br>Error al actualizar cantidades del stock para reserva de productos<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t\t$query=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Reserva de productos para OC o para Movimiento/Pedido de material'\";\r\n\t\t\t\t\t\t\t\t\t\t$tipo_mov=sql($query,\"<br>Error al traer el tipo de movimiento<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t\tif($tipo_mov->fields[\"id_tipo_movimiento\"]!=\"\")\r\n\t\t\t\t\t\t\t\t \t\t $id_tipo_movimiento=$tipo_mov->fields[\"id_tipo_movimiento\"];\r\n\t\t\t\t\t\t\t\t \t\telse\r\n\t\t\t\t\t\t\t\t \t\t die(\"Error Interno PM539: no se pudo determinar el tipo de movimiento de stock. Consulte a la División Software<br>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t//luego registramos el cambio en el log de movimientos de stock\r\n\t\t\t\t\t\t\t\t\t\t$campos=\" id_en_stock,id_tipo_movimiento,cantidad,fecha_mov,usuario_mov,comentario\";\r\n\t\t\t\t\t\t\t\t\t $values=\" $id_en_stock,$id_tipo_movimiento,$cantidad_aumentar,'$fecha','$usuario','Reserva de productos para Pedido de Material Nº $id'\";\r\n\t\t\t\t\t\t\t\t\t $sql=\"insert into log_movimientos_stock ($campos) values ($values)\";\r\n\t\t\t\t\t\t\t\t\t sql($sql,\"<br>Error al insetar en el log de movimientos de stock (insertar537)<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t}//de if($cantidad_aumentar>0)\r\n\r\n\t\t\t\t\t\t\t\t if($acum_otras_reservas)\r\n\t\t\t\t\t\t\t\t {//si habia mas de una reserva por el mismo producto provenientes de OC distintas, se eliminan, excepto la primera, todas\r\n\t\t\t\t\t\t\t\t\t//las reservas restantes que se utilizaron, de las que estan indicadas en $reservas_a_bajar, para que se mantenga\r\n\t\t\t\t\t\t\t\t\t//la idea de una unica reserva por detalle_movimiento\r\n\t\t\t\t\t\t\t\t\t//y se agrega el registro del movimiento en el log de movimientos de stock\r\n\t\t\t\t\t\t\t\t\t//(Se pone el movimiento de que se utilizaron esas reservas)\r\n\t\t\t\t\t\t\t\t\t//El procedimiento es sumar a la primer reserva la cantidad de las otras, necesaria para satisfacer la cantidad\r\n\t\t\t\t\t\t\t\t\t//que la fila del PM requiere. Lo que se use de las otras reservas se pondra como utilizado en el log del stock\r\n\t\t\t\t\t\t\t\t\t//y se descontara o eliminara de detalle_reserva. Lo que quede sin usarse, queda atado a la OC como estaba.\r\n\t\t\t\t\t\t\t\t\t//En caso de que se use una parte de una reserva y la otra no, se genera un nuevo log de stock parar la parte\r\n\t\t\t\t\t\t\t //que se utilizó de la OC, y se decuenta la cantidad usada, de la reserva afectada. Esto se explica mejor\r\n\t\t\t\t\t\t\t //durante la ejecucion del codigo que sigue:\r\n\r\n\t\t\t\t\t\t\t\t\t\t//la cantidad pedida por la fila\r\n\t\t\t\t\t\t\t\t\t\t$cantidad_pedida_para_fila=$items[$i]['cantidad'];\r\n\t\t\t\t\t\t\t\t\t\t//la cantidad acumulada para satisfacer la cantidad pedida por la fila\r\n\t\t\t\t\t\t\t\t\t\t//es hasta ahora la cantidad de la primer reserva\r\n\t\t\t\t\t\t\t\t\t\t$cantidad_acumulada_de_reservas=$cantidad_primer_reserva;\r\n\r\n\t\t\t\t\t\t\t\t\t\t//la cantidad que se saca de las restantes reservas, para agregarle a la primera\r\n\t\t\t\t\t\t\t\t\t\t$cantidad_total_a_sumar=0;\r\n\r\n //vamos acumulando el resto de las cantidades de las otras reservas, hasta que se acumule la cantidad pedida\r\n //por la fila, o hasta que se acaben las reservas disponibles\r\n\t\t\t\t\t\t\t\t\t\tfor($j=0;$j<sizeof($reservas_a_bajar);$j++ )\r\n {\r\n \t//si falta acumular para completar la cantidad requerida por la fila\r\n if($cantidad_acumulada_de_reservas<$cantidad_pedida_para_fila)\r\n {\r\n \t$cant_reserva_actual=$reservas_a_bajar[$j][\"cantidad_reservada\"];\r\n \t//utilizamos de la reserva actual, solo la cantidad necesaria que es:\r\n \t$cantidad_faltante=$cantidad_pedida_para_fila-$cantidad_acumulada_de_reservas;\r\n\r\n \tif($cant_reserva_actual<=$cantidad_faltante)\r\n \t{\r\n \t\t//si la cantidad para la reserva que estamos viendo es justo\r\n \t\t//lo que esta faltando, o no alcanza para cubrir todo lo que esta faltando\r\n \t\t//acumulamos toda esa reserva para la fila (es decir: se utilizan todos los productos de esa reserva)\r\n \t\t$cantidad_a_utilizar=$cant_reserva_actual;\r\n \t\t$cantidad_no_utilizada=0;\r\n \t}\r\n \telse if($cantidad_faltante>0)\r\n \t{\r\n \t\t//si en cambio, la cantidad faltante (que es mayor que cero) para cubrir lo requerido por la fila es\r\n \t\t//menor que la cantidad en la reserva que estamos viendo,\r\n \t\t//utilizamos de esa reserva solo la cantidad faltante, pero el resto la dejamos como estaba en la reserva\r\n \t\t$cantidad_a_utilizar=$cantidad_faltante;\r\n \t\t$cantidad_no_utilizada=$cant_reserva_actual-$cantidad_faltante;\r\n \t}\r\n \telse\r\n \t die(\"Error interno: la cantidad acumulada ($cantidad_acumulada_de_reservas) no es mayor o igual que la pedida por la fila($cantidad_pedida_para_fila)<br>\r\n \t \t Pero la cantidad faltante es igual a cero. Consulte a la División Software por este error. \");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t$cantidad_acumulada_de_reservas+=$cantidad_a_utilizar;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$reservas_a_bajar[$j][\"cantidad_utilizada\"]=$cantidad_a_utilizar;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$reservas_a_bajar[$j][\"cantidad_no_utilizada\"]=$cantidad_no_utilizada;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t$cantidad_total_a_sumar+=$cantidad_a_utilizar;\r\n }//de if($cantidad_acumulada_de_reservas<$cantidad_pedida_para_fila)\r\n else//si ya se acumulo todo lo que la fila pedia, la reserva queda como esta y lo indicamos en el arreglo\r\n {\r\n \t$reservas_a_bajar[$j][\"cantidad_utilizada\"]=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$reservas_a_bajar[$j][\"cantidad_no_utilizada\"]=$reservas_a_bajar[$j][\"cantidad_reservada\"];\r\n }//de if($cantidad_acumulada_de_reservas<$cantidad_pedida_para_fila)\r\n\r\n }//de for($j=0;$j<$reservas_a_bajar;$j++)\r\n\r\n //agregamos a la primer reserva, la cantidad que se utilizara de las demas reservas\r\n $query=\"update stock.detalle_reserva set cantidad_reservada=cantidad_reservada+$cantidad_total_a_sumar,\r\n id_detalle_movimiento=\".$id_det->fields['id_detalle_movimiento'].\",\r\n\t\t\t\t\t\t\t\t\t id_fila=null,id_tipo_reserva=$tipo_reserva\r\n\t\t\t\t\t\t\t\t\t where id_detalle_reserva=$id_primer_reserva\";\r\n\t\t\t\t\t\t\t\t\t sql($query, \"<br>c612: Error al actualizar la reserva de la fila con las otras reservas<br>\") or fin_pagina();\r\n\r\n //luego, por cada reserva afectada extra, descontamos las cantidades utilizadas\r\n for($j=0;$j<sizeof($reservas_a_bajar);$j++)\r\n {\r\n \t//si de esta reserva se utilizo algo de su cantidad debemos descontar esa cantidad\r\n \t//ya sea actualizando la cantidad de la reserva en cuestion, si aun queda una parte\r\n \t//sin utilizar; o eliminando ese detalle de reserva porque se utilizó completa\r\n \tif($reservas_a_bajar[$j][\"cantidad_utilizada\"]>0)\r\n \t{\r\n \t\t//si se utilizó toda la cantidad para esa reserva, simplemente se elimina la reserva,\r\n \t\t//debio a que ya quedó esa cantidad registrada como parte de la primer reserva con id: $id_primer_reserva\r\n \t\tif($reservas_a_bajar[$j][\"cantidad_reservada\"]==$reservas_a_bajar[$j][\"cantidad_utilizada\"])\r\n \t\t{\r\n \t\t\t$query=\"delete from stock.detalle_reserva where id_detalle_reserva=\".$reservas_a_bajar[$j][\"id\"];\r\n \t\t\tsql($query,\"<br>Error al eliminar la reserva con id \".$reservas_a_bajar[$j][\"id\"].\"<br>\") or fin_pagina();\r\n \t\t}//de if($reservas_a_bajar[$j][\"cantidad_reservada\"]==$reservas_a_bajar[$j][\"cantidad_utilizada\"])\r\n \t\telseif($reservas_a_bajar[$j][\"cantidad_utilizada\"]<$reservas_a_bajar[$j][\"cantidad_reservada\"])\r\n \t\t{\r\n \t\t\t//si la cantidad de la reserva a utilizar es menor que la reservada, entonces se resta de dicha reserva\r\n \t\t\t//la cantidad utilizada, y se registra en el log de stock que se utilizo esa cantidad\r\n \t\t\t$query=\"update stock.detalle_reserva set cantidad_reservada=cantidad_reservada-\".$reservas_a_bajar[$j][\"cantidad_utilizada\"].\" where id_detalle_reserva=\".$reservas_a_bajar[$j][\"id\"];\r\n \t\t\tsql($query,\"<br>Error al actualizar la cantidad del detalle de la reserva<br>\") or fin_pagina();\r\n\r\n \t\t\t//la cantidad utilizada entra a la primer reserva, por lo que solo es necesario registrar el log en\r\n \t\t\t//los movimientos de stock la utilizacion de $reservas_a_bajar[$j][\"cantidad_utilizada\"]\r\n \t\t\t//para la reserva $reservas_a_bajar[$j][\"id\"]\r\n\r\n \t\t\t$query=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Reserva de productos para OC o para Movimiento/Pedido de material'\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tipo_mov=sql($query,\"<br>Error al traer el tipo de movimiento<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($tipo_mov->fields[\"id_tipo_movimiento\"]!=\"\")\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t $id_tipo_movimiento=$tipo_mov->fields[\"id_tipo_movimiento\"];\r\n\t\t\t\t\t\t\t\t\t\t\t \t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t die(\"Error Interno PM654: no se pudo determinar el tipo de movimiento de stock. Consulte a la División Software<br>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t//generamos el log\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$campos=\" id_en_stock,id_tipo_movimiento,cantidad,fecha_mov,usuario_mov,comentario\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t $values=\" $id_en_stock,$id_tipo_movimiento,\".$reservas_a_bajar[$j][\"cantidad_utilizada\"].\",'$fecha','$usuario','Reserva de productos para Pedido de Material Nº $id'\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t $sql=\"insert into log_movimientos_stock ($campos) values ($values)\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t sql($sql,\"<br>Error al insetar en el log de movimientos de stock (insertar649)<br>\") or fin_pagina();\r\n\r\n\r\n\t\t\t //y generamos el correspondiente log indicando que se utilizaron productos reservados\r\n\t\t\t \t\t\t$query=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Se utilizaron los productos reservados para OC o para Movimiento de material'\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tipo_mov=sql($query,\"<br>Error al traer el tipo de movimiento<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($tipo_mov->fields[\"id_tipo_movimiento\"]!=\"\")\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t $id_tipo_movimiento=$tipo_mov->fields[\"id_tipo_movimiento\"];\r\n\t\t\t\t\t\t\t\t\t\t\t \t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t die(\"Error Interno PM700: no se pudo determinar el tipo de movimiento de stock. Consulte a la División Software<br>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$campos=\" id_en_stock,id_tipo_movimiento,cantidad,fecha_mov,usuario_mov,comentario\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t $values=\" $id_en_stock,$id_tipo_movimiento,\".$reservas_a_bajar[$j][\"cantidad_utilizada\"].\",'$fecha','$usuario','Utilización de los productos para $titulo_material Nº $id'\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t $sql=\"insert into log_movimientos_stock ($campos) values ($values)\";\r\n\t\t\t\t\t\t\t\t\t\t\t sql($sql,\"<br>Error al insetar en el log de movimientos de stock (insertar649)<br>\") or fin_pagina();\r\n\r\n \t\t}//de elseif($reservas_a_bajar[$j][\"cantidad_utilizada\"]<$reservas_a_bajar[$j][\"cantidad_reservada\"])\r\n \t\telse\r\n \t\t{\r\n \t\t\t//SI ENTRA POR ACA SIGNIFICA QUE LA CANTIDAD UTILIZADA ES MAYOR A LA RESERVADA PARA ESA RESERVA,\r\n \t\t\t//POR LO TANTO LA DECISION ANTERIOR AL ARMAR EL ARREGLO $reservas_a_bajar FUE INCORRECTA. ENTONCES\r\n \t\t\t//NO SE PUEDE CONTINUAR CON LA EJECUCION PORQUE ALGO ESTA MAL HECHO\r\n \t\t\tdie(\"Error interno: La cantidad que se decidio utilizar para la reserva con id \".$reservas_a_bajar[$j][\"id\"].\" es mayor a la que estaba reservada originalmente.<br>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCantidad a utilizar: \".$reservas_a_bajar[$j][\"cantidad_utilizada\"].\" - Cantidad reservada: \".$reservas_a_bajar[$j][\"cantidad_reservada\"].\"<br>\r\n \t\t\t No se puede continuar la ejecución. Contacte a la División Software\");\r\n \t\t}//del else\r\n\r\n \t}//de if($reservas_a_bajar[$j][\"cantidad_utilizada\"]>0)\r\n\r\n }//de for($j=0;$j<sizeof($reservas_a_bajar);$j++)\r\n\r\n\t\t\t\t\t\t\t\t\t}//if($acum_otras_reservas)\r\n\r\n\t\t\t\t\t\t\t\t}//del else de if($nueva_reserva_pm)\r\n///////////////////////////////\r\n\r\n\t\t\t\t\t\t }//de if ($items[$i][\"cantidad_res\"]>0)\r\n }//de if($items[$i]['id_producto'])\r\n }//de if($items[$i]['id_detalle_movimiento']==\"\")\r\n //sino, si la fila no fue borrada, la actualizamos\r\n elseif($tam_filas_borrar>0 && !in_array($items[$i]['id_detalle_movimiento'],$filas_borrar))\r\n {\r\n\r\n\t for($j=0;$j<$items_en_bd['cantidad'];$j++){\r\n\r\n\t if ($items_en_bd[$j][\"id_detalle_movimiento\"]==$items[$i][\"id_detalle_moviento\"])\r\n\t $cantidad_reservada_bd=$items_en_bd[$j][\"cantidad\"];\r\n\r\n\t }\r\n\r\n\t if ($cantidad_reservada_bd==$items[$i][\"cantidad\"])\r\n\t {\r\n\t //se modifico la cantidad y tendriamos que borrar los reservados\r\n\t //cancelar_reserva\r\n\t //reservar_stock\r\n\t }\r\n\r\n\t $query=\"update detalle_movimiento set descripcion='\".$items[$i]['descripcion'].\"',cantidad=\".$items[$i]['cantidad'].\",precio=\".(($items[$i]['precio']!=\"\")?$items[$i]['precio']:0).\"\r\n\t where id_detalle_movimiento=\".$items[$i]['id_detalle_movimiento'];\r\n\t sql($query) or fin_pagina(\"<br>Error al actualizar el producto $i del movimiento <br>$query\");\r\n\r\n\r\n }//de elseif($tam_filas_borrar>0 && !in_array($items[$i]['id_detalle_movimiento'],$filas_borrar))\r\n }//de for($i=0;$i<$items['cantidad'];$i++)\r\n\r\n $db->CompleteTrans();\r\n}", "function inserir($cidade, $bairro, $rua, $numeroTerreno, $quantidadeCasa, $valor, $idUsuario) #Funcionou\n {\n $conexao = new conexao();\n $sql = \"insert into terreno( Cidade, Bairro, Rua, NumeroTerreno, QuantidadeCasa, Valor, idUsuario) \n values('$cidade', '$bairro', '$rua', '$numeroTerreno', '$quantidadeCasa', '$valor', $idUsuario )\";\n mysqli_query($conexao->conectar(), $sql);\n echo \"<p> Inserido </p>\";\n }", "function insertarSolicitudObligacionPago()\r\n {\r\n $this->procedimiento = 'tes.ft_solicitud_obligacion_pago_ime';\r\n $this->transaccion = 'TES_SOOBPG_INS';\r\n $this->tipo_procedimiento = 'IME';\r\n\r\n //Define los parametros para la funcion\r\n $this->setParametro('id_proveedor', 'id_proveedor', 'int4');\r\n $this->setParametro('tipo_obligacion', 'tipo_obligacion', 'varchar');\r\n $this->setParametro('id_moneda', 'id_moneda', 'int4');\r\n $this->setParametro('obs', 'obs', 'varchar');\r\n $this->setParametro('porc_retgar', 'porc_retgar', 'numeric');\r\n $this->setParametro('id_funcionario', 'id_funcionario', 'int4');\r\n $this->setParametro('porc_anticipo', 'porc_anticipo', 'numeric');\r\n $this->setParametro('id_depto', 'id_depto', 'int4');\r\n $this->setParametro('fecha', 'fecha', 'date');\r\n $this->setParametro('tipo_cambio_conv', 'tipo_cambio_conv', 'numeric');\r\n $this->setParametro('pago_variable', 'pago_variable', 'varchar');\r\n $this->setParametro('total_nro_cuota', 'total_nro_cuota', 'int4');\r\n $this->setParametro('fecha_pp_ini', 'fecha_pp_ini', 'date');\r\n $this->setParametro('rotacion', 'rotacion', 'int4');\r\n $this->setParametro('id_plantilla', 'id_plantilla', 'int4');\r\n $this->setParametro('tipo_anticipo', 'tipo_anticipo', 'varchar');\r\n $this->setParametro('id_contrato', 'id_contrato', 'int4');\r\n\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $this->ejecutarConsulta();\r\n\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }", "function insertar_recibidos_mov($id_mov)\r\n {\r\n global $db,$_ses_user;\r\n\r\n $ok=1;\r\n\r\n $db->StartTrans();\r\n\r\n $items=get_items_mov($id_mov);\r\n\r\n for($i=0;$i<$items['cantidad'];$i++)\r\n {\r\n $cantidad=$_POST[\"cant_recib_$i\"];\r\n if($cantidad>0)\r\n {\r\n $desc_recib=$_POST[\"desc_recib_$i\"];\r\n $id_prod_esp=$items[$i][\"id_prod_esp\"];\r\n $id_detalle_mov=$items[$i]['id_detalle_movimiento'];\r\n //vemos si ya se recibieo alguno de este producto. Si es asi, se actualiza\r\n //es entrada en recibidos_mov, sino, se inserta una nueva entrada\r\n $query=\"select id_recibidos_mov from recibidos_mov\r\n where id_detalle_movimiento=$id_detalle_mov and ent_rec=1\";\r\n $res=sql($query) or fin_pagina();\r\n if($res->fields['id_recibidos_mov'])\r\n {\r\n $query=\"update recibidos_mov set cantidad=cantidad+$cantidad , observaciones='$desc_recib' where id_recibidos_mov=\".$res->fields['id_recibidos_mov'].\" and ent_rec=1\";\r\n $tipo_log=\"actualización\";\r\n $id_recibidos_mov=$res->fields['id_recibidos_mov'];\r\n }\r\n else\r\n {\r\n $query=\"select nextval('recibidos_mov_id_recibidos_mov_seq') as id\";\r\n $id=$db->Execute($query) or die($db->ErrorMsg().\"<br>Error al traer la seucencia de recibidos_mov\");\r\n $id_recibidos_mov=$id->fields['id'];\r\n $query=\"insert into recibidos_mov(id_recibidos_mov,cantidad,observaciones,id_detalle_movimiento,ent_rec)\r\n values($id_recibidos_mov,$cantidad,'$desc_recib',$id_detalle_mov,1)\";\r\n $tipo_log=\"inserción\";\r\n }\r\n sql($query) or fin_pagina();\r\n\r\n $fecha_hoy=date(\"Y-m-d H:i:s\",mktime());\r\n $query=\"insert into log_recibidos_mov(fecha,usuario,tipo,id_recibidos_mov,cantidad_recibida)\r\n values('$fecha_hoy','\".$_ses_user['name'].\"','$tipo_log',$id_recibidos_mov,$cantidad)\";\r\n sql($query) or fin_pagina();\r\n }\r\n }\r\n if (!$db->CompleteTrans()) $ok=0;\r\n\r\n return $ok;\r\n}", "public function queryInsertEnd($dados){\n try{\n $ID = $dados['0'];\n $IDENTIFICADOR = $dados['1']; \n $CEP = preg_replace(\"/[^0-9]/\", \"\",$dados['2']);\n $LOGRADOURO = $dados['3'];\n $NUMERO = $dados['4'];\n $COMPLEMENTO = $dados['5'];\n $BAIRRO = $dados['6'];\n $CIDADE = $dados['7'];\n $ESTADO = $dados['8'];\n $PAIS = $dados['9'];\n $STATUS = $dados['10'];\n $SQL = \"INSERT INTO `endereco` (`id`, `identificador`, `cep`, `logradouro`, `numero`, `complemento`, `bairro`, `cidade`, `estado`, `pais`, `status`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\"; \n $sqlEndereco = $this->conecta->conectar()->prepare($SQL); \n $sqlEndereco->bindParam(1, $ID, PDO::PARAM_STR);\n $sqlEndereco->bindParam(2, $IDENTIFICADOR, PDO::PARAM_STR);\n $sqlEndereco->bindParam(3, $CEP, PDO::PARAM_STR);\n $sqlEndereco->bindParam(4, $LOGRADOURO, PDO::PARAM_STR);\n $sqlEndereco->bindParam(5, $NUMERO, PDO::PARAM_STR);\n $sqlEndereco->bindParam(6, $COMPLEMENTO, PDO::PARAM_STR);\n $sqlEndereco->bindParam(7, $BAIRRO, PDO::PARAM_STR);\n $sqlEndereco->bindParam(8, $CIDADE, PDO::PARAM_STR);\n $sqlEndereco->bindParam(9, $ESTADO, PDO::PARAM_STR);\n $sqlEndereco->bindParam(10, $PAIS, PDO::PARAM_STR);\n $sqlEndereco->bindParam(11, $STATUS, PDO::PARAM_STR);\n if($sqlEndereco->execute()){\n return \"ok\";\n }else{\n return print_r($sqlEndereco->errorInfo());\n }\n } catch (PDOException $ex) {\n return 'error '.$ex->getMessage();\n }\n }", "public function enviarPeticion( $comando ) {\n SocketClass::client_reply($comando);\n }", "function crearComentario($bd,$usuario){\n //Hago un filtrado previo por si hay valores indeseables en el array\n $arrayFiltrado=array();\n foreach ($_POST as $k => $v)\n $arrayFiltrado[$k] = filtrado($v);\n $entrada = new Entrada($arrayFiltrado[\"entrada\"]);\n $comentario = new Comentario(NULL,$arrayFiltrado[\"comentario\"],$arrayFiltrado[\"fechacreacion\"]);\n $daoComentario = new Comentarios($bd);\n $daoComentario->addComentario($comentario,$entrada,$usuario);\n return true;\n}", "public function insertar(){\n $pdo=Conexion::conectar();\n $sentencia = $pdo->prepare(\"INSERT INTO empleado (id, nombre, apellido,direccion,telefono,email,estado,firma,jefe,id_cargo,id_departamento) VALUES (:id, :nombre, :apellido,:direccion,:telefono,:email,:estado,:firma,:jefe,:id_cargo,:id_departamento)\");\n $sentencia->bindParam(':id', $id);\n $sentencia->bindParam(':nombre', $nombre);\n $sentencia->bindParam(':apellido', $apellido);\n $sentencia->bindParam(':direccion', $direccion);\n $sentencia->bindParam(':telefono', $telefono);\n $sentencia->bindParam(':email', $email);\n $sentencia->bindParam(':estado', $estado);\n $sentencia->bindParam(':firma', $firma);\n $sentencia->bindParam(':jefe', $jefe);\n $sentencia->bindParam(':id_cargo', $id_cargo);\n $sentencia->bindParam(':id_departamento', $id_departamento);\n \n // estos los valores de los input\n $id=\"0700950454\";\n $nombre=\"aaa\";\n $apellido=\"ssss\";\n $direccion=\"sss\";\n $telefono=23323232;\n $email=\"[email protected]\";\n $estado=1;\n $firma=\"NULL\";\n $jefe=\"0706430980\";\n $id_cargo=3;\n $id_departamento=16;\n $sentencia->execute();\n \n \n //CUANDO NO TIENE JEFE--=EL EMPLEADO ES JEFE (NO ENVIAR EL PARAMETRO JEFE,LA BDD AUTOMTICAMENTE PONE NULL)\n $pdo=Conexion::conectar();\n $sentencia = $pdo->prepare(\"INSERT INTO empleado (id, nombre, apellido,direccion,telefono,email,estado,firma,id_cargo,id_departamento) VALUES (:id, :nombre, :apellido,:direccion,:telefono,:email,:estado,:firma,:id_cargo,:id_departamento)\");\n $sentencia->bindParam(':id', $id);\n $sentencia->bindParam(':nombre', $nombre);\n $sentencia->bindParam(':apellido', $apellido);\n $sentencia->bindParam(':direccion', $direccion);\n $sentencia->bindParam(':telefono', $telefono);\n $sentencia->bindParam(':email', $email);\n $sentencia->bindParam(':estado', $estado);\n $sentencia->bindParam(':firma', $firma);\n $sentencia->bindParam(':id_cargo', $id_cargo);\n $sentencia->bindParam(':id_departamento', $id_departamento);\n \n // estos los valores de los inputs\n $id=\"0700950454\";\n $nombre=\"aaa\";\n $apellido=\"ssss\";\n $direccion=\"sss\";\n $telefono=23323232;\n $email=\"[email protected]\";\n $estado=1;\n $firma=\"NULL\";\n $id_cargo=3;\n $id_departamento=16;\n $sentencia->execute();\n \n \n\n \n }", "public function insert($cliente){\r\n\t\t$sql = 'INSERT INTO clientes (nome, sobrenome, email, senha, ativo) VALUES (?, ?, ?, ?, ?)';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t\n\t\t$sqlQuery->set($cliente->nome);\n\t\t$sqlQuery->set($cliente->sobrenome);\n\t\t$sqlQuery->set($cliente->email);\n\t\t$sqlQuery->set($cliente->senha);\n\t\t$sqlQuery->setNumber($cliente->ativo);\n\r\n\t\t$id = $this->executeInsert($sqlQuery);\t\r\n\t\t$cliente->id = $id;\r\n\t\treturn $id;\r\n\t}", "public function guardar(){\n \n $_vectorpost=$this->_vcapitulo;\n $_programadas=[1,3,4,5,6,7,8,2,11,15,26];\n \n if(!empty($this->_relaciones)){\n \n $_vpasspregunta=explode(\"%%\",$this->_relaciones);\n \n /*Iniciando Transaccion*/\n $_transaction = Yii::$app->db->beginTransaction();\n try {\n foreach($_vpasspregunta as $_clguardar){\n\n /*Aqui se debe ir la funcion segun el tipo de pregunta\n * la variable $_clguardar es un string que trae\n * name_input ::: id_pregunta ::: id_tpregunta ::: id_respuesta\n * cada funcion de guardar por tipo se denomina gr_tipo...\n */\n\n $_ldata=explode(\":::\",$_clguardar);\n\n //Recogiendo codigos SQL\n //Se envia a la funcion de acuerdo al tipo\n // @name_input \"0\"\n // @id_pregunta \n // @id_tpregunta\n // @id_respuesta ==========================//\n \n /*Asociando Respuesta*/\n $_nameq = 'rpta'.$_ldata[0];\n \n \n \n if(!empty($_ldata[2]) and in_array($_ldata[2], $_programadas) === TRUE and isset($_vectorpost['Detcapitulo'][$_nameq])){\n \n \n //Yii::trace(\"Llegan tipos de preguntas \".$_ldata[2].\" Para idpregunta \".$_ldata[1],\"DEBUG\");\n /*Recogiendo Id_respuesta si existe*/ \n $_idrespuesta=(!empty($_ldata[3]))? $_ldata[3]:'';\n $id_pregunta= $_ldata[1];\n $this->_idcapitulo = $_ldata[4];\n \n \n /*Armando Trama SQL segun el tipo de pregunta*/\n $_valor = $_vectorpost['Detcapitulo'][$_nameq];\n \n //Yii::trace(\"que respuestas llegan \".$_valor,\"DEBUG\");\n \n if(isset($this->_agrupadas[$id_pregunta])){\n \n /*1) Buscando si existe una respuesta asociada a la agrupacion*/\n $idrpta_2a = Yii::$app->db->createCommand(\n 'SELECT id_respuesta FROM fd_respuesta\n LEFT JOIN fd_pregunta ON fd_pregunta.id_pregunta = fd_respuesta.id_pregunta\n WHERE fd_pregunta.id_agrupacion= :agrupacion \n and fd_respuesta.id_conjunto_pregunta= :idconjprta \n and fd_respuesta.id_conjunto_respuesta= :idconjrpta\n and fd_respuesta.id_capitulo= :idcapitulo\n and fd_respuesta.id_formato = :idformato\n and fd_respuesta.id_version = :idversion ')\n ->bindValues([\n ':idconjrpta' => $this->_idconjrpta,\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion, \n ':agrupacion' =>$this->_agrupadas[$id_pregunta],\n ])->queryOne();\n \n $_idrespuesta = $idrpta_2a['id_respuesta'];\n \n /*2) Si existe respuesta asociada se envia como _idrespuesta*/\n \n $v_rpta= $this->{\"gr_tipo2a\"}($_idrespuesta,$_valor,$id_pregunta); //Preguntas tipo 2 agrupadas\n $_ldata[1]= $v_rpta[2];\n \n }else{\n \n //Averiguando si la pregunta es tipo multiple y si la respuesta es null si es asi \n //Salta a la siguiente pregunta\n if(!empty($this->multiples[$id_pregunta]) and empty($_valor)){\n continue;\n }else if(!empty($this->multiples[$id_pregunta]) and !is_null($_valor)){\n $_idrespuesta=''; \n } \n \n /*Si la pregunta es tipo 3 se averigua si la respuesta es tipo especifique*/\n $_otros=null;\n if($_ldata[2]=='3' and isset($_vectorpost['Detcapitulo']['otros_'.$_ldata[0]])){\n \n $_otros = $_vectorpost['Detcapitulo']['otros_'.$_ldata[0]];\n $v_rpta= $this->{\"gr_tipo\".$_ldata[2]}($_idrespuesta,$_valor,$_otros);\n \n }else{\n \n if($_ldata[2]==11 and isset($this->_tipo11[$_nameq])){\n $_valor=count($this->_tipo11[$_nameq]);\n $v_rpta= $this->{\"gr_tipo\".$_ldata[2]}($_idrespuesta,$_valor);\n }else if ($_ldata[2]!=11 and !isset($this->_tipo11[$_nameq])){\n $v_rpta= $this->{\"gr_tipo\".$_ldata[2]}($_idrespuesta,$_valor,$_otros,$id_pregunta);\n }else{\n continue;\n } \n }\n } \n \n /*Asignando valor == null*/\n $v_rpta[1]=(!isset($v_rpta[1]))? NULL:$v_rpta[1];\n \n \n /*Generado comando SQL*/\n if(!empty($v_rpta[0])){\n \n if(empty($this->_idjunta))$this->_idjunta=0;\n if(is_null($_otros)){ \n \n if (strpos($v_rpta[0], ';') !== false) {\n $sep_qu = explode(\";\", $v_rpta[0]);\n \n Yii::$app->db->createCommand($sep_qu[0])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ':idconjrpta' => $this->_idconjrpta,\n ':idpregunta' => $_ldata[1],\n ':idtpregunta' => $_ldata[2],\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion,\n ':idjunta' =>$this->_idjunta,\n ])->execute();\n \n Yii::$app->db->createCommand($sep_qu[1])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ])->execute();\n \n \n }\n else\n {\n Yii::$app->db->createCommand($v_rpta[0])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ':idconjrpta' => $this->_idconjrpta,\n ':idpregunta' => $_ldata[1],\n ':idtpregunta' => $_ldata[2],\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion,\n ':idjunta' =>$this->_idjunta,\n ])->execute();\n }\n \n \n }else{ \n Yii::$app->db->createCommand($v_rpta[0])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ':idconjrpta' => $this->_idconjrpta,\n ':idpregunta' => $_ldata[1],\n ':idtpregunta' => $_ldata[2],\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion,\n ':idjunta' =>$this->_idjunta,\n ':otros' =>$_otros, \n ])->execute();\n }\n\n /*Se averigua con que id quedo guardada la respuesta si es tipo 11 -> guarda en SOP SOPORTE*/\n if($_ldata[2]=='11' and !empty($this->_tipo11[$_nameq])){\n\n $id_rpta = Yii::$app->db->createCommand(\n 'SELECT id_respuesta FROM fd_respuesta '\n . 'WHERE id_pregunta = :_prta'\n . ' and fd_respuesta.id_conjunto_pregunta= :idconjprta \n and fd_respuesta.id_conjunto_respuesta= :idconjrpta\n and fd_respuesta.id_capitulo= :idcapitulo\n and fd_respuesta.id_formato = :idformato\n and fd_respuesta.id_version = :idversion' )\n ->bindValues([\n ':_prta' => $_ldata[1], \n ':idconjrpta' => $this->_idconjrpta,\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion, \n ])->queryOne();\n\n\n foreach($this->_tipo11[$_nameq] as $_cltp11){\n\n $_vctp11=explode(\":::\",$_cltp11);\n $_namefile = $_vctp11[0].\".\".$_vctp11[2];\n\n $_sqlSOP=\"INSERT INTO sop_soportes ([[ruta_soporte]],[[titulo_soporte]],[[tamanio_soportes]],[[id_respuesta]]) VALUES (:ruta, :titulo, :tamanio, :_idrpta)\";\n\n Yii::$app->db->createCommand($_sqlSOP)\n ->bindValues([\n ':ruta' => $_vctp11[1],\n ':titulo' => $_namefile,\n ':tamanio' => $_vctp11[3],\n ':_idrpta' => $id_rpta[\"id_respuesta\"],\n ])->execute();\n\n }\n \n }\n /*Fin guardando en SOP_SOPORTES para tipo 11*/\n \n } \n }\n\n }\n \n \n \n $_transaction->commit();\n \n }catch (\\Exception $e) {\n $_transaction->rollBack();\n throw $e;\n return FALSE;\n } catch (\\Throwable $e) {\n $_transaction->rollBack();\n throw $e;\n return FALSE;\n } \n \n }\n return TRUE;\n }", "public function save_Linea()\n {\n //con un campo AUTO_INCREMENT, podemos obtener \n //el ID del último registro insertado / actualizado inmediatamente. \"\n\n\n $sql = \"SELECT LAST_INSERT_ID() AS 'pedido'\";\n $query = $this->db->query($sql);\n $pedidoId = $query->fetch_object()->pedido;\n\n\n $carritoData = $_SESSION['carrito'];\n\n foreach ($carritoData as $valor) {\n $item = $valor['producto'];\n\n $insert = \"INSERT INTO lineaspedidos VALUES (NULL,\n {$pedidoId},\n {$item->id},\n {$valor['unidades']})\";\n\n $producto = $this->db->query($insert);\n\n $result = false;\n }\n if ($producto) {\n $result = true;\n }\n return $result;\n }", "public function inserir($nome, $email, $endereco, $bairro, $cep, $cpf, $fone) {\n\n //$nome = $_POST[\"txt_nome\"]; // assim já pega os dados mas\n // por questão de segurança recomenda-se usar strip_tags para quebrar as tags e ficar mais seguro\n // usa-se o issset para verificar se o dado existe, senão retorna null\n $nome = isset($_POST[\"txt_nome\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_nome\")) : NULL; // usado para a edição e inserção do cliente\n $email = isset($_POST[\"txt_email\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_email\")) : NULL; // usado para a edição e inserção do cliente\n $endereco = isset($_POST[\"txt_endereco\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_endereco\")) : NULL; // usado para a edição e inserção do cliente\n $bairro = isset($_POST[\"txt_bairro\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_bairro\")) : NULL; // usado para a edição e inserção do cliente\n $cep = isset($_POST[\"txt_cep\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_cep\")) : NULL; // usado para a edição e inserção do cliente\n $cpf = isset($_POST[\"txt_cpf\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_cpf\")) : NULL; // usado para a edição e inserção do cliente\n $fone = isset($_POST[\"txt_fone\"]) ? strip_tags(filter_input(INPUT_POST, \"txt_fone\")) : NULL; // usado para a edição e inserção do cliente\n\n $sql = \"INSERT INTO cliente SET nome = :nome, email = :email, endereco = :endereco, bairro = :bairro, cep = :cep, cpf = :cpf, fone = :fone\";\n $qry = $this->db->prepare($sql); // prepare para os dados externos\n $qry->bindValue(\":nome\", $nome); // comando para inserir\n $qry->bindValue(\":email\", $email); // comando para inserir\n $qry->bindValue(\":endereco\", $endereco); // comando para inserir\n $qry->bindValue(\":bairro\", $bairro); // comando para inserir\n $qry->bindValue(\":cep\", $cep); // comando para inserir\n $qry->bindValue(\":cpf\", $cpf); // comando para inserir\n $qry->bindValue(\":fone\", $fone); // comando para inserir\n $qry->execute(); // comando para executar\n\n return $this->db->lastInsertId(); // retorna o id do ultimo registro inserido\n }", "public function save_linea(){\n \n //$sql = \"SELECT LAST_INSERT_ID() as 'pedido' ;\";//Devuelve id del ultimo pedido\n $sql = \"SELECT * FROM pedidos ORDER BY id DESC LIMIT 1;\";\n $query = $this->db->query($sql);\n\n $pedido_id = $query->fetch_object()->id;\n\n $cast_pedido_id = (int)$pedido_id;\n \n //var_dump($cast_pedido_id);\n \n //Insertamos productos y cantidad de productos\n foreach($_SESSION['carrito'] as $indice =>$elemento){\n \n $producto = $elemento['producto'];\n $product_id = (int)$producto->id;\n \n $insert = \"INSERT INTO lineas_pedidos VALUES(null , $cast_pedido_id, $product_id, {$elemento['unidades']});\";\n $save = $this->db->query($insert);\n \n //Llamada al método updateStock, el cual le pasamos el id del producto y las unidades y va modificando el stock.\n $this->updateStock($producto->id, $elemento['unidades']);\n // echo $this->db->error;\n // die();\n } \n\n\n $result = false;\n if($save){\n $result = true;\n }\n return $result;\n }", "public function GenerarPedidoWeb($arregloPedido,$arregloPasajeros,$codigoTransaccion,$idPoliza,$cantidadPasajeros)\r\n\t{\r\n\t\ttry\r\n\t\t{\t$fechaRegistro=date(\"m/d/Y h:m:s\" );\r\n\t\t\t//CREAMOS EL PEDIDO\r\n\t\t\t//var_dump($arregloPedido);\r\n\t\t\t$recordSett = &$this->conexion->conectarse()->Execute(\" INSERT INTO PedidoWeb\r\n\t\t(Id, CodigoTransaccion, IdPoliza, FechaCreacion, FechaRespuesta, NombreTitularFactura, DocumentoTitularFactura, DireccionTitularFactura, \r\n\t\tTelefonoTitularFactura,EmailTitularFactura, TelefonoContacto, TelefonoMovilContacto, DireccionContacto, NombreContactoEmergencia, ApellidoContactoEmergencia, \r\n\t\tTelefonoContactoEmergencia, EmailContactoEmergencia,FechaInicio,FechaFin,Precio ,Region,TrmIata, Estado)\r\n\t\tVALUES ( '\".$arregloPedido[0].\"','\".$codigoTransaccion.\"','\".$idPoliza.\"','\".$fechaRegistro.\"','\".$fechaRegistro.\"','\".$arregloPedido[7].\"','\".$arregloPedido[8].\"','\".$arregloPedido[9].\"','\".$arregloPedido[10].\"','\".$arregloPedido[11].\"','\".$arregloPedido[5].\"','\".$arregloPedido[4].\"','\".$arregloPedido[6].\"','\".$arregloPedido[1].\"','\".$arregloPedido[2].\"','\".$arregloPedido[3].\"','\".$arregloPedido[12].\"','\".$arregloPedido[13].\"','\".$arregloPedido[14].\"','\".$arregloPedido[15].\"','\".$arregloPedido[16].\"','\".$this->fun->getTrmIata($idPoliza).\"',3) \");\t\r\n\t\t\t//CREAMOS LOS PASAJEROS DEL PEDIDO.\r\n\t\t\t//var_dump($arregloPasajeros);\r\n\t\t\t//echo \"Cantidad Inicial \".$cantidadPasajeros.\"<br>\";\r\n\t\t\t$guardaPasajeros=0;\r\n\t\t\t$i=0;\r\n\t\t\t\twhile($cantidadPasajeros!= $guardaPasajeros){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t$Nombre=$arregloPasajeros[$i++];\r\n\t\t\t\t$Apellido=$arregloPasajeros[$i++];\r\n\t\t\t\t$Documento=$arregloPasajeros[$i++];\r\n\t\t\t\t$Email=$arregloPasajeros[$i++];\r\n\t\t\t\t$FechaNacimiento=$arregloPasajeros[$i++];\t\t\t\t\r\n\t\t\t\t\t$Idpasajero=$this->fun->NewGuid();\r\n\t\t\t\t\t$recordSett = &$this->conexion->conectarse()->Execute(\"INSERT INTO PasajerosPedido\r\n\t\t\t\t\t\t (Id, IdPedido, Nombre, Apellido, Documento, Email, FechaNacimiento)\r\n\t\t\t\t\t\t VALUES('\".$Idpasajero.\"','\".$arregloPedido[0].\"','\".$Nombre.\"','\".$Apellido.\"','\".$Documento.\"','\".$Email.\"','\".$FechaNacimiento.\"')\");\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$guardaPasajeros++;\t\r\n\t\t\t\t\t//echo $guardaPasajeros .\"<br>\";\r\n\t\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\techo 'Caught exception: ', $e->getMessage(), \"\\n\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function cadastraCliente($conexao,$nome,$endereco,$cep,$tel_celular,$tel_residencial,$email,$senha)\n {\n $sql = \"INSERT INTO cliente (nome,endereco,cep,tel_celular,tel_residencial,email,senha) VALUES\n ('{$nome}','{$endereco}','{$cep}','{$tel_celular}','{$tel_residencial}','{$email}','{$senha}')\";\n return mysqli_query($conexao,$sql);\n }", "public function registrarCliente($dados){\n //$conexao = $c->conexao();\n $tipoCadastro = $_POST['tipocad'];\n $tipoCliente = $_POST['tipo'];\n $iss = $_POST['iss'];\n $nome = trim($_POST['nome']);\n // $nomeJuridico = trim($_POST['nomeJuridico']);\n $nomeFantasia = trim($_POST['nomeFantasia']);\n $apelido = trim($_POST['apelido']);\n $cnpj = $_POST['cnpj'];\n $cpf = $_POST['cpf'];\n $rg = trim($_POST['rg']);\n $dt_nascimento = trim($_POST['dtnascimento']);\n $telefone = $_POST['telefone'];\n // $telefoneJ = $_POST['telefoneJ'];\n $telefone2J = $_POST['telefone2J'];\n $cep = $_POST['cep'];\n $endereco = $_POST['endereco'];\n $bairro = $_POST['bairro'];\n $uf = $_POST['uf'];\n $cidade = $_POST['cidade'];\n $complemento = $_POST['complemento'];\n $numero = trim($_POST['numero']);\n $usuid = $_SESSION['usuid'];\n\n $sql = \"SELECT count(*) as total from tbclientes WHERE rg = '$rg' or cnpj = '$cnpj' or cpf = '$cpf' \";\n $sql = $this->conexao->query($sql);\n $row = $sql->fetch_assoc();\n\n if($row['total'] == 1){\n return 0;\n }else{\n\n $sql = \"INSERT INTO tbclientes (nome, nomefantasia, apelido, tipocad, tipopessoa, iss, cpf, cnpj, rg, telefone, telefone2, dt_nascimento, data_cadastro, usuid, habilitado, cep, endereco, bairro, uf, cidade, complemento, numero) VALUES ('$nome', '$nomeFantasia', '$apelido', '$tipoCadastro', '$tipoCliente', '$iss', '$cpf', '$cnpj', '$rg', '$telefone', '$telefone2J', '$dt_nascimento', NOW(), '$usuid', 'S', '$cep', '$endereco', '$bairro', '$uf', '$cidade', '$complemento', '$numero') \";\n\n $mensagem = \"O Usuário \".$_SESSION['email'].\" cadastrou o Cliente $nome \";\n $this->salvaLog($mensagem);\n\n return $this->conexao->query($sql);\n\n }\n\n }", "public function save(){\n //para insertar datos que entrarar debemos unterpolar\n\n //los numero no van entrecomillas\n \n $sql=\"INSERT INTO pedidos VALUES (NULL,{$this->getUsuario_id()},'{$this->getProvincia()}','{$this->getLocalidad()}','{$this->getDireccion()}',{$this->getCoste()},'confirm',curdate(),curtime());\";\n //ahora insertamos una consulta \n $save = $this->db->query($sql);\n \n\n $result = false; //este es el resultado por defecto\n //si el $save da true (en otras palabras no esta vacio y los datos se llenaron correctamente)\n if($save){\n $result=true;\n }\n return $result;\n }", "public function cadastrar(){\r\n //DEFINIR A DATA DE CADASTRO\r\n $this->cadastro = date('Y-m-d H:i:s');\r\n\r\n $db = new Database('cartao');\r\n $this->id = $db->insert([\r\n 'bandeira' => $this->bandeira,\r\n 'numero' => $this->numero,\r\n 'doador' => $this->doador,\r\n ]);\r\n\r\n }", "public function setVendedor($nome,$comissao){\n try{\n $x = 1;\n $Conexao = Conexao::getConnection();\n $query = $Conexao->prepare(\"INSERT INTO vendedor (nome,comissao) VALUES ('$nome',$comissao)\"); \n $query->execute(); \n // $query = $Conexao->query(\"DELETE FROM vendedor WHERE id_vendedor = (SELECT top 1 id_vendedor from vendedor order by id_vendedor desc)\"); \n // $query->execute();\n return 1;\n\n }catch(Exception $e){\n echo $e->getMessage();\n return 2;\n exit;\n } \n }", "public function Insert($dados){\n $sql = \"insert into tbl_pedido (idProduto, idUsuario, quantidade,idStatus,data,idEnderecoUsuario)\n values ('\".$dados->idProduto.\"',\n '\".$dados->idUsuario.\"',\n '\".$dados->quantidade.\"','1',CURDATE(),'1')\";\n\n\n\n //echo $sql;\n\n // conexao com o banco\n $conex = new Mysql_db();\n $PDO_conex = $conex->Conectar();\n\n if ($PDO_conex->query($sql)) {\n // echo \"</br> sucesso\";\n\n if (isset($_SESSION['idUsuario'])) {\n $idUser = $_SESSION['idUsuario'];\n\n session_destroy();\n @session_start();\n\n $_SESSION['idUsuario'] = $idUser;\n\n\n\n }\n }\n\n header(\"location:pagamento.php\");\n\n $conex->Desconectar();\n\n }", "function inserirContato($dadosContato) {\n require_once('../modulo/config.php');\n\n //Import do arquivo de função para conectar no BD \n require_once('conexaoMysql.php');\n\n if(!$conex = conexaoMysql())\n {\n echo(\"<script> alert('\".ERRO_CONEX_BD_MYSQL.\"'); </script>\");\n //die; //Finaliza a interpretação da página\n }\n \n $nome = (string) null;\n $celular = (string) null;\n $email = (string) null;\n $estado = (int) null;\n $dataNascimento = (string) null;\n $sexo = (string) null;\n $obs = (string) null;\n $foto = \"noImage.png\";\n\n\n $nome = $dadosContato['nome'];\n $celular = $dadosContato['celular'];\n $email = $dadosContato['email'];\n $estado = $dadosContato['estado'];\n $dataNascimento =$dadosContato['dataNascimento'];\n\n $sexo = $dadosContato['sexo'];\n $obs = $dadosContato['obs'];\n //$foto = uploadFoto($_FILES['fleFoto']);\n\n\n\n // var_dump($arquivoUpload);\n\n $sql = \"insert into tblcontatos \n (\n nome, \n celular, \n email, \n idEstado, \n dataNascimento, \n sexo, \n obs,\n foto,\n statusContato\n )\n values\n (\n '\". $nome .\"',\n '\". $celular .\"',\n '\". $email .\"', \n \".$estado.\",\n '\". $dataNascimento .\"',\n '\". $sexo .\"', \n '\". $obs .\"',\n '\" . $foto . \"',\n 1\n )\n \";\n // Executa no BD o Script SQL\n\n if (mysqli_query($conex, $sql))\n \n return convertJson($dadosContato);\n else\n return false; \n \n}", "public function crear() {\n \n //json_decode — Decodifica un string de JSON\n $myArray = isset($_POST['dvArray']) ? json_decode($_POST['dvArray']) : false; \n\n //Get arreglo DetalleVenta\n if ($myArray) {\n \n //Get sesion User\n $usuario=new UsuarioModelo();\n $usuario->set_nombre('admin');\n $unUsuario = $usuario->getBy('nombre', $usuario->get_nombre());\n //Destruir el objeto\n unset($usuario);\n\n $cont = 0;\n //Recorrer y recuperar valores de un objeto JSON con foreach\n foreach($myArray as $obj){\n if ($cont==0) {\n $idcliente = $obj->idcliente;\n $forma_pago = $obj->forma_pago;\n $total_venta = $obj->total_venta;\n \n //set new Venta\n $venta = new VentaModelo();\n $venta->set_idcliente($idcliente);\n $venta->set_idusuario($unUsuario[0]->idusuario);\n $venta->set_forma_pago($forma_pago);\n $venta->set_total_venta($total_venta); \n $save = $venta->addVenta();\n if ($save) {\n $this->resultadoC = true;\n $idventa = $venta->get_idventa(); \n } else {\n $this->resultadoC = false;\n }\n unset($venta);\n\n } else {\n\n if ($this->resultadoC && isset($idventa)) {\n $idproducto = $obj->dvCodProducto;\n $precio = (float) $obj->dvPUnitario;\n $cantidad = (int) $obj->dvCantidad;\n $total = round($precio*$cantidad,2);\n\n $values[] = \"('{$idventa}', '{$idproducto}', '{$cantidad}', '{$total}')\";\n\n /*//set new DetalleVenta\n $dVenta = new DetalleVentaModelo();\n $dVenta->set_idventa($idventa);\n $dVenta->set_idproducto($idproducto);\n $dVenta->set_cantidad($cantidad);\n $dVenta->set_total($total);\n $save = $dVenta->addDetalleVenta();\n if (!$save) {\n $this->resultadoC = false;\n }\n unset($dVenta);*/\n\n // Actualizar PRODUCTO\n //set new Producto\n $producto = new ProductoModelo();\n $unProducto= $producto->buscarProductoModelo($idproducto);\n\n $producto->setIdproducto($unProducto[0]->idproducto);\n $producto->setIdcategoria($unProducto[0]->idcategoria);\n $producto->setDetalle($unProducto[0]->detalle);\n $producto->setPrecio($unProducto[0]->precio_venta);\n $producto->setStock((int) ($unProducto[0]->stock - $cantidad));\n $save = $producto->actualizar();\n if (!$save) {\n $this->resultadoC = false;\n }\n unset($producto);\n }\n }\n $cont++;\n }\n\n if (isset($values)) {\n //set new DetalleVenta\n $dVenta = new DetalleVentaModelo();\n $save = $dVenta->addDetalleVentaArray($values);\n /*if (!$save) {\n $this->resultadoC = false;\n }*/\n unset($dVenta); \n }\n\n echo $save; //Este mensaje devolverá a la llamada AJAX \n\n } else {\n echo \"false\";\n } \n }", "public function inserirDados()\n\t\t{\n\t\t\t$insertIdoso = \"INSERT INTO idoso(logradouro,\n\t\t\t\t\t\t\t\t\t\ttipo_logradouro,\n\t\t\t\t\t\t\t\t\t\tnumero,\n\t\t\t\t\t\t\t\t\t\tcomplemento,\n\t\t\t\t\t\t\t\t\t\tbaiiro,\n\t\t\t\t\t\t\t\t\t\tcidade,\n\t\t\t\t\t\t\t\t\t\tuf,\n\t\t\t\t\t\t\t\t\t\tusuario_id_usuario)\n\t\t\t\t\t\t\t\tVALUES(:logradouro,\n\t\t\t\t\t\t\t\t\t\t:tipo_logradouro,\n\t\t\t\t\t\t\t\t\t\t:numero,\n\t\t\t\t\t\t\t\t\t\t:complemento,\n\t\t\t\t\t\t\t\t\t\t:baiiro,\n\t\t\t\t\t\t\t\t\t\t:cidade,\n\t\t\t\t\t\t\t\t\t\t:uf,\n\t\t\t\t\t\t\t\t\t\t:usuario_id_usuario)\";\n\n\t\t\t$stmt->pdo->prepare($insertIdoso);\n\t\t\t$stmt->bindParam(':logradouro', $this->logradouro);\n\t\t\t$stmt->bindParam(':tipo_logradouro', $this->tipo_logradouro);\n\t\t\t$stmt->bindParam(':numero', $this->numero);\n\t\t\t$stmt->bindParam(':complemento', $this->complemento);\n\t\t\t$stmt->bindParam(':bairro', $this->baiiro);\n\t\t\t$stmt->bindParam(':cidade', $this->cidade);\n\t\t\t$stmt->bindParam(':uf', $this->uf);\n\t\t\t$stmt->bindParam(':usuario_id_usuario', $this->buscarTodosDados());\n\n\t\t\tif($stmt->execute()) {\n\t\t\t\theader(\"Location: localhost:8001/contato\");\n\t\t\t} else {\n\t\t\t\tdie('Erro ao cadastrar');\n\t\t\t}\n\t\t}", "public function registerCliente($clientes, $pagos) {\n $where = \" WHERE Email = :Email\";\n $response = $this->db->select1(\"*\", 'clientes', $where, array('Email' => $clientes->Email));\n\n if (is_array($response)) {\n //A qui insertamos los datos a la tabla cliente\n $response = $response['results'];\n if (0 == count($response)) {\n //\n //Esta seria la query\n $value = \"(Nombre, Apellido_paterno, Apellido_materno, Email, Edad, Fecha_inicio, Folio) \n VALUE (:Nombre, :Apellido_paterno, :Apellido_materno, :Email, :Edad, :Fecha_inicio, :Folio)\";\n $data = $this->db->insert1(\"clientes\", $clientes, $value);\n // $data = true;\n if (is_bool($data)) {\n //A qui ya se inserto los datos en los datos en la tabla proveedores\n // echo $data;\n $response = $this->db->select1(\"*\", 'clientes', $where, array('Email' => $clientes->Email));\n // var_dump($response);\n if (is_array($response)) {\n echo \"condi2\";\n //Checamos si es el mismo proveedor\n $response = $response['results'];\n // var_dump($pagos);\n $pagos->Id_cliente = $response[0][\"Id_cliente\"];\n var_dump($pagos);\n $value = \" (`Id_pago`, `Nombre`, `Mes`, `Pago`, `Fecha_pago`, `Estatus`, `Folio`, `Id_cliente`) VALUES (:Id_pago, :Nombre,:Mes,:Pago,:Fecha_pago, :Estatus, :Folio, :Id_cliente)\";\n print_r($pagos);\n $data = $this->db->insert1(\"pagos\", $pagos, $value);\n\n if (is_bool($data)) {\n // return 0;\n return 0;\n } else {\n // return $data;\n echo $data;\n }\n } else {\n return $response;\n }\n } else {\n return $data;\n }\n } else {\n return 1;\n }\n } else {\n return $response;\n }\n }", "function guardarComida($arg) {\n\t\tSessionHandler()->check_session();\n\t\tdate_default_timezone_set('America/Argentina/La_Rioja');\n\t\t$ids = explode('@', $arg);\n\t\t$mesa = $ids[0];\n\t\t$comida = $ids[1];\n\t\t$cantidad = $ids[2];\n\t\t$pedidoId = $ids[3];\n\t\t\n\t\tif ($pedidoId != null || $pedidoId != 0 || $pedidoId != \"\") {\n\t\t\t$bp = new ComidaPedido();\n\t\t\t$bp->pedido = $pedidoId;\n\t\t\t$bp->comida = $comida;\n\t\t\t$bp->cantidad = $cantidad;\n\t\t\t$bp->save();\n\t\t\t\n\t\t\t$md = new Mesa();\n\t\t\t$md->mesa_id = $mesa;\n\t\t\t$md->get();\n\t\t\t$md->disponible = 2;\n\t\t\t$md->save();\n\t\t\tprint($pedidoId);exit;\n\t\t}\n\n\t\t$this->model->fecha = date('Y-m-d');\t\t\n\t\t$this->model->mesa = $mesa;\t\t\n\t\t$this->model->estado = 1;\t\t\n $this->model->save();\n\t\t\n\t\t$pedido_id = $this->model->pedido_id;\n\n\t\t$md = new Mesa();\n\t\t$md->mesa_id = $mesa;\n\t\t$md->get();\n\t\t$md->disponible = 2;\n\t\t$md->save();\n\t\t\n\t\t$bp = new ComidaPedido();\n\t\t$bp->pedido = $pedido_id;\n\t\t$bp->comida = $comida;\n\t\t$bp->cantidad = $cantidad;\n\t\t$bp->save();\n\t\tprint($pedido_id);exit;\n\n\t}", "public function insertar($pojo,$CONTRATO)\n {\n try{\n $rec = [];\n $dao=new DocumentoSalidaDAO();\n $lista=array();\n $contador=0;\n $tabla = $pojo->getId_documento_entrada() == -1 ? \"documento_salida_sinfolio_entrada\" :\"documento_salida\";\n\n $id1 = $dao->obtenermayorDocumentoSalidasSinFolio();\n $id2 = $dao->obtenermayorDocumentoSalidaConFolio();\n if($id1<$id2)\n $id1=$id2;\n if($id1==-1)\n $id1=0;\n $exito= $dao->insertarDocumentosSalida($tabla,$id1+1,$pojo->getId_documento_entrada(),$pojo->getFolio_salida(),$pojo->getFecha_envio(),\n $pojo->getAsunto(),$pojo->getDestinatario(),$pojo->getObservaciones(),$CONTRATO);\n\n if($exito[0] == 1)\n {\n $rec = $tabla == \"documento_salida\" ? $dao->mostrarDocumentoSalida($id1+1) : $dao->listarDocumentoSalidaSinFolio($id1+1);\n // echo \"valor rec: \".json_encode($rec);\n // foreach($rec as $value)\n // {\n // $lista[$contador] = array(\n // \"id_documento_salida\"=>$value[\"id_documento_salida\"],\n // \"id_documento_entrada\"=>$value[\"id_documento_entrada\"],\n // \"documento\"=>$value[\"documento\"],\n // \"folio_entrada\"=>$value[\"folio_entrada\"],\n // \"folio_salida\"=>$value[\"folio_salida\"],\n // \"fecha_envio\"=>$value[\"fecha_envio\"],\n // \"asunto\"=>$value[\"asunto\"],\n // \"clave_autoridad\"=>$value[\"clave_autoridad\"],\n // \"destinatario\"=>$value[\"destinatario\"],\n // \"nombre_empleado\"=>$value[\"nombre_empleado\"],\n // \"apellido_paterno\"=>$value[\"apellido_paterno\"],\n // \"apellido_materno\"=>$value[\"apellido_materno\"],\n // \"documento\"=>$value[\"documento\"],\n // \"observaciones\"=>$value[\"observaciones\"] \n // );\n // // $cont++;\n // $contador++;\n // }\n // return $lista;\n }\n else\n return $exito[0];\n return $rec;\n \n } catch (Exception $ex) {\n throw $ex;\n return -1;\n }\n }", "public function guardar($datosCampos) {\n $guardar = new SqlQuery(); //instancio objeto de la clase sqlQuery\n (string) $tabla = get_class($this); //obtengo el nombre de la clase para poder realizar la consulta\n switch ($datosCampos[\"acceso\"]) {\n case \"total\":\n $datosCampos[\"acceso\"] = 1;\n break;\n case \"restringido\":\n $datosCampos[\"acceso\"] = 2;\n break;\n default:\n $datosCampos[\"acceso\"] = 0;\n break;\n }\n $datosCampos[\"pass\"] = sha1(\"123\"); //agrego la contraseña en sha1 para que solicite el cambio cada vez que se cree un usuario\n $this->refControladorPersistencia->get_conexion()->beginTransaction(); //comienza transaccion\n $rtaVerifUser = $this->refControladorPersistencia->ejecutarSentencia(\n $guardar->verificarExistenciaUsuario($tabla, $datosCampos[\"usuario\"])); //verifico si ya hay un usuario con ese nombre \n $existeUser = $rtaVerifUser->fetch(); //paso a un array\n $this->refControladorPersistencia->get_conexion()->commit(); //cierro\n if ($existeUser[0] == '0') {//solamente si el usuario no existe se comienza con la carga a la BD\n try {\n $this->refControladorPersistencia->get_conexion()->beginTransaction(); //comienza la transacción\n $arrayCabecera = $guardar->meta($tabla); //armo la cabecera del array con los datos de la tabla de BD\n $sentencia = $guardar->armarSentencia($arrayCabecera, $tabla); //armo la sentencia\n $array = $guardar->armarArray($arrayCabecera, $datosCampos); //armo el array con los datos de la vista y los datos que obtuve de la BD \n array_shift($array); //remuevo el primer elemento id si es nuevo se genera automaticamente en la BD\n $this->refControladorPersistencia->ejecutarSentencia($sentencia, $array); //genero la consulta\n $this->refControladorPersistencia->get_conexion()->commit();\n $this->refControladorPersistencia->get_conexion()->beginTransaction();\n $ultimo = $guardar->buscarUltimo($tabla);\n $idUser = $this->refControladorPersistencia->ejecutarSentencia($ultimo); //busco el ultimo usuario para mostrarlo en la vista \n $id = $idUser->fetchColumn(); //array \n $this->refControladorPersistencia->get_conexion()->commit(); //si todo salió bien hace el commit\n } catch (PDOException $excepcionPDO) {\n echo \"<br>Error PDO: \" . $excepcionPDO->getTraceAsString() . '<br>';\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si salio mal hace un rollback\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si hay algún error hace rollback\n }\n $respuesta = $this->getUsuario($id); //busco el usuario\n return $respuesta; //regreso\n } else {\n return $id = [\"incorrecto\" => \"incorrecto\"]; //si hubo un error volvemos a vista y corregimos\n }\n }", "public function insert($datos_){\n $id=$datos_->getId();\n$nombre_proyecto=$datos_->getNombre_proyecto();\n$nombre_actividad=$datos_->getNombre_actividad();\n$modalidad_participacion=$datos_->getModalidad_participacion();\n$responsable=$datos_->getResponsable();\n$fecha_realizacion=$datos_->getFecha_realizacion();\n$producto=$datos_->getProducto();\n$semillero_id=$datos_->getSemillero_id()->getId();\n\n try {\n $sql= \"INSERT INTO `datos_`( `id`, `nombre_proyecto`, `nombre_actividad`, `modalidad_participacion`, `responsable`, `fecha_realizacion`, `producto`, `semillero_id`)\"\n .\"VALUES ('$id','$nombre_proyecto','$nombre_actividad','$modalidad_participacion','$responsable','$fecha_realizacion','$producto','$semillero_id')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "public function inserirAtividade($id_atividade = '172', $s, $id_usuario, $id_pedido_item) {\n global $controle_id_empresa, $controle_id_usuario;\n $where = '';\n #verifica se a forma de pagamento é deposito e se não é do correio para enviar ao operacional ou ao financeiro\n $this->sql = \"SELECT (CASE WHEN(pi.valor_rec = 0) THEN ('0') ELSE ('1') END) as recebido,\n\t\t\t\t\t\t\tp.origem, p.forma_pagamento, \n\t\t\t\t\t\t\tpi.data_prazo, pi.id_pedido, pi.certidao_nome, pi.certidao_devedor, pi.id_servico, p.cpf, p.id_pacote,pi.id_status, \n\t\t\t\t\t\t\tpi.data_atividade, pi.dias, pi.id_usuario_op, pi.encerramento, pi.atendimento, pi.inicio, pi.operacional,\n\t\t\t\t\t\t\tpi.certidao_cidade, pi.certidao_estado, pi.id_empresa_atend\n\t\t\t\t\t\t\tfrom vsites_pedido_item as pi, vsites_pedido as p where pi.id_pedido_item=? and pi.id_pedido=p.id_pedido limit 1\";\n\n $this->values = array($id_pedido_item);\n \n $res = $this->fetch();\n\t\tif($controle_id_usuario == 1 OR $controle_id_usuario == 3720){\n\t\t\t\t#print_r($res);\t\n\t\t\t\t#echo $id_atividade;\n\t\t\t\t#exit;\n\t\t}\n if (($res[0]->recebido == '0' or $res[0]->recebido == '') and ($id_atividade == '137' or $id_atividade == '198') and $res[0]->origem != 'Correios' and $res[0]->forma_pagamento == 'Depósito') {\n $id_atividade = '153';\n }\n\n #verifica se vai criar data da agenda\n $data_agenda = date('Y-m-d');\n if (($s->status_dias <> '' and $s->status_dias != '0' or $s->status_hora <> '') and ($id_atividade != \"110\" && $id_atividade != \"217\")) {\n if ($s->status_dias == '')\n $s->status_dias = '0';\n $data_agenda = somar_dias_uteis($data_agenda, $s->status_dias);\n $where .= \",data_i='\" . $data_agenda . \"' ,status_hora='\" . $s->status_hora . \":00'\";\n } else {\n if ($s->status_dias == '0' and $id_atividade != \"110\" and $id_atividade != \"217\") {\n $where .= \",data_i=NOW(), status_hora='\" . $s->status_hora . \":00'\";\n } else {\n if ($id_atividade != \"110\" && $id_atividade != \"217\") {\n $where .= \",data_i='', status_hora='\" . $s->status_hora . \":00'\";\n }\n }\n }\n\n #seleciona o status da nova atividade e verifica se tem que voltar para o status anterior\n $ativ = $this->selecionaPorID($id_atividade);\n if ($ativ->id_status == 99) {\n $this->sql = \"SELECT a.id_status from vsites_pedido_status as s, vsites_atividades as a where s.id_pedido_item=? and a.id_atividade=s.id_atividade and a.id_status!='0' and a.id_status!='99' and a.id_status!='15' and a.id_status!='12' and a.id_status!='18' and a.id_status!='17' order by s.id_pedido_status DESC LIMIT 1\";\n $this->values = array($id_pedido_item);\n $res_ant = $this->fetch();\n $id_status = $res_ant[0]->id_status;\n } else {\n $id_status = $ativ->id_status;\n }\n\n #se estiver no pendente precisa somar os dias que ficaram parado\n if (($res[0]->id_status == '12' or $res[0]->id_status == '15') and $res[0]->inicio != '0000-00-00 00:00:00') {\n $dias_add = dias_uteis(invert($res[0]->data_atividade, '/', 'PHP'), date('d/m/Y'));\n $prazo_dias = $res[0]->dias + $dias_add;\n $data_prazo = somar_dias_uteis($res[0]->inicio, $prazo_dias);\n $where .= \", dias='\" . $prazo_dias . \"', data_prazo='\" . $data_prazo . \"'\";\n }\n\n #se for liberado para a franquia marca o dia da liberação para franquia\n\n if ($id_atividade == '205') {\n $where .= \", data_status=NOW()\";\n }\n \n #se for para cadastrado começa a contar o prazo\n if (($id_atividade == '137' or $id_atividade == '198' or $id_atividade == '180') and ($res[0]->inicio == '0000-00-00 00:00:00')) {\n #verifica CDT\n $pedidoDAO = new PedidoDAO();\n $id_empresa_dir = $pedidoDAO->listaCDT($res[0]->certidao_cidade, $res[0]->certidao_estado, $res[0]->id_pedido, $controle_id_empresa);\n if ($id_empresa_dir <> '') {\n $where .= \", id_empresa_dir='\" . $id_empresa_dir . \"'\";\n }\n\n $where .= \", inicio=NOW()\";\n #se for atividade Conferido aguardar 24 horas soma 1 dia no prazo\n if ($id_atividade == '198' and $res[0]->inicio == '0000-00-00 00:00:00') {\n $res[0]->dias++;\n $data_prazo = somar_dias_uteis(date('Y-m-d'), $res[0]->dias);\n $where .= \", dias='\" . $res[0]->dias . \"', data_prazo='\" . $data_prazo . \"'\";\n } else {\n $data_prazo = somar_dias_uteis(date('Y-m-d'), $res[0]->dias);\n $where .= \", data_prazo='\" . $data_prazo . \"'\";\n }\n }\n\n #se atividade = conciliação ou cadastrado, inicia o atendimento\n if (($ativ->id_status == '2' or $ativ->id_status == '3' or $id_atividade == '153') and $res[0]->atendimento == '0000-00-00 00:00:00') {\n $where .= \", atendimento=NOW()\";\n }\n\n #verifica se foi concluído operacional\n if (($id_atividade == '203') and ($res[0]->operacional == '0000-00-00' or $res[0]->operacional == '')) {\n $where .= \", operacional=NOW()\";\n }\n\n #verifica se foi concluído\n if ($id_atividade == '119' and ($res[0]->encerramento == '0000-00-00 00:00:00' or $res[0]->encerramento == '')) {\n $where .= \", encerramento=NOW()\";\n }\n\n #verifica se o pedido já foi direcionado caso não tenha sido direciona para o proprio usuário\n if ($id_atividade == '145' and $res[0]->id_usuario_op == '0') {\n $where .= \", id_usuario_op=\" . $id_usuario;\n }\n\n #se o pedido de imóveis e detran estiverem liberados libera para faturamento\n if (($ativ->id_status == '8' or $ativ->id_status == '10') and ($res[0]->id_servico == '170' or $res[0]->id_servico == '11' or $res[0]->id_servico == '16' or $res[0]->id_servico == '64' or $res[0]->id_servico == '169' or $res[0]->id_servico == '156' or $res[0]->id_servico == '117') and $res[0]->id_pacote == '1') {\n if ($res[0]->id_servico == '169' or $res[0]->id_servico == '156' or $res[0]->id_servico == '117') {\n #se o pedido de imóveis e detran estiverem liberados libera para faturamento\n $this->sql = \"update vsites_pedido_item as pi set pi.pacote_lib = '1' where pi.id_pedido_item=?\";\n $this->values = array($id_pedido_item);\n $this->exec();\n } else {\n //verifica se todos os pedidos foram liberados para faturamento\n $this->sql = \"SELECT COUNT(0) as total from vsites_pedido_item as pi, vsites_pedido as p where \n pi.id_empresa_atend=? and\n pi.id_status!='14' and pi.id_status!='8' and pi.id_status!='10' and \n (pi.id_servico='170' or pi.id_servico='11' or pi.id_servico='16' or pi.id_servico='64') and \n (pi.certidao_devedor = ? and pi.certidao_devedor <> '' or \n pi.certidao_nome = ? and pi.certidao_nome <> '' and pi.certidao_devedor='') and \n pi.id_pedido_item!=? and\n pi.id_pedido=p.id_pedido and \n p.id_pacote='1' and p.cpf=?\";\n $this->values = array($res[0]->id_empresa_atend, $res[0]->certidao_devedor, $res[0]->certidao_nome, $id_pedido_item, $res[0]->cpf);\n $num_pacote = $this->fetch();\n if ($num_pacote[0]->total == 0) {\n //seleciona todos os pedidos que foram liberados para faturamento dentro do pacote\n $this->sql = \"SELECT pi.id_pedido_item, pi.id_pedido, pi.ordem from vsites_pedido_item as pi, vsites_pedido as p where \n pi.id_empresa_atend=? and\n (pi.id_servico='170' or pi.id_servico='11' or pi.id_servico='16' or pi.id_servico='64') and \n pi.id_status!='14' and\n (pi.certidao_devedor =? and pi.certidao_devedor <> '' or \n pi.certidao_nome = ? and pi.certidao_nome <> '' and pi.certidao_devedor='') and \n pi.id_pedido=p.id_pedido and\n p.id_pacote='1' and p.cpf=?\";\n $this->values = array($res[0]->id_empresa_atend, $res[0]->certidao_devedor, $res[0]->certidao_nome, $res[0]->cpf);\n $num_pacote = $this->fetch();\n foreach ($num_pacote as $l) {\n $this->sql = \"update vsites_pedido_item as pi set pi.pacote_lib = '1' where pi.id_pedido_item=?\";\n $this->values = array($l->id_pedido_item);\n $this->exec();\n }\n }\n }\n }\n\n\n if (($id_status == '8' or $id_status == '10') and $res[0]->id_pacote == '2') {\n #se o pacote empresarial estao liberados entao libera para faturamento\n $this->sql = \"SELECT COUNT(0)as total from vsites_pedido_item as pi where pi.id_pedido=? and pi.id_status!='14' and pi.id_status!='8' and pi.id_status!='10' and pi.id_pedido_item!=?\";\n $this->values = array($res[0]->id_pedido, $id_pedido_item);\n $num_pacote = $this->fetch();\n if ($num_pacote[0]->total == 0) {\n $this->sql = \"update vsites_pedido_item set pacote_lib = '1' where id_pedido=? and id_status!='14'\";\n $this->values = array($res[0]->id_pedido);\n $this->exec();\n }\n }\n\n\n if ($id_atividade != 110 && $id_atividade != 217) {\n #se status = 0 nao muda o status, nem data da atividade\n if($controle_id_usuario == 1 OR $controle_id_usuario == 3720){\n\t\t\t\t#print_r($this);\t\n\t\t\t\t#echo $id_atividade;\n\t\t\t\t#exit;\n\t\t\t}\n if ($id_status == '' or $id_status == '0') {\n if ($id_atividade == 212) {\n $where .= \", atraso=NOW() \";\n }\n $this->sql = \"update vsites_pedido_item set id_atividade='\" . $id_atividade . \"' \" . $where . \" where id_pedido_item=?\";\n $this->values = array($id_pedido_item);\n $this->exec();\n } else {\n if ($id_atividade == 155 and $res[0]->id_status == 6 or $id_atividade != 155) {\n if ($id_atividade == 115) {\n $where .= \", des=1 \";\n }\n $this->sql = \"update vsites_pedido_item set data_atividade=NOW(), id_status=?, id_atividade=?,status_hora=? \" . $where . \" where id_pedido_item=?\";\n $this->values = array($id_status, $id_atividade, $s->status_hora . ':00', $id_pedido_item);\n $this->exec();\n }\n }\n }\n\n $data_i = date('Y-m-d H:i:s');\n $this->fields = array('id_atividade', 'status_obs', 'data_i', 'id_usuario',\n 'id_pedido_item', 'status_dias', 'status_hora');\n $this->values = array('id_atividade' => $id_atividade, 'status_obs' => $s->status_obs, 'data_i' => $data_i, 'id_usuario' => $id_usuario,\n 'id_pedido_item' => $id_pedido_item, 'status_dias' => $s->status_dias, 'status_hora' => $s->status_hora);\n $this->insert();\n return 1;\n }", "function insertarRelacionProceso(){\n\n $this->objFunc=$this->create('MODObligacionPago');\n if($this->objParam->insertar('id_relacion_proceso_pago')){\n $this->res=$this->objFunc->insertarRelacionProceso($this->objParam);\n } else{\n $this->res=$this->objFunc->modificarRelacionProceso($this->objParam);\n }\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "public function enviarPeticion( $comando ) {\n SocketClass::client_reply($comando);\n }", "public function EntregarDelivery()\n\t{\n\t\tself::SetNames();\n\t\t\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" entregado = ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $entregado);\n\t\t$stmt->bindParam(2, $codventa);\n\t\t\n\t\t$entregado = strip_tags(\"0\");\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$stmt->execute();\n\t\t\n echo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-check-square-o'></span> EL PEDIDO EN DELIVERY FUE ENTREGADO EXITOSAMENTE </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\t\n }", "function hacerPedido($usuario, $fecha){\n $sql=\"INSERT INTO pedido(id, id_user, fecha) VALUES (NULL, \".$usuario.\", '\".$fecha.\"')\";\n //Realizamos la consulta\n $resultado=$this->realizarConsulta($sql);\n if($resultado!=false){\n //Recogemos el ultimo pedido insertado\n $sql=\"SELECT * from pedido ORDER BY id DESC\";\n //Realizamos la consulta\n $resultado=$this->realizarConsulta($sql);\n if($resultado!=false){\n return $resultado->fetch_assoc();\n }else{\n return null;\n }\n }else{\n return null;\n }\n}", "public function gerarVenda($titulo,$cliente){\n //$conexao = $c->conexao();\n\n\n $sql = \"INSERT INTO tbpedidos (reg, tipo, titulo, data_inc) VALUES ('$cliente','V','$titulo', NOW()) \";\n\n return $this->conexao->query($sql);\n\n\n }", "function guardar_producto($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Valida el tipo de producto: 5-> Receta, 4-> Insumo preparado\n\t$tipo = ($datos['tipo']==1) ? 1 : 4 ;\n\n\n\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tapp_productos\n\t\t\t\t\t\t(codigo, nombre, precio, linea, costo_servicio, id_unidad_venta, id_unidad_compra,\n\t\t\t\t\t\t\ttipo_producto\n\t\t\t\t\t\t)\n\t\t\t\tVALUES\n\t\t\t\t\t('\".$datos['codigo'].\"','\".$datos['nombre'].\"',\".$datos['precio_venta'].\",\n\t\t\t\t\t\t1, \".$datos['costo'].\", \".$datos['unidad_venta'].\", \".$datos['unidad_compra'].\", \".$tipo.\"\n\t\t\t\t\t)\";\n\t\t// return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t// Guarda los campos de foodware\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tapp_campos_foodware\n\t\t\t\t\t\t(id_producto, ganancia)\n\t\t\t\tVALUES\n\t\t\t\t\t('\".$result.\"', '\".$datos['margen_ganancia'].\"')\";\n\t\t// return $sql;\n\t\t$result_foodware =$this->query($sql);\n\n\t\treturn $result;\n\t}", "public function agregar_Cliente($datosCliente){\n\n $stmt=$this->db->prepare(\"CALL INSERT_CLIENTE(:nombre,:ciudad,:responsable)\");\n $stmt->bindParam(':nombre', $nombre);\n $stmt->bindParam(':ciudad', $ciudad);\n $stmt->bindParam(':responsable', $responsable);\n\n $nombre=$datosCliente['nombre'];\n $ciudad=$datosCliente['ciudad'];\n $responsable=$datosCliente['responsable'];\n $tel1=$datosCliente['tel1'];\n $tel2=$datosCliente['tel2'];\n $correo1=$datosCliente['correo1'];\n $correo2=$datosCliente['correo2'];\n\n $stmt->execute();\n\n //Obtener el ultimo codigo de cliente\n $cods=new Tablas_model();\n $codigos=$cods->getCodigosClientes(); //array de arrays\n $codigosCliente=array();\n foreach ($codigos as $arrayCod) {\n array_push($codigosCliente,($arrayCod[0]+0));\n }\n $ultimoCod=max($codigosCliente);// ultimo codigo de cliente ingresado\n\n\n //obtener el ultimo codigo de cliente ingresado\n\n //ingresar uno o 2 teléfonos:\n $this->db->query(\"DELETE FROM tel_clientes WHERE tel_clientes.cod_cliente =\".$ultimoCod); //eliminar registros\n if ($datosCliente['tel2']==\"\") {\n $this->db->query('INSERT INTO tel_clientes (tel_clientes.cod_cliente, tel_clientes.tel)\n VALUES ('.$ultimoCod.','.$tel1.')');\n }else{\n $this->db->query('INSERT INTO tel_clientes (tel_clientes.cod_cliente, tel_clientes.tel)\n VALUES ('.$ultimoCod.', '.$tel1.'); INSERT INTO tel_clientes (tel_clientes.cod_cliente, tel_clientes.tel)\n VALUES ('.$ultimoCod.', '.$tel2.')');\n }\n\n //ingresar uno o dos correos:\n $this->db->query(\"DELETE FROM correos_clientes WHERE correos_clientes.cod_cliente =\".$ultimoCod); //eliminar registros\n if ($datosCliente['correo2']==\"\") {\n $this->db->query('INSERT INTO correos_clientes (correos_clientes.cod_cliente, correos_clientes.correo)\n VALUES ('.$ultimoCod.',\"'.$correo1.'\")');\n }else{\n $this->db->query('INSERT INTO correos_clientes (correos_clientes.cod_cliente, correos_clientes.correo)\n VALUES ('.$ultimoCod.', \"'.$correo1.'\"); INSERT INTO correos_clientes (correos_clientes.cod_cliente, correos_clientes.correo)\n VALUES ('.$ultimoCod.', \"'.$correo2.'\")');\n }\n\n $this->db=null; //cerrar conexión\n\n\n }", "function cocinar_pedido() {\n\t\tglobal $bd;\n\t\tglobal $x_from;\n\t\tglobal $x_idpedido;\n\t\tglobal $x_idcliente;\n\t\t\n\t\t$x_array_pedido_header = $_POST['p_header'];\n \t$x_array_pedido_body = $_POST['p_body'];\n\t\t$x_array_subtotales=$_POST['p_subtotales'];\n\t\t\n\t\t$idc=$x_array_pedido_header['idclie'] == '' ? ($x_idcliente == '' ? 0 : $x_idcliente) : $x_array_pedido_header['idclie'];\n\t\t// $idc = cocinar_registro_cliente();\n\t\t// $x_array_pedido_footer = $_POST['p_footer'];\n\t\t// $x_array_tipo_pago = $_POST['p_tipo_pago'];\n\n\t\t //sacar de arraypedido || tipo de consumo || local || llevar ... solo llevar\n\t\t $count_arr=0;\n\t\t $count_items=0;\n\t\t $item_antes_solo_llevar=0;\n\t\t $solo_llevar=0;\n\t\t $tipo_consumo;\n\t\t $categoria;\n\t\t \n\t\t $sql_pedido_detalle='';\n\t\t $sql_sub_total='';\n\n\t\t $numpedido='';\n\t\t $correlativo_dia='';\n\t\t $viene_de_bodega=0;// para pedido_detalle\n\t\t $id_pedido;\n\n\t\t \t\t \n\t\t // cocina datos para pedidodetalle\n\t\t foreach ($x_array_pedido_body as $i_pedido) {\n\t\t\tif($i_pedido==null){continue;}\n\t\t\t// tipo de consumo\n\t\t\t//solo llevar\n\t\t\t$pos = strrpos(strtoupper($i_pedido['des']), \"LLEVAR\");\n\t\t\t\n\t\t\t\n\t\t\t//subitems // detalles\n\t\t\tforeach ($i_pedido as $subitem) {\n\t\t\t\tif(is_array($subitem)==false){continue;}\n\t\t\t\t$count_items++;\n\t\t\t\tif($pos!=false){$solo_llevar=1;$item_antes_solo_llevar=$count_items;}\n\t\t\t\t$tipo_consumo=$subitem['idtipo_consumo'];\n\t\t\t\t$categoria=$subitem['idcategoria'];\n\n\t\t\t\t$tabla_procede=$subitem['procede']; // tabla de donde se descuenta\n\n\t\t\t\t$viene_de_bodega=0;\n\t\t\t\tif($tabla_procede===0){$viene_de_bodega=$subitem['procede_index'];}\n\n\t\t\t\t//armar sql pedido_detalle con arrPedido\n\t\t\t\t$precio_total=$subitem['precio_print'];\n\t\t\t\tif($precio_total==\"\"){$precio_total=$subitem['precio_total'];}\n\n\t\t\t\t//concatena descripcion con indicaciones\n\t\t\t\t$indicaciones_p=\"\";\n\t\t\t\t$indicaciones_p=$subitem['indicaciones'];\n\t\t\t\tif($indicaciones_p!==\"\"){$indicaciones_p=\" (\".$indicaciones_p.\")\";$indicaciones_p=strtolower($indicaciones_p);}\n\t\t\t\t\n\t\t\t\t$sql_pedido_detalle=$sql_pedido_detalle.'(?,'.$tipo_consumo.','.$categoria.','.$subitem['iditem'].','.$subitem['iditem2'].',\"'.$subitem['idseccion'].'\",\"'.$subitem['cantidad'].'\",\"'.$subitem['cantidad'].'\",\"'.$subitem['precio'].'\",\"'.$precio_total.'\",\"'.$precio_total.'\",\"'.$subitem['des'].$indicaciones_p.'\",'.$viene_de_bodega.','.$tabla_procede.'),'; \n\n\t\t\t}\n\n\t\t\t$count_arr++;\n\t\t}\t\t\n\t\t\n\t\tif($count_items==0){return false;}//si esta vacio\n\n\t\tif($item_antes_solo_llevar>1){$solo_llevar=0;} // >1 NO solo es para llevar\n\n\t\t//armar sql pedido_subtotales con arrTotales\t\t\n\t\t// $importe_total=0; // la primera fila es subtotal o total si no hay adicionales\n\t\t// $importe_subtotal = $x_array_subtotales[0]['importe'];\n\t\t// for ($z=0; $z < count($x_array_subtotales); $z++) {\t\n\t\t// \t$importe_total = $x_array_subtotales[$z]['importe'];\t\t\n\t\t// \t$sql_sub_total=$sql_sub_total.'(?,\"'.$x_array_subtotales[$z]['descripcion'].'\",\"'.$x_array_subtotales[$z]['importe'].'\"),';\n\t\t// }\n\t\t\n\t\t// subtotales\t\t\n\t\t$sql_subtotales = '';\n\t\t$importe_total=0; // la primera fila es subtotal o total si no hay adicionales\n\t\t$importe_subtotal = $x_array_subtotales[0]['importe'];\n\t\tforeach ( $x_array_subtotales as $sub_total ) {\n\t\t\t$tachado = $sub_total['tachado'] === \"true\" ? 1 : 0; \n\t\t\t$importe_row = $tachado === 1 ? $sub_total['importe_tachado'] : $sub_total['importe'];\n\t\t\t$importe_total = $sub_total['importe'];\n\t\t\t$sql_subtotales = $sql_subtotales.\"(?,\".$_SESSION['ido'].\",\".$_SESSION['idsede'].\",'\".$sub_total['descripcion'].\"','\".$importe_row.\"',\".$tachado.\"),\";\n\t\t}\n\n //guarda primero pedido para obtener el idpedio\n\t\tif(!isset($_POST['estado_p'])){$estado_p=0;}else{$estado_p=$_POST['estado_p'];}//para el caso de venta rapida si ya pago no figura en control de pedidos\n\t\tif(!isset($_POST['idpedido'])){$id_pedido=0;}else{$id_pedido=$_POST['idpedido'];}//si se agrea en un pedido / para control de pedidos al agregar\t\t\n\n if($id_pedido==0){ // nuevo pedido\n\t\t\t//num pedido\n\t\t\t$sql=\"select count(idpedido) as d1 from pedido where idorg=\".$_SESSION['ido'].\" and idsede=\".$_SESSION['idsede'];\n\t\t\t$numpedido=$bd->xDevolverUnDato($sql);\n\t\t\t$numpedido++;\n\n\t\t\t//numcorrelativo segun fecha\n\t\t\t$sql=\"SELECT count(fecha) AS d1 FROM pedido WHERE (idorg=\".$_SESSION['ido'].\" and idsede=\".$_SESSION['idsede'].\") and STR_TO_DATE(fecha,'%d/%m/%Y')=curdate()\";\n\t\t\t$correlativo_dia=$bd->xDevolverUnDato($sql);\n\t\t\t$correlativo_dia++;\n\n\t\t\t// si es delivery y si trae datos adjuntos -- json-> direccion telefono forma pago\n\t\t\t$json_datos_delivery=array_key_exists('arrDatosDelivery', $x_array_pedido_header) ? $x_array_pedido_header['arrDatosDelivery'] : '';\n\t\t\t\n\n // guarda pedido\n $sql=\"insert into pedido (idorg, idsede, idcliente, fecha,hora,fecha_hora,nummesa,numpedido,correlativo_dia,referencia,total,total_r,solo_llevar,idtipo_consumo,idcategoria,reserva,idusuario,subtotales_tachados,estado,json_datos_delivery)\n\t\t\t\t\tvalues(\".$_SESSION['ido'].\",\".$_SESSION['idsede'].\",\".$idc.\",DATE_FORMAT(now(),'%d/%m/%Y'),DATE_FORMAT(now(),'%H:%i:%s'),now(),'\".$x_array_pedido_header['mesa'].\"','\".$numpedido.\"','\".$correlativo_dia.\"','\".$x_array_pedido_header['referencia'].\"','\".$importe_subtotal.\"','\".$importe_total.\"',\".$solo_llevar.\",\".$tipo_consumo.\",\".$x_array_pedido_header['idcategoria'].\",\".$x_array_pedido_header['reservar'].\",\".$_SESSION['idusuario'].\",'\". $x_array_pedido_header['subtotales_tachados'] .\"',\".$estado_p.\",'\".$json_datos_delivery.\"')\";\n $id_pedido=$bd->xConsulta_UltimoId($sql);\n \n\t\t}else{\n\t\t\t//actualiza monto\n\t\t\t$sql=\"update pedido set total=FORMAT(total+\".$xarr['ImporteTotal'].\",2), subtotales_tachados = '\".$x_array_pedido_header['subtotales_tachados'].\"' where idpedido=\".$id_pedido;\n\t\t\t$bd->xConsulta_NoReturn($sql);\n }\n\n //armar sql completos\n\t\t//remplazar ? por idpedido\n\t\t$sql_subtotales = str_replace(\"?\", $id_pedido, $sql_subtotales);\n\t\t$sql_pedido_detalle = str_replace(\"?\", $id_pedido, $sql_pedido_detalle);\n\n\t\t//saca el ultimo caracter ','\n\t\t$sql_subtotales=substr ($sql_subtotales, 0, -1);\n\t\t$sql_pedido_detalle=substr ($sql_pedido_detalle, 0, -1);\n\n\t\t//pedido_detalle\n\t\t$sql_pedido_detalle='insert into pedido_detalle (idpedido,idtipo_consumo,idcategoria,idcarta_lista,iditem,idseccion,cantidad,cantidad_r,punitario,ptotal,ptotal_r,descripcion,procede,procede_tabla) values '.$sql_pedido_detalle;\n\t\t//pedido_subtotales\n\t\t$sql_subtotales='insert into pedido_subtotales (idpedido,idorg,idsede,descripcion,importe, tachado) values '.$sql_subtotales;\n\t\t// echo $sql_pedido_detalle;\n\t\t//ejecutar\n //$sql_ejecuta=$sql_pedido_detalle.'; '.$sql_sub_total.';'; // guarda pedido detalle y pedido subtotal\n $bd->xConsulta_NoReturn($sql_pedido_detalle.';');\n\t\t$bd->xConsulta_NoReturn($sql_subtotales.';');\n\t\t\n\t\t// $x_array_pedido_header['id_pedido'] = $id_pedido; // si viene sin id pedido\n\t\t$x_idpedido = $id_pedido;\n\n\t\t// SI ES PAGO TOTAL\n\t\tif ( strrpos($x_from, \"b\") !== false ) { $x_from = str_replace('b','',$x_from); cocinar_pago_total(); }\n\n\t\t\n\t\t// $x_respuesta->idpedido = $id_pedido; \n\t\t// $x_respuesta->numpedido = $numpedido; \n\t\t// $x_respuesta->correlativo_dia = $correlativo_dia; \n\t\t\n\t\t$x_respuesta = json_encode(array('idpedido' => $id_pedido, 'numpedido' => $numpedido, 'correlativo_dia' => $correlativo_dia));\n\t\tprint $x_respuesta.'|';\n\t\t// $x_respuesta = ['idpedido' => $idpedido];\n\t\t// print $id_pedido.'|'.$numpedido.'|'.$correlativo_dia;\n\t\t\n\t}", "public function cadastrar($cliente){\r\n\t\tinclude(\"../config/conexao.php\");\r\n\t\t$sql = 'INSERT INTO cliente (cod, n_casa, rua, bairro, cidade, estado, pais, cep, data_nasc, nome, tel_celular, tel_fixo, email) VALUES (:cod, :n_casa, :rua, :bairro, :cidade, :estado, :pais, :cep, :data_nasc, :nome, :tel_celular, :tel_fixo, :email)';\r\n\t\t$consulta = $pdo->prepare($sql);\r\n\t\t$consulta->bindValue(':cod',$cliente->getCod()); \r\n\t\t$consulta->bindValue(':n_casa',$cliente->getN_casa()); \r\n\t\t$consulta->bindValue(':rua',$cliente->getRua()); \r\n\t\t$consulta->bindValue(':bairro',$cliente->getBairro()); \r\n\t\t$consulta->bindValue(':cidade',$cliente->getCidade()); \r\n\t\t$consulta->bindValue(':estado',$cliente->getEstado()); \r\n\t\t$consulta->bindValue(':pais',$cliente->getPais()); \r\n\t\t$consulta->bindValue(':cep',$cliente->getCep()); \r\n\t\t$consulta->bindValue(':data_nasc',$cliente->getData_nasc()); \r\n\t\t$consulta->bindValue(':nome',$cliente->getNome()); \r\n\t\t$consulta->bindValue(':tel_celular',$cliente->getTel_celular()); \r\n\t\t$consulta->bindValue(':tel_fixo',$cliente->getTel_fixo()); \r\n\t\t$consulta->bindValue(':email',$cliente->getEmail()); \r\n\t\tif($consulta->execute())\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "function insertar_producto($producto, $tarifa, $cliente, $cant) {\r\n\t//tengo que tener en cuenta que no esté ya el articulo en el pedido sino loque hago es actualizar ese producto con uno más\r\n\t$conn = mysql_connect(BD_HOST, BD_USERNAME, BD_PASSWORD);\r\n\tmysql_select_db(BD_DATABASE1);\r\n\t//busco la serie para pedidos de clientes\r\n\t//compruebo si existe correo y si no lo creo\r\n\tif (!existe_pedido($cliente)) { nuevo_pedido($cliente); }\r\n\t//compruebo si se permiten decimales\r\n\t$cant = decimal($cant);\r\n\t$ssql = 'SELECT SPCCFG FROM F_CFG';\r\n\t$rs1 = mysql_query($ssql, $conn);\r\n\t$datos1 = mysql_fetch_array($rs1);\r\n\tmysql_select_db(BD_DATABASE1);\r\n\t//busco los pedidos por serie, cliente y estado \r\n\t$ssql = 'SELECT * FROM F_PCL WHERE CLIPCL=' . $cliente . ' AND TIPPCL=\\'' . $datos1['SPCCFG'] . '\\' AND ESTPCL=\\'0\\'';\r\n\t$rs = mysql_query($ssql, $conn);\r\n\tif (mysql_num_rows($rs) != 0) {\r\n\t\t$datos = mysql_fetch_array($rs);\r\n\t\t//averiguo si hay articulos iguales en el pedido pendiente\r\n\t\t$ssql = 'SELECT * FROM F_LPC WHERE ARTLPC=\\'' . $producto . '\\' AND TIPLPC=\\'' . $datos1['SPCCFG'] . '\\' AND CODLPC=' . $datos['CODPCL'];\r\n\t\t$rs2 = mysql_query($ssql, $conn);\r\n\t\tif (mysql_num_rows($rs2) != 0) {\r\n\t\t\t//actualizo el pedido\r\n\t\t\t$datos2 = mysql_fetch_array($rs2);\r\n\t\t\t$cantidad = decimal($datos2['CANLPC'] + $cant);\r\n\t\t\t$total = ($datos2['PRELPC'] * $cantidad) - ($datos2['PRELPC'] * $cantidad * $datos2['DT1LPC'] / 100);\r\n\t\t\t$ssql = 'UPDATE F_LPC SET CANLPC=' . $cantidad . ', TOTLPC=' . $total . ' WHERE TIPLPC=\\'' . $datos2['TIPLPC'] . '\\' AND CODLPC=' . $datos2['CODLPC'] . ' AND ARTLPC=\\'' . $producto . '\\'' ;\r\n\t\t\tmysql_query($ssql, $conn);\r\n\t\t}else{\r\n\t\t\t//escribo el nuevo artículo y actualizo las tablas.\r\n\t\t\t//posicion de la linea\r\n\t\t\t$ssql = 'SELECT * FROM F_LPC WHERE TIPLPC=\\'' . $datos1['SPCCFG'] . '\\' AND CODLPC=' . $datos['CODPCL'] . ' ORDER BY POSLPC DESC';\r\n\t\t\t$rs3 = mysql_query($ssql, $conn);\r\n\t\t\t$linea = (mysql_num_rows($rs3) + 1);\r\n\t\t\t//Descripcion y tipo de IVA\r\n\t\t\tmysql_select_db(BD_DATABASE1);\r\n\t\t\t$ssql = 'SELECT * FROM F_ART WHERE CODART=\\'' . $producto . '\\'';\r\n\t\t\t$rs3 = mysql_query($ssql, $conn);\r\n\t\t\t$datos3 = mysql_fetch_array($rs3);\r\n\t\t\t$descripcion = $datos3['DESART'];\r\n\t\t\t$tipoiva = $datos3['TIVART'];\r\n\t\t\t$familia = $datos3['FAMART'];\r\n\t\t\t//Descuento del cliente\r\n\t\t\t//descuento porcentaje\r\n\t\t\t$descuento = descuento($_SESSION['cod_factusol'], $producto, $familia);\r\n\t\t\t//Precio del Articulo \r\n\t\t\t//Descuento unitario\r\n\t\t\t$ssql = 'SELECT * FROM F_LTA WHERE TARLTA=' . $tarifa . ' AND ARTLTA=\\'' . $producto . '\\'';\r\n\t\t\t$rs3 = mysql_query($ssql, $conn);\r\n\t\t\t$datos3 = mysql_fetch_array($rs3);\r\n\t\t\t$precio = preciodesc($producto, $_SESSION['cod_factusol']);\r\n\t\t\t//IVA Inc.\r\n\t\t\t$ssql = 'SELECT * FROM F_TAR WHERE CODTAR=' . $tarifa;\r\n\t\t\t$rs3 = mysql_query($ssql, $conn);\r\n\t\t\t$datos3 = mysql_fetch_array($rs3);\r\n\t\t\t$ivainc = $datos3['IINTAR']; \r\n\t\t\t$total = ($precio-($precio * $descuento / 100)) * $cant; \r\n\t\t\tmysql_select_db(BD_DATABASE1);\r\n\t\t\t$ssql = 'INSERT INTO F_LPC (TIPLPC,CODLPC,POSLPC,ARTLPC,DESLPC,CANLPC,DT1LPC,PRELPC,TOTLPC,IVALPC,IINLPC) VALUES(\\'' . $datos1['SPCCFG'] . '\\',' . $datos['CODPCL'] . ',' . $linea . ',\\'' . $producto . '\\',\\'' . $descripcion . '\\',' . $cant . ',' . $descuento . ',' . $precio . ',' . $total . ',' . $tipoiva . ',' . $ivainc . ')'; \r\n\t\t\t$rs3 = mysql_query($ssql, $conn);\r\n\t\t\tif ($rs3) {\r\n\t\t\t\techo('');\r\n\t\t\t}else{\r\n\t\t\t\techo('Ha habido un error');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "public function ejecutar_sentencia(){\n\t\t$this->abrir_conexion();\n\t\t$this->conexion->query($this->sentencia);\n\t\t$this->cerrar_conexion();\n\t}", "public function SalvarPromocion($porciento_id, $nombre, $titulo, $descripcion, $tags, $estado,\n $fechainicio, $fechafin, $imagen, $productos)\n {\n $em = $this->getDoctrine()->getManager();\n $resultado = array();\n\n $entity = new Entity\\Promocion();\n\n //generar un codigo\n $codigo = $this->generarCadenaAleatoriaMix();\n $caux = $this->getDoctrine()->getRepository('IcanBundle:Promocion')\n ->findOneByCodigo($codigo);\n while (!empty($caux)) {\n $codigo = $this->generarCadenaAleatoriaMix();\n $caux = $this->getDoctrine()->getRepository('IcanBundle:Promocion')\n ->findOneByCodigo($codigo);\n }\n $entity->setCodigo($codigo);\n\n $naux = $this->getDoctrine()->getRepository('IcanBundle:Promocion')\n ->findOneByNombre($nombre);\n if (!empty($naux)) {\n $resultado['success'] = false;\n $resultado['error'] = \"El nombre ingresado ya está en uso por otra promoción.\";\n return $resultado;\n }\n\n $entity->setNombre($nombre);\n $entity->setTitulo($titulo);\n $entity->setDescripcion($descripcion);\n $entity->setEstado($estado);\n $entity->setTags($tags);\n\n if ($fechainicio != \"\") {\n $fechainicio = \\DateTime::createFromFormat('d/m/Y H:i', $fechainicio);\n $entity->setFechainicio($fechainicio);\n }\n if ($fechafin != \"\") {\n $fechafin = \\DateTime::createFromFormat('d/m/Y H:i', $fechafin);\n $entity->setFechafin($fechafin);\n }\n\n $porciento = $em->find('IcanBundle:Porciento', $porciento_id);\n if ($porciento != null) {\n $entity->setPorciento($porciento);\n }\n\n //Hacer Url \n $url = $this->HacerUrl($nombre);\n $i = 1;\n $paux = $this->getDoctrine()->getRepository('IcanBundle:Promocion')\n ->findOneByUrl($url);\n while (!empty($paux)) {\n $url = $this->HacerUrl($nombre) . \"-\" . $i;\n $paux = $this->getDoctrine()->getRepository('IcanBundle:Promocion')\n ->findOneByUrl($url);\n $i++;\n }\n\n $entity->setUrl($url);\n\n $em->persist($entity);\n $em->flush();\n\n //Salvar imagen\n $imagen = $this->RenombrarImagen($url, $imagen);\n $entity->setImagen($imagen);\n\n //Productos\n if (count($productos) > 0) {\n foreach ($productos as $value) {\n $producto_id = $value['producto_id'];\n\n $producto = $this->getDoctrine()->getRepository('IcanBundle:Producto')\n ->find($producto_id);\n if ($producto != null) {\n $producto->setPromocion($entity);\n $producto->setPorciento($porciento);\n\n $especial = $producto->getPrecio() * (100 - $entity->getPorciento()->getValor()) / 100;\n $producto->setPrecioEspecial($especial);\n }\n }\n }\n\n //Productos que ya tiene el descuento seleccionado\n $productos = $this->getDoctrine()->getRepository('IcanBundle:Producto')\n ->ListarProductosDePorciento($porciento_id);\n if (count($productos) > 0) {\n foreach ($productos as $producto) {\n $producto->setPromocion($entity);\n }\n }\n\n $em->flush();\n\n $resultado['success'] = true;\n\n return $resultado;\n }", "function salvarContatoEditado($id, $nome, $email, $telefone)\n{\n $contatosAuxiliar = pegarContatos();\n foreach ($contatosAuxiliar as $posicao => $contato) {/*itera sobre o array. percorre cada contato do contatosAuxiliar para pegar informações do contato*/\n if ($contato['id'] == $id) {\n $contatosAuxiliar[$posicao]['nome'] = $nome;\n $contatosAuxiliar[$posicao]['email'] = $email;\n $contatosAuxiliar[$posicao]['telefone'] = $telefone;\n break;\n }\n }\n salvarArquivoJson($contatosAuxiliar);\n}", "static public function mdlIngresarCliente($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(nombre, documento, email, telefono, direccion,cliente,nombreContacto,puestoCargo,emailcontacto,telefonofijocontacto,telefonocelularcontacto,comentarios) VALUES (:nombre, :documento, :email, :telefono, :direccion,:cliente, :nombreContacto,:puestoCargo, :emailcontacto, :telefonofijocontacto,:telefonocelularcontacto,:comentarios)\");\n\n\t\t$stmt->bindParam(\":nombre\", $datos[\"nombre\"], PDO::PARAM_STR);\n\n\t\n\t\t$stmt->bindParam(\":documento\", $datos[\"documento\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":rfc\", $datos[\"rfc\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":email\", $datos[\"email\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":cliente\", $datos[\"cliente\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":telefono\", $datos[\"telefono\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":direccion\", $datos[\"direccion\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":nombreContacto\", $datos[\"nombreContacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":puestoCargo\", $datos[\"puestoCargo\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":emailcontacto\", $datos[\"emailcontacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":telefonofijocontacto\", $datos[\"telefonofijocontacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":telefonocelularcontacto\", $datos[\"telefonocelularcontacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":comentarios\", $datos[\"comentarios\"], PDO::PARAM_STR);\n\t\t\n\t\t\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "public function movimienCompra($id_producto, $cantidad)\n {\n $mensaje = \" \";\n \n try {\n \n \n /* Primero hacemos una consulta SQL para sacar un array asosiativo y guardar lso datos que necesitamos */\n $conexion = conexion::conectar();\n $statement = $conexion->prepare('SELECT * FROM producto where id_producto=:id_producto');\n $statement->execute(array(':id_producto' => $id_producto));\n \n $resultado = $statement->fetch(PDO::FETCH_ASSOC);/* Se verifica si la consulta fue false/true, encontro algo o no */\n \n \n \n /* Aquí tomamos la cantidad del producto que hay antes de ser modificado */\n $_SESSION['cantidad'] = $resultado['cant_producto'];/* Array asociativo */\n \n \n /* Este solo es de prueba */\n $_SESSION['nom_producto'] = $resultado['nom_producto'];/* Array asociativo */\n \n \n \n \n /* -----DESCONTANDO PRODUTOS DE STOCK */\n \n /* Retamos la cantidad en stock - la que vamos a verder */\n $descuento = $_SESSION['cantidad'] + $cantidad;\n \n \n /* Y luego ya le pasamos ese resultado a una sentencia SQL para que lo modifique */\n $statement = $conexion->prepare('UPDATE producto SET cant_producto=:cant_producto where id_producto=:id_producto');\n $statement->execute(array(':id_producto' => $id_producto, ':cant_producto' => $descuento));\n \n \n $mensaje = \"La cantidad de \" . $_SESSION['nom_producto'] . \" es de: \" . $_SESSION['cantidad'] . \" con aumento queda en: \" . $descuento;\n } catch (PDOException $e) {\n \n echo \" el error es\" . $e->getMessage();\n }\n \n //$statement = null;\n return $mensaje;\n }", "public function insertComentario($params = null){\n\n $logueado = $this->controllerUsuario->checkLoggedIn();\n\n if ($logueado) {\n //obtengo el objeto JSON enviado por POST \n $body = $this->getData();\n\n // inserto el comentario\n $id_comentario = $this->model->insertComentario($body->id_cerveza, $body->id_usuario, $body->comentario, $body->valoracion);\n\n if (!empty($id_comentario)) {\n $this->view->response(\"El comentario se pudo insertar id=$id_comentario\", 201);\n }else {\n $this->view->response(\"El comentario no se pudo insertar\", 404);\n }\n\n } else {\n header(\"Location:\" . BASE_URL . \"home\");\n }\n \n \n }", "public function insert($usuario_has_hojaruta);", "function alta_compra(){\n\t\t$u= new Pr_pedido();\n\t\t$u->get_by_id($_POST['id']);\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->empresas_id=$GLOBALS['empresa_id'];\n\t\t$usuario=$this->usuario->get_usuario($GLOBALS['usuarioid']);\n\t\t//Encargada de Tienda\n\t\tif ($usuario->puesto_id==6 or $usuario->puesto_id==7) {\n\t\t\t$u->corigen_pedido_id=3;\n\t\t\t$u->usuario_validador_id=$u->usuario_id;\n\t\t} else {\n\t\t\t$u->corigen_pedido_id=2;\n\t\t}\n\t\t$u->fecha_alta=date(\"Y-m-d H:i:s\");\n\t\t$related = $u->from_array($_POST);\n\t\t//Adecuar las Fechas al formato YYYY/MM/DD\n\t\t$fecha_pago=explode(\" \", $_POST['fecha_pago']);\n\t\t$fecha_entrega=explode(\" \", $_POST['fecha_entrega']);\n\t\t$u->fecha_pago=\"\".$fecha_pago[2].\"-\".$fecha_pago[1].\"-\".$fecha_pago[0];\n\t\t$u->fecha_entrega=\"\".$fecha_entrega[2].\"-\".$fecha_entrega[1].\"-\".$fecha_entrega[0] ;\n\t\t// save with the related objects\n\t\tif($u->save($related)) {\n\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\techo '<button type=\"submit\" id=\"boton1\" style=\"display:none;\">Actualizar Registro</button>';\n\t\t\techo \"<p id=\\\"response\\\">Datos Generales Guardados<br/><b>Capturar los detalles del pedido</b></p>\";\n\t\t} else\n\t\t\tshow_error(\"\".$u->error->string);\n\t}", "public function encuentros_post()\n {\n $this->Encuentro->Evento_Id = $this->post('Evento_Id');\n $this->Encuentro->Ronda = $this->post('Ronda');\n $this->Encuentro->Lugar = $this->post('Lugar');\n $this->Encuentro->Partes = $this->post('Partes');\n $this->Encuentro->Duracion = $this->post('Duracion');\n $this->Encuentro->Estado = 0;\n $this->Encuentro->Fecha = $this->post('Fecha');\n $this->Encuentro->Hora = $this->post('Hora');\n $this->Encuentro->FechaInicio = $this->post('Fecha');\n $this->Encuentro->HoraInicio = $this->post('Hora');\n $this->Encuentro->TiempoTranscurrido = $this->post('Hora');\n\n $status = REST_Controller::HTTP_CREATED; // CREATED (201) HTTP response code\n if ($this->Encuentro->insert())\n {\n $msg =sprintf('Encuentro %s creado con exito', $this->Encuentro->Id);\n $message = [\n 'status' => FALSE,\n 'message' => $msg\n ];\n }\n else\n {\n $msg = sprintf('Error al insertar el Encuentro %s', $this->Encuentro->Id);\n $message = [\n 'status' => TRUE,\n 'message' => $msg\n ];\n $status = REST_Controller::HTTP_BAD_REQUEST; // BAD_REQUEST (400) HTTP response code\n }\n $this->set_response($message, $status);\n }", "public function productosInsert($nombre, $preciounitario, $preciopaquete, $unidadesporpaquete, $unidadesenstock, $categoria, $proveedor,$foto)\n {\n $sql = \"INSERT INTO productos (nombreproducto,preciounitario,preciopaquete,unidadesporpaquete,unidadesenstock,idcategoria,idproveedor,foto) VALUES ('$nombre',$preciounitario,$preciopaquete,$unidadesporpaquete,$unidadesenstock,'$categoria','$proveedor','$foto')\";\n \nmysqli_query($this->open(), $sql) or die('Error. ' . mysqli_error($sql));\n $this->productosSelect();\n }", "public function primerCliente($id_usuario,$nombreE,$rfcE,$cpE,$correo1E,$observacionesE,$fijo,$logo){\r\n\t\t$sql = \"INSERT INTO tbl_clientesclientes (id_usuario,logo,nombreE,rfcE,cpE,correo1E,observacionesE,estatus,fijo)VALUES('$id_usuario','$logo','$nombreE','$rfcE','$cpE','$correo1E','$observacionesE','1','$fijo')\";\r\n return ejecutarConsulta($sql); \t\r\n\t}", "public function store(StorePagoTransportistaRequest $request)\n { \n //Transaction\n $array_selected = $request->array_selected;\n $pago = PagoTransportista::create( $request->validated() ); \n $id = $request->transportista_id;\n $transportista = Transportista::findOrFail($id);\n //modificar aquí si descuento pendiente anterior no se cancela completamente\n $transportista->descuento_pendiente = 0;\n $transportista->descuento_pendiente += $request->pendiente_dejado;\n $transportista->save();\n //1ero PAGO A SUS PEDIDOS CLIENTE\n $pedidos_cliente\n = Pedido::join('vehiculos','pedidos.vehiculo_id','=','vehiculos.id')\n ->join('transportistas','transportistas.id','=','vehiculos.transportista_id')\n ->join('pedido_proveedor_clientes','pedido_proveedor_clientes.pedido_id','=','pedidos.id')\n ->join('pedido_clientes','pedido_clientes.id','=','pedido_proveedor_clientes.pedido_cliente_id')\n ->whereNotNull('pedidos.vehiculo_id')\n ->whereIn('pedidos.id',$array_selected)\n //->where('pedidos.estado_flete','=',1)\n ->where('transportistas.id','=',$id) \n ->select('pedido_proveedor_clientes.id','pedidos.id as pedido_id')\n ->get();\n\n foreach ( $pedidos_cliente as $pivote ) {\n $pedido_prov_cliente = PedidoProveedorCliente::findOrFail( $pivote->id );\n $pedido_prov_cliente->timestamps = false;\n $pedido_prov_cliente->pago_transportista_id = $pago->id;\n $pedido_prov_cliente->save();\n //estado flete\n $pedido = Pedido::findOrFail( $pivote->pedido_id );\n $pedido->estado_flete = 2;\n $pedido->save();\n }\n\n //2do PAGO A SUS PEDIDOS GRFIOSS\n $pedidos_grifo = Pedido::join('vehiculos','pedidos.vehiculo_id','=','vehiculos.id')\n ->join('transportistas','transportistas.id','=','vehiculos.transportista_id')\n ->join('pedido_grifos','pedido_grifos.pedido_id','=','pedidos.id')\n ->join('grifos','pedido_grifos.grifo_id','=','grifos.id') \n ->whereNotNull('pedidos.vehiculo_id')\n ->whereIn('pedidos.id',$array_selected)\n //->where('pedidos.estado_flete','=',1)\n ->where('transportistas.id','=',$id) \n ->select('pedido_grifos.id','pedidos.id as pedido_id')\n ->get();\n foreach ($pedidos_grifo as $pivote) {\n $pedido_prov_grifo = PedidoProveedorGrifo::findOrFail($pivote->id);\n $pedido_prov_grifo->timestamps = false;\n $pedido_prov_grifo->pago_transportista_id = $pago->id;\n $pedido_prov_grifo->save();\n $pedido = Pedido::findOrFail( $pivote->pedido_id );\n $pedido->estado_flete = 2;\n $pedido->save();\n }\n\n return \n redirect()->route('pago_transportistas.index')->with('alert-type','success')->with('status','Pago Realizado con éxito');\n }", "public function insertar($objeto){\r\n\t}", "function insertarProducto($con,$user,$foto1,$foto2,$foto3,$nombre,$precio,$descripcion,$peso,$dimension,$marca,$color,$envase,$categoria,$estado){\n\n $fecha = new DateTime();\n\n $fechaImagen = $fecha->format('dmYHis');\n\n //URL UPLOADS \n $link = \"http://localhost/TiendaPHP-Ajax/uploads/\";\n\n //VARIABLE OBTIENE ID DEL USUARIO QUE ESTA EN LA SESSION\n $idUsuario = selectSessionId($con,$user);\n\n //llenamos los valores a insertar\n $valor1 = 0;\n\n $valor2 = $link.$fechaImagen.$foto1;\n\n if ($foto2 === \"\") {\n \n $valor3 = $link.$foto2;\n\n }else{\n\n $valor3 = $link.$fechaImagen.$foto2;\n }\n\n if ($foto3 === \"\") {\n\n $valor4 = $link.$foto3;\n \n }else{\n\n $valor4 = $link.$fechaImagen.$foto3;\n\n }\n\n $valor5 = $nombre;\n\n $valor6 = $precio;\n\n $valor7 = $descripcion;\n\n $valor8 = $peso;\n\n $valor9 = $dimension;\n\n $valor10 = $marca;\n\n $valor11 = $color;\n\n $valor12 = $envase;\n\n $valor13 = $categoria;\n\n $valor14 = $estado;\n\n $valor15 = $fecha->format('d-m-Y');\n\n $valor16 = 0;\n\n $valor17 = $idUsuario;\n\n $sql = \"INSERT INTO `producto`(`id`, `imagen_front`, `imagen_back`,`imagen_left`, `nombre`, `precio`, `descripcion`, `peso`, `dimension`, `marca`, `color`, `envase`, `categoria`, `estado`, `fecha`,`numero_visitas`, `id_cliente`)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n\n $consultaPreparada = $con->prepare($sql);\n\n $consultaPreparada->bind_param(\"issssdsssssssssii\",$valor1,$valor2,$valor3,$valor4,$valor5,$valor6,$valor7,$valor8,$valor9,$valor10,$valor11,$valor12,$valor13,$valor14,$valor15,$valor16,$valor17);\n\n /* VALIDAMOS PARA ENVIAR MENSAJE DE INSERCION O NO INSERCION DEL PRODUCTO */\n if($consultaPreparada->execute()){\n\n $directorio = \"../uploads/\";\n\n $fichero1 = $directorio.basename($fechaImagen.$_FILES['image1']['name']);\n \n $fichero2 = $directorio.basename($fechaImagen.$_FILES['image2']['name']);\n \n $fichero3 = $directorio.basename($_FILES['image3']['name']); \n \n /* AQUI MOVEMOS EL ARCHIVO AL SERVIDOR */\n move_uploaded_file($_FILES['image1']['tmp_name'],$fichero1);\n \n move_uploaded_file($_FILES['image2']['tmp_name'],$fichero2);\n\n move_uploaded_file($_FILES['image3']['tmp_name'],$fichero3);\n\n $error['result']=\"true\";\n\n echo json_encode($error);\n\n }else{\n\n $error['result']=\"false\";\n\n echo json_encode($error);\n }\n}", "public function insert(ParecerTrabalho $ParecerTrabalho) {\r\n $sql = \"INSERT INTO $this->table\"\r\n . \" (fk_revisor, datahora, status, fk_trabalho, seq,\"\r\n . \" status_introducao, status_objetivos,\"\r\n . \" status_metodologia, status_resultados, observacoes, observacoes_internas,\"\r\n . \" obs_introducao, obs_objetivos, obs_metodologia, obs_resultados) \"\r\n . \"VALUES\"\r\n . \" (:fkRevisor, :datahora, :status, :fkTrabalho, :seq,\"\r\n . \" :statusIntroducao, :statusObjetivos,\"\r\n . \" :statusMetodologia, :statusResultados, :observacoes, :observacoesInternas,\"\r\n . \" :obsIntroducao, :obsObjetivos, :obsMetodologia, :obsResultados)\";\r\n\r\n\r\n\r\n\r\n $fkRevisor = $ParecerTrabalho->getFkRevisor();\r\n $datahora = $ParecerTrabalho->getDatahora();\r\n $status = $ParecerTrabalho->getStatus();\r\n $fkTrabalho = $ParecerTrabalho->getFkTrabalho();\r\n $seq = $ParecerTrabalho->getSeq();\r\n $statusIntroducao = $ParecerTrabalho->getStatusIntroducao();\r\n $statusObjetivos = $ParecerTrabalho->getStatusObjetivos();\r\n $statusMetodologia = $ParecerTrabalho->getStatusMetodologia();\r\n $statusResultados = $ParecerTrabalho->getStatusResultados();\r\n $observacoes = $ParecerTrabalho->getObservacoes();\r\n $observacoesInternas = $ParecerTrabalho->getObservacoesInternas();\r\n $obsIntroducao = $ParecerTrabalho->getObsIntroducao();\r\n $obsObjetivos = $ParecerTrabalho->getObsObjetivos();\r\n $obsMetodologia = $ParecerTrabalho->getObsMetodologia();\r\n $obsResultados = $ParecerTrabalho->getObsResultados();\r\n\r\n $stmt = ConnectionFactory::prepare($sql);\r\n\r\n $stmt->bindParam(':fkRevisor', $fkRevisor);\r\n $stmt->bindParam(':datahora', $datahora);\r\n $stmt->bindParam(':status', $status);\r\n $stmt->bindParam(':fkTrabalho', $fkTrabalho);\r\n $stmt->bindParam(':seq', $seq);\r\n $stmt->bindParam(':statusIntroducao', $statusIntroducao);\r\n $stmt->bindParam(':statusObjetivos', $statusObjetivos);\r\n $stmt->bindParam(':statusMetodologia', $statusMetodologia);\r\n $stmt->bindParam(':statusResultados', $statusResultados);\r\n $stmt->bindParam(':observacoes', $observacoes);\r\n $stmt->bindParam(':observacoesInternas', $observacoesInternas);\r\n $stmt->bindParam(':obsIntroducao', $obsIntroducao);\r\n $stmt->bindParam(':obsObjetivos', $obsObjetivos);\r\n $stmt->bindParam(':obsMetodologia', $obsMetodologia);\r\n $stmt->bindParam(':obsResultados', $obsResultados);\r\n return $stmt->execute();\r\n }", "public function createCliente($cliente){\n try {\n $sql = \"INSERT INTO cliente (clien_id, clien_nit, clien_codverif, clien_nombre) VALUES (?,?,?,?)\";\n $query = $this->pdo->prepare($sql);\n $result = $query->execute(array('', $cliente[0], $cliente[1], $cliente[2]));\n if ($result == true) {\n return true;\n }else {\n return false;\n }\n } catch (\\Exception $e) {\n die($e->getMessage());\n }\n\n }", "public function inserCompte()\n {\n $username = \"Numherit\";\n $userId = 1;\n $token = $this->utils->getToken($userId);\n\n $nom = $this->utils->securite_xss($_POST['nom']);\n $prenom = $this->utils->securite_xss($_POST['prenom']);\n $adresse = $this->utils->securite_xss($_POST['adresse']);\n $email = $this->utils->securite_xss($_POST['email']);\n $password = $this->utils->generation_code(12);\n $dateNaissance = $this->utils->securite_xss($_POST['datenaiss']);\n $typePiece = $this->utils->securite_xss($_POST['typepiece']);\n $numPiece = $this->utils->securite_xss($_POST['piece']);\n $dateDeliv = $this->utils->securite_xss($_POST['datedelivrancepiece']);\n $telephone = trim(str_replace(\"+\", \"00\", $this->utils->securite_xss($_POST['phone'])));\n $sexe = $this->utils->securite_xss($_POST['sexe']);\n $user_creation = $this->userConnecter->rowid;\n $agence = $this->userConnecter->fk_agence;\n $response = $this->api_numherit->creerCompte($username, $token, $nom, $prenom, $adresse, $email, $password, $dateNaissance, $telephone, $user_creation, $agence, $sexe, $typePiece, $numPiece, $dateDeliv);\n\n $tab = json_decode($response);\n if (is_object($tab)) {\n if ($tab->{'statusCode'} == '000') {\n @$num_transac = $this->utils->generation_numTransaction();\n @$idcompte = $this->utils->getCarteTelephone($telephone);\n @$this->utils->SaveTransaction($num_transac, $service = ID_SERVICE_CREATION_COMPTE, $montant = 0, $idcompte, $user_creation, $statut = 0, 'SUCCESS: CREATION COMPTE', $frais = 0, $agence, 0);\n $true = 'bon';\n $this->utils->log_journal('Creation compte', 'Client:' . $nom . ' ' . $prenom . ' Agence:' . $agence, 'succes', 1, $user_creation);\n $this->rediriger('compte', 'compte/' . base64_encode($true));\n } else {\n $this->utils->log_journal('Creation compte', 'Client:' . $nom . ' ' . $prenom . ' Agence:' . $agence, 'echec', 1, $user_creation);\n $this->rediriger('compte', 'compte/' . base64_encode($tab->{'statusMessage'}));\n }\n }\n }", "function ajouterArticle($id,$qteProduit){\r\n $idpanier=creationPanier();\r\n if($idpanier==false)\r\n {\r\n echo 'Probleme acces au panier.';\r\n die(); \r\n }\r\n\r\n echo 'debug1';\r\n //Connexion database\r\n try {\r\n $dbh = new PDO('mysql:host=localhost;dbname=retromathon', 'root', '');\r\n }\r\n catch( PDOException $Exception ) {\r\n echo $Exception->getMessage();\r\n die();\r\n }\r\n\r\n //Selection du id produit s'il existe dans le panier\r\n $req = \"SELECT * FROM selectionne WHERE REF_PANIER=\".$idpanier.\" AND REF_ART='\".$id.\"';\";\r\n $prep = $dbh->query($req);\r\n if($prep==false) //Erreur\r\n {\r\n echo 'Erreur Base de Donnees';\r\n die(); \r\n }\r\n $article = $prep->fetch();\r\n if(($article!=null)&&(count($article)!=0)) //Article existe\r\n {\r\n //On incremante la quantite\r\n $newQte=$article['QTE_CHOISI']+$qteProduit;\r\n $req = \"UPDATE selectionne SET QTE_CHOISI=\".$newQte.\" WHERE REF_PANIER=\".$idpanier.\" AND REF_ART='\".$id.\"';\";\r\n $prep = $dbh->exec($req);\r\n if($prep==0) //Erreur\r\n {\r\n echo 'Erreur Base de Donnees';\r\n die(); \r\n }\r\n }\r\n else //Article n'existe pas\r\n {\r\n //Ajout de l'article au panier\r\n $req = \"INSERT INTO selectionne (REF_ART, REF_PANIER,QTE_CHOISI) VALUES ('\".$id.\"',\".$idpanier.\",\".$qteProduit.\");\";\r\n $prep = $dbh->exec($req);\r\n if($prep==0) //Erreur\r\n {\r\n echo 'Erreur INSERT Base de Donnees';\r\n die(); \r\n }\r\n }\r\n}", "function enlazar(\r\n\t\t$Id_Pedido,\r\n\t\t$Id_Pedido_Hijo\r\n\t)\r\n\t{\r\n\t\t\r\n\t\t//Creacion del enlace\r\n\t\t$Consulta = '\r\n\t\t\tinsert into pedido_pedido values(\r\n\t\t\t\tNULL,\r\n\t\t\t\t\"'.$Id_Pedido.'\",\r\n\t\t\t\t\"'.$Id_Pedido_Hijo.'\"\r\n\t\t\t)\r\n\t\t';\r\n\t\t\r\n\t\t//Ingreso del pedido\r\n\t\t$this->db->query($Consulta);\r\n\t\t\r\n\t\treturn 'ok';\r\n\t\t\r\n\t}", "function guardar($arg) {\n\t\tSessionHandler()->check_session();\n\t\tdate_default_timezone_set('America/Argentina/La_Rioja');\n\n\t\t$ids = explode('@', $arg);\n\t\t$mesa = $ids[0];\n\t\t$bebida = $ids[1];\n\t\t$cantidad = $ids[2];\n\t\t$pedidoId = $ids[3];\n\n\t\t//COMPROBAR STOCK DE BEBIDA.\n\t\t\n\t\tif ($pedidoId != null || $pedidoId != 0 || $pedidoId != \"\") {\n\t\t\t$bp = new BebidaPedido();\n\t\t\t$bp->pedido = $pedidoId;\n\t\t\t$bp->bebida = $bebida;\n\t\t\t$bp->cantidad = $cantidad;\n\t\t\t$bp->save();\n\n\t\t\t$md = new Mesa();\n\t\t\t$md->mesa_id = $mesa;\n\t\t\t$md->get();\n\t\t\t$md->disponible = 2;\n\t\t\t$md->save();\n\t\t\tprint($pedidoId);exit;\n\t\t}\n\n\t\t$this->model->fecha = date('Y-m-d');\t\t\n\t\t$this->model->mesa = $mesa;\t\t\n\t\t$this->model->estado = 1;\t\t\n\t\t$this->model->save();\n\t\t\n\t\t$md = new Mesa();\n\t\t$md->mesa_id = $mesa;\n\t\t$md->get();\n\t\t$md->disponible = 2;\n\t\t$md->save();\n\t\t\n\t\t$pedido_id = $this->model->pedido_id;\n\t\t\n\t\t$bp = new BebidaPedido();\n\t\t$bp->pedido = $pedido_id;\n\t\t$bp->bebida = $bebida;\n\t\t$bp->cantidad = $cantidad;\n\t\t$bp->save();\n\t\tprint($pedido_id);exit;\n\n\t}", "public static function ingresarFicha($ficha,$programa_formacion,$etapa,$trimestre,$jornada,$tipo){\n\n $fic=Conexion::conectar('localhost','proyecto','root','');\n\n $fich=$fic->prepare(\"SELECT * FROM ficha WHERE numero_ficha=:numero\");\n $fich->execute(array(':numero' => $ficha ));\n\n if ($row=$fich->fetch(PDO::FETCH_ASSOC)) {\n\n setcookie(\"ficha\",\"<div class=\\\"alert alert-danger\\\" role=\\\"alert\\\">\n La ficha ya se encuentra registrada.\n </div>\",time()+10,\"/\");\n header(\"Location: ../vistas/consultar.php?aprendices=fichas\");\n \n }else{\n\n switch ($etapa) {\n case 1:\n $fichaa=$fic->prepare(\"INSERT INTO ficha (id_ficha,numero_ficha,id_programa,id_jornada,id_trimestre,id_etapa,id_tipo_formacion) \n VALUES (NULL, :numero_ficha, :programa, :etapa, :trimestre, :jornada, :tipo)\");\n $fichaa->execute(array(':numero_ficha' => $ficha, \n ':programa' => $programa_formacion, \n ':etapa' => $etapa, \n ':trimestre' => $trimestre, \n ':jornada' => $jornada, \n ':tipo' => $tipo));\n echo $ficha.\" \".$programa_formacion.\" \".$etapa.\" \".$trimestre.\" \".$jornada.\" \".$tipo;\n break;\n\n case 2:\n $fichaa=$fic->prepare(\"INSERT INTO ficha (id_ficha,numero_ficha,id_programa,id_jornada,id_trimestre,id_etapa,id_tipo_formacion) \n VALUES (NULL, :numero_ficha, :programa, :etapa, NULL, NULL, NULL)\");\n $fichaa->execute(array(':numero_ficha' => $ficha, \n ':programa' => $programa_formacion, \n ':etapa' => $etapa));\n break;\n }\n\n setcookie(\"ficha\",\"<div class=\\\"alert alert-primary\\\" role=\\\"alert\\\">\n La ficha fue registrada correctamente.\n </div>\",time()+10,\"/\");\n header(\"Location: ../vistas/consultar.php?aprendices=fichas\");\n } \n }", "function cadastrarRegistro($id_cliente, $trabalho, $campanha, $peca)\n\t\t{\n\t\t\t$sql = \"INSERT INTO tb_portfolio \";\n\t\t\t$sql = $sql . \"(id_cliente, trabalho, campanha, peca) \";\n\t\t\t$sql = $sql . \"VALUES('$id_cliente','$trabalho','$campanha','$peca')\";\n\t\t\t\n\t\t\t$banco = new Banco();\n\t\t\t\n\t\t\tif ($busca = mysql_query($sql))\n\t\t\t{\n\t\t\t\t$_SESSION['inclusao']=\"OK\";\n\t\t\t\techo \"<meta HTTP-EQUIV='Refresh' CONTENT='0;URL=../home/index.php'>\";\t\n\t\t\t\t$banco->fecharConexao();\n\t\t\t\treturn $busca;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_SESSION['inclusao']=\"ERROR\";\n\t\t\t\techo \"<meta HTTP-EQUIV='Refresh' CONTENT='0;URL=../home/index.php'>\";\n\t\t\t\t$banco->fecharConexao();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function enviarPapelera() {\n//Recibimos los parametros\n $doc_document_ids = $this->input->post('doc_document_id');\n\n try {\n $doc_document_ids = explode(\",\", $doc_document_ids);\n\n foreach ($doc_document_ids as $doc_document_id) {\n $findGrId = Doctrine_Core::getTable('DocDocument')->find($doc_document_id);\n $findGrId->doc_status_id = 1;\n $findGrId->save();\n $success = true;\n $msg = $this->translateTag('General', 'sent_to_the_trash_registration_successfully');\n }\n } catch (Exception $e) {\n $success = false;\n $msg = $e->getMessage();\n }\n\n $json_data = $this->json->encode(array(\n 'success' => $success,\n 'msg' => $msg\n ));\n echo $json_data;\n }", "public function insertPreDetalle(){\n $sql='INSERT INTO predetalle (idCliente, idProducto, cantidad) VALUES (?, ?, ?)';\n $params=array($this->cliente, $this->id, $this->cantidad);\n return Database::executeRow($sql, $params);\n }", "function crear_ruta_unidad($un_x,$r_x,$usu,$cli){\n\t\n global $db,$dbf,$fecha_con_formato,$nueva_ruta,$insertar_ruta_unidad;\n\t \n\n $data = Array(\n \t'DESCRIPTION' => utf8_decode(strtoupper($r_x)),\n 'COD_USER' => $usu,\n 'COD_CLIENT' => $cli,\n 'CREATE_DATE' => $fecha_con_formato\n \n );\n \n if($dbf-> insertDB($data,'SAVL_ROUTES',true) == true){\n echo \"se genero la ruta, ahora se asigna unidad a ruta siempre y cuando sea diferente de -1 en el cod_entity\";\n\t\t\t\t\n\t\t\t\t$ruta = \"SELECT ID_ROUTE FROM SAVL_ROUTES WHERE DESCRIPTION LIKE '%\".strtoupper($r_x).\"%'\";\n\t\t\t\t $query = $db->sqlQuery($ruta);\n\t\t\t\t $row = $db->sqlFetchArray($query);\n\t\t\t\t \t$count_x = $db->sqlEnumRows($query);\t \n\t\t\t\t\t\n\t\t\t\t\t \t\n\t\t\t\tif($un_x!=-1) {\n\t\t\t\t\t $data_3 = Array(\n\t\t\t\t\t\t\t\t\t 'ID_ROUTE' => $row['ID_ROUTE'],\n\t\t\t\t\t\t\t\t\t 'COD_ENTITY' => $un_x,\n\t\t\t\t\t\t\t\t\t 'COD_USER' => $usu,\n\t\t\t\t\t\t\t\t\t 'CREATE_DATE' => $fecha_con_formato\n\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t if($dbf-> insertDB($data_3,'SAVL_ROUTES_UNITS',true) == true){\n \t\t\t\t\t echo \"info de la ruta\".$row['ID_ROUTE'].'-'.$un_x.'-'.$usu.'-'.$fecha_con_formato.'<br />';\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t }else{\n \t\t\t\t echo \"fallo en ruta-unidad\";\t\n }\n\t\t\t\t\t\t\t \n\t\t\t }\t\t\t\t \t\t\t\n\t\t\t}\t\t\n\t\t\t\n\t\t\t\n\t $nueva_ruta = $row['ID_ROUTE'];\t\t\n $insertar_ruta_unidad = $insertar_ruta_unidad + 1;\n}", "public function agregarComentario($coment){\n \n $cliente=array(\n 'va_nombre_cliente'=>$coment['va_nombre'],\n 'va_email'=>$coment['va_email'], \n );\n $insert = $this->tableGateway->getSql()->insert()->into('ta_cliente')\n ->values($cliente);\n $statement = $this->tableGateway->getSql()->prepareStatementForSqlObject($insert);\n \n $statement->execute(); \n// $selectString2 = $this->tableGateway->getSql()->getSqlStringForSqlObject($insert);\n// $adapter=$this->tableGateway->getAdapter();\n// $result = $adapter->query($selectString2, $adapter::QUERY_MODE_EXECUTE);\n $idcliente=$this->tableGateway->getAdapter()->getDriver()->getLastGeneratedValue();//$this->tableGateway->getLastInsertValue();\n// var_dump($idcliente);Exit;\n\n// date_default_timezone_set('UTC');\n $comentario = array(\n 'tx_descripcion' => $coment['tx_descripcion'],\n 'Ta_plato_in_id' => $coment['Ta_plato_in_id'],\n 'Ta_cliente_in_id' => $idcliente,//$coment->Ta_cliente_in_id,\n 'Ta_puntaje_in_id' => $coment['Ta_puntaje_in_id'],\n 'Ta_plato_in_id'=>35,\n 'da_fecha'=>date('c')//date('Y-m-dTH:i:s.uZ')//'2013-12-12'\n );\n \n $id = (int) $coment['in_id'];\n if ($id == 0) { \n $insertcoment= $this->tableGateway->getSql()->insert()->into('ta_comentario')\n ->values($comentario);\n $statement2 = $this->tableGateway->getSql()->prepareStatementForSqlObject($insertcoment);\n $statement2->execute(); \n\n }\n \n }", "function inserisci_record(Spesa $spesa){\n //variaibili che arrivano dall'oggetto creato\n $titolo = $spesa->getTitoloSpesa();\n $tipologia = $spesa->getTipologiaSpesa();\n $data_p = converti_data_pagamento_spesa($spesa->getDataPagamentoSpesa());\n $data_s = converti_data_scadenza_spesa($spesa->getDataScadenzaSpesa());\n $autore = $spesa->getAutoreSpesa();\n $importo = verifica_importo_spesa($spesa->getImportoSpesa());\n\n $mysqli = connetti();\n\n $sql = \"INSERT INTO `spesa` (`titolo_spesa`, `tipologia_spesa`, `data_pagamento_spesa`, `data_scadenza_spesa`, `autore_spesa`, `importo_spesa`) \n VALUES('$titolo','$tipologia','$data_p','$data_s','$autore',$importo)\";\n\n if($mysqli->query($sql)){\n header(\"Location:index.php\");\n }else{\n header(\"Location:inserisci_spesa.php\");\n }\n chiudi_connessione($mysqli);\n}", "public function modificar($datosCampos) {\n $guardar = new SqlQuery(); //instancio objeto de la clase sqlQuery\n (string) $tabla = get_class($this); //obtengo el nombre de la clase para poder realizar la consulta\n $id = $datosCampos[\"id\"];\n switch ($datosCampos[\"acceso\"]) //cambio los dato que vienen de la vista\n {\n case \"total\":\n $datosCampos[\"acceso\"] = 1;\n break;\n case \"restringido\":\n $datosCampos[\"acceso\"] = 2;\n break;\n default:\n $datosCampos[\"acceso\"] = 0;\n break;\n }\n try {\n $this->refControladorPersistencia->get_conexion()->beginTransaction(); //comienza la transacción \n $arrayCabecera = $guardar->meta($tabla);//armo el array con la cabecera de los datos\n $sentencia = $guardar->armarSentenciaModificar($arrayCabecera, $tabla);//genero sentencia\n $array = $guardar->armarArray($arrayCabecera, $datosCampos);//Armo el array con los datos que vienen de la vista y la cabecera de la BD\n array_shift($array);//elimino primer elemento del array que es el id\n array_push($array, $id);//agrego el id al final del array para realizar la consulta\n $this->refControladorPersistencia->ejecutarSentencia($sentencia, $array);//genero la consulta a la BD \n $this->refControladorPersistencia->get_conexion()->commit(); //si todo salió bien hace el commit \n } catch (PDOException $excepcionPDO) {\n echo \"<br>Error PDO: \" . $excepcionPDO->getTraceAsString() . '<br>';\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si salio mal hace un rollback\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si hay algún error hace rollback\n }\n $respuesta = $this->getUsuario($id);\n return $respuesta;\n }", "public function insertarProductoCompra($datos){\n $con= new conectar();\n $conexion= $con->conexion();\n $sql= \"INSERT INTO producto_comprar(id_cliente, id_producto,nombre,precio,compro,fecha)\n values('$datos[0]','$datos[1]','$datos[2]','$datos[3]','$datos[4]','$datos[5]')\"; \n return $result= mysqli_query($conexion, $sql); \n }", "static public function mdlIngresarCliente($tabla, $datos) {\n $stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla (nombre,documento,fecha_nacimiento,correo,num_celular,area_trabajo)\"\n . \"VALUES (:nombre,:documento,:fecha_nacimiento,:correo,:num_celular,:area_trabajo)\");\n\n $stmt->bindParam(\":nombre\", $datos[\"nombre\"], PDO::PARAM_STR);\n $stmt->bindParam(\":documento\", $datos[\"documento\"], PDO::PARAM_INT);\n $stmt->bindParam(\":fecha_nacimiento\", $datos[\"fecha_nacimiento\"], PDO::PARAM_STR);\n $stmt->bindParam(\":correo\", $datos[\"correo\"], PDO::PARAM_STR);\n $stmt->bindParam(\":num_celular\", $datos[\"num_celular\"], PDO::PARAM_STR);\n $stmt->bindParam(\":area_trabajo\", $datos[\"area_trabajo\"], PDO::PARAM_STR);\n\n if ($stmt->execute()) {\n\n return \"ok\";\n } else {\n\n return \"error\";\n }\n $stmt->close();\n $stmt = null;\n }", "function insertar_temporada_producto(){\t\t\n\t\t$this->accion=\"Insertar Nueva Temporada\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\"){\n\t\t\t$this->asignar_valores2();\n\t\t\t$this->desde=$this->convertir_fecha($this->desde);\n\t\t\t$this->hasta=$this->convertir_fecha($this->hasta);\n\t\t\t\n\t\t\t$sql=\"INSERT INTO temporadas2 VALUES ('', '$this->id', '$this->mostrar', '$this->prioridad', 'Por Fecha', '0', '$this->desde', '$this->hasta', '0', '0', '$this->alternativo', '0', '0', '$this->titulo', 'NULL', '$this->paxadicional', 'NULL', '$this->desde_a', '$this->hasta_a', '$this->precio_a', '0', 'NULL', '$this->desde_b', '$this->hasta_b', '$this->precio_b', '0', 'NULL', '0', '0', '0', '0', 'NULL')\";\n\t\t\t$id=$this->id;\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/producto/detalle.php?id=$id#next\");\n\t\t\texit();\n\t\t}\n\t}" ]
[ "0.7210985", "0.71000344", "0.7065209", "0.7060017", "0.69389707", "0.69246984", "0.68504465", "0.68451905", "0.68101484", "0.6780883", "0.6758263", "0.67288923", "0.6692599", "0.66860694", "0.6674472", "0.66703045", "0.6654263", "0.66345197", "0.66182727", "0.6604472", "0.6596771", "0.65924597", "0.65658706", "0.6561551", "0.65550894", "0.6554754", "0.6532978", "0.6514803", "0.650895", "0.650635", "0.6503008", "0.6498869", "0.6497959", "0.6490203", "0.64879644", "0.6470086", "0.6458513", "0.64572895", "0.64571625", "0.64498866", "0.6447767", "0.6446727", "0.6439571", "0.6437992", "0.64312816", "0.642784", "0.64171857", "0.64079225", "0.6399194", "0.6394506", "0.6389171", "0.6379441", "0.6376544", "0.63743126", "0.6374237", "0.63737124", "0.6370247", "0.63702184", "0.63614225", "0.63427657", "0.6338546", "0.6338525", "0.63328385", "0.63158697", "0.6315672", "0.62988037", "0.6293359", "0.6292836", "0.6285728", "0.6285148", "0.6280262", "0.6279616", "0.6269729", "0.62674415", "0.62631184", "0.6259505", "0.62580365", "0.6251007", "0.6249979", "0.6242393", "0.6240581", "0.6227236", "0.62248856", "0.6223904", "0.6216759", "0.62163156", "0.6208381", "0.6205568", "0.62038904", "0.6203353", "0.6198764", "0.6198159", "0.619735", "0.619487", "0.61906445", "0.6189111", "0.6187703", "0.61855924", "0.6183492", "0.6175827" ]
0.643746
44
consulta pedidos prontos a facturar
function CuentaPedidosProntoAFacturar($CardCode){ $Total_Pedido = 0; $NumPedido = 0; $FechaCreacion = 0; $FechaFin = 0; $Total = 0; $TotalGeneral = 0; if($this->con->conectar()==true){ $Resultado = mysql_query("SELECT * FROM `PedidosProntosAFacturar` WHERE `CardCode` = '" .$CardCode. "'"); if($Resultado){ echo "<table class='altrowstable' id='alternatecolor' align='center'> <tr> <th>Num Pedido</th> <th>Fecha Creacion</th> <th>Total</th> <th>Accion</th> </tr>"; while( $PedidoHecho = mysql_fetch_array($Resultado) ) { //suma total pedido // $Total_Pedido = $Total_Pedido + ($PedidoHecho['Cantidad']*$PedidoHecho['Precio']); //respalda numero pedido if ($NumPedido != $PedidoHecho['NumPedido']) { echo"<tr> <td>". $PedidoHecho['NumPedido']."</td> <td>". $PedidoHecho['Fecha']."</td> <td>". number_format($PedidoHecho['Total'], 2) ."</td> <td> <a id='Actualizar' class='ClassBotones' href='javascript:VerDetallePedido(\"".$CardCode."\",\"". $PedidoHecho['NumPedido']."\");'>Ver Detalle</a> </td> <tr>"; $TotalGeneral=$TotalGeneral+$PedidoHecho['Total']; } $NumPedido = $PedidoHecho['NumPedido']; /* NOTAS SE DEBE HACER UA VARIABLE INDEPENDIENTE PARA CADA DATO YA QUE SI NO EL TOTAL DEL PEDIDO NO PODRA MOSTRARSE */ //si el proximo pedido es diferente al actual //agarra la siguiente linea }//fin while /*echo"<table class='altrowstable' id='alternatecolor'> <tr> <th>Num Pedido</th> <th>Foto</th> <th>CodArticulo</th> <th>Descripcion</th> <th>Cantidad</th> <th>Precio</th> <th>Total</th> </tr>"; while( $PedidoHecho = mysql_fetch_array($Resultado) ) { echo"<tr> <td>". $PedidoHecho['NumPedido']."</td> <td>"; if (file_exists("../img/Articulos/".trim($ItemCode).".jpg")) { echo" <img src='img/Articulos/$ItemCode.jpg' width='100' height='117'>"; } else { echo"<img src='img/General/SinImagenDisponible.jpg' width='100' height='115'>"; } echo" </td> <td>". $PedidoHecho['CodArticulo']."</td> <td>". $PedidoHecho['Descripcion']."</td> <td>". $PedidoHecho['Cantidad']."</td> <td>". number_format($PedidoHecho['Precio'], 2) ."</td> <td>". number_format(($PedidoHecho['Cantidad']*$PedidoHecho['Precio']), 2) . "\n" ."</td> </tr>"; $Total_Pedido = $Total_Pedido + ($PedidoHecho['Cantidad']*$PedidoHecho['Precio']); // $Total_Articulos = $Result["NumItems"]; }//FIN WHILE */ echo "<tr> <td colspan='2' align='center'>TOTAL</td> <td colspan='1' align='left'>". number_format($TotalGeneral, 2)."</td> </tr> </table>"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function consultasPendientes(){\n\n\t\t$resultado = array();\n\t\t\n\t\t$query = \"SELECT count(C.idConsulta) as cantidadConsultas\n\t\t\n\t\t\t\t\t\tFROM tb_consultas AS C \n\t\t\t\t\t\t\n \t\t\t\tWHERE Not C.idConsulta IN (SELECT idTipoDetalle FROM tb_pago_factura_caja_detalle WHERE tipoDetalle = 'Consulta' AND estado = 'Activo' )\";\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n\t\tif($res = $conexion->query($query)){\n \n /* obtener un array asociativo */\n while ($filas = $res->fetch_assoc()) {\n $resultado = $filas;\n }\n \n /* liberar el conjunto de resultados */\n $res->free();\n \n }\n\n return $resultado['cantidadConsultas'];\t\n\n\n\t\t\n\t}", "public function AgregaPedidos()\n{\n\n\tif(empty($_SESSION[\"CarritoVentas\"]))\n\t\t\t\t{\n\t\t\t\t\techo \"3\";\n\t\t\t\t\texit;\n\n\t\t\t\t} \n\n\t$ver = $_SESSION[\"CarritoVentas\"];\n\tfor($i=0;$i<count($ver);$i++){ \n\n\t\t$sql = \"select existencia from productos where codproducto = '\".$ver[$i]['txtCodigo'].\"'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$existenciadb = $row['existencia'];\n\n\t\tif($ver[$i]['cantidad'] > $existenciadb) {\n\n\t\t\techo \"4\";\n\t\t\texit; }\n\t\t}\n\n\t$ven = $_SESSION[\"CarritoVentas\"];\n\tfor($i=0;$i<count($ven);$i++){\n\n\t$sql = \"select existencia from productos where codproducto = '\".$ven[$i]['txtCodigo'].\"'\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\t$existenciadb = $row['existencia'];\n\n\n\t\t$sql = \"select * from detalleventas where codventa = ? and codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array( $_POST[\"codventa\"], $ven[$i]['txtCodigo'] ) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num>0)\n\t\t{\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $row;\n\t\t\t}\n\t\t\t$codproducto = $pae[0]['codproducto'];\n\t\t\t$cantven = $pae[0]['cantventa'];\n\t\t\t$import = $pae[0]['importe'];\n\t\t\t$import2 = $pae[0]['importe2'];\n\n\t\t\t$sql = \" update detalleventas set \"\n\t\t\t.\" cantventa = ?, \"\n\t\t\t.\" importe = ?, \"\n\t\t\t.\" importe2 = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codventa = '\".$_POST[\"codventa\"].\"' and codproducto = '\".$ven[$i]['txtCodigo'].\"';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $cantidad);\n\t\t\t$stmt->bindParam(2, $importe);\n\t\t\t$stmt->bindParam(3, $importe2);\n\n\t\t\t$cantidad = rount($ven[$i]['cantidad']+$cantven,2);\n\t\t\t$importe = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio2']+$import);\n\t\t\t$importe2 = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio']+$import2);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$existencia = rount($existenciadb-$ven[$i]['cantidad'],2);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" statusproducto = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"' and existencia = '0';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $statusproducto);\n\t\t\t$statusproducto = \"INACTIVO\";\n\t\t\t$stmt->execute();\n\n################## REGISTRAMOS LOS DATOS DE PRODUCTOS EN KARDEX #################\n\t\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $movimiento);\n\t\t\t$stmt->bindParam(5, $entradas);\n\t\t\t$stmt->bindParam(6, $salidas);\n\t\t\t$stmt->bindParam(7, $devolucion);\n\t\t\t$stmt->bindParam(8, $stockactual);\n\t\t\t$stmt->bindParam(9, $preciounit);\n\t\t\t$stmt->bindParam(10, $costototal);\n\t\t\t$stmt->bindParam(11, $documento);\n\t\t\t$stmt->bindParam(12, $fechakardex);\n\n\t\t\t$codventa = strip_tags($_POST[\"codventa\"]);\n\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t$codproducto = strip_tags($ven[$i]['txtCodigo']);\n\t\t\t$movimiento = strip_tags(\"SALIDAS\");\n\t\t\t$entradas = strip_tags(\"0\");\n\t\t\t$salidas = rount($ven[$i]['cantidad'],2);\n\t\t\t$devolucion = strip_tags(\"0\");\n\t\t\t$stockactual = rount($existenciadb-$ven[$i]['cantidad'],2); \n\t\t\t$preciounit = strip_tags($ven[$i]['precio2']);\n\t\t\t$costototal = strip_tags($ven[$i]['precio2'] * $ven[$i]['cantidad']);\n\t\t\t$documento = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t$fechakardex = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t$stmt->execute();\n\n\n############## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ###############\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array( $ven[$i]['txtCodigo'] ) );\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto IN ('\".$ven[$i]['txtCodigo'].\"')\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$racion = rount($cantracion*$cantidad,2);\n\t\t\t$cantidadracion = rount($cantingrediente-$racion,2);\n\t\t\t$stmt->execute();\n\n\n##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX #####################\n\t\t\t\t\t$query = \" insert into kardexingredientes values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t\t\t$stmt->bindParam(4, $codingrediente);\n\t\t\t\t\t$stmt->bindParam(5, $movimientoing);\n\t\t\t\t\t$stmt->bindParam(6, $entradasing);\n\t\t\t\t\t$stmt->bindParam(7, $salidasing);\n\t\t\t\t\t$stmt->bindParam(8, $stockactualing);\n\t\t\t\t\t$stmt->bindParam(9, $preciouniting);\n\t\t\t\t\t$stmt->bindParam(10, $costototaling);\n\t\t\t\t\t$stmt->bindParam(11, $documentoing);\n\t\t\t\t\t$stmt->bindParam(12, $fechakardexing);\n\n\t\t\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t\t\t$codproducto = strip_tags($codproducto);\n\t\t\t\t\t$codingrediente = strip_tags($codingrediente);\n\t\t\t\t\t$movimientoing = strip_tags(\"SALIDAS\");\n\n\t\t\t\t\t$entradasing = strip_tags(\"0\");\n\t\t\t\t\t$salidasing = rount($cantracion*$cantidad,2);\n\t\t\t\t\t$stockactualing = rount($cantingrediente-$racion,2);\n\t\t\t\t\t$preciouniting = strip_tags($costoingrediente);\n\t\t\t\t\t$costototaling = strip_tags($costoingrediente * $cantidad);\n\n\t\t\t\t\t$documentoing = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t\t\t$fechakardexing = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t\t\t$stmt->execute();\n\t##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX ###################\n\n\t\t }\n\n}\n############## FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ###########\t\n\n\n\t\t}\n\t\telse\n\t\t{\n\n\n\t\t\t$query = \" insert into detalleventas values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $producto);\n\t\t\t$stmt->bindParam(5, $codcategoria);\n\t\t\t$stmt->bindParam(6, $cantidad);\n\t\t\t$stmt->bindParam(7, $preciocompra);\n\t\t\t$stmt->bindParam(8, $precioventa);\n\t\t\t$stmt->bindParam(9, $ivaproducto);\n\t\t\t$stmt->bindParam(10, $importe);\n\t\t\t$stmt->bindParam(11, $importe2);\n\t\t\t$stmt->bindParam(12, $fechadetalleventa);\n\t\t\t$stmt->bindParam(13, $statusdetalle);\n\t\t\t$stmt->bindParam(14, $codigo);\n\n\t\t\t$codventa = strip_tags($_POST[\"codventa\"]);\n\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t$codproducto = strip_tags($ven[$i]['txtCodigo']);\n\t\t\t$producto = strip_tags($ven[$i]['descripcion']);\n\t\t\t$codcategoria = strip_tags($ven[$i]['tipo']);\n\t\t\t$cantidad = rount($ven[$i]['cantidad'],2);\n\t\t\t$preciocompra = strip_tags($ven[$i]['precio']);\n\t\t\t$precioventa = strip_tags($ven[$i]['precio2']);\n\t\t\t$ivaproducto = strip_tags($ven[$i]['ivaproducto']);\n\t\t\t$importe = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio2']);\n\t\t\t$importe2 = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio']);\n\t\t\t$fechadetalleventa = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t$statusdetalle = \"1\";\n\t\t\t$codigo = strip_tags($_SESSION['codigo']);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$existencia = rount($existenciadb-$ven[$i]['cantidad'],2);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" statusproducto = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"' and existencia = '0';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $statusproducto);\n\t\t\t$statusproducto = \"INACTIVO\";\n\t\t\t$stmt->execute();\n\n##################### REGISTRAMOS LOS DATOS DE PRODUCTOS EN KARDEX ###################\n\t\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $movimiento);\n\t\t\t$stmt->bindParam(5, $entradas);\n\t\t\t$stmt->bindParam(6, $salidas);\n\t\t\t$stmt->bindParam(7, $devolucion);\n\t\t\t$stmt->bindParam(8, $stockactual);\n\t\t\t$stmt->bindParam(9, $preciounit);\n\t\t\t$stmt->bindParam(10, $costototal);\n\t\t\t$stmt->bindParam(11, $documento);\n\t\t\t$stmt->bindParam(12, $fechakardex);\n\n\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t$codproducto = strip_tags($ven[$i]['txtCodigo']);\n\t\t\t$movimiento = strip_tags(\"SALIDAS\");\n\t\t\t$entradas = strip_tags(\"0\");\n\t\t\t$salidas =rount($ven[$i]['cantidad'],2);\n\t\t\t$devolucion = strip_tags(\"0\");\n\t\t\t$stockactual = rount($existenciadb-$ven[$i]['cantidad'],2);\n\t\t\t$preciounit = strip_tags($ven[$i]['precio2']);\n\t\t\t$costototal = strip_tags($ven[$i]['precio2'] * $ven[$i]['cantidad']);\n\t\t\t$documento = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t$fechakardex = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t$stmt->execute();\t\n\n\n############### CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array( $ven[$i]['txtCodigo'] ) );\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto IN ('\".$ven[$i]['txtCodigo'].\"')\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$racion = rount($cantracion*$cantidad,2);\n\t\t\t$cantidadracion = rount($cantingrediente-$racion,2);\n\t\t\t$stmt->execute();\n\n\n##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX #####################\n$query = \" insert into kardexingredientes values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t\t\t$stmt->bindParam(4, $codingrediente);\n\t\t\t\t\t$stmt->bindParam(5, $movimientoing);\n\t\t\t\t\t$stmt->bindParam(6, $entradasing);\n\t\t\t\t\t$stmt->bindParam(7, $salidasing);\n\t\t\t\t\t$stmt->bindParam(8, $stockactualing);\n\t\t\t\t\t$stmt->bindParam(9, $preciouniting);\n\t\t\t\t\t$stmt->bindParam(10, $costototaling);\n\t\t\t\t\t$stmt->bindParam(11, $documentoing);\n\t\t\t\t\t$stmt->bindParam(12, $fechakardexing);\n\n\t\t\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t\t\t$codproducto = strip_tags($codproducto);\n\t\t\t\t\t$codingrediente = strip_tags($codingrediente);\n\t\t\t\t\t$movimientoing = strip_tags(\"SALIDAS\");\n\n\t\t\t\t\t$entradasing = strip_tags(\"0\");\n\t\t\t\t\t$salidasing = rount($cantracion*$cantidad,2);\n\t\t\t\t\t$stockactualing = rount($cantingrediente-$racion,2);\n\t\t\t\t\t$preciouniting = strip_tags($costoingrediente);\n\t\t\t\t\t$costototaling = strip_tags($costoingrediente * $cantidad);\n\n\t\t\t\t\t$documentoing = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t\t\t$fechakardexing = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t\t\t$stmt->execute();\n##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX ###################\n\n\t\t }\n\n}\n############# FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS #############\t\n\n\t\t}\n\t}\n\n\t$sql4 = \"select * from ventas where codventa = ? \";\n\t$stmt = $this->dbh->prepare($sql4);\n\t$stmt->execute( array($_POST[\"codventa\"]) );\n\t$num = $stmt->rowCount();\n\n\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$paea[] = $row;\n\t\t}\n\t\t$subtotalivasive = $paea[0][\"subtotalivasive\"];\n\t\t$subtotalivanove = $paea[0][\"subtotalivanove\"];\n\t\t$iva = $paea[0][\"ivave\"]/100;\n\t\t$descuento = $paea[0][\"descuentove\"]/100;\n\t\t$totalivave = $paea[0][\"totalivave\"];\n\t\t$totaldescuentove = $paea[0][\"totaldescuentove\"];\n\n\n\t\t$sql3 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'SI'\";\n\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t$stmt->execute( array($_POST[\"codventa\"]));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$preciocompraiva = $p[0][\"preciocompra\"];\n\t\t$importeiva = $p[0][\"importe\"];\n\t\t$importe2iva = $p[0][\"importe2\"];\n\n\t\t$sql5 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'NO'\";\n\t\t$stmt = $this->dbh->prepare($sql5);\n\t\t$stmt->execute( array($_POST[\"codventa\"]));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $row;\n\t\t\t}\n\t\t\t$preciocompra = $row[\"preciocompra\"];\n\t\t\t$importe = $row[\"importe\"];\n\t\t\t$importe2 = $row[\"importe2\"];\t\t\n\n\t\t\t$sql = \" update ventas set \"\n\t\t\t.\" subtotalivasive = ?, \"\n\t\t\t.\" subtotalivanove = ?, \"\n\t\t\t.\" totalivave = ?, \"\n\t\t\t.\" totaldescuentove = ?, \"\n\t\t\t.\" totalpago= ?, \"\n\t\t\t.\" totalpago2= ?, \"\n\t\t\t.\" observaciones= ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codventa = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $subtotalivasive);\n\t\t\t$stmt->bindParam(2, $subtotalivanove);\n\t\t\t$stmt->bindParam(3, $totaliva);\n\t\t\t$stmt->bindParam(4, $totaldescuentove);\n\t\t\t$stmt->bindParam(5, $total);\n\t\t\t$stmt->bindParam(6, $total2);\n\t\t\t$stmt->bindParam(7, $observaciones);\n\t\t\t$stmt->bindParam(8, $codventa);\n\n\t\t\t$subtotalivasive= rount($importeiva,2);\n\t\t\t$subtotalivanove= rount($importe,2);\n\t\t\t$totaliva= rount($subtotalivasive*$iva,2);\n\t\t\t$tot= rount($subtotalivasive+$subtotalivanove+$totaliva,2);\n\t\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t\t$total= rount($tot-$totaldescuentove,2);\n\t\t\t$total2= rount($preciocompra,2);\nif (strip_tags(isset($_POST['observaciones']))) { $observaciones = strip_tags($_POST['observaciones']); } else { $observaciones =''; }\n\t\t\t$codventa = strip_tags($_POST[\"codventa\"]);\n\t\t\t$stmt->execute();\n\n###### AQUI DESTRUIMOS TODAS LAS VARIABLES DE SESSION QUE RECIBIMOS EN CARRITO DE VENTAS ######\n\t\t\tunset($_SESSION[\"CarritoVentas\"]);\n\n\necho \"<div class='alert alert-success'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<span class='fa fa-check-square-o'></span> LOS DETALLES FUERON AGREGADOS A LA \".$_POST[\"nombremesa\"].\", EXITOSAMENTE <a href='reportepdf?codventa=\".base64_encode($codventa).\"&tipo=\".base64_encode(\"TICKETCOMANDA\").\"' class='on-default' data-placement='left' data-toggle='tooltip' data-original-title='Imprimir Comanda' target='_black'><strong>IMPRIMIR COMANDA</strong></a>\";\necho \"</div>\";\n\necho \"<script>window.open('reportepdf?codventa=\".base64_encode($codventa).\"&tipo=\".base64_encode(\"TICKETCOMANDA\").\"', '_blank');</script>\";\nexit;\n\n\t\t}", "function contarServicios()\n\t{\n\t\treturn \"select count(*) as number\nfrom trabajadores, servicios,sucursales where servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 1 \nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}", "public function ContarRegistros()\n\t{\n$sql = \"select\n(select count(*) from productos where existencia <= stockminimo) as stockproductos,\n(select count(*) from ingredientes where CAST(cantingrediente AS DECIMAL(10,5)) <= CAST(stockminimoingrediente AS DECIMAL(10,5))) as stockingredientes,\n(select count(*) from ventas where tipopagove = 'CREDITO' AND formapagove = '' AND fechavencecredito <= '\".date(\"Y-m-d\").\"') as creditosventasvencidos,\n(select count(*) from compras where tipocompra = 'CREDITO' AND statuscompra = 'PENDIENTE' AND fechavencecredito <= '\".date(\"Y-m-d\").\"') as creditoscomprasvencidos\";\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\treturn $this->p;\n\t\t$this->dbh=null;\n\t}", "public function get_ventas_consulta($id_paciente){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n \n\t$sql=\"select*from ventas where id_paciente=?;\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$id_paciente);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function consultar_dependencia($tabla,$filtro){\n $id = new MongoDB\\BSON\\ObjectId($filtro);\n $res = $this->mongo_db->where(array('eliminado'=>false,'id_modulo_vista'=>$id))->get($tabla);\n return count($res);\n }", "function consultarEstudiantesSinPrueba(){\n $cadena_sql=$this->cadena_sql(\"estudiantesSinPrueba\",$this->codProyecto);\n $estudiantes=$this->funcionGeneral->ejecutarSQL($this->configuracion, $this->accesoGestion, $cadena_sql,\"busqueda\" );\n return $estudiantes;\n }", "function contarServiciosFinalizados()\n\t{\n\t\treturn \"select count(*) as number\nfrom trabajadores, servicios,sucursales \nwhere servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 0\nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}", "function consultarEstudiantesParaHomologacion($cod_proyecto){\n $cadena_sql = $this->sql->cadena_sql(\"consultarEstudiantesProyecto\",$cod_proyecto);\n return $resultadoEspacio = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\n }", "function listarAnalisisPorqueDet(){\n\t\t$this->procedimiento='gem.ft_analisis_porque_det_sel';\n\t\t$this->transaccion='GM_DET_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_analisis_porque','id_analisis_porque','int4');\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_analisis_porque_det','int4');\n\t\t$this->captura('id_analisis_porque','int4');\n\t\t$this->captura('solucion','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('porque','varchar');\n\t\t$this->captura('respuesta','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function listarProcesoCompraPedido(){\n\t\t$this->procedimiento='adq.f_proceso_compra_sel';\n\t\t$this->transaccion='ADQ_PROCPED_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t$this->setParametro('id_proceso_compra','id_proceso_compra','int4');\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_proceso_compra','int4');\n\t\t$this->captura('id_depto','int4');\n\t\t$this->captura('num_convocatoria','varchar');\n\t\t$this->captura('id_solicitud','int4');\n\t\t$this->captura('id_estado_wf','int4');\n\t\t$this->captura('fecha_ini_proc','date');\n\t\t$this->captura('obs_proceso','varchar');\n\t\t$this->captura('id_proceso_wf','int4');\n\t\t$this->captura('num_tramite','varchar');\n\t\t$this->captura('codigo_proceso','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('estado','varchar');\n\t\t$this->captura('num_cotizacion','varchar');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t$this->captura('desc_depto','varchar');\n\t\t$this->captura('desc_funcionario','text');\n\t\t$this->captura('desc_solicitud','varchar');\n\t\t$this->captura('desc_moneda','varchar');\n\t\t\n\t\t \n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function buscar_comprobante_venta_3($anio ,$mes ,$fech1 ,$fech2 ,$tipodocumento) {\n //CPC_TipoDocumento => F factura, B boleta\n //CPC_total => total de la FACTURA o BOLETA CPC_FechaRegistro BETWEEN '20121201' AND '20121202'\n\n $where=\"\";\n //----------\n if($anio!=\"--\" && $mes ==\"--\"){// SOLO AÑO\n $where=\"AND YEAR(CPC_FechaRegistro)='\" . $anio . \"'\";\n }\n if($anio!=\"--\" && $mes !=\"--\" ){// MES Y AÑO\n $where=\"AND YEAR(CPC_FechaRegistro)='\" . $anio . \"' AND MONTH(CPC_FechaRegistro)='\" . $mes .\"'\";\n }\n if($anio==\"--\" && $mes !=\"--\"){//MES CON AÑO ACTUAL\n $where=\"AND YEAR(CPC_FechaRegistro)=' \".date(\"Y\").\"' AND MONTH(CPC_FechaRegistro)='\" . $mes .\"'\";\n }\n\n //-----------------\n \n if($anio==\"--\" && $mes ==\"--\" && $fech1!=\"--\" && $fech2==\"--\"){//FECHA INICIAL\n $where=\"AND CPC_FechaRegistro > '\" . $fech1 . \"'\";\n }\n if($anio==\"--\" && $mes ==\"--\" && $fech1!=\"--\" && $fech2!=\"--\" ){//FECHA INICIAL Y FECHA FINAL\n $where=\"AND CPC_FechaRegistro >= '\" . $fech1 . \"' AND CPC_FechaRegistro <= '\" . $fech2 . \"'\";\n }\n \n \n //------------\n\n \n $wheretdoc= \"\";\n if($tipodocumento !=\"--\")\n $wheretdoc= \" AND CPC_TipoDocumento='\".$tipodocumento.\"' \";\n\n \n\n $sql = \" SELECT com.*,CONCAT(pe.PERSC_Nombre , ' ', pe.PERSC_ApellidoPaterno, ' ', pe.PERSC_ApellidoMaterno) as nombre , MONED_Simbolo from cji_comprobante com\n inner join cji_cliente cl on cl.CLIP_Codigo = com.CLIP_Codigo\n inner join cji_persona pe on pe.PERSP_Codigo = cl.PERSP_Codigo\n inner JOIN cji_moneda m ON m.MONED_Codigo=com.MONED_Codigo \n WHERE CPC_TipoOperacion='V' \".$wheretdoc.$where.\"\n \n UNION \n SELECT com.* ,EMPRC_RazonSocial as nombre ,MONED_Simbolo from cji_comprobante com\n inner join cji_cliente cl on cl.CLIP_Codigo = com.CLIP_Codigo\n inner join cji_empresa es on es.EMPRP_Codigo = cl.EMPRP_Codigo\n inner JOIN cji_moneda m ON m.MONED_Codigo = com.MONED_Codigo \n WHERE CPC_TipoOperacion='V' \".$wheretdoc.$where.\"\";\n\n //echo $sql;\n $query = $this->db->query($sql);\n if ($query->num_rows > 0) {\n foreach ($query->result() as $fila) {\n $data[] = $fila;\n }\n return $data;\n }\n return array();\n }", "public function listar_mis_pedidos() {\n \n try {\n $sql = \"\n select \n c.nro_documento,\n c.nombre,\n c.correo,\n c.telefono_celular,\n p.direccion_entrega,\n p.referencia_entrega,\n p.observacion,\n d.descripcion,\n c.cod_distrito,\n f.descripcion,\n p.importe_total,\n p.fecha_pedido,\n p.nro_pedido,\n p.cantidad_productos,\n p.estado,\n p.id_pedido\n from \n cliente c inner join pedido p\n on\n c.id_cliente = p.id_cliente inner join distrito d\n on\n c.cod_distrito = d.cod_distrito inner join forma_pago f\n on\n f.id_forma_pago = p.id_forma_pago\n where\n p.estado = 'PENDIENTE' and c.id_cliente = '$_SESSION[cliente_id]'; \n \";\n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n return $resultado;\n } catch (Exception $exc) {\n throw $exc;\n }\n }", "public function ConsultarAsistenciaDiarias()\n {\n try {\n $datos = $_REQUEST;\n $filtros = array_filter($datos);\n $dbm = new DbmControlescolar($this->get(\"db_manager\")->getEntityManager());\n if($filtros['permiso'] != 1) {\n $id = $dbm->BuscarIProfesorTitular($filtros['grupoid']);\n if(!$id) {\n return new View(\"No se han encontrado profesores en el grupo consultado\", Response::HTTP_PARTIAL_CONTENT);\n }\n\n $usuario = $dbm->getRepositorioById('Usuario', 'profesorid', $id[0][\"profesorid\"]);\n if(!$usuario) {\n return new View(\"Se requiere tener un permiso especial o ser el profesor titular para poder consultar\", Response::HTTP_PARTIAL_CONTENT);\n \n }\n if($usuario->getUsuarioid() != $filtros['usuarioid']) {\n return new View(\"Se requiere tener un permiso especial o ser el profesor titular para poder consultar\", Response::HTTP_PARTIAL_CONTENT);\n }\n } \n $respuesta = $this->asistenciasDiarias($filtros, $dbm);\n if($respuesta['error']) {\n return new View($respuesta['mensaje'], Response::HTTP_PARTIAL_CONTENT);\n }\n return new View($respuesta, Response::HTTP_OK);\n } catch (\\Exception $e) {\n return new View($e->getMessage(), Response::HTTP_BAD_REQUEST);\n }\n }", "public function anularTodosDetallesFactura($idPagoFacturaCaja){\n\t\t\n\t\t\t\t\n\t\t$query = \"UPDATE tb_pago_factura_caja_detalle SET estado = 'Anulado' WHERE idPagoFacturaCaja = '$idPagoFacturaCaja'\";\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n\t\t$res = $conexion->query($query);\t\n\t\t\n\t\t//retornar los productos al inventario \n\t\t$query2 = \"SELECT idTipoDetalle, cantidad, idSucursal \n\t\t\t\t\tFROM tb_pago_factura_caja_detalle \n\t\t\t\t WHERE tipoDetalle = 'Producto' AND idPagoFacturaCaja = '$idPagoFacturaCaja' \";\n\t\t\n\t\tif($res2 = $conexion->query($query2)){\n\t\t\t\n\t\t\twhile ($filas = $res2->fetch_assoc()) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t$cantidadAumentar = \t$filas['cantidad'];\t\n\t\t\t\t$id \t\t\t\t=\t$filas['idTipoDetalle'];\n\t\t\t\t$sucursal\t\t\t= \t$filas['idSucursal'];\n\t\t\t\t\n\t\t\t\t$query3 = \"UPDATE tb_productos_sucursal SET cantidad = cantidad + '$cantidadAumentar' \n\t\t\t\t\t\t\tWHERE idSucursal = '$sucursal' AND idProducto = '$id'\";\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t$conexion->query($query3);\n\t\t\t\t\t\n\t\t\t}//fin while\n\t\t\t\n\t\t\t/* liberar el conjunto de resultados */\n\t\t\t$res2->free();\n\t\t\t\n\t\t}//fin if\n\t\t\n\t}", "public function RelatorioContasPagarPorFornecedor($where,$codigo){\n\t\t\t\t\n\t\t$dba = $this->dba;\n\n\t\t$vet = array();\n\n\n\t\t$sql =\"SELECT \n\t\t\t\td.emissao,\n\t\t\t\td.vencimento,\n\t\t\t\td.numero,\n\t\t\t\tsum(d.valordoc) as valordoc,\n\t\t\t\td.numero_nota,\n\t\t\t\tf.codigo,\n\t\t\t\tf.nome,\n\t\t\t\td.parcial1,\n\t\t\t\td.parcial2,\n\t\t\t\td.parcial3,\n\t\t\t\td.parcial4,\n\t\t\t\td.parcial5,\n\t\t\t\td.data_parcial1,\n\t\t\t\td.data_parcial2,\n\t\t\t\td.data_parcial3,\n\t\t\t\td.data_parcial4,\n\t\t\t\td.data_parcial5\n\t\t\tFROM\n\t\t\t\tduplic d\n\t\t\t\t\tinner join\n\t\t\t\tfornecedores f ON (f.codigo = d.cedente)\n\t\t\t\t\".$where.\"\n\t\t\t\t\tand f.codigo = \".$codigo.\"\n\t\t\tgroup by d.numero , d.numero_nota , d.emissao , f.codigo , f.nome , d.tipo , d.vencimento , d.parcial1 , d.parcial2 , d.parcial3 , d.parcial4 , d.parcial5 , d.data_parcial1 , d.data_parcial2 , d.data_parcial3 , d.data_parcial4 , d.data_parcial5\";\n\t\t\n\t\t$res = $dba->query($sql);\n\n\t\t$num = $dba->rows($res); \n\n\t\t$i = 0;\n\t\t\t\n\t\twhile($dup = ibase_fetch_object($res)){\t\t\n\t\t\t\n\t\t\t$numero = $dup->NUMERO;\n\t\t\t$valordoc = $dup->VALORDOC;\n\t\t\t$numnota = $dup->NUMERO_NOTA;\n\t\t\t$emissao\t = $dup->EMISSAO;\n\t\t\t$codfor = $dup->CODIGO;\n\t\t\t$nomfor = $dup->NOME;\t\t\t\t\t\n\t\t\t$vencimento = $dup->VENCIMENTO;\n\t\t\t$parcial1 = $dup->PARCIAL1;\n\t\t\t$parcial2 = $dup->PARCIAL2;\n\t\t\t$parcial3 = $dup->PARCIAL3;\n\t\t\t$parcial4 = $dup->PARCIAL4;\n\t\t\t$parcial5 = $dup->PARCIAL5;\n\t\t\t$data_parcial1 = $dup->DATA_PARCIAL1;\n\t\t\t$data_parcial2 = $dup->DATA_PARCIAL2;\n\t\t\t$data_parcial3 = $dup->DATA_PARCIAL3;\n\t\t\t$data_parcial4 = $dup->DATA_PARCIAL4;\n\t\t\t$data_parcial5 = $dup->DATA_PARCIAL5;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$duplic = new Duplic();\t\t\t\n\n\t\t\t$duplic->setNumero($numero);\n\t\t\t$duplic->setValorDoc($valordoc);\n\t\t\t$duplic->setNumeroNota($numnota);\n\t\t\t$duplic->setCodFornecedor($codfor);\n\t\t\t$duplic->setNomeFornevedor($nomfor);\n\t\t\t$duplic->setEmissao($emissao);\n\t\t\t$duplic->setVencimento($vencimento);\n\t\t\t$duplic->setParcial1($parcial1);\n\t\t\t$duplic->setParcial2($parcial2);\n\t\t\t$duplic->setParcial3($parcial3);\n\t\t\t$duplic->setParcial4($parcial4);\n\t\t\t$duplic->setParcial5($parcial5);\n\t\t\t$duplic->setDataParcial1($data_parcial1);\n\t\t\t$duplic->setDataParcial2($data_parcial2);\n\t\t\t$duplic->setDataParcial3($data_parcial3);\n\t\t\t$duplic->setDataParcial4($data_parcial4);\n\t\t\t$duplic->setDataParcial5($data_parcial5);\t\n\t\t\t\n\t\t\t$vet[$i++] = $duplic;\n\n\t\t}\n\n\t\treturn $vet;\n\n\t}", "function getMisPedidos($db, $idusuario) {\n $idusuario = mysqli_real_escape_string($db, $idusuario);\n //Trae todos los pedidos de un usuario\n $query = \"SELECT p.id, p.fechayhora, p.monto, u.fullname,\n (select COUNT(c.clavecarrito) FROM carrito c WHERE c.idpedido = p.id) as items, p.cumplido \n FROM pedidos p INNER JOIN usuarios u ON p.idusuario=u.id where p.idusuario=\".$idusuario.\" \n ORDER BY p.fechayhora DESC\";\n\n return mysqli_query($db, $query);\n}", "function listarPersonalAlmacenDisponible($conexion){\n\ttry{\n\t\t$consulta = \"SELECT PID FROM PERSONAL WHERE DEPARTAMENTO='Almacen' AND ESTADO='Libre' ORDER BY PID\"; \n \t$stmt = $conexion->query($consulta);\n\t\treturn $stmt;\n\t}catch(PDOException $e) {\n\t\treturn $e->getMessage();\n }\n}", "public function get_datos_factura($n_venta_cf,$id_paciente_cf){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n\t$sql=\"select producto from detalle_ventas where numero_venta=? and id_paciente=? order by id_detalle_ventas ASC;\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$n_venta_cf);\n $sql->bindValue(2,$id_paciente_cf);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function BusquedaDetallesVentas()\n\t{\n self::SetNames();\n\n if ($_SESSION['acceso'] == \"administrador\") {\n\n\tif ($_GET['tipobusquedad'] == \"1\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria WHERE ventas.codventa = ? ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"codventa\"]));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS CON ESTE N&deg; DE FACTURA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusquedad'] == \"2\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, cajas.nrocaja, cajas.nombrecaja FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE ventas.codcaja = ? ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcaja']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA CAJA SELECCIONADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusquedad'] == \"3\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, cajas.nrocaja, cajas.nombrecaja FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') = ? ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(date(\"Y-m-d\",strtotime($_GET['fecha']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA FECHA INGRESADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\t\t } \n\n ################# AQUI BUSCAMOS POR CAJEROS Y DISTRIBUIDOR ################\n\n\t } else {\n\n\n\t\t \tif ($_GET['tipobusquedad'] == \"1\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria WHERE ventas.idventa = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"codventa\"]));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS CON ESTE N&deg; DE FACTURA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusquedad'] == \"2\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, cajas.nrocaja, cajas.nombrecaja FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE ventas.codcaja = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcaja']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA CAJA SELECCIONADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusquedad'] == \"3\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, cajas.nrocaja, cajas.nombrecaja FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(date(\"Y-m-d\",strtotime($_GET['fecha']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA FECHA INGRESADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\t\t }\n\t }\n}", "public function ConsultarDetallePedidos($codigo)\r\n {\r\n $objetoBD = new Conexion();\r\n $objetoBD->conectar();\r\n $mysqli = $objetoBD->cadenaconexion();\r\n\r\n $consulta = \"SELECT productos.pro_id, pro_descripcion, pro_precio, dep_cantidad, dep_subtotal FROM productos, detalle_pedido WHERE\r\n productos.pro_id=detalle_pedido.pro_id AND ped_id=\".$codigo;\r\n $resultado = $mysqli->query($consulta);\r\n return $resultado;\r\n }", "public function readPedidos(){\n $sql='SELECT IdEncabezado, u.Nombre, u.Apellido, Fecha, TipoEstado \n FROM encabezadopedidos en INNER JOIN usuarios u USING (IdUsuario) \n INNER JOIN estadopedidos es USING(IdEstadoPedido) ORDER by IdEncabezado ASC ';\n $params=array(null);\n return Database::getRows($sql, $params);\n }", "public function MesasPorId()\n{\n\tself::SetNames();\n\t$sql = \" select salas.codsala, salas.nombresala, salas.salacreada, mesas.codmesa, mesas.nombremesa, mesas.mesacreada, mesas.statusmesa FROM mesas INNER JOIN salas ON salas.codsala = mesas.codsala where mesas.codmesa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codmesa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function obtenerDatosFact($ids_Ventas, $rfc, $link, $verificarBoleta)\n{\n //$ids_Ventas=[8];\n if ($rfc == 'XAXX010101000') {\n $complemento = '0';\n $metpags = \"PUE\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n\n $formPago = \"99\";\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n } else {\n $ArrayIdsVentas = array();\n $ArrayIdsVentas = array_merge($ArrayIdsVentas, $ids_Ventas);\n $busqVentas = implode(',', $ArrayIdsVentas);\n $sql = \"SELECT DISTINCT COUNT(vtas.id) AS totalVtas, pgosvta.idFormaPago, metpgos.clave FROM ventas vtas\n INNER JOIN pagosventas pgosvta ON vtas.id= pgosvta.idVenta\n INNER JOIN sat_formapago metpgos ON metpgos.id= pgosvta.idFormaPago\n WHERE vtas.id IN ($busqVentas) GROUP BY pgosvta.idFormaPago\";\n //print_r($sql);\n $resultXpagos = mysqli_query($link, $sql) or die(json_encode(array('estatus' => '3', 'mensaje' => \"Error al Buscar el Metodo de Pago, notifica a tu Administrador\", 'idsErroneos' => mysqli_error($link))));\n $ventaXBoleta = \"<div class='text-danger'>Total de Ventas Pagadas Con Boleta:</div>\";\n $contarxBoleta = 0;\n $erroresVentas = array();\n $total_ventas = mysqli_num_rows($resultXpagos);\n $formaUnica = 0;\n $formaAnterior = \"\";\n $complemento = 0;\n if ($total_ventas == 1) {\n $xpags = mysqli_fetch_array($resultXpagos);\n if ($xpags['idFormaPago'] == '7') {\n $complemento = 1;\n $metpags = \"PPD\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n $formaUnica = 1;\n }\n //----------------------pago de boletas---------------------------------\n else if ($xpags[\"idFormaPago\"] == \"6\" and $verificarBoleta == '1') {\n $ventaXBoleta .= $xpags[\"totalVtas\"];\n $contarxBoleta++;\n } else if ($xpags['idFormaPago'] == '7') {\n $complemento = 1;\n $metpags = \"PPD\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n } else {\n $metpags = \"PUE\";\n $formPago = $xpags['clave'];\n $descripcionMetPgo = \"Pago en una sola exhibición\";\n $formaUnica = 1;\n }\n } else {\n while ($dat = mysqli_fetch_array($resultXpagos)) {\n\n if ($complemento == 0) {\n //----------------------pago de boletas---------------------------------\n if ($dat[\"idFormaPago\"] == \"6\" and $verificarBoleta == '1') {\n $ventaXBoleta .= $dat[\"totalVtas\"];\n $contarxBoleta++;\n } else {\n if ($dat['idFormaPago'] == '7') {\n $complemento = 1;\n $metpags = \"PPD\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n }\n }\n }\n } //cierra While\n\n }\n\n if ($contarxBoleta > 0) {\n array_push($erroresVentas, $ventaXBoleta);\n $resp = array('estatus' => '0', 'mensaje' => 'Ventas Pagadas con Boletas NO se pueden facturar.', 'idsErroneos' => json_encode($erroresVentas));\n return $resp;\n } else {\n if ($formaUnica == 1) {\n\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n } else {\n if ($complemento == 1) {\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n } else {\n $metpags = \"PUE\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en una sola exhibición\";\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n }\n }\n }\n }\n}", "function consultarListadoPesadasRecolector($idOferta, $cedula)\n{\n\t$sql = \"SELECT pesadas.fecha, pesadas.kilos, ofertas.valorpago as valorkilo, (pesadas.kilos \t* ofertas.valorpago ) as valorpesada \n\t\t\tFROM pesadas JOIN ofertas ON pesadas.idoferta = ofertas.id \n\t\t\tWHERE pesadas.idoferta = {$idOferta} AND pesadas.idrecolector = (SELECT usuarios.id FROM usuarios WHERE usuarios.cedula = '{$cedula}')\";\n\tleerRegistro($sql);\n}", "public function BuscarIngredientesVendidos() \n{\n\tself::SetNames();\n\t$sql = \"SELECT productos.codproducto, productos.producto, productos.codcategoria, productos.precioventa, productos.existencia, ingredientes.costoingrediente, ingredientes.codingrediente, ingredientes.nomingrediente, ingredientes.cantingrediente, productosvsingredientes.cantracion, detalleventas.cantventa, SUM(productosvsingredientes.cantracion*detalleventas.cantventa) as cantidades FROM productos INNER JOIN detalleventas ON productos.codproducto=detalleventas.codproducto INNER JOIN productosvsingredientes ON productos.codproducto=productosvsingredientes.codproducto LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente WHERE DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') >= ? AND DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') <= ? GROUP BY ingredientes.codingrediente\";\n\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"<div class='alert alert-danger'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN INGREDIENTES FACTURADOS PARA EL RANGO DE FECHAS SELECCIONADAS</center>\";\n\t\techo \"</div>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function listarFactura(){\r\n\t\t$this->procedimiento='tesor.ft_factura_sel';\r\n\t\t$this->transaccion='TSR_FAC_SEL';\r\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\r\n\t\t\t\t\r\n\t\t//Definicion de la lista del resultado del query\r\n\t\t$this->captura('id_factura','int4');\r\n\t\t$this->captura('estado_reg','varchar');\r\n\t\t$this->captura('nro_factura','int4');\r\n\t\t$this->captura('nombre_emisor','varchar');\t\t\r\n\t\t$this->captura('domicilio_emisor','varchar');\r\n\t\t$this->captura('nit_emisor','int4');\r\n\t\t$this->captura('nombre_cliente','varchar');\t\t\r\n\t\t$this->captura('domicilio_cliente','varchar');\r\n\t\t$this->captura('nit_cliente','int4');\r\n\t\t$this->captura('fecha_emision','date');\r\n\t\t\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\t\t\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "function listar($objeto){\n\t\t$condicion.=(!empty($objeto['id']))?' AND r.id='.$objeto['id']:'';\n\t// Filtra por los insumos preparados\n\t\t$condicion.=(!empty($objeto['insumos_preparados']))?' AND ids_insumos_preparados!=\\'\\'':'';\n\t// Filtra por tipo\n\t\t$condicion.=(!empty($objeto['tipo'])) ? ' AND p.tipo_producto = '.$objeto['tipo'] : '';\n\t// Filtros\n\t\t$condicion.=(!empty($objeto['filtro']) && $objeto['filtro'] == 'insumos_preparados_formula') ? ' AND (p.tipo_producto = 8 OR p.tipo_producto = 9) ' : '';\n\n\n\t// Ordena la consulta si existe\n\t\t$condicion.=(!empty($objeto['orden']))?' ORDER BY '.$objeto['orden']:'';\n\n\t\t$sql = \"SELECT\n\t\t\t\t\tp.id AS idProducto, p.nombre, p.costo_servicio AS costo,\n\t\t\t\t\tp.id_unidad_compra AS idunidadCompra, p.id_unidad_venta AS idunidad, p.factor as multiplo,\n\t\t\t\t\t(SELECT\n\t\t\t\t\t\tnombre\n\t\t\t\t\tFROM\n\t\t\t\t\t\tapp_unidades_medida uni\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tuni.id=p.id_unidad_venta) AS unidad, u.factor, p.tipo_producto,\n\t\t\t\t\tr.ids_insumos_preparados AS insumos_preparados, r.ids_insumos AS insumos,\n\t\t\t\t\tr.preparacion, r.ganancia, ROUND(p.precio, 2) AS precio, p.codigo, p.minimos\n\t\t\t\tFROM\n\t\t\t\t\tapp_productos p\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tapp_campos_foodware f\n\t\t\t\t\tON\n\t\t\t\t\t\tp.id = f.id_producto\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tcom_recetas r\n\t\t\t\t\tON\n\t\t\t\t\t\tr.id = p.id\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tapp_unidades_medida u\n\t\t\t\t\tON\n\t\t\t\t\t\tu.id = p.id_unidad_compra\n\t\t\t\tWHERE\n\t\t\t\t\tp.status = 1 AND (p.tipo_producto = 8 OR p.tipo_producto = 9)\";\n\n\t\treturn $this->queryArray($sql);\n\t}", "public function PedidosDelDia()\r\n {\r\n $objetoBD = new Conexion();\r\n $objetoBD->conectar();\r\n $mysqli = $objetoBD->cadenaconexion();\r\n \r\n $consulta = \"SELECT ped_id, clie_nombres, clie_apellidos, ped_hora_entrega, ped_direccion, ped_estado\r\n FROM pedidos, clientes WHERE clientes.clie_id=pedidos.clie_id AND ped_estado='PENDIENTE' AND ped_fecha_entrega=CURDATE() GROUP BY ped_id\";\r\n $resultado = $mysqli->query($consulta);\r\n return $resultado;\r\n }", "function validaFactAnt($ids_Ventas, $link)\n{\n $userReg = $_SESSION['LZFident'];\n //vaciar ids en un array\n // $ids_Ventas=[1,6,34,8];\n $ArrayIdsVentas = array();\n $ArrayIdsVentas = array_merge($ArrayIdsVentas, $ids_Ventas);\n $resp = array(); //array para retornar\n\n $busqVentas = implode(',', $ArrayIdsVentas);\n //VALIDAR QUE EXISTA LA VENTA Y ESTE CERRADA\n $idsDefectuosos = array();\n $idAnt = '';\n for ($i = 0; $i <= count($ArrayIdsVentas) - 1; $i++) {\n $idVenta = $ArrayIdsVentas[$i];\n $sql = \"SELECT\n COUNT( factgencancel.id ) AS factCanceladas,\n COUNT( factgen.id ) AS totalFact\nFROM\n vtasfact vf\n INNER JOIN facturasgeneradas factgen ON factgen.id = vf.idFactgen\n LEFT JOIN facturasgeneradas factgencancel ON factgencancel.id = vf.idFactgen\n AND factgencancel.idCancelada != ''\n WHERE vf.idVenta='$idVenta'\";\n\n $result = mysqli_query($link, $sql) or die(json_encode(array('estatus' => '3', 'mensaje' => 'Error al consultar la Facturas de la venta, notifica a tu Administrador', 'idsErroneos' => mysqli_error($link))));\n $array_resultado = mysqli_fetch_array($result);\n $factCanceladas = $array_resultado['factCanceladas'];\n $totalFact = $array_resultado['totalFact'];\n //Se verifica que el total de cancelaciones sea igual al total de las facturas emitidas\n if ($totalFact > $factCanceladas) {\n array_push($idsDefectuosos, \"#\" . $idVenta);\n }\n }\n if (count($idsDefectuosos) > 0) {\n $resp = array('estatus' => '0', 'mensaje' => 'Verifica que las ventas no tengan facturas ACTIVAS.', 'idsErroneos' => json_encode($idsDefectuosos));\n return $resp;\n } else {\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de los ticket(s) de venta(s) correcta', 'idsErroneos' => '');\n return $resp;\n } //no permitidas\n}", "function validarcrear_veredas($coddpt, $codmun, $codver){\n $sql = \"SELECT count(cod_vecor) as cont from veredas where cod_dpto='$coddpt' and cod_muni = '$codmun' and cod_vecor= '$codver'\";\n //echo \"<pre>$sql</pre>\";\n $this->consultar($sql, __FUNCTION__);\n }", "function verifica_filhos($pdo, $id_processo_pai) {\r\n global $array_filhos;\r\n $sql_apenso = \"SELECT * FROM apenso WHERE id_processo_pai = '{$id_processo_pai}'\";\r\n $query = $pdo->prepare($sql_apenso);\r\n if ($query->execute()) {\r\n for ($i = 0; $dados = $query->fetch(); $i++) {\r\n array_push($array_filhos, $dados['id_processo_filho']);\r\n verifica_filhos($pdo, $dados['id_processo_filho']);\r\n }\r\n }\r\n}", "public function listarPacientes(){\n\t\t\t$list= oci_parse($conn,\"BEGIN Nombre_paquete.NOmbre.funvion(Aqui los values) END \");\n\t\t\t// $list= oci_parse($conn,\"SELECT * FROM CITAS\");\n\t\t\toci_execute($list);\n\t\t}", "public function CreditosPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT clientes.codcliente, clientes.cedcliente, clientes.nomcliente, clientes.tlfcliente, clientes.direccliente, clientes.emailcliente, ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.totalpago2, ventas.tipopagove, ventas.formapagove, ventas.fechaventa, ventas.fechavencecredito, ventas.statusventa, usuarios.nombres, cajas.nrocaja, abonoscreditos.codventa as cod, abonoscreditos.fechaabono, SUM(montoabono) AS abonototal FROM (ventas LEFT JOIN clientes ON clientes.codcliente = ventas.codcliente) LEFT JOIN abonoscreditos ON ventas.codventa = abonoscreditos.codventa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN usuarios ON ventas.codigo = usuarios.codigo WHERE ventas.codventa =? GROUP BY cod\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function consult(){\n\t\t\t$para = array(\"1\"=>1);\n\t\t\tif($this->tipodocum_id_tipodocum != null){\n\t\t\t\t$para[\"tipodocum_id_tipodocum\"] = $this->tipodocum_id_tipodocum;\n\t\t\t}\n\t\t\tif($this->documento != null){\n\t\t\t\t$para[\"documento\"] = $this->documento;\n\t\t\t}\n\t\t\t\n\t\t\t$query = $this->db->get_where(\"paciente\",$para);\n\t\t\treturn $query->result();\n\t\t}", "function listarReenvioFactura(){\n\t\t$this->procedimiento='vef.ft_reenvio_factura_sel';\n\t\t$this->transaccion='VF_REFACOR_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_venta', 'id_venta', 'int4');\n\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_reenvio_factura','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('id_venta','int4');\n\t\t$this->captura('correo','varchar');\n\t\t$this->captura('correo_copia','varchar');\n\t\t$this->captura('observacion','text');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('estado_envio_correo','int4');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function _ConsultarResultadosPruebasIMM1($tipo_prueba, $id_cliente) //consulta el último biotest para imm se necesitan 16 campos.\n\t{\n\t\t$query='\n\t\t\tselect * from sg_pruebas \n\t\t\twhere Tipo_Prueba=\"'.$tipo_prueba.'\" \n\t\t\tand id_cliente=\"'.$id_cliente.'\" order by fecha and id asc limit 16\n\n\t\t';\n\t\t$con=Conectar::_con();\n\t\t$result=$con->query($query) or die(\"Error en: $query \".mysqli_error($query));\n\t\treturn $result;\n\t}", "public function BuscarVentasFechas() \n\t{\n\t\tself::SetNames();\n\t\t$sql =\"SELECT detalleventas.codventa, cajas.nrocaja, ventas.idventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.totalpago2, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, SUM(detalleventas.cantventa) as articulos FROM (detalleventas LEFT JOIN ventas ON detalleventas.codventa=ventas.codventa) \n\t\tLEFT JOIN cajas ON cajas.codcaja=ventas.codcaja LEFT JOIN clientes ON ventas.codcliente=clientes.codcliente WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') >= ? AND DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') <= ? GROUP BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\n\t\t\techo \"<div class='alert alert-danger'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN VENTAS DE PRODUCTOS PARA EL RANGO DE FECHAS SELECCIONADAS</center>\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[]=$row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "function voirDerniereCommandeAvecFacture(){\n\t$conditions = array();\n\t$order = array();\n\tarray_push($order, array('nameChamps'=>'idFacture','sens'=>'desc'));\n\tarray_push($conditions, array('nameChamps'=>'idFacture','type'=>'is not null','name'=>'','value'=>''));\n\t$req = new myQueryClass('commande',$conditions,$order,'','limit 1');\n\t$r = $req->myQuerySelect();\n\treturn $r[0];\n}", "private function listarParticipantePeloCodigo(){\n echo \"\\nDigite o código para pesquisa: \";\n $codigo = rtrim(fgets(STDIN));\n print_r($this->participantePDO->findById($codigo));\n }", "function getPedidos($db) {\n //Trae todos los pedidos\n $query = \"SELECT p.id, p.idusuario, p.fechayhora, p.monto, \n (select COUNT(c.clavecarrito) FROM carrito c WHERE c.idpedido = p.id) as items, \n u.fullname, p.cumplido FROM pedidos p INNER JOIN usuarios u ON p.idusuario=u.id \n ORDER BY p.fechayhora DESC\";\n\n return mysqli_query($db, $query);\n}", "public function PedidosDelDia2()\r\n {\r\n $objetoBD = new Conexion();\r\n $objetoBD->conectar();\r\n $mysqli = $objetoBD->cadenaconexion();\r\n \r\n $consulta = \"SELECT ped_id, clie_nombres, clie_apellidos, ped_hora_entrega, ped_direccion, ped_estado\r\n FROM pedidos, clientes WHERE clientes.clie_id=pedidos.clie_id AND ped_fecha_entrega=CURDATE() GROUP BY ped_id\";\r\n $resultado = $mysqli->query($consulta);\r\n return $resultado;\r\n }", "function consultarFacultades() {\r\n $cadena_sql=$this->sql->cadena_sql(\"datos_facultades\",\"\");\r\n $resultado=$this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql,\"busqueda\");\r\n return $resultado;\r\n }", "function obtener_facultades (){\n \n //$nombre_usuario=toba::usuario()->get_nombre();\n //$sql=\"SELECT t_s.sigla FROM sede t_s, administrador t_a WHERE t_a.nombre_usuario=$nombre_usuario AND t_s.id_sede=t_a.id_sede\";\n //$sql=\"SELECT t_ua.sigla, t_ua.descripcion FROM unidad_academica t_ua, sede t_s JOIN administrador t_a ON (t_a.nombre_usuario=$nombre_usuario) JOIN (t_a.id_sede=t_s.id_sede) WHERE t_s.sigla=t_ua.id_sede\";\n $sql=\"SELECT sigla, descripcion FROM unidad_academica WHERE sigla <> 'RECT'\";\n return toba::db('gestion_aulas')->consultar($sql);\n \n }", "public function pesquisa()\n {\n $query = \"SELECT * FROM noticia WHERE titulo LIKE :titulo\";\n $stmt = $this->db->prepare($query);\n $stmt->bindValue(\":titulo\", $this->titulo.\"%\");\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function hospitalizacionesPendientes(){\n\n\t\t$resultado = array();\n\t\t\n\t\t$query = \"SELECT count(H.idHospitalizacion) as cantidadHospitalizaciones\n\t\t\t\t\t\tFROM tb_hospitalizacion AS H \n\t\t\t\t\t\tINNER JOIN tb_hospitalizacionAlta AS HA ON HA.idHospitalizacion = H.idHospitalizacion\n \t\t\t\tWHERE Not H.idHospitalizacion IN (SELECT idTipoDetalle FROM tb_pago_factura_caja_detalle WHERE tipoDetalle = 'Hospitalizacion' AND estado = 'Activo' )\";\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n\t\tif($res = $conexion->query($query)){\n \n /* obtener un array asociativo */\n while ($filas = $res->fetch_assoc()) {\n $resultado = $filas;\n }\n \n /* liberar el conjunto de resultados */\n $res->free();\n \n }\n\n return $resultado['cantidadHospitalizaciones'];\t\t\n\n\n\t\t\n\t}", "public function get_datos_factura_paciente($id_paciente){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n\t$sql=\"select *from pacientes where id_paciente=?\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$id_paciente);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function get_datos_factura_venta($n_venta,$id_paciente){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n\t$sql=\"select *from ventas where numero_venta=? and id_paciente=?\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$n_venta);\n $sql->bindValue(2,$id_paciente);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function buscarPareceresProjetoParaImpressao($where = array(), $order = array(), $tamanho = -1, $inicio = -1)\n {\n $slct = $this->select();\n\n $slct->setIntegrityCheck(false);\n\n $slct->from(\n array('p' => $this->_name),\n array('p.IdPRONAC',\n '(p.AnoProjeto + p.Sequencial) AS PRONAC',\n 'p.NomeProjeto',\n 'dbo.fnFormataProcesso(p.idPronac) as Processo')\n );\n\n $slct->joinInner(\n array('i' => 'Interessado'),\n \"p.CgcCPf = i.CgcCPf\",\n array('i.Nome AS Proponente')\n );\n\n $slct->joinInner(\n array('a' => 'tbAnaliseDeConteudo'),\n \"p.IdPRONAC = a.idPronac\",\n array(\"a.idProduto\",\n \"Lei8313\" => new Zend_Db_Expr(\"CASE WHEN Lei8313 = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"Artigo3\" => new Zend_Db_Expr(\"CASE WHEN Artigo3 = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"IncisoArtigo3\" => new Zend_Db_Expr(\"CASE WHEN IncisoArtigo3 = 1 THEN 'I' WHEN IncisoArtigo3 = 2 THEN 'II' WHEN IncisoArtigo3 = 3 THEN 'III' WHEN IncisoArtigo3 = 4 THEN 'IV' WHEN IncisoArtigo3 = 5 THEN 'V' END\"),\n \"a.AlineaArtigo3\",\n \"Artigo18\" => new Zend_Db_Expr(\"CASE WHEN Artigo18 = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"a.AlineaArtigo18\",\n \"Artigo26\" => new Zend_Db_Expr(\"CASE WHEN Artigo26 = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"Lei5761\" => new Zend_Db_Expr(\"CASE WHEN Lei5761 = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"Artigo27\" => new Zend_Db_Expr(\"CASE WHEN Artigo27 = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"IncisoArtigo27_I\" => new Zend_Db_Expr(\"CASE WHEN IncisoArtigo27_I = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"IncisoArtigo27_II\" => new Zend_Db_Expr(\"CASE WHEN IncisoArtigo27_II = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"IncisoArtigo27_III\" => new Zend_Db_Expr(\"CASE WHEN IncisoArtigo27_III = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"IncisoArtigo27_IV\" => new Zend_Db_Expr(\"CASE WHEN IncisoArtigo27_IV = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"TipoParecer\" => new Zend_Db_Expr(\"CASE WHEN TipoParecer = 1 THEN 'Aprova��o' WHEN TipoParecer = 2 THEN 'Complementa��o' WHEN TipoParecer = 4 THEN 'Redu��o' END\"),\n \"ParecerFavoravel\" => new Zend_Db_Expr(\"CASE WHEN ParecerFavoravel = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"a.ParecerDeConteudo\",\n \"sac.dbo.fnNomeParecerista(a.idUsuario) AS Parecerista\",\n )\n );\n\n\n $slct->joinInner(\n array('pr' => 'Produto'),\n \"a.idProduto = pr.Codigo\",\n array('pr.Descricao AS Produto')\n );\n\n $slct->joinInner(\n array('dp' => 'tbDistribuirParecer'),\n \"dp.idPronac = a.idPronac AND dp.idProduto = a.idProduto\",\n array(new Zend_Db_Expr('CONVERT(CHAR(23), dp.DtDevolucao, 120) AS DtDevolucao'),\n new Zend_Db_Expr('CONVERT(CHAR(23), dp.DtRetorno, 120) AS DtRetorno', 'dp.idOrgao'))\n );\n\n $slct->joinLeft(\n array('u' => 'Usuarios'),\n \"dp.idusuario = u.usu_codigo\",\n array('u.usu_nome AS Coordenador',\n 'u.usu_identificacao AS cpfCoordenador'),\n 'TABELAS.dbo'\n );\n\n $slct->joinInner(\n array('b' => 'Nomes'),\n \"dp.idAgenteParecerista = b.idAgente\",\n array(),\n $this->getSchema('agentes')\n );\n\n $slct->joinInner(\n array('h' => 'Agentes'),\n \"h.idAgente = b.idAgente\",\n array('h.CNPJCPF as cpfParecerista'),\n $this->getSchema('agentes')\n );\n\n // adicionando clausulas where\n foreach ($where as $coluna => $valor) {\n $slct->where($coluna, $valor);\n }\n\n return $this->fetchAll($slct);\n }", "public function BusquedaVentas()\n\t{\n\n self::SetNames();\n\n if ($_SESSION['acceso'] == \"administrador\") {\n\n\n\tif ($_GET['tipobusqueda'] == \"1\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE ventas.codcliente = ? GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcliente']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS PARA EL CLIENTE INGRESADO !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusqueda'] == \"2\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, cajas.nombrecaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE ventas.codcaja = ? GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcaja']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA CAJA SELECCIONADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusqueda'] == \"3\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') = ? GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(date(\"Y-m-d\",strtotime($_GET['fecha']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA FECHA INGRESADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\t\t } \n\n ################# AQUI BUSCAMOS POR CAJEROS Y DISTRIBUIDOR ################\n\n\t } else {\n\n\n\t\t \tif ($_GET['tipobusqueda'] == \"1\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE ventas.codcliente = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcliente']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS PARA EL CLIENTE INGRESADO !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusqueda'] == \"2\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, cajas.nombrecaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE ventas.codcaja = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcaja']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA CAJA SELECCIONADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusqueda'] == \"3\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(date(\"Y-m-d\",strtotime($_GET['fecha']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA FECHA INGRESADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\t\t }\n\t }\n}", "function buscar_comprobante_documento($id_cuenta, $id_anexo, $id_serie, $id_numero ) {\n $sql = \"SELECT\n\t\t\t\t\t prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\t, sum(prosic_detalle_comprobante.importe_soles*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)) as importe_soles\n\t\t\t\t\t, sum(prosic_detalle_comprobante.importe_soles*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)/prosic_tipo_cambio.compra_sunat) as importe_dolares\n\t\t\t\tFROM prosic_detalle_comprobante\n\t\t\t\tINNER JOIN prosic_plan_contable ON prosic_detalle_comprobante.id_plan_contable=prosic_plan_contable.id_plan_contable\n\t\t\t\tINNER JOIN prosic_anexo ON prosic_detalle_comprobante.id_anexo = prosic_anexo.id_anexo\n\t\t\t\tINNER JOIN prosic_moneda ON prosic_detalle_comprobante.id_moneda = prosic_moneda.id_moneda\n\t\t\t\tLEFT JOIN prosic_tipo_cambio ON prosic_detalle_comprobante.fecha_doc_comprobante=prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\tWHERE 1=1 \";\n\t\t\t\tif ($id_cuenta != '')$sql.=\" AND prosic_plan_contable.cuenta_plan_contable LIKE '%\" . $id_cuenta . \"%'\";\n if ($id_anexo != '')$sql.=\" AND prosic_anexo.codigo_anexo LIKE '%\" . $id_anexo . \"%'\";\n if ($id_numero != '')$sql.=\" AND prosic_detalle_comprobante.nro_doc_comprobante LIKE '%\" . $id_numero . \"%'\";\n\t\t\t$sql.=\" group by prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\thaving importe_soles>0\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "public function BuscarMovimientosCajasFechas() \n\t{\n\t\tself::SetNames();\n\t$sql = \" SELECT * FROM movimientoscajas INNER JOIN cajas ON movimientoscajas.codcaja = cajas.codcaja WHERE movimientoscajas.codcaja = ? AND DATE_FORMAT(movimientoscajas.fechamovimientocaja,'%Y-%m-%d') >= ? AND DATE_FORMAT(movimientoscajas.fechamovimientocaja,'%Y-%m-%d') <= ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim($_GET['codcaja']));\n\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t$stmt->bindValue(3, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\n\t\t\techo \"<div class='alert alert-danger'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN MOVIMIENTOS DE ESTA CAJA PARA EL RANGO DE FECHA SELECCIONADO</center>\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[]=$row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "function consultarEstudiantes($codProyecto) {\r\n $variables=array('codProyecto'=>$codProyecto,\r\n 'ano'=> $this->ano,\r\n 'periodo'=> $this->periodo);\r\n $cadena_sql=$this->sql->cadena_sql(\"consultarEstudiantes\",$variables);\r\n $resultado=$this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql,\"busqueda\");\r\n return $resultado;\r\n }", "function consultar_opedidos(){\n \n $query_RecordsetResumo = \"SELECT * FROM CAIXACUPOM \";\n $query_RecordsetResumo .= \" WHERE TIPOATENDIMENTO = 'DELIVERY' \";\n #$query_RecordsetResumo .= \" AND STATUS_GO4YOU != '4' \";\n $query_RecordsetResumo .= \" ORDER BY CAIXACUPOM_CONTROLE DESC\";\n $query_RecordsetResumo .= \" LIMIT 20\";\n $RecordsetResumo = mysql_query($query_RecordsetResumo, $con) or die(mysql_error());\n $row_RecordsetResumo = mysql_fetch_assoc($RecordsetResumo);\n $totalRows_RecordsetResumo = mysql_num_rows($RecordsetResumo);\n \n $tempo = $_SESSION['TEMPO_PREPARACAO'];\n $pedidos = array();\n $i = 0;\n if($totalRows_RecordsetResumo != 0 ){\n do {\n \n # Checa se percisa alterar o status\n if(dif_hora(acrescenta_min($row_RecordsetResumo['DATAHORA' ], $tempo)) == 2 && $row_RecordsetResumo['STATUS_GO4YOU'] == \"0\"){\n update_status($row_RecordsetResumo['CAIXACUPOM_CONTROLE'], 2);\n }\n \n # Condicao para gerar contador de Tempo\n $status = \" excedido \";\n if($row_RecordsetResumo['STATUS_GO4YOU'] == \"0\" && dif_hora(acrescenta_min($row_RecordsetResumo['DATAHORA' ], $tempo)) != 2){\n $status = dif_hora_draw(acrescenta_min($row_RecordsetResumo['DATAHORA'], $tempo), date('Y-m-d H:i:s'));\n }\n \n $pedidos[$i]['CAIXACUPOM_CONTROLE'] = $row_RecordsetResumo['CAIXACUPOM_CONTROLE' ];\n $pedidos[$i]['DATAHORA' ] = dataMySql2BR($row_RecordsetResumo['DATAHORA' ]);\n $pedidos[$i]['TEMPO_PREVISTO' ] = acrescenta_min($row_RecordsetResumo['DATAHORA' ], $tempo);\n $pedidos[$i]['STATUS_GO4YOU' ] = trata_texto(status($row_RecordsetResumo['STATUS_GO4YOU']));\n $pedidos[$i]['TEMPO' ] = $status;\n $pedidos[$i]['STATUS_BTN' ] = $row_RecordsetResumo['STATUS_GO4YOU'] < 4 ? \n '<input type=\"submit\" value=\"'.trata_texto(status($row_RecordsetResumo['STATUS_GO4YOU'] + 1)).'\" onClick=\"update_status('.$row_RecordsetResumo['CAIXACUPOM_CONTROLE'].', '.$row_RecordsetResumo['STATUS_GO4YOU'].')\" style=\"cursor: pointer;\" />' :\n '<input type=\"button\" value=\"Entregue\" disabled />' ;\n ++$i;\n } while ($row_RecordsetResumo = mysql_fetch_assoc($RecordsetResumo)); \n }\n \n return json_encode($pedidos);\n \n}", "public function BuscarArqueosCajasFechas() \n\t{\n\t\tself::SetNames();\n\t\t$sql = \" select * FROM arqueocaja INNER JOIN cajas ON arqueocaja.codcaja = cajas.codcaja WHERE DATE_FORMAT(arqueocaja.fechaapertura,'%Y-%m-%d') >= ? AND DATE_FORMAT(arqueocaja.fechaapertura,'%Y-%m-%d') <= ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\n\t\t\techo \"<div class='alert alert-danger'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN ARQUEOS DE CAJAS PARA EL RANGO DE FECHA SELECCIONADO</center>\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[]=$row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function DetallesVentasPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codcliente as cliente, detalleventas.codproducto, detalleventas.producto, detalleventas.codcategoria, detalleventas.cantventa, detalleventas.precioventa, detalleventas.preciocompra, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, productos.ivaproducto, productos.existencia, clientes.codcliente, clientes.cedcliente, clientes.nomcliente, usuarios.nombres FROM detalleventas LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN clientes ON detalleventas.codcliente = clientes.codcliente LEFT JOIN productos ON detalleventas.codproducto = productos.codproducto LEFT JOIN usuarios ON detalleventas.codigo = usuarios.codigo WHERE detalleventas.coddetalleventa = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"coddetalleventa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function consultar_cuerpo_consulta_destinatarios($f_nom,$f_num,$offset,$limit)\n\t{\n\t\t$where=\"\";\n\t\tif($f_nom!=\"\")\n\t\t{\n\t\t\t$where.=\" AND upper(contactos.nombre) like '%\".$f_nom.\"%'\";\n\t\t}\n\t\tif($f_num!=\"\")\n\t\t{\n\t\t\t$where.=\" AND upper(contactos.tlf1) like '%\".$f_num.\"%'\";\n\t\t}\t\n\t\tif(($offset!=\"\")&&($limit!=\"\"))\t\n\t\t{\n\t\t\t$where2=\"limit '\".$limit.\"' \n offset '\".$offset.\"' \";\n\t\t}\n\t\t$this->sql=\"SELECT \n\t\t\t\t\t\t\tcontactos.id,\n\t\t\t\t\t\t\tcontactos.nombre,\n\t\t\t\t\t\t\tcontactos.tlf1\n\t\t\t\t\tFROM\n\t\t\t\t\t\t\tcontactos\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t1=1\n\t\t\t\t\t\".$where.\" \n\t\t\t\t\t\".$where2.\" \n\t\t\t\t\t;\";\n\t\t$this->rs=$this->procesar_query($this->sql);\n\t\t//calculo cuantos son...\n\t\t$this->cuantos_son($where);\n\t\treturn \t$this->rs;\t\t\n\t}", "function f_get_permisos_modulos($cod_perfil_pk){\n\t\tglobal $db;\n\t\t\n\t\t$query = \"\tselect \tspta.*,\n\t\t\t\t\t\t\tcc.cod_entidad as cod_entidad_pk,\n\t\t\t\t\t\t\tcc.fec_consulta\n\t\t\t\t\tfrom \tseg_permiso_tabla_autonoma spta left join condicion_consulta cc on (spta.cod_perfil = cc.cod_perfil)\n\t\t\t\t\twhere \tspta.cod_perfil = $cod_perfil_pk \n\t\t\t\t\tgroup \tby cod_tabla\";\n\n\t\t$cursor = $db->consultar($query);\t\t\n\t\treturn $cursor;\n\t\t\t\n\t}", "function contarReprobados($espacios_por_cursar){\n $cantidad=0;\n if(count($espacios_por_cursar)>0){\n foreach ($espacios_por_cursar as $key => $espacio) {\n if($espacio['REPROBADO']==1){\n $cantidad++;\n \t }\n }\n }\n return $cantidad; \n }", "function fmodulo(){\n\t\t$this->sentencia=\"SELECT modulo_id,modulo_nombre FROM modulo ORDER BY modulo_orden ASC\";\n\t\t$this->fsentencia();\n\t\t$this->modulo=$this->resultado;\n\t}", "function consultarNotas(){ \n $cadena_sql=$this->cadena_sql(\"notas\",$this->codProyecto);\n $estudiantes=$this->funcionGeneral->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql,\"busqueda\" );\n return $estudiantes;\n }", "function recuperaDadosAdesaoPAR($exercicio) {\n\n $sql = \"SELECT pfa.pfavalortotalprograma\n FROM par3.proadesao pfa\n INNER JOIN par3.programa prg ON prg.prgid = pfa.prgid\n INNER JOIN par3.programaorigem po ON po.pgoid = prg.pgoid\n WHERE prg.prganoreferencia = '{$exercicio}'\n AND pfa.pfaano = '{$exercicio}' AND po.pgoid = 12 \";\n \n return $this->pegaLinha($sql);\n }", "function consultarProyectos() {\n $cadena_sql = $this->sql->cadena_sql(\"consultaProyectos\",\"\");\n return $resultadoProyectos = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\n }", "function consulta_registro_ventas_imprimir($w_anio, $w_mes, $w_anexo) {\n $sql = \"SELECT\n prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.pago_comprobante\n , prosic_tipo_comprobante.sunat_tipo_comprobante\n , prosic_comprobante.serie_comprobante\n , prosic_comprobante.anio_dua_comprobante\n , prosic_comprobante.nro_comprobante\n , prosic_tipo_documento.sunat_tipo_documento\n , prosic_anexo.codigo_anexo\n , SUBSTRING(prosic_anexo.descripcion_anexo,1,20)\n , prosic_comprobante.afecto_comprobante\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.igv_comprobante\n , prosic_comprobante.total_comprobante \t\n , prosic_comprobante.id_operacion\n , prosic_comprobante.no_gravadas_igv\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.isc_comprobante\n , prosic_comprobante.otros_tributos\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.tipo_cambio_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n , prosic_comprobante.id_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_tipo_comprobante ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_tipo_documento ON (prosic_anexo.id_tipo_documento = prosic_tipo_documento.id_tipo_documento)\n WHERE prosic_comprobante.id_subdiario=2\";\n if ($w_anio != '')$sql.=\" AND prosic_comprobante.id_anio=\" . $w_anio;\n if ($w_mes != '')$sql.=\" AND prosic_comprobante.id_mes=\" . $w_mes;\n if ($w_anexo != '')$sql.=\" AND prosic_comprobante.id_anexo='\" . $w_anexo . \"'\";\n $sql.=\" ORDER BY prosic_tipo_comprobante.sunat_tipo_comprobante,CAST(prosic_comprobante.codigo_comprobante AS UNSIGNED)\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "private function query_facturas_ordenes_servicios_usuarios($co_usuario, \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t $fecha_inicio, \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t $fecha_fin)\n {\n \t$respuesta = false;\n\n\t\ttry {\n\n\t\t\t$this->db->select('cao_fatura.co_os');\n\t\t\t$this->db->select('cao_fatura.co_fatura');\t\t\t\n\t\t\t$this->db->select('cao_fatura.valor');\t\t\t\n\t\t\t$this->db->select('cao_fatura.data_emissao');\n\t\t\t$this->db->select('cao_fatura.comissao_cn');\n\t\t\t$this->db->select('cao_fatura.total_imp_inc');\n\t\t\t$this->db->select('cao_usuario.co_usuario');\n\t\t\t$this->db->from('cao_fatura');\n\t\t\t$this->db->join('cao_os', 'cao_os.co_os = cao_fatura.co_os');\n\t\t\t$this->db->join('cao_usuario', 'cao_usuario.co_usuario = cao_os.co_usuario');\n\t\t\t$this->db->where('cao_fatura.co_os is NOT NULL', NULL, FALSE);\n\t\t\t$this->db->where('cao_fatura.co_fatura is NOT NULL', NULL, FALSE);\t\t\t\n\t\t\t$this->db->where('cao_fatura.data_emissao >=', $fecha_inicio);\n\t\t\t$this->db->where('cao_fatura.data_emissao <=', $fecha_fin);\n\t\t\t$this->db->where_in('cao_os.co_usuario',$co_usuario);\t\t\n\t\t\t$this->db->order_by(\"cao_fatura.data_emissao\", \"asc\");\n\n\t\t\t$query = $this->db->get();\n\n\t\t if ($query && $query->num_rows() > 0)\n\t\t {\n\t\t\t\t$respuesta = $query->result_array();\n\n\t\t }else{\n\n\t\t throw new Exception('Error al intentar listar las facturas asociadas a los consultores');\n\t\t\t log_message('error', 'Error al intentar listar las facturas asociadas a los consultores');\t\t\t \n\n\t\t $respuesta = false;\t\t\t\t\n\t\t\t}\n\n\t\t} catch (Exception $e) {\n\n\t\t\t$respuesta = false;\n\t\t}\t\t\t\n\n\t\treturn $respuesta;\n }", "public function consultaSeguimientos(){\n\t\t$conect= Yii::app()->db;\n\t\t$sqlConsSegPaiDer=\"select fecha_seguim_compderecho,seguim_compderecho from seguimiento_compderecho \n\t\twhere id_pai=:id_pai and id_derechocespa=:id_derechocespa and num_doc=:num_doc order by fecha_seguim_compderecho desc\";\n\t\t$segCompDer=$conect->createCommand($sqlConsSegPaiDer);\n\t\t$segCompDer->bindParam(\":id_pai\",$this->id_pai,PDO::PARAM_INT);\n\t\t$segCompDer->bindParam(\":id_derechocespa\",$this->id_derechocespa,PDO::PARAM_INT);\n\t\t$segCompDer->bindParam(\":num_doc\",$this->num_doc,PDO::PARAM_STR);\n\t\t$readConsSegPaiDer=$segCompDer->query();\n\t\t$resConsSegPaiDer=$readConsSegPaiDer->readAll();\n\t\t$readConsSegPaiDer->close();\n\t\treturn $resConsSegPaiDer;\n\t}", "function ConsultarAntecedentesAPH(){\n $sql = \"CALL spConsultarAntecedentesAPH(?)\";\n $query = $this->_CONEXION->prepare($sql);\n $query->bindParam(1, $this->idReporteAPH);\n $query->execute();\n if ($query->rowCount() > 0) {\n return array('antecedentes' => $query->fetchAll());\n }else{\n return array('antecedentes' => null);\n }\n }", "public function ConsultarMesas($request, $response, $args)\n {\n $listado = $request->getParam('listado');\n $idMesa = $request->getParam('idMesa');\n $fechaInicio = $request->getParam('fechaInicio');\n $fechaFin = $request->getParam('fechaFin');\n $informacion = null;\n \n switch($listado)\n {\n case \"mas_usada\":\n $informacion = factura::select('id_mesa')\n ->groupBy('id_mesa')\n ->orderByRaw('COUNT(*) DESC')\n ->selectRaw(\"COUNT(*) as veces_usada\")\n ->limit(1)\n ->get();\n break;\n case \"menos_usada\":\n $informacion = factura::select('id_mesa')\n ->groupBy('id_mesa')\n ->orderByRaw('COUNT(*) ASC')\n ->selectRaw(\"COUNT(*) as veces_usada\")\n ->limit(1)\n ->get();\n break;\n case \"mas_facturo\":\n $informacion = factura::select('id_mesa')\n ->groupBy('id_mesa')\n ->orderByRaw('SUM(monto) desc')\n ->selectRaw(\"SUM(monto) as monto_total\")\n ->limit(1)\n ->get();\n break;\n case \"menos_facturo\":\n $informacion = factura::select('id_mesa')\n ->groupBy('id_mesa')\n ->orderByRaw('SUM(monto) asc')\n ->selectRaw(\"SUM(monto) as monto_total\")\n ->limit(1)\n ->get();\n break;\n case \"mayor_importe\":\n $informacion = factura::orderBy('monto', 'desc')\n ->select('id_mesa', 'monto')\n ->first();\n break;\n case \"menor_importe\":\n $informacion = factura::orderBy('monto', 'asc')\n ->select('id_mesa', 'monto')\n ->first();\n break; \n // case \"entre_dos_fechas\":\n // if($idMesa != null)\n // {\n // $informacion = factura::where('id_mesa', $idMesa)\n // ->where('hora', '>=', $fechaInicio)\n // ->where('hora', '<=', $fechaFin)\n // ->get();\n // }\n break; \n case \"mejores_comentarios\":\n $informacion = encuesta::select('id_cliente', 'texto_experiencia')\n ->selectRaw(\"(puntaje_mesa + puntaje_restaurante + puntaje_mozo + puntaje_cocinero) as puntaje_total\")\n ->orderByRaw('(puntaje_mesa + puntaje_restaurante + puntaje_mozo + puntaje_cocinero) desc')\n ->limit(3)\n ->get();\n break; \n case \"peores_comentarios\":\n $informacion = encuesta::select('id_cliente', 'texto_experiencia')\n ->selectRaw(\"(puntaje_mesa + puntaje_restaurante + puntaje_mozo + puntaje_cocinero) as puntaje_total\")\n ->orderByRaw('(puntaje_mesa + puntaje_restaurante + puntaje_mozo + puntaje_cocinero) asc')\n ->limit(3)\n ->get();\n break; \n }\n if($informacion == null)\n {\n $informacion = 'No hay pedidos';\n }\n\n $newResponse = $response->withJson($informacion, 200);\n \n return $newResponse;\n }", "function buscar_comprobante_doc_venta($id_cuenta, $id_anexo, $id_serie, $id_numero ) {\n $sql = \"SELECT\n\t\t\t\t\t prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\t, sum(if(prosic_moneda.id_moneda=1,prosic_detalle_comprobante.importe_soles,prosic_detalle_comprobante.importe_dolares*prosic_tipo_cambio.venta_financiero)*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)) as importe_soles\n\t\t\t\t\t, sum(if(prosic_moneda.id_moneda=1,prosic_detalle_comprobante.importe_soles*prosic_tipo_cambio.venta_financiero,prosic_detalle_comprobante.importe_dolares)*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)) as importe_dolares\n\t\t\t\tFROM prosic_detalle_comprobante\n\t\t\t\tINNER JOIN prosic_plan_contable ON prosic_detalle_comprobante.id_plan_contable=prosic_plan_contable.id_plan_contable\n\t\t\t\tINNER JOIN prosic_anexo ON prosic_detalle_comprobante.id_anexo = prosic_anexo.id_anexo\n\t\t\t\tINNER JOIN prosic_moneda ON prosic_detalle_comprobante.id_moneda = prosic_moneda.id_moneda\n\t\t\t\tLEFT JOIN prosic_tipo_cambio ON prosic_detalle_comprobante.fecha_doc_comprobante=prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\tWHERE 1=1 \";\n\t\t\t\tif ($id_cuenta != '')$sql.=\" AND prosic_plan_contable.cuenta_plan_contable LIKE '%\" . $id_cuenta . \"%'\";\n if ($id_anexo != '')$sql.=\" AND prosic_anexo.codigo_anexo LIKE '%\" . $id_anexo . \"%'\";\n if ($id_numero != '')$sql.=\" AND prosic_detalle_comprobante.nro_doc_comprobante LIKE '%\" . $id_numero . \"%'\";\n\t\t\t$sql.=\" group by prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\thaving importe_soles>0\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "public function RelatorioContasPagarEmissao($where,$dtemi){\n\t\t\t\t\n\t\t$dba = $this->dba;\n\n\t\t$vet = array();\n\n\n\t\t$sql =\"SELECT \n\t\t\t\td.emissao,\n\t\t\t\td.vencimento,\n\t\t\t\td.numero,\n\t\t\t\tsum(d.valordoc) as valordoc,\n\t\t\t\td.numero_nota,\n\t\t\t\tf.codigo,\n\t\t\t\tf.nome\n\t\t\tFROM\n\t\t\t\tduplic d\n\t\t\t\t\tinner join\n\t\t\t\tfornecedores f ON (f.codigo = d.cedente)\n\t\t\t\".$where.\" and d.emissao = '\".$dtemi.\"'\n\t\t\tgroup by d.numero , d.numero_nota , d.emissao , f.codigo , f.nome , d.tipo,d.vencimento\";\n\t\t\n\t\t$res = $dba->query($sql);\n\n\t\t$num = $dba->rows($res); \n\n\t\t$i = 0;\n\t\t\t\n\t\twhile($dup = ibase_fetch_object($res)){\t\t\n\t\t\t\n\t\t\t$numero = $dup->NUMERO;\n\t\t\t$valordoc = $dup->VALORDOC;\n\t\t\t$numnota = $dup->NUMERO_NOTA;\n\t\t\t$emissao\t = $dup->EMISSAO;\n\t\t\t$codfor = $dup->CODIGO;\n\t\t\t$nomfor = $dup->NOME;\t\t\t\t\t\n\t\t\t$vencimento = $dup->VENCIMENTO;\n\t\t\t\n\t\t\t$duplic = new Duplic();\t\t\t\n\n\t\t\t$duplic->setNumero($numero);\n\t\t\t$duplic->setValorDoc($valordoc);\n\t\t\t$duplic->setNumeroNota($numnota);\n\t\t\t$duplic->setCodFornecedor($codfor);\n\t\t\t$duplic->setNomeFornevedor($nomfor);\n\t\t\t$duplic->setEmissao($emissao);\n\t\t\t$duplic->setVencimento($vencimento);\n\t\t\t\n\t\t\t$vet[$i++] = $duplic;\n\n\t\t}\n\n\t\treturn $vet;\n\n\t}", "public function busquedaEstudianteplanificacion() {\n $con = \\Yii::$app->db_academico;\n $estado = 1;\n \n $sql = \"SELECT est.per_id as id, concat(/*est.per_id, ' - ',*/ pers.per_cedula, ' - ', \n ifnull(pers.per_pri_nombre, ' ') ,' ', \n ifnull(pers.per_pri_apellido,' ')) as name\n FROM db_academico.estudiante est\n JOIN db_asgard.persona pers ON pers.per_id = est.per_id\n WHERE pers.per_estado = :estado AND\n pers.per_estado_logico = :estado AND\n est.est_estado = :estado AND\n est.est_estado_logico = :estado;\";\n\n $comando = $con->createCommand($sql);\n $comando->bindParam(\":estado\", $estado, \\PDO::PARAM_STR);\n $resultData = $comando->queryAll();\n return $resultData;\n }", "public function permisos()\n {\n\n $conectar = parent::conexion();\n\n $sql = \"select * from permisos;\";\n\n $sql = $conectar->prepare($sql);\n $sql->execute();\n return $resultado = $sql->fetchAll();\n }", "public function pesquisa(array $filtros){\n if(empty($filtros)){\n return FALSE;\n }\n //Monta clasula where e seus paramentros\n $this->where = 'i.id <> :id';\n $this->parameters['id'] = 'null';\n \n if(isset($filtros['rua'])){\n $this->where .= ' AND i.rua LIKE :rua';\n $this->parameters['rua'] = $filtros['rua'] . '%'; \n }\n \n if(isset($filtros['refImovel'])){\n $this->where .= ' AND i.refImovel LIKE :refImovel';\n $this->parameters['refImovel'] = $filtros['refImovel'] . '%'; \n }\n \n if(isset($filtros['locador'])){\n $this->where .= ' AND i.locador = :locador';\n $this->parameters['locador'] = $filtros['locador']; \n }\n \n if(isset($filtros['locatario'])){\n $this->where .= ' AND i.locatario = :locatario';\n $this->parameters['locatario'] = $filtros['locatario']; \n }\n \n $query = $this->getEntityManager()\n ->createQueryBuilder()\n ->select('i,ld,lt')\n ->from('Livraria\\Entity\\Imovel', 'i')\n ->join('i.locador', 'ld')\n ->join('i.locatario', 'lt')\n ->where($this->where)\n ->orderBy('i.rua')\n ->setParameters($this->parameters)\n ->getQuery();\n $list = $query->getResult();\n \n if (!empty($list))\n return $query;\n \n //Nova pesquisa pesquisando por qualquer ocorrencia \n if(isset($filtros['rua'])){\n $this->parameters['rua'] = '%' . $filtros['rua'] . '%'; \n }else{\n //Apenas para retornar uma query vazia\n $this->parameters['id'] = '0'; \n }\n $query = $this->getEntityManager()\n ->createQueryBuilder()\n ->select('i,ld,lt')\n ->from('Livraria\\Entity\\Imovel', 'i')\n ->join('i.locador', 'ld')\n ->join('i.locatario', 'lt')\n ->where($this->where)\n ->orderBy('i.rua')\n ->setParameters($this->parameters)\n ->getQuery();\n \n return $query;\n }", "function ProjetosPendentes() {\n\n $count = 0;\n $conexao = new classeConexao();\n\n //selecionando id dos projetos\n $projetos = $conexao::fetch(\"SELECT id FROM tb_projetos\");\n\n foreach ($projetos as $projeto) {\n\n //Qtd tarefas a fazer\n $tarefasFazer = $conexao::fetchuniq(\"SELECT COUNT(id) as qtd FROM tb_tarefas WHERE tb_tarefas_status=0 AND tb_tarefas_projeto = \".$projeto['id']);\n\n //Qtd tarefas feitas\n $tarefasFeitas = $conexao::fetchuniq(\"SELECT COUNT(id) as qtd FROM tb_tarefas WHERE tb_tarefas_status=1 AND tb_tarefas_projeto = \".$projeto['id']);\n\n //Porcentagem\n if(($tarefasFeitas['qtd'] + $tarefasFazer['qtd']) == 0){\n $qtd3 = 1;\n }else{\n $qtd3 = ($tarefasFeitas['qtd'] + $tarefasFazer['qtd']);\n }\n $porcentagem = ($tarefasFeitas['qtd'] * 100) / ($qtd3);\n\n if($porcentagem!=100) {\n $count++;\n }\n }\n\n return $count;\n}", "function dadosCadastros(){//função geral que será chamada na index\n pegaCadastrosJson();//pega os valores dos cadastros do arquivo JSON e salva em um array\n contaNumeroCadastros();//conta Quantos cadastros existem\n }", "public function listServRequetes($idFournisseur){\n $requete = \" SELECT idForfaitFournisseur, (SELECT count(idservice) FROM bitvoix_db.services WHERE idFournisseur = ?) AS nroServ\n FROM fournisseur WHERE idFournisseur = ?\";\n // var_dump($requete);\n $stmt = $this->_pdo->prepare($requete);\n $stmt->execute(array($idFournisseur,$idFournisseur));\n $result = $stmt->fetchAll(PDO::FETCH_OBJ);\n return $result;\n }", "public function buscarDadosParaImpressao($where = array(), $order = array(), $tamanho = -1, $inicio = -1)\n {\n $slct = $this->select();\n\n $slct->setIntegrityCheck(false);\n\n $slct->from(\n array('pr' => $this->_name),\n array('*',\n 'dbo.fnFormataProcesso(pr.idPronac) as Processo')\n );\n\n $slct->joinInner(\n array('ar' => 'Area'),\n \"ar.Codigo = pr.Area\",\n array('ar.descricao as dsArea')\n );\n $slct->joinInner(\n array('sg' => 'Segmento'),\n \"sg.Codigo = pr.Segmento\",\n array('sg.descricao as dsSegmento')\n );\n $slct->joinInner(\n array('mc' => 'Mecanismo'),\n \"mc.Codigo = pr.Mecanismo\",\n array('mc.Descricao as dsMecanismo')\n );\n $slct->joinInner(\n array('i' => 'Interessado'),\n \"pr.CgcCPf = i.CgcCPf\"\n );\n\n // adicionando clausulas where\n foreach ($where as $coluna => $valor) {\n $slct->where($coluna, $valor);\n }\n\n return $this->fetchAll($slct);\n }", "function contar(){\n $sql = \"Select (select count(cita.id) from cita) as Citas,( select count(medico.id) from medico) as Medicos, (select count(paciente.id) from paciente)as Pacientes\";\n $conexion = new Conexion();\n return $conexion->executeQuery($sql)->fetch_object();\n }", "function listarPartidaEjecucion(){\n\t\t$this->procedimiento='pre.ft_partida_ejecucion_sel';\n\t\t$this->transaccion='PRE_PAREJE_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_tipo_cc','id_tipo_cc','int4');\n\t\t\n\t\t$this->capturaCount('total_egreso_mb','numeric');\n\t\t$this->capturaCount('total_ingreso_mb','numeric');\n\t\t$this->capturaCount('total_monto_anticipo_mb','numeric');\n\t\t$this->capturaCount('total_monto_desc_anticipo_mb','numeric');\n\t\t$this->capturaCount('total_monto_iva_revertido_mb','numeric');\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_partida_ejecucion','int4');\n\t\t$this->captura('id_int_comprobante','int4');\n\t\t$this->captura('id_moneda','int4');\n $this->captura('moneda','varchar');\n\t\t$this->captura('id_presupuesto','int4');\n $this->captura('desc_pres','varchar');\n $this->captura('codigo_categoria','varchar');\n\t\t$this->captura('id_partida','int4');\n $this->captura('codigo','varchar');\n $this->captura('nombre_partida','varchar');\n\t\t$this->captura('nro_tramite','varchar');\n\t\t$this->captura('tipo_cambio','numeric');\n\t\t$this->captura('columna_origen','varchar');\n\t\t$this->captura('tipo_movimiento','varchar');\n\t\t$this->captura('id_partida_ejecucion_fk','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('fecha','date');\n\t\t$this->captura('egreso_mb','numeric');\n\t\t$this->captura('ingreso_mb','numeric');\n\t\t$this->captura('monto_mb','numeric');\n\t\t$this->captura('monto','numeric');\n\t\t$this->captura('valor_id_origen','int4');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\t\t\n\t\t$this->captura('id_tipo_cc','int4');\n\t\t$this->captura('desc_tipo_cc','varchar');\n\t\t\n\t\t$this->captura('nro_cbte','varchar');\n\t\t$this->captura('id_proceso_wf','int4');\n\t\t\n\t\t$this->captura('monto_anticipo_mb','numeric');\n\t\t$this->captura('monto_desc_anticipo_mb','numeric');\n\t\t$this->captura('monto_iva_revertido_mb','numeric');\n\t\t\n\t\t$this->captura('glosa1','varchar');\t\t\n\t\t$this->captura('glosa','varchar');\n\t\t\n\t\t$this->captura('cantidad_descripcion','numeric');\n\n $this->captura('total_pago','numeric');\n $this->captura('desc_contrato','varchar');\n $this->captura('obs','varchar');\n $this->captura('tipo_ajuste_formulacion','varchar'); //#41\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function contarServiciosNombre($nombre_buscado)\n\t{\n\t\treturn \"select count(*) as number\nfrom trabajadores, servicios,sucursales where servicios.nombre_servicio like '%$nombre_buscado%'\nand servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 1 \nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}", "public function forfaitServic($idFournisseur){\n $requete = \" SELECT idForfaitFournisseur, (SELECT count(idservice) FROM bitvoix_db.services WHERE idFournisseur = ?) AS nroServ,\n DATEDIFF(now(),fournisseur.datInsFournisseur) as jours, DATEDIFF(datEcheFournisseur,now()) as jouract \n FROM fournisseur WHERE idFournisseur = ?\";\n // var_dump($requete);\n $stmt = $this->_pdo->prepare($requete);\n $stmt->execute(array($idFournisseur,$idFournisseur));\n $result = $stmt->fetchAll(PDO::FETCH_OBJ);\n if (!$result){\n $requete = \" SELECT '' AS idService, 0 AS nroServ, idForfaitFournisseur,datEcheFournisseur, idForfaitFournisseur,\n DATEDIFF(now(),fournisseur.datInsFournisseur) as jours, DATEDIFF(datEcheFournisseur,now()) as jouract \n FROM fournisseur\n WHERE idFournisseur = ? \";\n // var_dump($requete);\n $stmt = $this->_pdo->prepare($requete);\n $stmt->execute(array($idFournisseur));\n $result = $stmt->fetchAll(PDO::FETCH_OBJ);\n }\n return $result;\n\n }", "public function desparasitantes_TotalAplicarFiltrosDesparasitantes($fechaInicial, $fechaFinal, $fechaInicialProximo, $fechaFinalProximo, $idDesparasitante, $idPropietario, $paciente){\n \t\n\t\t\t$resultado = 0;\n\t\t\t$adicionQuery = \"WHERE 1 \";\n\t\t\t\n\t\t\tif($idDesparasitante != '0'){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND D.idDesparasitante = '$idDesparasitante' \";\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif($fechaInicial != \"\" AND $fechaFinal != \"\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND ( D.fecha BETWEEN '$fechaInicial' AND '$fechaFinal')\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($fechaInicialProximo != \"\" AND $fechaFinalProximo != \"\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND ( D.fechaProximoDesparasitante BETWEEN '$fechaInicialProximo' AND '$fechaFinalProximo')\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\n\t\t\tif($idPropietario != \"0\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND P.idPropietario = '$idPropietario' \";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($paciente != \"\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND D.idMascota = '$paciente' \";\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\t$query = \"SELECT \n\t\t\t\t\t\t count(D.idDesparasitanteMascota) as totalRegistros\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t tb_desparasitantesMascotas AS D\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_mascotas AS M ON D.idMascota = M.idMascota\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_propietarios AS P ON P.idPropietario = M.idPropietario\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_desparasitantes AS DD ON DD.idDesparasitante = D.idDesparasitante\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\".$adicionQuery.\"\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$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado = $filas['totalRegistros'];\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado;\n\t\t\t\n\t\t\t\n }", "public function reporte1($pos)\n {\n //declarando variables del filtro\n $accioncentralizada=\"\";\n $accespecifica=\"\";\n $proyecto=\"\";\n $proyectoespecifica=\"\";\n $materiales=\"\";\n $unidades=\"\";\n $partida=\"\"; \n\n //print_r($pos); exit();\n //verificacion de filtros acciones centrales\n if($pos['accion_centralizada']!='-1')\n {\n if($pos['accion_centralizada']!='x999')\n {\n $accioncentralizada=\" and a.id=\".$pos['accion_centralizada'];\n }\n \n\n if(isset($pos['acc_especifica']) && $pos['acc_especifica']!='x999' && $pos['acc_especifica']!='')\n {\n $accespecifica=\" and b.id=\".$pos['acc_especifica'];\n }\n }\n else\n {\n $accioncentralizada=\" and a.id=-1 \";\n }\n //verificacion de filtros proyectos\n if($pos['proyectos']!='-1')\n {\n if($pos['proyectos']!='x999')\n {\n $proyecto=\" and a.id=\".$pos['proyectos'];\n }\n \n if(isset($pos['proyectos_especifica']) && $pos['proyectos_especifica']!='x999' && $pos['proyectos_especifica']!='')\n {\n $proyectoespecifica=\" and b.id=\".$pos['proyectos_especifica'];\n }\n }\n else\n {\n $proyecto=\" and a.id=-1 \";\n }\n\n //verificando Filtros de materiales o servicios\n if($pos['materiales-servicios']!='x999')\n {\n $materiales=\" and f.id=\".$pos['materiales-servicios'];\n }\n\n //verificando Filtros de unidad ejecutora\n if($pos['unidadessejecutoras']!='x999')\n {\n $unidades=\" and i.id=\".$pos['unidadessejecutoras'];\n }\n\n //filtro partida\n if(isset($pos['partida']) && $pos['partida']!=\"\")\n {\n $array_partida=explode(\",\", $pos['partida']);\n $partida=\" and (\";\n foreach ($array_partida as $key => $value) \n {\n $partida.= \"concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) like '%\".$value.\"%' || \";\n }\n $partida=substr($partida, 0, -3);\n $partida.=\") \";\n }\n\n //construyendo el query\n //Agrupar por partida\n if(isset($pos['partida_agrupar']))\n {\n $sql=\"\n\n select a.cod_proyecto_central, a.nombre_proyecto_central, a.cod_especifica, a.nombre_especifica, a.nombre_unidad_ejecutora, a.partida, \n sum(a.trim1) as trim1,\n format(sum(a.total_trim1),2,'de_DE') as total_trim1, \n sum(a.trim2) as trim2, \n format(sum(a.total_trim2),2,'de_DE') as total_trim2, \n sum(a.trim3) as trim3, \n format(sum(a.total_trim3),2,'de_DE') as total_trim3, \n sum(a.trim4) as trim4, \n format(sum(a.total_trim4),2,'de_DE') as total_trim4, \n format(sum(a.total_iva),2, 'de_DE') as total_iva, \n format(sum(a.total), 2, 'de_DE') as total \n from \n ( \n\n select a.codigo_accion as cod_proyecto_central, a.nombre_accion as nombre_proyecto_central, b.cod_ac_espe as cod_especifica, b.nombre as nombre_especifica, concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) as partida, i.nombre as nombre_unidad_ejecutora,\n (e.enero+e.febrero+e.marzo) as trim1, \n ((e.enero+e.febrero+e.marzo) * e.precio) as total_trim1, \n (e.abril+e.mayo+e.junio) as trim2, \n ((e.abril+e.mayo+e.junio) * e.precio) as total_trim2, \n (e.julio+e.agosto+e.septiembre) as trim3, \n ((e.julio+e.agosto+e.septiembre) * e.precio) as total_trim3, \n (e.octubre+e.noviembre+e.diciembre) as trim4, \n ((e.octubre+e.noviembre+e.diciembre) * e.precio) as total_trim4, \n (round((((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio)/e.iva))) as total_iva, \n (((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio) + round((((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio)/e.iva))) as total \n from \n accion_centralizada as a \n inner join accion_centralizada_accion_especifica as b on a.id=b.id_ac_centr \n inner join accion_centralizada_ac_especifica_uej as c on b.id=c.id_ac_esp \n inner join accion_centralizada_asignar as d on c.id=d.accion_especifica_ue \n inner join accion_centralizada_pedido as e on d.id=e.asignado \n inner join materiales_servicios as f on e.id_material=f.id \n inner join unidad_medida as g on f.unidad_medida=g.id \n inner join presentacion as h on f.presentacion=h.id \n inner join unidad_ejecutora as i on c.id_ue=i.id \n where 1=1 \n \".$accioncentralizada.$accespecifica.$materiales.$unidades.$partida.\"\n\n union all\n\n SELECT a.codigo_proyecto as cod_proyecto_central, a.nombre as nombre_proyecto_central, b.codigo_accion_especifica as cod_especifica, b.nombre as nombre_especifica, concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) partida, i.nombre as nombre_unidad_ejecutora, \n (d.enero+d.febrero+d.marzo) as trim1, \n ((d.enero+d.febrero+d.marzo) * d.precio) as total_trim1, \n (d.abril+d.mayo+d.junio) as trim2, \n ((d.abril+d.mayo+d.junio) * d.precio) as total_trim2, \n (d.julio+d.agosto+d.septiembre) as trim3, \n ((d.julio+d.agosto+d.septiembre) * d.precio) as total_trim3, \n (d.octubre+d.noviembre+d.diciembre) as trim4, \n ((d.octubre+d.noviembre+d.diciembre) * d.precio) as total_trim4, \n (((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio)/d.iva) as total_iva, \n (((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio) + round((((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio)/d.iva))) as total \n FROM proyecto as a \n inner join proyecto_accion_especifica as b on a.id=b.id_proyecto \n inner join proyecto_usuario_asignar as c on b.id=c.accion_especifica_id \n inner join proyecto_pedido as d on c.id=d.asignado \n inner join materiales_servicios as f on d.id_material=f.id \n inner join unidad_medida as g on f.unidad_medida=g.id \n inner join presentacion as h on f.presentacion=h.id \n inner join unidad_ejecutora as i on b.id_unidad_ejecutora=i.id \n where 1=1 \n \".$proyecto.$proyectoespecifica.$materiales.$unidades.$partida.\"\n\n ) \n as a \n where a.cod_proyecto_central is not null group by a.partida \n \"; \n }\n else\n {\n $sql=\"\n\n select a.cod_proyecto_central, a.nombre_proyecto_central, a.cod_especifica, a.nombre_especifica, a.nombre_unidad_ejecutora, a.partida, a.material, a.unidad_medida, a.presentacion, a.precio, a.iva, a.trim1, a.total_trim1, a.trim2, a.total_trim2, a.trim3, a.total_trim3, a.trim4, a.total_trim4, format(a.total_iva,2, 'de_DE') as total_iva, format(a.total, 2, 'de_DE') as total\n from \n (\n select a.codigo_accion as cod_proyecto_central, a.nombre_accion as nombre_proyecto_central, b.cod_ac_espe as cod_especifica, b.nombre as nombre_especifica, concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) partida, f.nombre as material, g.unidad_medida as unidad_medida, h.nombre as presentacion, e.precio,\n e.iva, i.nombre as nombre_unidad_ejecutora,\n (e.enero+e.febrero+e.marzo) as trim1, ((e.enero+e.febrero+e.marzo) * e.precio) as total_trim1, \n (e.abril+e.mayo+e.junio) as trim2, \n ((e.abril+e.mayo+e.junio) * e.precio) as total_trim2, \n (e.julio+e.agosto+e.septiembre) as trim3, \n ((e.julio+e.agosto+e.septiembre) * e.precio) as total_trim3, \n (e.octubre+e.noviembre+e.diciembre) as trim4, \n ((e.octubre+e.noviembre+e.diciembre) * e.precio) as total_trim4,\n round((((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio)/e.iva)) as total_iva,\n ((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio) + round((((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio)/e.iva)) as total\n from accion_centralizada as a\n inner join accion_centralizada_accion_especifica as b on a.id=b.id_ac_centr \n inner join accion_centralizada_ac_especifica_uej as c on b.id=c.id_ac_esp \n inner join accion_centralizada_asignar as d on c.id=d.accion_especifica_ue \n inner join accion_centralizada_pedido as e on d.id=e.asignado\n inner join materiales_servicios as f on e.id_material=f.id\n inner join unidad_medida as g on f.unidad_medida=g.id\n inner join presentacion as h on f.presentacion=h.id\n inner join unidad_ejecutora as i on c.id_ue=i.id\n where\n 1=1\n \".$accioncentralizada.$accespecifica.$materiales.$unidades.$partida.\" \n\n\n union all\n\n SELECT a.codigo_proyecto as cod_proyecto_central, a.nombre as nombre_proyecto_central, b.codigo_accion_especifica as cod_especifica, b.nombre as nombre_especifica, concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) partida, f.nombre as material, g.unidad_medida as unidad_medida, h.nombre as presentacion, d.precio,\n d.iva, i.nombre as nombre_unidad_ejecutora,\n (d.enero+d.febrero+d.marzo) as trim1, ((d.enero+d.febrero+d.marzo) * d.precio) as total_trim1, \n (d.abril+d.mayo+d.junio) as trim2, \n ((d.abril+d.mayo+d.junio) * d.precio) as total_trim2, \n (d.julio+d.agosto+d.septiembre) as trim3, \n ((d.julio+d.agosto+d.septiembre) * d.precio) as total_trim3, \n (d.octubre+d.noviembre+d.diciembre) as trim4, \n ((d.octubre+d.noviembre+d.diciembre) * d.precio) as total_trim4,\n (((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio)/d.iva) as total_iva,\n ((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio) + round((((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio)/d.iva)) as total\n FROM proyecto as a\n inner join proyecto_accion_especifica as b on a.id=b.id_proyecto\n inner join proyecto_usuario_asignar as c on b.id=c.accion_especifica_id\n inner join proyecto_pedido as d on c.id=d.asignado\n inner join materiales_servicios as f on d.id_material=f.id\n inner join unidad_medida as g on f.unidad_medida=g.id\n inner join presentacion as h on f.presentacion=h.id\n inner join unidad_ejecutora as i on b.id_unidad_ejecutora=i.id\n where\n 1=1\n \".$proyecto.$proyectoespecifica.$materiales.$unidades.$partida.\"\n\n ) as a\n where a.cod_proyecto_central is not null order by partida\n \n \";\n\n }\n\n \n //print_r($sql); exit();\n //Arreglo para el DataProvider\n $query = Yii::$app->db->createCommand($sql)->queryAll();\n //DataProvider\n $dataProvider = new ArrayDataProvider([\n 'allModels' => $query,\n ]);\n return $dataProvider;\n }", "public function consultarFacturaIniciada($idUsuario){\n\t\t\t\t\n\t\t$resultado = array();\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n\t\t$query = \"SELECT \n\t\t\t\t F.idFactura,\n\t\t\t\t F.numeroFactura,\n\t\t\t\t F.fecha,\n\t\t\t\t F.hora,\n\t\t\t\t F.iva,\n\t\t\t\t F.valorIva,\n\t\t\t\t F.descuento,\n\t\t\t\t F.metodopago,\n\t\t\t\t F.observaciones,\n\t\t\t\t F.idPropietario,\n\t\t\t\t F.idFacturador,\n\t\t\t\t F.idResolucionDian,\n\t\t\t\t P.identificacion as identificacionPropietario,\n \t\t\t\tP.nombre as nombrePropietario,\n\t\t\t\t P.apellido,\n\t\t\t\t FACT.nombre AS nombreFacturador,\n\t\t\t\t RE.numeroResolucion,\n\t\t\t\t PFCD.idPagoFacturaCajaDetalle,\n\t\t\t\t PFCD.tipoDetalle,\n\t\t\t\t PFCD.idTipoDetalle,\n\t\t\t\t PFCD.valorUnitario,\n\t\t\t\t PFCD.cantidad,\n \t\t\t\tPFCD.descuento\n\t\t\t\tFROM\n\t\t\t\t tb_facturas AS F\n\t\t\t\t INNER JOIN\n\t\t\t\t tb_propietarios AS P ON P.idPropietario = F.idPropietario\n\t\t\t\t INNER JOIN\n\t\t\t\t tb_facturadores AS FACT ON FACT.idFacturador = F.idFacturador\n\t\t\t\t INNER JOIN\n\t\t\t\t tb_resolucionDian AS RE ON RE.idResolucionDian = F.idResolucionDian\n\t\t\t\t INNER JOIN\n\t\t\t\t tb_pago_factura_caja AS PFC ON PFC.idTipoElemento = F.idFactura\n\t\t\t\t AND PFC.tipoElemento = 'Factura'\n\t\t\t\t INNER JOIN\n\t\t\t\t tb_pago_factura_caja_detalle AS PFCD ON PFCD.idPagoFacturaCaja = PFC.idPagoFacturaCaja\n\t\t\t\t AND PFCD.estado = 'Activo'\n\t\t\t\tWHERE\n\t\t\t\t F.idUsuario = '$idUsuario'\n\t\t\t\t AND F.estado = 'Iniciada'\";\n\t\t\n\t\tif($res = $conexion->query($query)){\n\t\t\twhile ($filas = $res->fetch_assoc()) {\n\t\t\t\t\t\t\t\n\t\t\t\t$resultado[] = $filas;\n\t\t\t\t\t\n\t\t\t}//fin while\n\t\t\t\n\t\t\t/* liberar el conjunto de resultados */\n\t\t\t$res->free();\n\t\t\t\n\t\t}//fin if\n\t\t\n\t\treturn $resultado;\n\t\t\t\t\t\n\t\t\n\t}", "public function DetallesComprasPorId()\n\t{\n\t\tif(base64_decode($_GET['tipoentrada'])==\"PRODUCTO\"){\n\n\t\t\tself::SetNames();\n\t\t\t$sql = \" SELECT * FROM detallecompras LEFT JOIN categorias ON detallecompras.categoria = categorias.codcategoria LEFT JOIN productos ON detallecompras.codproducto = productos.codproducto WHERE detallecompras.coddetallecompra = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"coddetallecompra\"])) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num==0)\n\t\t\t{\n\t\t\t\techo \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t} else {\n\n\t\t\t$sql = \" SELECT * FROM detallecompras LEFT JOIN ingredientes ON detallecompras.codproducto = ingredientes.codingrediente WHERE detallecompras.coddetallecompra = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"coddetallecompra\"])) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num==0)\n\t\t\t{\n\t\t\t\techo \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\n\t\t}\n\t}", "function consultarPedido (){\n\t\t$x = $this->pdo->prepare('SELECT * FROM pedido');\n\t\t$x->execute();\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "public function consulta_asistencia()\n {\n $fecha_reporte = cambiaf_a_mysql($this->txt_fecha_desde->Text);\n $dir = $this->drop_direcciones->SelectedValue;\n $cod_organizacion = usuario_actual('cod_organizacion');\n\n // se obtienen las justificaciones del día seleccionado\n $sql=\"SELECT (p.cedula) as cedula_just, p.nombres, p.apellidos, j.codigo, jd.fecha_desde, jd.hora_desde,\n jd.fecha_hasta, jd.hora_hasta, jd.observaciones, jd.lun, jd.mar, jd.mie, jd.jue, jd.vie,\n tf.descripcion as descripcion_falta, tj.descripcion as descripcion_tipo_justificacion\n\t\t\t\t\t FROM asistencias.justificaciones as j, asistencias.justificaciones_dias as jd,\n\t\t\t\t\t\t asistencias.justificaciones_personas as jp, organizacion.personas as p, organizacion.personas_nivel_dir as n, asistencias.tipo_faltas tf, asistencias.tipo_justificaciones tj\n\t\t\t\t\t\tWHERE ((p.cedula = jp.cedula) and\n\t\t\t\t\t\t (p.cedula = n.cedula) and (jd.codigo_tipo_falta = tf.codigo) and (tj.id = jd.codigo_tipo_justificacion) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%') and\n\t\t\t\t\t\t (p.fecha_ingreso <= '$fecha_reporte') and\n\t\t\t\t\t\t (jd.fecha_desde <= '$fecha_reporte') and\n\t\t\t\t\t\t\t (jd.fecha_hasta >= '$fecha_reporte') and\n\t\t\t\t\t\t\t (j.estatus='1') and (j.codigo=jd.codigo_just) and (j.codigo=jp.codigo_just))\n\t\t\t\t\t\tORDER BY p.nombres, p.apellidos, jp.cedula \";\n $this->justificaciones=cargar_data($sql,$this); \n\n // se obtiene el horario vigente para la fecha seleccionada\n $this->horario_vigente = obtener_horario_vigente($cod_organizacion,$fecha_reporte,$this);\n \n // se realizan las consultas para mostrar los listados\n // Se consultan los asistentes\n $sql=\"SELECT (p.cedula) as cedula_integrantes, CONCAT(p.nombres,' ',p.apellidos) as nombre,\n e.cedula, e.fecha, MIN(e.hora) as entrada, MAX(e.hora) as salida\n FROM asistencias.entrada_salida as e, organizacion.personas as p, organizacion.personas_nivel_dir as n\n WHERE ((p.cedula = e.cedula) and\n (p.cedula = n.cedula) and\n (n.cod_direccion LIKE '$dir%') and\n (p.fecha_ingreso <= '$fecha_reporte') and\n (e.fecha <= '$fecha_reporte') and\n (e.fecha >= '$fecha_reporte'))\n GROUP BY e.cedula\n ORDER BY entrada, p.nombres, p.apellidos \";\n $this->asistentes=cargar_data($sql,$this);\n $this->ind_asistentes = count($this->asistentes);\n\n // se consultan los inasistentes\n $sql2=\"SELECT p.cedula as cedula_integrantes, CONCAT(p.nombres,' ',p.apellidos) as nombre\n\t\t\t\t\t\t\t\t\t FROM organizacion.personas as p, asistencias.personas_status_asistencias as s,\n\t\t\t\t\t\t\t\t\t organizacion.personas_nivel_dir as n\n\t\t\t\t\t\t\t\t\t WHERE ((s.status_asistencia = '1') and\n\t\t\t\t\t\t\t\t\t \t\t (s.cedula = p.cedula) and\n\t\t\t\t\t\t\t\t\t\t\t (p.cedula = n.cedula) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%') and\n\t\t\t\t\t\t\t\t\t (p.fecha_ingreso <= '$fecha_reporte') and\n\t\t\t\t\t\t\t\t\t (p.cedula not in\n\t\t\t\t\t\t\t\t\t (SELECT e.cedula\n\t\t\t\t\t\t\t\t\t\t FROM asistencias.entrada_salida as e, organizacion.personas_nivel_dir as n\n\t\t\t\t\t\t\t\t\t\t \t WHERE ((e.fecha = '$fecha_reporte') and\n\t\t\t\t\t\t\t\t\t\t\t\t (p.cedula = n.cedula) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%'))\n\t\t\t\t\t\t\t\t\t\t\t GROUP BY e.cedula)))\n\t\t\t\t\t\t\t\t\t ORDER BY p.nombres, p.apellidos\";\n $this->inasistentes=cargar_data($sql2,$this);\n\n\n // Se consultan los asistentes para comparar inconsistencia de horas en el marcado\n // Si le falta hora\n $inconsistentes = array();\n foreach($this->asistentes as $arreglo){\n \n $sql2=\"SELECT COUNT(*) as n_horas FROM asistencias.entrada_salida as e\n\t\t\t WHERE e.fecha = '$fecha_reporte' AND e.cedula = '$arreglo[cedula_integrantes]' \";\n $resultado2=cargar_data($sql2,$this);\n if(!empty($resultado2)){\n if ($resultado2[0][n_horas]%2!=0) {//impar\n array_unshift($inconsistentes, array('cedula'=>$arreglo[cedula_integrantes], 'nombre'=>$arreglo[nombre],'salida'=>$arreglo[salida]));\n }//fin si\n }//fin si\n }//fin each\n\n\n\n // Se enlaza el nuevo arreglo con el listado de Direcciones\n //$this->DataGrid_fj->Caption=\"Reporte de Asistencias del \".$this->txt_fecha_desde->Text;\n if(!empty($inconsistentes)){\n $this->DataGrid_fh->DataSource=$inconsistentes;\n $this->DataGrid_fh->dataBind();\n }\n\n // Se enlaza el nuevo arreglo con el listado de Direcciones\n $this->DataGrid->Caption=\"Reporte de Asistencias del \".$this->txt_fecha_desde->Text;\n $this->DataGrid->DataSource=$this->asistentes;\n $this->DataGrid->dataBind();\n\n\n $this->DataGrid_ina->Caption=\"Inasistentes el d&iacute;a \".$this->txt_fecha_desde->Text;\n $this->DataGrid_ina->DataSource=$this->inasistentes;\n $this->DataGrid_ina->dataBind();\n\n /* Por un error que no supe identificar, el cual suma un numero adicional a la variable\n * de inasistentes no justificados, he tenido que sacarla del procedimiento donde normalmente\n * se contaba y tuve que realizarla por resta en esta sección.\n */\n $this->ind_inasistentes_no_just = count($this->inasistentes) - $this->ind_inasistentes_si_just;\n\n $this->Repeater->DataSource = $this->justificaciones;\n $this->Repeater->dataBind();\n\n $xale=rand(100,99999);\n // Se realiza la construcción del gráfico para indicadores\n\n $chart = new PieChart();\n $dataSet = new XYDataSet();\n if ($this->ind_asistentes>=1) {$dataSet->addPoint(new Point(\"Funcionarios Asistentes: (\".$this->ind_asistentes.\")\", $this->ind_asistentes));};\n if ($this->ind_inasistentes_no_just>=1) {$dataSet->addPoint(new Point(\"Inasistentes NO JUSTIFICADOS: (\".$this->ind_inasistentes_no_just.\")\", $this->ind_inasistentes_no_just));};\n if ($this->ind_inasistentes_si_just>=1) {$dataSet->addPoint(new Point(\"Inasistentes JUSTIFICADOS: (\".$this->ind_inasistentes_si_just.\")\", $this->ind_inasistentes_si_just));};\n $chart->setDataSet($dataSet);\n $chart->setTitle(\"Porcentajes de Asistencias / Inasistencias del: \".$this->txt_fecha_desde->Text);\n elimina_grafico($xale.\"_01.png\");\n $chart->render(\"imagenes/temporales/\".$xale.\"_01.png\");\n $this->grafico1->ImageUrl = \"imagenes/temporales/\".$xale.\"_01.png\";\n\n\n $chart2 = new PieChart();\n $dataSet2 = new XYDataSet();\n $this->ind_asistentes_no_retrasados=$this->ind_asistentes-$this->ind_asistentes_tarde_no_just-$this->ind_asistentes_tarde_si_just;\n if ($this->ind_asistentes_no_retrasados>=1) {$dataSet2->addPoint(new Point(\"Puntuales: (\".$this->ind_asistentes_no_retrasados.\")\", $this->ind_asistentes_no_retrasados));};\n if ($this->ind_asistentes_tarde_no_just>=1) {$dataSet2->addPoint(new Point(\"Impuntuales NO JUSTIFICADOS: (\".$this->ind_asistentes_tarde_no_just.\")\", $this->ind_asistentes_tarde_no_just));};\n if ($this->ind_asistentes_tarde_si_just>=1) {$dataSet2->addPoint(new Point(\"Impuntuales JUSTIFICADOS: (\".$this->ind_asistentes_tarde_si_just.\")\", $this->ind_asistentes_tarde_si_just));};\n $chart2->setDataSet($dataSet2);\n $chart2->setTitle(\"Porcentajes de Retrasos del: \".$this->txt_fecha_desde->Text);\n elimina_grafico($xale.\"_02.png\");\n $chart2->render(\"imagenes/temporales/\".$xale.\"_02.png\");\n $this->grafico2->ImageUrl = \"imagenes/temporales/\".$xale.\"_02.png\";\n\n // si la consulta de asistentes tiene resultados se habilita la impresion, sino, se deshabilita\n if (!empty($this->asistentes)) {$this->btn_imprimir->Enabled = true;} else {$this->btn_imprimir->Enabled = false;}\n\n }", "function afficher_produits_commande($id_resto) {\n global $connexion;\n try {\n $select = $connexion -> prepare(\"SELECT * \n FROM lunchr_commandes as lc, \n lunchr_ligne_commande as lcl, \n lunchr_produits as lp\n WHERE lc.lc_id = lcl.lc_id\n AND lp.lp_id = lcl.lp_id\n AND lc.lc_id = :id_resto\");\n $select -> execute(array(\"id_resto\" => $id_resto));\n $select -> setFetchMode(PDO::FETCH_ASSOC);\n $resultat = $select -> fetchAll();\n return $resultat;\n }\n \n catch (Exception $e) {\n print $e->getMessage();\n return false;\n }\n }", "function guardaoe(){\n\t\t$m = intval($_POST['totalitem']);\n\t\t$t = 0;\n\t\t// calcula el total de\n\t\tfor ( $i=0; $i < $m; $i++ ){\n\t\t\t$t += $_POST['cana_'.$i];\n\t\t}\n\t\tif ( $t <= 0 ) {\n\t\t\techo \"No hay pedido\";\n\t\t\treturn;\n\t\t}\n\n\t\t// Crea encabezado\n\t\t$numero = $this->datasis->fprox_numero('nprdo');\n\t\t$data['numero'] = $numero;\n\t\t$data['fecha'] = date('Y-m-d');\n\t\t$data['almacen'] = $_POST['almacen'];\n\t\t$data['status'] = 'A';\n\t\t$data['usuario'] = $this->secu->usuario();\n\t\t$data['estampa'] = date('Ymd');\n\t\t$data['hora'] = date('H:i:s');\n\n\t\t$data['instrucciones'] = $_POST['instrucciones'];\n\n\t\t$this->db->insert('prdo',$data);\n\n\t\t// Crea Detalle\n\t\t$ids = '';\n\t\tfor ( $i=0; $i < $m; $i++ ){\n\t\t\t$cana = $_POST['cana_'.$i];\n\t\t\tif ( $cana > 0 ){\n\t\t\t\t// Guarda\n\t\t\t\t$id = intval($_POST['idpfac_'.$i]);\n\t\t\t\t$mSQL = \"\n\t\t\t\tINSERT INTO itprdo (numero, pedido, codigo, descrip, cana, ordenado, idpfac )\n\t\t\t\tSELECT '${numero}' numero, a.numa pedido, a.codigoa codigo, a.desca descrip, a.cana, ${cana} ordenado, ${id} idpfac\n\t\t\t\tFROM itpfac a JOIN pfac b ON a.numa = b.numero\n\t\t\t\tWHERE a.id= ${id}\";\n\t\t\t\t$this->db->query($mSQL);\n\t\t\t}\n\t\t}\n\n\t\t// Crea totales\n\t\t$mSQL = \"\n\t\tINSERT INTO itprdop ( numero, codigo, descrip, ordenado, producido)\n\t\tSELECT '${numero}' numero, codigo, descrip, sum(ordenado) ordenado, 0 producido\n\t\tFROM itprdo\n\t\tWHERE numero = '${numero}'\n\t\tGROUP BY codigo\";\n\t\t$this->db->query($mSQL);\n\n\t}", "function idiomas_disponibles($id_palabra,$estado) {\n\t\n\t\tif ($estado==0) { $sql_estado='AND traducciones.estado = 0'; }\n\t\telseif ($estado==1) { $sql_estado='AND traducciones.estado = 1'; }\n\t\telseif ($estado==2) { $sql_estado='AND traducciones.estado = 2'; }\n\t\telse { $sql_estado=''; } \n\t\t$query = \"SELECT \n\t\ttraducciones.estado,traducciones.id_palabra,traducciones.id_idioma,\n\t\tidiomas.id_idioma,idiomas.idioma \n\t\tFROM traducciones, idiomas\n\t\tWHERE traducciones.id_palabra = '$id_palabra'\n\t\tAND traducciones.id_idioma = idiomas.id_idioma\n\t\t$sql_estado\n\t\tGROUP BY idiomas.id_idioma\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\tmysql_close($connection);\n\t\treturn $result;\n\t}", "function listarPais(){\n $this->procedimiento='rec.ft_cliente_sel';\n $this->transaccion='CLI_LUG_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n $this->setCount(false);\n //Definicion de la lista del resultado del query\n $this->captura('id_lugar','int4');\n $this->captura('codigo','varchar');\n $this->captura('estado_reg','varchar');\n $this->captura('id_lugar_fk','int4');\n $this->captura('nombre','varchar');\n $this->captura('sw_impuesto','varchar');\n $this->captura('sw_municipio','varchar');\n $this->captura('tipo','varchar');\n $this->captura('fecha_reg','timestamp');\n $this->captura('id_usuario_reg','int4');\n $this->captura('fecha_mod','timestamp');\n $this->captura('id_usuario_mod','int4');\n $this->captura('usr_reg','varchar');\n $this->captura('usr_mod','varchar');\n $this->captura('es_regional','varchar');\n\n //$this->captura('nombre_lugar','varchar');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n //var_dump($this->consulta); exit;\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function ProjetosRealizadosCliente($empresa = null) {\n\n $count = 0;\n $conexao = new classeConexao();\n\n //selecionando id dos projetos\n $projetos = $conexao::fetch(\"SELECT id FROM tb_projetos WHERE id_projetos_empresas_id = {$empresa}\");\n\n foreach ($projetos as $projeto) {\n\n //Qtd tarefas a fazer\n $tarefasFazer = $conexao::fetchuniq(\"SELECT COUNT(id) as qtd FROM tb_tarefas WHERE tb_tarefas_status=0 AND tb_tarefas_projeto = \".$projeto['id']);\n\n //Qtd tarefas feitas\n $tarefasFeitas = $conexao::fetchuniq(\"SELECT COUNT(id) as qtd FROM tb_tarefas WHERE tb_tarefas_status=1 AND tb_tarefas_projeto = \".$projeto['id']);\n\n //Porcentagem\n if(($tarefasFeitas['qtd'] + $tarefasFazer['qtd']) == 0){\n $qtd2 = 1;\n }else{\n $qtd2 = ($tarefasFeitas['qtd'] + $tarefasFazer['qtd']);\n }\n $porcentagem = ($tarefasFeitas['qtd'] * 100) / ($qtd2);\n\n if($porcentagem==100) {\n $count++;\n }\n }\n\n return $count;\n}", "public function AbonosCreditosId() \n{\n\tself::SetNames();\n\t$sql = \" SELECT clientes.codcliente, clientes.cedcliente, clientes.nomcliente, ventas.idventa, ventas.codventa, ventas.totalpago, ventas.statusventa, abonoscreditos.codventa as codigo, abonoscreditos.fechaabono, SUM(montoabono) AS abonototal FROM (clientes INNER JOIN ventas ON clientes.codcliente = ventas.codcliente) LEFT JOIN abonoscreditos ON ventas.codventa = abonoscreditos.codventa WHERE abonoscreditos.codabono = ? AND clientes.cedcliente = ? AND ventas.codventa = ? AND ventas.tipopagove ='CREDITO'\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(base64_decode($_GET['codabono'])));\n\t$stmt->bindValue(2, trim(base64_decode($_GET['cedcliente'])));\n\t$stmt->bindValue(3, trim(base64_decode($_GET['codventa'])));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function lista_proveedores($ubicacion,$idfamilia,$idservicio,$interno,$activo,$texto)\n\t{\n\n\t\t$condicion =\" WHERE 1 \";\n\n\t\tif ($idfamilia!='') $condicion.= \" AND cs.IDFAMILIA ='$idfamilia'\";\n\t\tif ($activo!='') $condicion.= \" AND (cp.ACTIVO = $activo)\";\n\t\tif ($idservicio!='') $condicion.= \" AND (cps.IDSERVICIO = '$idservicio' OR cps.IDSERVICIO ='0' )\";\n\t\tif ($interno!='') $condicion.= \" AND cp.INTERNO = '$interno' \";\n\t\tif ($texto!='') $condicion.= \" AND (cp.NOMBRECOMERCIAL like '%$texto%' OR cp.NOMBREFISCAL like '%$texto%')\";\n\n\t\t/* QUERY BUSCA LOA PROVEEDORES QUE PRESTAN EL SERVICIO*/\n\n\t\t$sql=\"\n\t\t\tSELECT \n\t\t\t\tcp.IDPROVEEDOR\n\t\t\tFROM \n\t\t\t$this->catalogo.catalogo_proveedor cp\n\t\t\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_servicio cps ON cps.IDPROVEEDOR = cp.IDPROVEEDOR \n\t\t\t\tLEFT JOIN $this->catalogo.catalogo_servicio cs ON cs.IDSERVICIO = cps.IDSERVICIO\n\t\t\t\t$condicion\n\t\t\t\t\n\t\t\tGROUP BY cps.IDPROVEEDOR\n\t\t\torder by cp.INTERNO DESC, cp.NOMBRECOMERCIAL ASC\n\t\t\";\n\n\n\t\t\t//\techo $sql;\n\t\t\t\t$res_prv= $this->query($sql);\n\t\t\t\t$lista_prov= array();\n\t\t\t\t$prov = new proveedor();\n\t\t\t\t$poli = new poligono();\n\t\t\t\t$circulo = new circulo();\n\t\t\t\t$point= array('lat'=>$ubicacion->latitud,'lng'=>$ubicacion->longitud);\n\n\t\t\t\tif ($ubicacion->cveentidad1==0){\n\t\t\t\t\twhile ($reg=$res_prv->fetch_object())\n\t\t\t\t\t{\n\t\t\t\t\t\t$lista_prov[$reg->IDPROVEEDOR][DISTANCIA]='';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\twhile ($reg_prv=$res_prv->fetch_object())\n\t\t\t\t\t{\n\t\t\t\t\t\t$prov->carga_datos($reg_prv->IDPROVEEDOR);\n\t\t\t\t\t\t$distancia= geoDistancia($ubicacion->latitud,$ubicacion->longitud,$prov->latitud,$prov->longitud,$prov->lee_parametro('UNIDAD_LONGITUD'));\n\t\t\t\t\t\t$sw=0;\n\n\t\t\t\t\t\t$condicion=\"\";\n\t\t\t\t\t\t$condicion.= \" cuf.CVEPAIS = '$ubicacion->cvepais'\";\n\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD1 in ('$ubicacion->cveentidad1','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD2 in ('$ubicacion->cveentidad2','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD3 in ('$ubicacion->cveentidad3','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD4 in ('$ubicacion->cveentidad4','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD5 in ('$ubicacion->cveentidad5','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD6 in ('$ubicacion->cveentidad6','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD7 in ('$ubicacion->cveentidad7','0'))\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$condicion.= \" OR (\"; \n\n\t\t\t\t\t\tif ($ubicacion->cveentidad1!='0') $condicion.= \" (cuf.CVEENTIDAD1 = '$ubicacion->cveentidad1')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad2!='0') $condicion.= \" AND (cuf.CVEENTIDAD2 = '$ubicacion->cveentidad2')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad3!='0') $condicion.= \" AND (cuf.CVEENTIDAD3 = '$ubicacion->cveentidad3')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad4!='0') $condicion.= \" AND (cuf.CVEENTIDAD4 = '$ubicacion->cveentidad4')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad5!='0') $condicion.= \" AND (cuf.CVEENTIDAD5 = '$ubicacion->cveentidad5')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad6!='0') $condicion.= \" AND (cuf.CVEENTIDAD6 = '$ubicacion->cveentidad6')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad7!='0') $condicion.= \" AND (cuf.CVEENTIDAD7 = '$ubicacion->cveentidad7')\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$condicion .= \" )\";\n\n\t\t\t\t\t\t/* QUERY BUSCA LAS UNIDADES FEDERATIVAS QUE COINCIDAN CON LA UBICACION PARA CADA PROVEEDOR*/\n\t\t\t\t\t\t$sql=\"\n\t\t\tSELECT \n\t\t\t\tcpsxuf.IDPROVEEDOR, cpsxuf.IDUNIDADFEDERATIVA,cpsxuf.ARRAMBITO\n\t\t\tFROM\n\t\t\t $this->catalogo.catalogo_proveedor_servicio_x_unidad_federativa cpsxuf\n\t\t\t\tLEFT JOIN $this->catalogo.catalogo_unidadfederativa cuf ON $condicion\n\t\t\tWHERE \n\t\t\t\tcpsxuf.IDUNIDADFEDERATIVA = cuf.IDUNIDADFEDERATIVA\n\t\t\t\tAND\tcpsxuf.IDPROVEEDOR ='$reg_prv->IDPROVEEDOR'\n\t\t\t\tand cpsxuf.IDSERVICIO IN ('$idservicio', '0')\n\t\t\t\tORDER BY 3 DESC\n\t\t\t\";\n\t\t\t\t\t//echo $sql;\n\t\t\t$res_prv_entid= $this->query($sql);\n\t\t\twhile ($reg_prv_entid= $res_prv_entid->fetch_object())\n\t\t\t{\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][DISTANCIA]= $distancia;\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][AMBITO]=\t$reg_prv_entid->ARRAMBITO;\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][TIPOPOLIGONO] ='ENTIDAD';\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][ID] = $reg_prv_entid->IDUNIDADFEDERATIVA;\n\t\t\t\tif ($reg_prv_entid->ARRAMBITO=='LOC') $sw=1; // si hubo algun entidad LOC se activa el sw\n\n\t\t\t}\n\t\t\tif (($ubicacion->latitud !='' )&& ($ubicacion->longitud!=''))\n\t\t\t{\n\t\t\t\t$sql=\"\n\t\t\t\tSELECT \n\t\t\t\t\tcpsxp.IDPROVEEDOR, cpsxp.IDPOLIGONO\n\t\t\t\tFROM \n\t\t\t\t$this->catalogo.catalogo_proveedor_servicio_x_poligono cpsxp\n\t\t\t\tWHERE\n\t\t\t\t\tcpsxp.IDPROVEEDOR ='$reg_prv->IDPROVEEDOR'\n\t\t\t\t\";\n\t\t\t\t$res_prv_poli= $this->query($sql);\n\t\t\t\twhile ($reg_prv_poli = $res_prv_poli->fetch_object())\n\t\t\t\t{\n\t\t\t\t\t// verifica si el punto esta incluido en el poligono\n\t\t\t\t\t$in = pointInPolygon($point,$poli->lee_vertices($reg_prv_poli->IDPOLIGONO));\n\t\t\t\t\tif (( $in ) && ($sw==0))\n\t\t\t\t\t{\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][DISTANCIA]= $distancia;\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][AMBITO]=\t$reg_prv_poli->ARRAMBITO;\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][TIPOPOLIGONO] ='POLIGONO';\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][ID] = $reg_prv_poli->IDPOLIGONO;\n\t\t\t\t\t\tif ($reg_prv_poli->ARRAMBITO=='LOC') $sw=1; // si hubo algun poligono LOC se activa el sw\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$sql=\"\n\t\t\t\tSELECT \n\t\t\t\t\tcpsxc.IDPROVEEDOR, cpsxc.IDCIRCULO\n\t\t\t\tFROM\n\t\t\t\t$this->catalogo.catalogo_proveedor_servicio_x_circulo cpsxc\n\t\t\t\tWHERE\n\t\t\t\t\tcpsxc.IDPROVEEDOR='$res_prv->IDPROVEEDOR'\n\t\t\t\t\";\n\n\t\t\t\t$res_prv_circ = $this->query($sql);\n\t\t\t\twhile ($reg_prv_circ = $res_prv_circ->fetch_object())\n\t\t\t\t{\n\t\t\t\t\t$circulo->leer($reg_prv_circ->IDCIRCULO);\n\t\t\t\t\t$vertices = $circulo->verticesCircle($circulo->latitud,$circulo->longitud,$circulo->radio,$circulo->idmedida);\n\t\t\t\t\t$in= pointInPolygon($point,$vertices);\n\n\t\t\t\t\tif (($in ) && ($sw==0))\n\t\t\t\t\t{\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][DISTANCIA]= $distancia;\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][AMBITO]=\t$reg_prv_circ->ARRAMBITO;\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][TIPOPOLIGONO] ='CIRCULO';\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][ID] = $reg_prv_circ->IDCIRCULO;\n\t\t\t\t\t\tif ($reg_prv_circ->ARRAMBITO=='LOC') $sw=1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // fin de la busqueda por LATITUD Y LONGITUD\n\n\n\n\n\n\t\t\t\t\t} // fin del while del proveedor\n\t\t\t\t}\n\n\t\t\t\t/* LEE LAS PROPORCIONES DE LA FORMULA DEL RANKING */\n\t\t\t\t$sql=\"\n\t\t\tSELECT \t\n\t\t\t\tELEMENTO,PROPORCION \n\t\t\tFROM \n\t\t\t$this->catalogo.catalogo_proporciones_ranking\n\t\t\t\";\n\t\t\t$result=$this->query($sql);\n\n\t\t\twhile($reg = $result->fetch_object())\n\t\t\t$proporcion[$reg->ELEMENTO] = $reg->PROPORCION;\n\n\n\t\t\t$max_costo_int=0;\n\t\t\t$max_costo_ext=0;\n\n\n\t\t\t/* OBTENER DATOS PARA EVALUAR EL RANKING */\n\t\t\tforeach ($lista_prov as $idproveedor=>$proveedor)\n\t\t\t{\n\t\t\t\t$sql=\"\n\t\tSELECT \n\t\t\tIF (cp.ARREVALRANKING='SKILL',IF (cp.SKILL>0,cp.SKILL/100,0), IF (cp.CDE>0,cp.CDE/100,0)) VALRANKING,\n\t\t\tIF (cpscn.MONTOLOCAL IS NULL,0,cpscn.MONTOLOCAL) COSTO,\n\t\t\tIF (cp.EVALSATISFACCION>0,cp.EVALSATISFACCION/100,0) EVALSATISFACCION ,\n\t\t\tcp.EVALINFRAESTRUCTURA EVALINFRAESTRUCTURA,\n\t\t\tcp.EVALFIDELIDAD EVALFIDELIDAD,\n\t\t\tcp.INTERNO\n\t\tFROM \n\t\t$this->catalogo.catalogo_proveedor cp\n\t\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_servicio_costo_negociado cpscn ON cpscn.IDPROVEEDOR = cp.IDPROVEEDOR AND cpscn.IDSERVICIO = '$idservicio' AND cpscn.IDCOSTO = 1\n\t\tWHERE \n\t\t\tcp.IDPROVEEDOR = '$idproveedor' \n\t\t\";\n\t\t//\t\t\t\techo $sql;\n\t\t$result = $this->query($sql);\n\n\t\twhile ($reg=$result->fetch_object())\n\t\t{\n\t\t\tif ($reg->INTERNO){\n\t\t\t\t$temp_prov_int[$idproveedor][VALRANKING] = $reg->VALRANKING;\n\t\t\t\t$temp_prov_int[$idproveedor][COSTO] = $reg->COSTO;\n\t\t\t\t$temp_prov_int[$idproveedor][EVALSATISFACCION] = $reg->EVALSATISFACCION;\n\t\t\t\t$temp_prov_int[$idproveedor][EVALINFRAESTRUCTURA] = $reg->EVALINFRAESTRUCTURA;\n\t\t\t\t$temp_prov_int[$idproveedor][EVALFIDELIDAD] = $reg->EVALFIDELIDAD;\n\t\t\t\tif ($reg->COSTO > $max_costo_int) $max_costo_int= $reg->COSTO;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$temp_prov_ext[$idproveedor][VALRANKING] = $reg->VALRANKING;\n\t\t\t\t$temp_prov_ext[$idproveedor][COSTO] = $reg->COSTO;\n\t\t\t\t$temp_prov_ext[$idproveedor][EVALSATISFACCION] = $reg->EVALSATISFACCION;\n\t\t\t\t$temp_prov_ext[$idproveedor][EVALINFRAESTRUCTURA] = $reg->EVALINFRAESTRUCTURA;\n\t\t\t\t$temp_prov_ext[$idproveedor][EVALFIDELIDAD] = $reg->EVALFIDELIDAD;\n\t\t\t\tif ($reg->COSTO > $max_costo_ext) $max_costo_ext= $reg->COSTO;\n\t\t\t}\n\t\t}\n\n\t\t\t}\n\n\t\t\t/*calcula el Ranking de proveedores internos */\n\n\t\t\tforeach ($temp_prov_int as $idproveedor=>$proveedor)\n\t\t\t{\n\t\t\t\t$valranking = round($proveedor[VALRANKING] * $proporcion[CDE_SKILL],4);\n\t\t\t\t$valcosto = ($proveedor[COSTO]==0)?0:(1-($proveedor[COSTO]/$max_costo_int))*$proporcion[COSTO];\n\t\t\t\t$evalsatisfaccion = round($proveedor[EVALSATISFACCION] * $proporcion[SATISFACCION],2);\n\t\t\t\t$evalinfraestructura = round($proveedor[EVALINFRAESTRUCTURA] * $proporcion[INFRAESTRUCTURA],2);\n\t\t\t\t$evalfidelidad = round($proveedor[EVALFIDELIDAD] * $proporcion[FIDELIDAD],2);\n\t\t\t\t$lista_prov_int[$idproveedor][RANKING] = ($valranking + $valcosto+$evalsatisfaccion + $evalinfraestructura + $evalfidelidad)*100;\n\t\t\t}\n\n\t\t\t/*calcula el Ranking de proveedores externos */\n\t\t\tforeach ($temp_prov_ext as $idproveedor=>$proveedor)\n\t\t\t{\n\t\t\t\t$valranking = round($proveedor[VALRANKING] * $proporcion[CDE_SKILL],4);\n\t\t\t\t$valcosto = ($proveedor[COSTO]==0)?0:(1-($proveedor[COSTO]/$max_costo_ext))*$proporcion[COSTO];\n\t\t\t\t$evalsatisfaccion = round($proveedor[EVALSATISFACCION] * $proporcion[SATISFACCION],2);\n\t\t\t\t$evalinfraestructura = round($proveedor[EVALINFRAESTRUCTURA] * $proporcion[INFRAESTRUCTURA],2);\n\t\t\t\t$evalfidelidad = round($proveedor[EVALFIDELIDAD] * $proporcion[FIDELIDAD],2);\n\t\t\t\t$lista_prov_ext[$idproveedor][RANKING] = ($valranking + $valcosto+$evalsatisfaccion + $evalinfraestructura + $evalfidelidad)*100;\n\t\t\t}\n\n\t\t\t$temp_prov_int = ordernarArray($lista_prov_int,'RANKING',1);\n\t\t\t$temp_prov_ext = ordernarArray($lista_prov_ext,'RANKING',1);\n\n\n\t\t\tforeach ($temp_prov_int as $idproveedor => $proveedor)\n\t\t\t{\n\t\t\t\t$lista_ordenada[$idproveedor] = $lista_prov[$idproveedor];\n\t\t\t\t$lista_ordenada[$idproveedor][RANKING] = $lista_prov_int[$idproveedor][RANKING];\n\t\t\t}\n\t\t\tforeach ($temp_prov_ext as $idproveedor => $proveedor)\n\t\t\t{\n\t\t\t\t$lista_ordenada[$idproveedor] = $lista_prov[$idproveedor];\n\t\t\t\t$lista_ordenada[$idproveedor][RANKING] = $lista_prov_ext[$idproveedor][RANKING];\n\t\t\t}\n\t\t\t/* DEVUELVE EL ARRAY*/\n\t\t\treturn $lista_ordenada ;\n\n\t}", "function listar($camposMostrar,$campo,$operador,$valor,$separador,$inicio,$fin)\n\t\t{\n\t\t\t$tablas=\"menciones*\".$this->tabla;\n\t\t\t$campos=\"en.mencion*en.apellidos*en.mencion\".$campo;\n\t\t\t$operadores=\"=*=*=\".$operador;\n\t\t\t$valores=\"me.id*\".$valor;\n\t\t\t$config=new config($tablas,$this->id,\"en.codigo*en.apellidos*en.nombres*en.maestria*me.nombre*en.anoEgreso*en.ofEnlace\",$campos,$operadores,$valores,\"AND*AND\",\"\",\"\",\"me*en\",$inicio,$fin);\n\t\t\t$config->enlazar();\n\t\t\t$a=$config->conn->crearConsultaMultiple();\n\t\t\treturn $a;\n\t\t}", "function ConsultarMedicamentosAPH(){\n $sql = \"CALL spConsultarMedicamentosAPH(?)\";\n $query = $this->_CONEXION->prepare($sql);\n $query->bindParam(1, $this->idReporteAPH);\n $query->execute();\n if ($query->rowCount() > 0) {\n return array('medicamentos' => $query->fetchAll());\n }else{\n return array('medicamentos' => null);\n }\n }", "public function BuscarComprasFechas() \n\t{\n\t\tself::SetNames();\n\t\t$sql = \" SELECT compras.codcompra, compras.subtotalivasic, compras.subtotalivanoc, compras.ivac, compras.totalivac, compras.descuentoc, compras.totaldescuentoc, compras.totalc, compras.statuscompra, compras.fechavencecredito, compras.fechacompra, proveedores.ritproveedor, proveedores.nomproveedor, SUM(detallecompras.cantcompra) AS articulos FROM (compras INNER JOIN proveedores ON compras.codproveedor = proveedores.codproveedor) INNER JOIN usuarios ON compras.codigo = usuarios.codigo LEFT JOIN detallecompras ON detallecompras.codcompra = compras.codcompra WHERE DATE_FORMAT(compras.fechacompra,'%Y-%m-%d') >= ? AND DATE_FORMAT(compras.fechacompra,'%Y-%m-%d') <= ? GROUP BY compras.codcompra\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"<div class='alert alert-danger'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN COMPRAS DE PRODUCTOS PARA EL RANGO DE FECHA INGRESADO</center>\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[]=$row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function IngredientesPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM ingredientes LEFT JOIN proveedores ON ingredientes.codproveedor = proveedores.codproveedor WHERE ingredientes.codingrediente = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codingrediente\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function gestionPedidos(){\n Utils::isAdmin();\n $gestion = true;\n\n $oPedido = new Pedido();\n $pedidos = $oPedido->getAll();\n\n require_once 'views/pedido/mis_pedidos.php';\n }", "public function pesquisa($nome){\n\t\t\t$Oconn = new conexaoClass();\n\t\t\t$Oconn -> abrir_conexao();\n\t\t\t$sql = \"SELECT * FROM noticias WHERE id='\".$nome.\"'\";\n\t\t\t$conn = $Oconn -> getconn();\n\t\t\t$this -> resultado = $conn -> query($sql);\n\t\t}", "public function projetosFiscalizacaoPesquisar($where)\n {\n $tbFiscalizacao = $this->select();\n $tbFiscalizacao->setIntegrityCheck(false);\n $tbFiscalizacao->from(array(\"tbFiscalizacao\" => 'tbFiscalizacao'), array('*'));\n $tbFiscalizacao->where('stFiscalizacaoProjeto = ?', '0');\n $tbFiscalizacao->orWhere('stFiscalizacaoProjeto = ?', '1');\n\n $select = $this->select();\n $select->setIntegrityCheck(false);\n $select->from(\n array(\"p\" => $this->_name),\n array(\n 'p.IdPRONAC',\n 'p.AnoProjeto',\n 'p.Sequencial',\n 'p.idProjeto',\n 'p.NomeProjeto',\n 'p.CgcCpf'\n )\n );\n $select->joinLeft(\n array('i' => 'Interessado'),\n 'p.CgcCpf = i.CgcCpf',\n array('Nome as Proponente'),\n \"SAC.dbo\"\n );\n $select->joinLeft(\n array('tf' => 'tbFiscalizacao'),\n 'tf.IdPRONAC = p.IdPRONAC',\n array('idFiscalizacao',\n 'dtInicioFiscalizacaoProjeto',\n 'dtFimFiscalizacaoProjeto',\n 'stFiscalizacaoProjeto',\n 'dsFiscalizacaoProjeto',\n 'dtRespostaSolicitada',\n 'idUsuarioInterno AS idTecnico'\n ),\n \"SAC.dbo\"\n );\n $select->joinLeft(\n array('tbNm' => 'Nomes'),\n \"tf.idAgente = tbNm.idAgente\",\n array('Descricao AS nmTecnico'),\n 'Agentes.dbo'\n );\n $select->joinLeft(\n array('trf' => 'tbRelatorioFiscalizacao'),\n 'tf.idFiscalizacao = trf.idFiscalizacao',\n array('stAvaliacao'),\n \"SAC.dbo\"\n );\n $select->joinLeft(\n array('AUXF' => $tbFiscalizacao),\n 'AUXF.IdPRONAC = tf.IdPRONAC',\n array()\n );\n\n foreach ($where as $coluna => $valor) {\n $select->where($coluna, $valor);\n }\n\n $select->order('p.AnoProjeto');\n\n return $this->fetchAll($select);\n }" ]
[ "0.64708805", "0.6157248", "0.61484003", "0.6116223", "0.6113456", "0.6052083", "0.6030047", "0.60179204", "0.6017553", "0.6004943", "0.6003943", "0.59942424", "0.59890795", "0.59845006", "0.59797084", "0.59740126", "0.59704584", "0.59461904", "0.5944612", "0.5936868", "0.5933021", "0.59241766", "0.592368", "0.5908676", "0.5899547", "0.5897043", "0.5890264", "0.5884285", "0.5878479", "0.5872756", "0.5864775", "0.58636963", "0.5854048", "0.5843302", "0.5842137", "0.5840908", "0.5839079", "0.583675", "0.58349407", "0.58345515", "0.58283037", "0.5818897", "0.5815167", "0.5810896", "0.58024776", "0.57852805", "0.5776992", "0.57686293", "0.57672423", "0.576537", "0.5760586", "0.57561034", "0.57549334", "0.57518125", "0.57507753", "0.57474643", "0.5744911", "0.57345665", "0.57340133", "0.5728192", "0.572429", "0.5723714", "0.57204664", "0.5720088", "0.5718129", "0.57176125", "0.570596", "0.57033914", "0.57029855", "0.5701232", "0.5693859", "0.56928974", "0.5689513", "0.56858575", "0.56846493", "0.56836724", "0.5682274", "0.56798106", "0.56741095", "0.5670479", "0.5669053", "0.5665078", "0.56619346", "0.56601304", "0.56595504", "0.5657425", "0.5656919", "0.56554174", "0.5653072", "0.56519777", "0.56505823", "0.56499755", "0.5649893", "0.56480736", "0.56480217", "0.5645395", "0.56415164", "0.5639181", "0.56384873", "0.563792", "0.56336313" ]
0.0
-1
consulta pedidos prontos a facturar
function DetallePedidosProntoAFacturar($CardCode,$NumPedido){ if($this->con->conectar()==true){ $Resultado = mysql_query("SELECT * FROM `PedidosProntosAFacturar` WHERE `CardCode` = '" .$CardCode. "' and `NumPedido` = '" .$NumPedido. "'"); if($Resultado){ echo"<a class='ClassBotones' id='IrPagos' href='javascript:ObtienePedidosProntosAFacturar(\"".$CardCode."\");'>Regresar</a> <table class='altrowstable' id='alternatecolor' align='center'> <tr> <th>Num Pedido</th> <th>Foto</th> <th>CodArticulo</th> <th>Descripcion</th> <th>Cantidad</th> <th>%Descuento</th> <th>I.V</th> <th>Precio</th> <th>Total</th> </tr>"; while( $PedidoHecho = mysql_fetch_array($Resultado) ) { echo"<tr> <td>". $PedidoHecho['NumPedido']."</td> <td>"; if (file_exists("../img/Articulos/".trim($ItemCode).".jpg")) { echo" <img src='img/Articulos/$ItemCode.jpg' width='100' height='117'>"; } else { echo"<img src='img/General/SinImagenDisponible.jpg' width='100' height='115'>"; } $TotalLinea = 0; if($PedidoHecho['Impuesto']=="13.00") { $IVI = "1.13"; $TotalLinea= $PedidoHecho['Cantidad']*$PedidoHecho['Precio']* $IVI; } else { $TotalLinea= $PedidoHecho['Cantidad']*$PedidoHecho['Precio'] ; } echo" </td> <td>". $PedidoHecho['CodArticulo']."</td> <td>". $PedidoHecho['Descripcion']."</td> <td>". $PedidoHecho['Cantidad']."</td> <td>". number_format("0.0", 2)."</td> <td>". number_format($PedidoHecho['Impuesto'], 2) ."</td> <td>". number_format($PedidoHecho['Precio'], 2) ."</td> <td>". number_format($TotalLinea, 2) . "\n" ."</td> </tr>"; $Total_Pedido = $Total_Pedido + ($TotalLinea); // $Total_Articulos = $Result["NumItems"]; }//FIN WHILE echo "<tr> <td colspan='8' align='center'>TOTAL</td> <td >". number_format($Total_Pedido, 2)."</td> </tr> </table>"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function consultasPendientes(){\n\n\t\t$resultado = array();\n\t\t\n\t\t$query = \"SELECT count(C.idConsulta) as cantidadConsultas\n\t\t\n\t\t\t\t\t\tFROM tb_consultas AS C \n\t\t\t\t\t\t\n \t\t\t\tWHERE Not C.idConsulta IN (SELECT idTipoDetalle FROM tb_pago_factura_caja_detalle WHERE tipoDetalle = 'Consulta' AND estado = 'Activo' )\";\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n\t\tif($res = $conexion->query($query)){\n \n /* obtener un array asociativo */\n while ($filas = $res->fetch_assoc()) {\n $resultado = $filas;\n }\n \n /* liberar el conjunto de resultados */\n $res->free();\n \n }\n\n return $resultado['cantidadConsultas'];\t\n\n\n\t\t\n\t}", "public function AgregaPedidos()\n{\n\n\tif(empty($_SESSION[\"CarritoVentas\"]))\n\t\t\t\t{\n\t\t\t\t\techo \"3\";\n\t\t\t\t\texit;\n\n\t\t\t\t} \n\n\t$ver = $_SESSION[\"CarritoVentas\"];\n\tfor($i=0;$i<count($ver);$i++){ \n\n\t\t$sql = \"select existencia from productos where codproducto = '\".$ver[$i]['txtCodigo'].\"'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$existenciadb = $row['existencia'];\n\n\t\tif($ver[$i]['cantidad'] > $existenciadb) {\n\n\t\t\techo \"4\";\n\t\t\texit; }\n\t\t}\n\n\t$ven = $_SESSION[\"CarritoVentas\"];\n\tfor($i=0;$i<count($ven);$i++){\n\n\t$sql = \"select existencia from productos where codproducto = '\".$ven[$i]['txtCodigo'].\"'\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\t$existenciadb = $row['existencia'];\n\n\n\t\t$sql = \"select * from detalleventas where codventa = ? and codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array( $_POST[\"codventa\"], $ven[$i]['txtCodigo'] ) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num>0)\n\t\t{\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $row;\n\t\t\t}\n\t\t\t$codproducto = $pae[0]['codproducto'];\n\t\t\t$cantven = $pae[0]['cantventa'];\n\t\t\t$import = $pae[0]['importe'];\n\t\t\t$import2 = $pae[0]['importe2'];\n\n\t\t\t$sql = \" update detalleventas set \"\n\t\t\t.\" cantventa = ?, \"\n\t\t\t.\" importe = ?, \"\n\t\t\t.\" importe2 = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codventa = '\".$_POST[\"codventa\"].\"' and codproducto = '\".$ven[$i]['txtCodigo'].\"';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $cantidad);\n\t\t\t$stmt->bindParam(2, $importe);\n\t\t\t$stmt->bindParam(3, $importe2);\n\n\t\t\t$cantidad = rount($ven[$i]['cantidad']+$cantven,2);\n\t\t\t$importe = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio2']+$import);\n\t\t\t$importe2 = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio']+$import2);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$existencia = rount($existenciadb-$ven[$i]['cantidad'],2);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" statusproducto = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"' and existencia = '0';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $statusproducto);\n\t\t\t$statusproducto = \"INACTIVO\";\n\t\t\t$stmt->execute();\n\n################## REGISTRAMOS LOS DATOS DE PRODUCTOS EN KARDEX #################\n\t\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $movimiento);\n\t\t\t$stmt->bindParam(5, $entradas);\n\t\t\t$stmt->bindParam(6, $salidas);\n\t\t\t$stmt->bindParam(7, $devolucion);\n\t\t\t$stmt->bindParam(8, $stockactual);\n\t\t\t$stmt->bindParam(9, $preciounit);\n\t\t\t$stmt->bindParam(10, $costototal);\n\t\t\t$stmt->bindParam(11, $documento);\n\t\t\t$stmt->bindParam(12, $fechakardex);\n\n\t\t\t$codventa = strip_tags($_POST[\"codventa\"]);\n\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t$codproducto = strip_tags($ven[$i]['txtCodigo']);\n\t\t\t$movimiento = strip_tags(\"SALIDAS\");\n\t\t\t$entradas = strip_tags(\"0\");\n\t\t\t$salidas = rount($ven[$i]['cantidad'],2);\n\t\t\t$devolucion = strip_tags(\"0\");\n\t\t\t$stockactual = rount($existenciadb-$ven[$i]['cantidad'],2); \n\t\t\t$preciounit = strip_tags($ven[$i]['precio2']);\n\t\t\t$costototal = strip_tags($ven[$i]['precio2'] * $ven[$i]['cantidad']);\n\t\t\t$documento = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t$fechakardex = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t$stmt->execute();\n\n\n############## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ###############\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array( $ven[$i]['txtCodigo'] ) );\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto IN ('\".$ven[$i]['txtCodigo'].\"')\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$racion = rount($cantracion*$cantidad,2);\n\t\t\t$cantidadracion = rount($cantingrediente-$racion,2);\n\t\t\t$stmt->execute();\n\n\n##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX #####################\n\t\t\t\t\t$query = \" insert into kardexingredientes values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t\t\t$stmt->bindParam(4, $codingrediente);\n\t\t\t\t\t$stmt->bindParam(5, $movimientoing);\n\t\t\t\t\t$stmt->bindParam(6, $entradasing);\n\t\t\t\t\t$stmt->bindParam(7, $salidasing);\n\t\t\t\t\t$stmt->bindParam(8, $stockactualing);\n\t\t\t\t\t$stmt->bindParam(9, $preciouniting);\n\t\t\t\t\t$stmt->bindParam(10, $costototaling);\n\t\t\t\t\t$stmt->bindParam(11, $documentoing);\n\t\t\t\t\t$stmt->bindParam(12, $fechakardexing);\n\n\t\t\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t\t\t$codproducto = strip_tags($codproducto);\n\t\t\t\t\t$codingrediente = strip_tags($codingrediente);\n\t\t\t\t\t$movimientoing = strip_tags(\"SALIDAS\");\n\n\t\t\t\t\t$entradasing = strip_tags(\"0\");\n\t\t\t\t\t$salidasing = rount($cantracion*$cantidad,2);\n\t\t\t\t\t$stockactualing = rount($cantingrediente-$racion,2);\n\t\t\t\t\t$preciouniting = strip_tags($costoingrediente);\n\t\t\t\t\t$costototaling = strip_tags($costoingrediente * $cantidad);\n\n\t\t\t\t\t$documentoing = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t\t\t$fechakardexing = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t\t\t$stmt->execute();\n\t##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX ###################\n\n\t\t }\n\n}\n############## FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ###########\t\n\n\n\t\t}\n\t\telse\n\t\t{\n\n\n\t\t\t$query = \" insert into detalleventas values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $producto);\n\t\t\t$stmt->bindParam(5, $codcategoria);\n\t\t\t$stmt->bindParam(6, $cantidad);\n\t\t\t$stmt->bindParam(7, $preciocompra);\n\t\t\t$stmt->bindParam(8, $precioventa);\n\t\t\t$stmt->bindParam(9, $ivaproducto);\n\t\t\t$stmt->bindParam(10, $importe);\n\t\t\t$stmt->bindParam(11, $importe2);\n\t\t\t$stmt->bindParam(12, $fechadetalleventa);\n\t\t\t$stmt->bindParam(13, $statusdetalle);\n\t\t\t$stmt->bindParam(14, $codigo);\n\n\t\t\t$codventa = strip_tags($_POST[\"codventa\"]);\n\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t$codproducto = strip_tags($ven[$i]['txtCodigo']);\n\t\t\t$producto = strip_tags($ven[$i]['descripcion']);\n\t\t\t$codcategoria = strip_tags($ven[$i]['tipo']);\n\t\t\t$cantidad = rount($ven[$i]['cantidad'],2);\n\t\t\t$preciocompra = strip_tags($ven[$i]['precio']);\n\t\t\t$precioventa = strip_tags($ven[$i]['precio2']);\n\t\t\t$ivaproducto = strip_tags($ven[$i]['ivaproducto']);\n\t\t\t$importe = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio2']);\n\t\t\t$importe2 = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio']);\n\t\t\t$fechadetalleventa = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t$statusdetalle = \"1\";\n\t\t\t$codigo = strip_tags($_SESSION['codigo']);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$existencia = rount($existenciadb-$ven[$i]['cantidad'],2);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" statusproducto = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"' and existencia = '0';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $statusproducto);\n\t\t\t$statusproducto = \"INACTIVO\";\n\t\t\t$stmt->execute();\n\n##################### REGISTRAMOS LOS DATOS DE PRODUCTOS EN KARDEX ###################\n\t\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $movimiento);\n\t\t\t$stmt->bindParam(5, $entradas);\n\t\t\t$stmt->bindParam(6, $salidas);\n\t\t\t$stmt->bindParam(7, $devolucion);\n\t\t\t$stmt->bindParam(8, $stockactual);\n\t\t\t$stmt->bindParam(9, $preciounit);\n\t\t\t$stmt->bindParam(10, $costototal);\n\t\t\t$stmt->bindParam(11, $documento);\n\t\t\t$stmt->bindParam(12, $fechakardex);\n\n\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t$codproducto = strip_tags($ven[$i]['txtCodigo']);\n\t\t\t$movimiento = strip_tags(\"SALIDAS\");\n\t\t\t$entradas = strip_tags(\"0\");\n\t\t\t$salidas =rount($ven[$i]['cantidad'],2);\n\t\t\t$devolucion = strip_tags(\"0\");\n\t\t\t$stockactual = rount($existenciadb-$ven[$i]['cantidad'],2);\n\t\t\t$preciounit = strip_tags($ven[$i]['precio2']);\n\t\t\t$costototal = strip_tags($ven[$i]['precio2'] * $ven[$i]['cantidad']);\n\t\t\t$documento = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t$fechakardex = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t$stmt->execute();\t\n\n\n############### CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array( $ven[$i]['txtCodigo'] ) );\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto IN ('\".$ven[$i]['txtCodigo'].\"')\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$racion = rount($cantracion*$cantidad,2);\n\t\t\t$cantidadracion = rount($cantingrediente-$racion,2);\n\t\t\t$stmt->execute();\n\n\n##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX #####################\n$query = \" insert into kardexingredientes values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t\t\t$stmt->bindParam(4, $codingrediente);\n\t\t\t\t\t$stmt->bindParam(5, $movimientoing);\n\t\t\t\t\t$stmt->bindParam(6, $entradasing);\n\t\t\t\t\t$stmt->bindParam(7, $salidasing);\n\t\t\t\t\t$stmt->bindParam(8, $stockactualing);\n\t\t\t\t\t$stmt->bindParam(9, $preciouniting);\n\t\t\t\t\t$stmt->bindParam(10, $costototaling);\n\t\t\t\t\t$stmt->bindParam(11, $documentoing);\n\t\t\t\t\t$stmt->bindParam(12, $fechakardexing);\n\n\t\t\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t\t\t$codproducto = strip_tags($codproducto);\n\t\t\t\t\t$codingrediente = strip_tags($codingrediente);\n\t\t\t\t\t$movimientoing = strip_tags(\"SALIDAS\");\n\n\t\t\t\t\t$entradasing = strip_tags(\"0\");\n\t\t\t\t\t$salidasing = rount($cantracion*$cantidad,2);\n\t\t\t\t\t$stockactualing = rount($cantingrediente-$racion,2);\n\t\t\t\t\t$preciouniting = strip_tags($costoingrediente);\n\t\t\t\t\t$costototaling = strip_tags($costoingrediente * $cantidad);\n\n\t\t\t\t\t$documentoing = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t\t\t$fechakardexing = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t\t\t$stmt->execute();\n##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX ###################\n\n\t\t }\n\n}\n############# FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS #############\t\n\n\t\t}\n\t}\n\n\t$sql4 = \"select * from ventas where codventa = ? \";\n\t$stmt = $this->dbh->prepare($sql4);\n\t$stmt->execute( array($_POST[\"codventa\"]) );\n\t$num = $stmt->rowCount();\n\n\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$paea[] = $row;\n\t\t}\n\t\t$subtotalivasive = $paea[0][\"subtotalivasive\"];\n\t\t$subtotalivanove = $paea[0][\"subtotalivanove\"];\n\t\t$iva = $paea[0][\"ivave\"]/100;\n\t\t$descuento = $paea[0][\"descuentove\"]/100;\n\t\t$totalivave = $paea[0][\"totalivave\"];\n\t\t$totaldescuentove = $paea[0][\"totaldescuentove\"];\n\n\n\t\t$sql3 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'SI'\";\n\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t$stmt->execute( array($_POST[\"codventa\"]));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$preciocompraiva = $p[0][\"preciocompra\"];\n\t\t$importeiva = $p[0][\"importe\"];\n\t\t$importe2iva = $p[0][\"importe2\"];\n\n\t\t$sql5 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'NO'\";\n\t\t$stmt = $this->dbh->prepare($sql5);\n\t\t$stmt->execute( array($_POST[\"codventa\"]));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $row;\n\t\t\t}\n\t\t\t$preciocompra = $row[\"preciocompra\"];\n\t\t\t$importe = $row[\"importe\"];\n\t\t\t$importe2 = $row[\"importe2\"];\t\t\n\n\t\t\t$sql = \" update ventas set \"\n\t\t\t.\" subtotalivasive = ?, \"\n\t\t\t.\" subtotalivanove = ?, \"\n\t\t\t.\" totalivave = ?, \"\n\t\t\t.\" totaldescuentove = ?, \"\n\t\t\t.\" totalpago= ?, \"\n\t\t\t.\" totalpago2= ?, \"\n\t\t\t.\" observaciones= ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codventa = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $subtotalivasive);\n\t\t\t$stmt->bindParam(2, $subtotalivanove);\n\t\t\t$stmt->bindParam(3, $totaliva);\n\t\t\t$stmt->bindParam(4, $totaldescuentove);\n\t\t\t$stmt->bindParam(5, $total);\n\t\t\t$stmt->bindParam(6, $total2);\n\t\t\t$stmt->bindParam(7, $observaciones);\n\t\t\t$stmt->bindParam(8, $codventa);\n\n\t\t\t$subtotalivasive= rount($importeiva,2);\n\t\t\t$subtotalivanove= rount($importe,2);\n\t\t\t$totaliva= rount($subtotalivasive*$iva,2);\n\t\t\t$tot= rount($subtotalivasive+$subtotalivanove+$totaliva,2);\n\t\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t\t$total= rount($tot-$totaldescuentove,2);\n\t\t\t$total2= rount($preciocompra,2);\nif (strip_tags(isset($_POST['observaciones']))) { $observaciones = strip_tags($_POST['observaciones']); } else { $observaciones =''; }\n\t\t\t$codventa = strip_tags($_POST[\"codventa\"]);\n\t\t\t$stmt->execute();\n\n###### AQUI DESTRUIMOS TODAS LAS VARIABLES DE SESSION QUE RECIBIMOS EN CARRITO DE VENTAS ######\n\t\t\tunset($_SESSION[\"CarritoVentas\"]);\n\n\necho \"<div class='alert alert-success'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<span class='fa fa-check-square-o'></span> LOS DETALLES FUERON AGREGADOS A LA \".$_POST[\"nombremesa\"].\", EXITOSAMENTE <a href='reportepdf?codventa=\".base64_encode($codventa).\"&tipo=\".base64_encode(\"TICKETCOMANDA\").\"' class='on-default' data-placement='left' data-toggle='tooltip' data-original-title='Imprimir Comanda' target='_black'><strong>IMPRIMIR COMANDA</strong></a>\";\necho \"</div>\";\n\necho \"<script>window.open('reportepdf?codventa=\".base64_encode($codventa).\"&tipo=\".base64_encode(\"TICKETCOMANDA\").\"', '_blank');</script>\";\nexit;\n\n\t\t}", "function contarServicios()\n\t{\n\t\treturn \"select count(*) as number\nfrom trabajadores, servicios,sucursales where servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 1 \nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}", "public function ContarRegistros()\n\t{\n$sql = \"select\n(select count(*) from productos where existencia <= stockminimo) as stockproductos,\n(select count(*) from ingredientes where CAST(cantingrediente AS DECIMAL(10,5)) <= CAST(stockminimoingrediente AS DECIMAL(10,5))) as stockingredientes,\n(select count(*) from ventas where tipopagove = 'CREDITO' AND formapagove = '' AND fechavencecredito <= '\".date(\"Y-m-d\").\"') as creditosventasvencidos,\n(select count(*) from compras where tipocompra = 'CREDITO' AND statuscompra = 'PENDIENTE' AND fechavencecredito <= '\".date(\"Y-m-d\").\"') as creditoscomprasvencidos\";\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\treturn $this->p;\n\t\t$this->dbh=null;\n\t}", "public function get_ventas_consulta($id_paciente){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n \n\t$sql=\"select*from ventas where id_paciente=?;\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$id_paciente);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function consultar_dependencia($tabla,$filtro){\n $id = new MongoDB\\BSON\\ObjectId($filtro);\n $res = $this->mongo_db->where(array('eliminado'=>false,'id_modulo_vista'=>$id))->get($tabla);\n return count($res);\n }", "function consultarEstudiantesSinPrueba(){\n $cadena_sql=$this->cadena_sql(\"estudiantesSinPrueba\",$this->codProyecto);\n $estudiantes=$this->funcionGeneral->ejecutarSQL($this->configuracion, $this->accesoGestion, $cadena_sql,\"busqueda\" );\n return $estudiantes;\n }", "function contarServiciosFinalizados()\n\t{\n\t\treturn \"select count(*) as number\nfrom trabajadores, servicios,sucursales \nwhere servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 0\nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}", "function consultarEstudiantesParaHomologacion($cod_proyecto){\n $cadena_sql = $this->sql->cadena_sql(\"consultarEstudiantesProyecto\",$cod_proyecto);\n return $resultadoEspacio = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\n }", "function listarAnalisisPorqueDet(){\n\t\t$this->procedimiento='gem.ft_analisis_porque_det_sel';\n\t\t$this->transaccion='GM_DET_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_analisis_porque','id_analisis_porque','int4');\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_analisis_porque_det','int4');\n\t\t$this->captura('id_analisis_porque','int4');\n\t\t$this->captura('solucion','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('porque','varchar');\n\t\t$this->captura('respuesta','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function listarProcesoCompraPedido(){\n\t\t$this->procedimiento='adq.f_proceso_compra_sel';\n\t\t$this->transaccion='ADQ_PROCPED_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t$this->setParametro('id_proceso_compra','id_proceso_compra','int4');\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_proceso_compra','int4');\n\t\t$this->captura('id_depto','int4');\n\t\t$this->captura('num_convocatoria','varchar');\n\t\t$this->captura('id_solicitud','int4');\n\t\t$this->captura('id_estado_wf','int4');\n\t\t$this->captura('fecha_ini_proc','date');\n\t\t$this->captura('obs_proceso','varchar');\n\t\t$this->captura('id_proceso_wf','int4');\n\t\t$this->captura('num_tramite','varchar');\n\t\t$this->captura('codigo_proceso','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('estado','varchar');\n\t\t$this->captura('num_cotizacion','varchar');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t$this->captura('desc_depto','varchar');\n\t\t$this->captura('desc_funcionario','text');\n\t\t$this->captura('desc_solicitud','varchar');\n\t\t$this->captura('desc_moneda','varchar');\n\t\t\n\t\t \n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function buscar_comprobante_venta_3($anio ,$mes ,$fech1 ,$fech2 ,$tipodocumento) {\n //CPC_TipoDocumento => F factura, B boleta\n //CPC_total => total de la FACTURA o BOLETA CPC_FechaRegistro BETWEEN '20121201' AND '20121202'\n\n $where=\"\";\n //----------\n if($anio!=\"--\" && $mes ==\"--\"){// SOLO AÑO\n $where=\"AND YEAR(CPC_FechaRegistro)='\" . $anio . \"'\";\n }\n if($anio!=\"--\" && $mes !=\"--\" ){// MES Y AÑO\n $where=\"AND YEAR(CPC_FechaRegistro)='\" . $anio . \"' AND MONTH(CPC_FechaRegistro)='\" . $mes .\"'\";\n }\n if($anio==\"--\" && $mes !=\"--\"){//MES CON AÑO ACTUAL\n $where=\"AND YEAR(CPC_FechaRegistro)=' \".date(\"Y\").\"' AND MONTH(CPC_FechaRegistro)='\" . $mes .\"'\";\n }\n\n //-----------------\n \n if($anio==\"--\" && $mes ==\"--\" && $fech1!=\"--\" && $fech2==\"--\"){//FECHA INICIAL\n $where=\"AND CPC_FechaRegistro > '\" . $fech1 . \"'\";\n }\n if($anio==\"--\" && $mes ==\"--\" && $fech1!=\"--\" && $fech2!=\"--\" ){//FECHA INICIAL Y FECHA FINAL\n $where=\"AND CPC_FechaRegistro >= '\" . $fech1 . \"' AND CPC_FechaRegistro <= '\" . $fech2 . \"'\";\n }\n \n \n //------------\n\n \n $wheretdoc= \"\";\n if($tipodocumento !=\"--\")\n $wheretdoc= \" AND CPC_TipoDocumento='\".$tipodocumento.\"' \";\n\n \n\n $sql = \" SELECT com.*,CONCAT(pe.PERSC_Nombre , ' ', pe.PERSC_ApellidoPaterno, ' ', pe.PERSC_ApellidoMaterno) as nombre , MONED_Simbolo from cji_comprobante com\n inner join cji_cliente cl on cl.CLIP_Codigo = com.CLIP_Codigo\n inner join cji_persona pe on pe.PERSP_Codigo = cl.PERSP_Codigo\n inner JOIN cji_moneda m ON m.MONED_Codigo=com.MONED_Codigo \n WHERE CPC_TipoOperacion='V' \".$wheretdoc.$where.\"\n \n UNION \n SELECT com.* ,EMPRC_RazonSocial as nombre ,MONED_Simbolo from cji_comprobante com\n inner join cji_cliente cl on cl.CLIP_Codigo = com.CLIP_Codigo\n inner join cji_empresa es on es.EMPRP_Codigo = cl.EMPRP_Codigo\n inner JOIN cji_moneda m ON m.MONED_Codigo = com.MONED_Codigo \n WHERE CPC_TipoOperacion='V' \".$wheretdoc.$where.\"\";\n\n //echo $sql;\n $query = $this->db->query($sql);\n if ($query->num_rows > 0) {\n foreach ($query->result() as $fila) {\n $data[] = $fila;\n }\n return $data;\n }\n return array();\n }", "public function listar_mis_pedidos() {\n \n try {\n $sql = \"\n select \n c.nro_documento,\n c.nombre,\n c.correo,\n c.telefono_celular,\n p.direccion_entrega,\n p.referencia_entrega,\n p.observacion,\n d.descripcion,\n c.cod_distrito,\n f.descripcion,\n p.importe_total,\n p.fecha_pedido,\n p.nro_pedido,\n p.cantidad_productos,\n p.estado,\n p.id_pedido\n from \n cliente c inner join pedido p\n on\n c.id_cliente = p.id_cliente inner join distrito d\n on\n c.cod_distrito = d.cod_distrito inner join forma_pago f\n on\n f.id_forma_pago = p.id_forma_pago\n where\n p.estado = 'PENDIENTE' and c.id_cliente = '$_SESSION[cliente_id]'; \n \";\n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n return $resultado;\n } catch (Exception $exc) {\n throw $exc;\n }\n }", "public function ConsultarAsistenciaDiarias()\n {\n try {\n $datos = $_REQUEST;\n $filtros = array_filter($datos);\n $dbm = new DbmControlescolar($this->get(\"db_manager\")->getEntityManager());\n if($filtros['permiso'] != 1) {\n $id = $dbm->BuscarIProfesorTitular($filtros['grupoid']);\n if(!$id) {\n return new View(\"No se han encontrado profesores en el grupo consultado\", Response::HTTP_PARTIAL_CONTENT);\n }\n\n $usuario = $dbm->getRepositorioById('Usuario', 'profesorid', $id[0][\"profesorid\"]);\n if(!$usuario) {\n return new View(\"Se requiere tener un permiso especial o ser el profesor titular para poder consultar\", Response::HTTP_PARTIAL_CONTENT);\n \n }\n if($usuario->getUsuarioid() != $filtros['usuarioid']) {\n return new View(\"Se requiere tener un permiso especial o ser el profesor titular para poder consultar\", Response::HTTP_PARTIAL_CONTENT);\n }\n } \n $respuesta = $this->asistenciasDiarias($filtros, $dbm);\n if($respuesta['error']) {\n return new View($respuesta['mensaje'], Response::HTTP_PARTIAL_CONTENT);\n }\n return new View($respuesta, Response::HTTP_OK);\n } catch (\\Exception $e) {\n return new View($e->getMessage(), Response::HTTP_BAD_REQUEST);\n }\n }", "public function anularTodosDetallesFactura($idPagoFacturaCaja){\n\t\t\n\t\t\t\t\n\t\t$query = \"UPDATE tb_pago_factura_caja_detalle SET estado = 'Anulado' WHERE idPagoFacturaCaja = '$idPagoFacturaCaja'\";\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n\t\t$res = $conexion->query($query);\t\n\t\t\n\t\t//retornar los productos al inventario \n\t\t$query2 = \"SELECT idTipoDetalle, cantidad, idSucursal \n\t\t\t\t\tFROM tb_pago_factura_caja_detalle \n\t\t\t\t WHERE tipoDetalle = 'Producto' AND idPagoFacturaCaja = '$idPagoFacturaCaja' \";\n\t\t\n\t\tif($res2 = $conexion->query($query2)){\n\t\t\t\n\t\t\twhile ($filas = $res2->fetch_assoc()) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t$cantidadAumentar = \t$filas['cantidad'];\t\n\t\t\t\t$id \t\t\t\t=\t$filas['idTipoDetalle'];\n\t\t\t\t$sucursal\t\t\t= \t$filas['idSucursal'];\n\t\t\t\t\n\t\t\t\t$query3 = \"UPDATE tb_productos_sucursal SET cantidad = cantidad + '$cantidadAumentar' \n\t\t\t\t\t\t\tWHERE idSucursal = '$sucursal' AND idProducto = '$id'\";\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t$conexion->query($query3);\n\t\t\t\t\t\n\t\t\t}//fin while\n\t\t\t\n\t\t\t/* liberar el conjunto de resultados */\n\t\t\t$res2->free();\n\t\t\t\n\t\t}//fin if\n\t\t\n\t}", "public function RelatorioContasPagarPorFornecedor($where,$codigo){\n\t\t\t\t\n\t\t$dba = $this->dba;\n\n\t\t$vet = array();\n\n\n\t\t$sql =\"SELECT \n\t\t\t\td.emissao,\n\t\t\t\td.vencimento,\n\t\t\t\td.numero,\n\t\t\t\tsum(d.valordoc) as valordoc,\n\t\t\t\td.numero_nota,\n\t\t\t\tf.codigo,\n\t\t\t\tf.nome,\n\t\t\t\td.parcial1,\n\t\t\t\td.parcial2,\n\t\t\t\td.parcial3,\n\t\t\t\td.parcial4,\n\t\t\t\td.parcial5,\n\t\t\t\td.data_parcial1,\n\t\t\t\td.data_parcial2,\n\t\t\t\td.data_parcial3,\n\t\t\t\td.data_parcial4,\n\t\t\t\td.data_parcial5\n\t\t\tFROM\n\t\t\t\tduplic d\n\t\t\t\t\tinner join\n\t\t\t\tfornecedores f ON (f.codigo = d.cedente)\n\t\t\t\t\".$where.\"\n\t\t\t\t\tand f.codigo = \".$codigo.\"\n\t\t\tgroup by d.numero , d.numero_nota , d.emissao , f.codigo , f.nome , d.tipo , d.vencimento , d.parcial1 , d.parcial2 , d.parcial3 , d.parcial4 , d.parcial5 , d.data_parcial1 , d.data_parcial2 , d.data_parcial3 , d.data_parcial4 , d.data_parcial5\";\n\t\t\n\t\t$res = $dba->query($sql);\n\n\t\t$num = $dba->rows($res); \n\n\t\t$i = 0;\n\t\t\t\n\t\twhile($dup = ibase_fetch_object($res)){\t\t\n\t\t\t\n\t\t\t$numero = $dup->NUMERO;\n\t\t\t$valordoc = $dup->VALORDOC;\n\t\t\t$numnota = $dup->NUMERO_NOTA;\n\t\t\t$emissao\t = $dup->EMISSAO;\n\t\t\t$codfor = $dup->CODIGO;\n\t\t\t$nomfor = $dup->NOME;\t\t\t\t\t\n\t\t\t$vencimento = $dup->VENCIMENTO;\n\t\t\t$parcial1 = $dup->PARCIAL1;\n\t\t\t$parcial2 = $dup->PARCIAL2;\n\t\t\t$parcial3 = $dup->PARCIAL3;\n\t\t\t$parcial4 = $dup->PARCIAL4;\n\t\t\t$parcial5 = $dup->PARCIAL5;\n\t\t\t$data_parcial1 = $dup->DATA_PARCIAL1;\n\t\t\t$data_parcial2 = $dup->DATA_PARCIAL2;\n\t\t\t$data_parcial3 = $dup->DATA_PARCIAL3;\n\t\t\t$data_parcial4 = $dup->DATA_PARCIAL4;\n\t\t\t$data_parcial5 = $dup->DATA_PARCIAL5;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$duplic = new Duplic();\t\t\t\n\n\t\t\t$duplic->setNumero($numero);\n\t\t\t$duplic->setValorDoc($valordoc);\n\t\t\t$duplic->setNumeroNota($numnota);\n\t\t\t$duplic->setCodFornecedor($codfor);\n\t\t\t$duplic->setNomeFornevedor($nomfor);\n\t\t\t$duplic->setEmissao($emissao);\n\t\t\t$duplic->setVencimento($vencimento);\n\t\t\t$duplic->setParcial1($parcial1);\n\t\t\t$duplic->setParcial2($parcial2);\n\t\t\t$duplic->setParcial3($parcial3);\n\t\t\t$duplic->setParcial4($parcial4);\n\t\t\t$duplic->setParcial5($parcial5);\n\t\t\t$duplic->setDataParcial1($data_parcial1);\n\t\t\t$duplic->setDataParcial2($data_parcial2);\n\t\t\t$duplic->setDataParcial3($data_parcial3);\n\t\t\t$duplic->setDataParcial4($data_parcial4);\n\t\t\t$duplic->setDataParcial5($data_parcial5);\t\n\t\t\t\n\t\t\t$vet[$i++] = $duplic;\n\n\t\t}\n\n\t\treturn $vet;\n\n\t}", "function getMisPedidos($db, $idusuario) {\n $idusuario = mysqli_real_escape_string($db, $idusuario);\n //Trae todos los pedidos de un usuario\n $query = \"SELECT p.id, p.fechayhora, p.monto, u.fullname,\n (select COUNT(c.clavecarrito) FROM carrito c WHERE c.idpedido = p.id) as items, p.cumplido \n FROM pedidos p INNER JOIN usuarios u ON p.idusuario=u.id where p.idusuario=\".$idusuario.\" \n ORDER BY p.fechayhora DESC\";\n\n return mysqli_query($db, $query);\n}", "function listarPersonalAlmacenDisponible($conexion){\n\ttry{\n\t\t$consulta = \"SELECT PID FROM PERSONAL WHERE DEPARTAMENTO='Almacen' AND ESTADO='Libre' ORDER BY PID\"; \n \t$stmt = $conexion->query($consulta);\n\t\treturn $stmt;\n\t}catch(PDOException $e) {\n\t\treturn $e->getMessage();\n }\n}", "public function get_datos_factura($n_venta_cf,$id_paciente_cf){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n\t$sql=\"select producto from detalle_ventas where numero_venta=? and id_paciente=? order by id_detalle_ventas ASC;\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$n_venta_cf);\n $sql->bindValue(2,$id_paciente_cf);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function BusquedaDetallesVentas()\n\t{\n self::SetNames();\n\n if ($_SESSION['acceso'] == \"administrador\") {\n\n\tif ($_GET['tipobusquedad'] == \"1\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria WHERE ventas.codventa = ? ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"codventa\"]));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS CON ESTE N&deg; DE FACTURA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusquedad'] == \"2\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, cajas.nrocaja, cajas.nombrecaja FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE ventas.codcaja = ? ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcaja']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA CAJA SELECCIONADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusquedad'] == \"3\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, cajas.nrocaja, cajas.nombrecaja FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') = ? ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(date(\"Y-m-d\",strtotime($_GET['fecha']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA FECHA INGRESADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\t\t } \n\n ################# AQUI BUSCAMOS POR CAJEROS Y DISTRIBUIDOR ################\n\n\t } else {\n\n\n\t\t \tif ($_GET['tipobusquedad'] == \"1\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria WHERE ventas.idventa = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"codventa\"]));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS CON ESTE N&deg; DE FACTURA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusquedad'] == \"2\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, cajas.nrocaja, cajas.nombrecaja FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE ventas.codcaja = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcaja']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA CAJA SELECCIONADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusquedad'] == \"3\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, cajas.nrocaja, cajas.nombrecaja FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(date(\"Y-m-d\",strtotime($_GET['fecha']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA FECHA INGRESADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\t\t }\n\t }\n}", "public function ConsultarDetallePedidos($codigo)\r\n {\r\n $objetoBD = new Conexion();\r\n $objetoBD->conectar();\r\n $mysqli = $objetoBD->cadenaconexion();\r\n\r\n $consulta = \"SELECT productos.pro_id, pro_descripcion, pro_precio, dep_cantidad, dep_subtotal FROM productos, detalle_pedido WHERE\r\n productos.pro_id=detalle_pedido.pro_id AND ped_id=\".$codigo;\r\n $resultado = $mysqli->query($consulta);\r\n return $resultado;\r\n }", "public function readPedidos(){\n $sql='SELECT IdEncabezado, u.Nombre, u.Apellido, Fecha, TipoEstado \n FROM encabezadopedidos en INNER JOIN usuarios u USING (IdUsuario) \n INNER JOIN estadopedidos es USING(IdEstadoPedido) ORDER by IdEncabezado ASC ';\n $params=array(null);\n return Database::getRows($sql, $params);\n }", "public function MesasPorId()\n{\n\tself::SetNames();\n\t$sql = \" select salas.codsala, salas.nombresala, salas.salacreada, mesas.codmesa, mesas.nombremesa, mesas.mesacreada, mesas.statusmesa FROM mesas INNER JOIN salas ON salas.codsala = mesas.codsala where mesas.codmesa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codmesa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function obtenerDatosFact($ids_Ventas, $rfc, $link, $verificarBoleta)\n{\n //$ids_Ventas=[8];\n if ($rfc == 'XAXX010101000') {\n $complemento = '0';\n $metpags = \"PUE\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n\n $formPago = \"99\";\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n } else {\n $ArrayIdsVentas = array();\n $ArrayIdsVentas = array_merge($ArrayIdsVentas, $ids_Ventas);\n $busqVentas = implode(',', $ArrayIdsVentas);\n $sql = \"SELECT DISTINCT COUNT(vtas.id) AS totalVtas, pgosvta.idFormaPago, metpgos.clave FROM ventas vtas\n INNER JOIN pagosventas pgosvta ON vtas.id= pgosvta.idVenta\n INNER JOIN sat_formapago metpgos ON metpgos.id= pgosvta.idFormaPago\n WHERE vtas.id IN ($busqVentas) GROUP BY pgosvta.idFormaPago\";\n //print_r($sql);\n $resultXpagos = mysqli_query($link, $sql) or die(json_encode(array('estatus' => '3', 'mensaje' => \"Error al Buscar el Metodo de Pago, notifica a tu Administrador\", 'idsErroneos' => mysqli_error($link))));\n $ventaXBoleta = \"<div class='text-danger'>Total de Ventas Pagadas Con Boleta:</div>\";\n $contarxBoleta = 0;\n $erroresVentas = array();\n $total_ventas = mysqli_num_rows($resultXpagos);\n $formaUnica = 0;\n $formaAnterior = \"\";\n $complemento = 0;\n if ($total_ventas == 1) {\n $xpags = mysqli_fetch_array($resultXpagos);\n if ($xpags['idFormaPago'] == '7') {\n $complemento = 1;\n $metpags = \"PPD\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n $formaUnica = 1;\n }\n //----------------------pago de boletas---------------------------------\n else if ($xpags[\"idFormaPago\"] == \"6\" and $verificarBoleta == '1') {\n $ventaXBoleta .= $xpags[\"totalVtas\"];\n $contarxBoleta++;\n } else if ($xpags['idFormaPago'] == '7') {\n $complemento = 1;\n $metpags = \"PPD\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n } else {\n $metpags = \"PUE\";\n $formPago = $xpags['clave'];\n $descripcionMetPgo = \"Pago en una sola exhibición\";\n $formaUnica = 1;\n }\n } else {\n while ($dat = mysqli_fetch_array($resultXpagos)) {\n\n if ($complemento == 0) {\n //----------------------pago de boletas---------------------------------\n if ($dat[\"idFormaPago\"] == \"6\" and $verificarBoleta == '1') {\n $ventaXBoleta .= $dat[\"totalVtas\"];\n $contarxBoleta++;\n } else {\n if ($dat['idFormaPago'] == '7') {\n $complemento = 1;\n $metpags = \"PPD\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en parcialidades o diferido\";\n }\n }\n }\n } //cierra While\n\n }\n\n if ($contarxBoleta > 0) {\n array_push($erroresVentas, $ventaXBoleta);\n $resp = array('estatus' => '0', 'mensaje' => 'Ventas Pagadas con Boletas NO se pueden facturar.', 'idsErroneos' => json_encode($erroresVentas));\n return $resp;\n } else {\n if ($formaUnica == 1) {\n\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n } else {\n if ($complemento == 1) {\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n } else {\n $metpags = \"PUE\";\n $formPago = \"99\";\n $descripcionMetPgo = \"Pago en una sola exhibición\";\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de datos de Facturación correcta', 'result' => array(\"metodosPago\" => $metpags, \"formaPago\" => $formPago, \"descMetPgo\" => $descripcionMetPgo, \"complemento\" => $complemento));\n return $resp;\n }\n }\n }\n }\n}", "function consultarListadoPesadasRecolector($idOferta, $cedula)\n{\n\t$sql = \"SELECT pesadas.fecha, pesadas.kilos, ofertas.valorpago as valorkilo, (pesadas.kilos \t* ofertas.valorpago ) as valorpesada \n\t\t\tFROM pesadas JOIN ofertas ON pesadas.idoferta = ofertas.id \n\t\t\tWHERE pesadas.idoferta = {$idOferta} AND pesadas.idrecolector = (SELECT usuarios.id FROM usuarios WHERE usuarios.cedula = '{$cedula}')\";\n\tleerRegistro($sql);\n}", "public function BuscarIngredientesVendidos() \n{\n\tself::SetNames();\n\t$sql = \"SELECT productos.codproducto, productos.producto, productos.codcategoria, productos.precioventa, productos.existencia, ingredientes.costoingrediente, ingredientes.codingrediente, ingredientes.nomingrediente, ingredientes.cantingrediente, productosvsingredientes.cantracion, detalleventas.cantventa, SUM(productosvsingredientes.cantracion*detalleventas.cantventa) as cantidades FROM productos INNER JOIN detalleventas ON productos.codproducto=detalleventas.codproducto INNER JOIN productosvsingredientes ON productos.codproducto=productosvsingredientes.codproducto LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente WHERE DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') >= ? AND DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') <= ? GROUP BY ingredientes.codingrediente\";\n\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"<div class='alert alert-danger'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN INGREDIENTES FACTURADOS PARA EL RANGO DE FECHAS SELECCIONADAS</center>\";\n\t\techo \"</div>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function listarFactura(){\r\n\t\t$this->procedimiento='tesor.ft_factura_sel';\r\n\t\t$this->transaccion='TSR_FAC_SEL';\r\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\r\n\t\t\t\t\r\n\t\t//Definicion de la lista del resultado del query\r\n\t\t$this->captura('id_factura','int4');\r\n\t\t$this->captura('estado_reg','varchar');\r\n\t\t$this->captura('nro_factura','int4');\r\n\t\t$this->captura('nombre_emisor','varchar');\t\t\r\n\t\t$this->captura('domicilio_emisor','varchar');\r\n\t\t$this->captura('nit_emisor','int4');\r\n\t\t$this->captura('nombre_cliente','varchar');\t\t\r\n\t\t$this->captura('domicilio_cliente','varchar');\r\n\t\t$this->captura('nit_cliente','int4');\r\n\t\t$this->captura('fecha_emision','date');\r\n\t\t\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\t\t\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "function listar($objeto){\n\t\t$condicion.=(!empty($objeto['id']))?' AND r.id='.$objeto['id']:'';\n\t// Filtra por los insumos preparados\n\t\t$condicion.=(!empty($objeto['insumos_preparados']))?' AND ids_insumos_preparados!=\\'\\'':'';\n\t// Filtra por tipo\n\t\t$condicion.=(!empty($objeto['tipo'])) ? ' AND p.tipo_producto = '.$objeto['tipo'] : '';\n\t// Filtros\n\t\t$condicion.=(!empty($objeto['filtro']) && $objeto['filtro'] == 'insumos_preparados_formula') ? ' AND (p.tipo_producto = 8 OR p.tipo_producto = 9) ' : '';\n\n\n\t// Ordena la consulta si existe\n\t\t$condicion.=(!empty($objeto['orden']))?' ORDER BY '.$objeto['orden']:'';\n\n\t\t$sql = \"SELECT\n\t\t\t\t\tp.id AS idProducto, p.nombre, p.costo_servicio AS costo,\n\t\t\t\t\tp.id_unidad_compra AS idunidadCompra, p.id_unidad_venta AS idunidad, p.factor as multiplo,\n\t\t\t\t\t(SELECT\n\t\t\t\t\t\tnombre\n\t\t\t\t\tFROM\n\t\t\t\t\t\tapp_unidades_medida uni\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tuni.id=p.id_unidad_venta) AS unidad, u.factor, p.tipo_producto,\n\t\t\t\t\tr.ids_insumos_preparados AS insumos_preparados, r.ids_insumos AS insumos,\n\t\t\t\t\tr.preparacion, r.ganancia, ROUND(p.precio, 2) AS precio, p.codigo, p.minimos\n\t\t\t\tFROM\n\t\t\t\t\tapp_productos p\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tapp_campos_foodware f\n\t\t\t\t\tON\n\t\t\t\t\t\tp.id = f.id_producto\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tcom_recetas r\n\t\t\t\t\tON\n\t\t\t\t\t\tr.id = p.id\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tapp_unidades_medida u\n\t\t\t\t\tON\n\t\t\t\t\t\tu.id = p.id_unidad_compra\n\t\t\t\tWHERE\n\t\t\t\t\tp.status = 1 AND (p.tipo_producto = 8 OR p.tipo_producto = 9)\";\n\n\t\treturn $this->queryArray($sql);\n\t}", "public function PedidosDelDia()\r\n {\r\n $objetoBD = new Conexion();\r\n $objetoBD->conectar();\r\n $mysqli = $objetoBD->cadenaconexion();\r\n \r\n $consulta = \"SELECT ped_id, clie_nombres, clie_apellidos, ped_hora_entrega, ped_direccion, ped_estado\r\n FROM pedidos, clientes WHERE clientes.clie_id=pedidos.clie_id AND ped_estado='PENDIENTE' AND ped_fecha_entrega=CURDATE() GROUP BY ped_id\";\r\n $resultado = $mysqli->query($consulta);\r\n return $resultado;\r\n }", "function validaFactAnt($ids_Ventas, $link)\n{\n $userReg = $_SESSION['LZFident'];\n //vaciar ids en un array\n // $ids_Ventas=[1,6,34,8];\n $ArrayIdsVentas = array();\n $ArrayIdsVentas = array_merge($ArrayIdsVentas, $ids_Ventas);\n $resp = array(); //array para retornar\n\n $busqVentas = implode(',', $ArrayIdsVentas);\n //VALIDAR QUE EXISTA LA VENTA Y ESTE CERRADA\n $idsDefectuosos = array();\n $idAnt = '';\n for ($i = 0; $i <= count($ArrayIdsVentas) - 1; $i++) {\n $idVenta = $ArrayIdsVentas[$i];\n $sql = \"SELECT\n COUNT( factgencancel.id ) AS factCanceladas,\n COUNT( factgen.id ) AS totalFact\nFROM\n vtasfact vf\n INNER JOIN facturasgeneradas factgen ON factgen.id = vf.idFactgen\n LEFT JOIN facturasgeneradas factgencancel ON factgencancel.id = vf.idFactgen\n AND factgencancel.idCancelada != ''\n WHERE vf.idVenta='$idVenta'\";\n\n $result = mysqli_query($link, $sql) or die(json_encode(array('estatus' => '3', 'mensaje' => 'Error al consultar la Facturas de la venta, notifica a tu Administrador', 'idsErroneos' => mysqli_error($link))));\n $array_resultado = mysqli_fetch_array($result);\n $factCanceladas = $array_resultado['factCanceladas'];\n $totalFact = $array_resultado['totalFact'];\n //Se verifica que el total de cancelaciones sea igual al total de las facturas emitidas\n if ($totalFact > $factCanceladas) {\n array_push($idsDefectuosos, \"#\" . $idVenta);\n }\n }\n if (count($idsDefectuosos) > 0) {\n $resp = array('estatus' => '0', 'mensaje' => 'Verifica que las ventas no tengan facturas ACTIVAS.', 'idsErroneos' => json_encode($idsDefectuosos));\n return $resp;\n } else {\n $resp = array('estatus' => '1', 'mensaje' => 'Verificación de los ticket(s) de venta(s) correcta', 'idsErroneos' => '');\n return $resp;\n } //no permitidas\n}", "function validarcrear_veredas($coddpt, $codmun, $codver){\n $sql = \"SELECT count(cod_vecor) as cont from veredas where cod_dpto='$coddpt' and cod_muni = '$codmun' and cod_vecor= '$codver'\";\n //echo \"<pre>$sql</pre>\";\n $this->consultar($sql, __FUNCTION__);\n }", "function verifica_filhos($pdo, $id_processo_pai) {\r\n global $array_filhos;\r\n $sql_apenso = \"SELECT * FROM apenso WHERE id_processo_pai = '{$id_processo_pai}'\";\r\n $query = $pdo->prepare($sql_apenso);\r\n if ($query->execute()) {\r\n for ($i = 0; $dados = $query->fetch(); $i++) {\r\n array_push($array_filhos, $dados['id_processo_filho']);\r\n verifica_filhos($pdo, $dados['id_processo_filho']);\r\n }\r\n }\r\n}", "public function listarPacientes(){\n\t\t\t$list= oci_parse($conn,\"BEGIN Nombre_paquete.NOmbre.funvion(Aqui los values) END \");\n\t\t\t// $list= oci_parse($conn,\"SELECT * FROM CITAS\");\n\t\t\toci_execute($list);\n\t\t}", "public function CreditosPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT clientes.codcliente, clientes.cedcliente, clientes.nomcliente, clientes.tlfcliente, clientes.direccliente, clientes.emailcliente, ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.totalpago2, ventas.tipopagove, ventas.formapagove, ventas.fechaventa, ventas.fechavencecredito, ventas.statusventa, usuarios.nombres, cajas.nrocaja, abonoscreditos.codventa as cod, abonoscreditos.fechaabono, SUM(montoabono) AS abonototal FROM (ventas LEFT JOIN clientes ON clientes.codcliente = ventas.codcliente) LEFT JOIN abonoscreditos ON ventas.codventa = abonoscreditos.codventa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN usuarios ON ventas.codigo = usuarios.codigo WHERE ventas.codventa =? GROUP BY cod\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function consult(){\n\t\t\t$para = array(\"1\"=>1);\n\t\t\tif($this->tipodocum_id_tipodocum != null){\n\t\t\t\t$para[\"tipodocum_id_tipodocum\"] = $this->tipodocum_id_tipodocum;\n\t\t\t}\n\t\t\tif($this->documento != null){\n\t\t\t\t$para[\"documento\"] = $this->documento;\n\t\t\t}\n\t\t\t\n\t\t\t$query = $this->db->get_where(\"paciente\",$para);\n\t\t\treturn $query->result();\n\t\t}", "function listarReenvioFactura(){\n\t\t$this->procedimiento='vef.ft_reenvio_factura_sel';\n\t\t$this->transaccion='VF_REFACOR_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_venta', 'id_venta', 'int4');\n\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_reenvio_factura','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('id_venta','int4');\n\t\t$this->captura('correo','varchar');\n\t\t$this->captura('correo_copia','varchar');\n\t\t$this->captura('observacion','text');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('estado_envio_correo','int4');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function _ConsultarResultadosPruebasIMM1($tipo_prueba, $id_cliente) //consulta el último biotest para imm se necesitan 16 campos.\n\t{\n\t\t$query='\n\t\t\tselect * from sg_pruebas \n\t\t\twhere Tipo_Prueba=\"'.$tipo_prueba.'\" \n\t\t\tand id_cliente=\"'.$id_cliente.'\" order by fecha and id asc limit 16\n\n\t\t';\n\t\t$con=Conectar::_con();\n\t\t$result=$con->query($query) or die(\"Error en: $query \".mysqli_error($query));\n\t\treturn $result;\n\t}", "public function BuscarVentasFechas() \n\t{\n\t\tself::SetNames();\n\t\t$sql =\"SELECT detalleventas.codventa, cajas.nrocaja, ventas.idventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.totalpago2, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, SUM(detalleventas.cantventa) as articulos FROM (detalleventas LEFT JOIN ventas ON detalleventas.codventa=ventas.codventa) \n\t\tLEFT JOIN cajas ON cajas.codcaja=ventas.codcaja LEFT JOIN clientes ON ventas.codcliente=clientes.codcliente WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') >= ? AND DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') <= ? GROUP BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\n\t\t\techo \"<div class='alert alert-danger'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN VENTAS DE PRODUCTOS PARA EL RANGO DE FECHAS SELECCIONADAS</center>\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[]=$row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "function voirDerniereCommandeAvecFacture(){\n\t$conditions = array();\n\t$order = array();\n\tarray_push($order, array('nameChamps'=>'idFacture','sens'=>'desc'));\n\tarray_push($conditions, array('nameChamps'=>'idFacture','type'=>'is not null','name'=>'','value'=>''));\n\t$req = new myQueryClass('commande',$conditions,$order,'','limit 1');\n\t$r = $req->myQuerySelect();\n\treturn $r[0];\n}", "private function listarParticipantePeloCodigo(){\n echo \"\\nDigite o código para pesquisa: \";\n $codigo = rtrim(fgets(STDIN));\n print_r($this->participantePDO->findById($codigo));\n }", "function getPedidos($db) {\n //Trae todos los pedidos\n $query = \"SELECT p.id, p.idusuario, p.fechayhora, p.monto, \n (select COUNT(c.clavecarrito) FROM carrito c WHERE c.idpedido = p.id) as items, \n u.fullname, p.cumplido FROM pedidos p INNER JOIN usuarios u ON p.idusuario=u.id \n ORDER BY p.fechayhora DESC\";\n\n return mysqli_query($db, $query);\n}", "public function PedidosDelDia2()\r\n {\r\n $objetoBD = new Conexion();\r\n $objetoBD->conectar();\r\n $mysqli = $objetoBD->cadenaconexion();\r\n \r\n $consulta = \"SELECT ped_id, clie_nombres, clie_apellidos, ped_hora_entrega, ped_direccion, ped_estado\r\n FROM pedidos, clientes WHERE clientes.clie_id=pedidos.clie_id AND ped_fecha_entrega=CURDATE() GROUP BY ped_id\";\r\n $resultado = $mysqli->query($consulta);\r\n return $resultado;\r\n }", "function consultarFacultades() {\r\n $cadena_sql=$this->sql->cadena_sql(\"datos_facultades\",\"\");\r\n $resultado=$this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql,\"busqueda\");\r\n return $resultado;\r\n }", "function obtener_facultades (){\n \n //$nombre_usuario=toba::usuario()->get_nombre();\n //$sql=\"SELECT t_s.sigla FROM sede t_s, administrador t_a WHERE t_a.nombre_usuario=$nombre_usuario AND t_s.id_sede=t_a.id_sede\";\n //$sql=\"SELECT t_ua.sigla, t_ua.descripcion FROM unidad_academica t_ua, sede t_s JOIN administrador t_a ON (t_a.nombre_usuario=$nombre_usuario) JOIN (t_a.id_sede=t_s.id_sede) WHERE t_s.sigla=t_ua.id_sede\";\n $sql=\"SELECT sigla, descripcion FROM unidad_academica WHERE sigla <> 'RECT'\";\n return toba::db('gestion_aulas')->consultar($sql);\n \n }", "public function pesquisa()\n {\n $query = \"SELECT * FROM noticia WHERE titulo LIKE :titulo\";\n $stmt = $this->db->prepare($query);\n $stmt->bindValue(\":titulo\", $this->titulo.\"%\");\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function hospitalizacionesPendientes(){\n\n\t\t$resultado = array();\n\t\t\n\t\t$query = \"SELECT count(H.idHospitalizacion) as cantidadHospitalizaciones\n\t\t\t\t\t\tFROM tb_hospitalizacion AS H \n\t\t\t\t\t\tINNER JOIN tb_hospitalizacionAlta AS HA ON HA.idHospitalizacion = H.idHospitalizacion\n \t\t\t\tWHERE Not H.idHospitalizacion IN (SELECT idTipoDetalle FROM tb_pago_factura_caja_detalle WHERE tipoDetalle = 'Hospitalizacion' AND estado = 'Activo' )\";\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n\t\tif($res = $conexion->query($query)){\n \n /* obtener un array asociativo */\n while ($filas = $res->fetch_assoc()) {\n $resultado = $filas;\n }\n \n /* liberar el conjunto de resultados */\n $res->free();\n \n }\n\n return $resultado['cantidadHospitalizaciones'];\t\t\n\n\n\t\t\n\t}", "public function get_datos_factura_paciente($id_paciente){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n\t$sql=\"select *from pacientes where id_paciente=?\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$id_paciente);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function get_datos_factura_venta($n_venta,$id_paciente){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n\t$sql=\"select *from ventas where numero_venta=? and id_paciente=?\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$n_venta);\n $sql->bindValue(2,$id_paciente);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function buscarPareceresProjetoParaImpressao($where = array(), $order = array(), $tamanho = -1, $inicio = -1)\n {\n $slct = $this->select();\n\n $slct->setIntegrityCheck(false);\n\n $slct->from(\n array('p' => $this->_name),\n array('p.IdPRONAC',\n '(p.AnoProjeto + p.Sequencial) AS PRONAC',\n 'p.NomeProjeto',\n 'dbo.fnFormataProcesso(p.idPronac) as Processo')\n );\n\n $slct->joinInner(\n array('i' => 'Interessado'),\n \"p.CgcCPf = i.CgcCPf\",\n array('i.Nome AS Proponente')\n );\n\n $slct->joinInner(\n array('a' => 'tbAnaliseDeConteudo'),\n \"p.IdPRONAC = a.idPronac\",\n array(\"a.idProduto\",\n \"Lei8313\" => new Zend_Db_Expr(\"CASE WHEN Lei8313 = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"Artigo3\" => new Zend_Db_Expr(\"CASE WHEN Artigo3 = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"IncisoArtigo3\" => new Zend_Db_Expr(\"CASE WHEN IncisoArtigo3 = 1 THEN 'I' WHEN IncisoArtigo3 = 2 THEN 'II' WHEN IncisoArtigo3 = 3 THEN 'III' WHEN IncisoArtigo3 = 4 THEN 'IV' WHEN IncisoArtigo3 = 5 THEN 'V' END\"),\n \"a.AlineaArtigo3\",\n \"Artigo18\" => new Zend_Db_Expr(\"CASE WHEN Artigo18 = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"a.AlineaArtigo18\",\n \"Artigo26\" => new Zend_Db_Expr(\"CASE WHEN Artigo26 = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"Lei5761\" => new Zend_Db_Expr(\"CASE WHEN Lei5761 = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"Artigo27\" => new Zend_Db_Expr(\"CASE WHEN Artigo27 = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"IncisoArtigo27_I\" => new Zend_Db_Expr(\"CASE WHEN IncisoArtigo27_I = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"IncisoArtigo27_II\" => new Zend_Db_Expr(\"CASE WHEN IncisoArtigo27_II = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"IncisoArtigo27_III\" => new Zend_Db_Expr(\"CASE WHEN IncisoArtigo27_III = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"IncisoArtigo27_IV\" => new Zend_Db_Expr(\"CASE WHEN IncisoArtigo27_IV = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"TipoParecer\" => new Zend_Db_Expr(\"CASE WHEN TipoParecer = 1 THEN 'Aprova��o' WHEN TipoParecer = 2 THEN 'Complementa��o' WHEN TipoParecer = 4 THEN 'Redu��o' END\"),\n \"ParecerFavoravel\" => new Zend_Db_Expr(\"CASE WHEN ParecerFavoravel = 1 THEN 'Sim' ELSE 'N�o' END\"),\n \"a.ParecerDeConteudo\",\n \"sac.dbo.fnNomeParecerista(a.idUsuario) AS Parecerista\",\n )\n );\n\n\n $slct->joinInner(\n array('pr' => 'Produto'),\n \"a.idProduto = pr.Codigo\",\n array('pr.Descricao AS Produto')\n );\n\n $slct->joinInner(\n array('dp' => 'tbDistribuirParecer'),\n \"dp.idPronac = a.idPronac AND dp.idProduto = a.idProduto\",\n array(new Zend_Db_Expr('CONVERT(CHAR(23), dp.DtDevolucao, 120) AS DtDevolucao'),\n new Zend_Db_Expr('CONVERT(CHAR(23), dp.DtRetorno, 120) AS DtRetorno', 'dp.idOrgao'))\n );\n\n $slct->joinLeft(\n array('u' => 'Usuarios'),\n \"dp.idusuario = u.usu_codigo\",\n array('u.usu_nome AS Coordenador',\n 'u.usu_identificacao AS cpfCoordenador'),\n 'TABELAS.dbo'\n );\n\n $slct->joinInner(\n array('b' => 'Nomes'),\n \"dp.idAgenteParecerista = b.idAgente\",\n array(),\n $this->getSchema('agentes')\n );\n\n $slct->joinInner(\n array('h' => 'Agentes'),\n \"h.idAgente = b.idAgente\",\n array('h.CNPJCPF as cpfParecerista'),\n $this->getSchema('agentes')\n );\n\n // adicionando clausulas where\n foreach ($where as $coluna => $valor) {\n $slct->where($coluna, $valor);\n }\n\n return $this->fetchAll($slct);\n }", "public function BusquedaVentas()\n\t{\n\n self::SetNames();\n\n if ($_SESSION['acceso'] == \"administrador\") {\n\n\n\tif ($_GET['tipobusqueda'] == \"1\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE ventas.codcliente = ? GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcliente']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS PARA EL CLIENTE INGRESADO !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusqueda'] == \"2\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, cajas.nombrecaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE ventas.codcaja = ? GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcaja']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA CAJA SELECCIONADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusqueda'] == \"3\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') = ? GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(date(\"Y-m-d\",strtotime($_GET['fecha']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA FECHA INGRESADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\t\t } \n\n ################# AQUI BUSCAMOS POR CAJEROS Y DISTRIBUIDOR ################\n\n\t } else {\n\n\n\t\t \tif ($_GET['tipobusqueda'] == \"1\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE ventas.codcliente = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcliente']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS PARA EL CLIENTE INGRESADO !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusqueda'] == \"2\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, cajas.nombrecaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE ventas.codcaja = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcaja']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA CAJA SELECCIONADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\n\t\t} else if ($_GET['tipobusqueda'] == \"3\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(date(\"Y-m-d\",strtotime($_GET['fecha']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA FECHA INGRESADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[]=$row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\n\t\t }\n\t\t }\n\t }\n}", "function buscar_comprobante_documento($id_cuenta, $id_anexo, $id_serie, $id_numero ) {\n $sql = \"SELECT\n\t\t\t\t\t prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\t, sum(prosic_detalle_comprobante.importe_soles*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)) as importe_soles\n\t\t\t\t\t, sum(prosic_detalle_comprobante.importe_soles*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)/prosic_tipo_cambio.compra_sunat) as importe_dolares\n\t\t\t\tFROM prosic_detalle_comprobante\n\t\t\t\tINNER JOIN prosic_plan_contable ON prosic_detalle_comprobante.id_plan_contable=prosic_plan_contable.id_plan_contable\n\t\t\t\tINNER JOIN prosic_anexo ON prosic_detalle_comprobante.id_anexo = prosic_anexo.id_anexo\n\t\t\t\tINNER JOIN prosic_moneda ON prosic_detalle_comprobante.id_moneda = prosic_moneda.id_moneda\n\t\t\t\tLEFT JOIN prosic_tipo_cambio ON prosic_detalle_comprobante.fecha_doc_comprobante=prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\tWHERE 1=1 \";\n\t\t\t\tif ($id_cuenta != '')$sql.=\" AND prosic_plan_contable.cuenta_plan_contable LIKE '%\" . $id_cuenta . \"%'\";\n if ($id_anexo != '')$sql.=\" AND prosic_anexo.codigo_anexo LIKE '%\" . $id_anexo . \"%'\";\n if ($id_numero != '')$sql.=\" AND prosic_detalle_comprobante.nro_doc_comprobante LIKE '%\" . $id_numero . \"%'\";\n\t\t\t$sql.=\" group by prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\thaving importe_soles>0\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "public function BuscarMovimientosCajasFechas() \n\t{\n\t\tself::SetNames();\n\t$sql = \" SELECT * FROM movimientoscajas INNER JOIN cajas ON movimientoscajas.codcaja = cajas.codcaja WHERE movimientoscajas.codcaja = ? AND DATE_FORMAT(movimientoscajas.fechamovimientocaja,'%Y-%m-%d') >= ? AND DATE_FORMAT(movimientoscajas.fechamovimientocaja,'%Y-%m-%d') <= ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim($_GET['codcaja']));\n\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t$stmt->bindValue(3, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\n\t\t\techo \"<div class='alert alert-danger'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN MOVIMIENTOS DE ESTA CAJA PARA EL RANGO DE FECHA SELECCIONADO</center>\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[]=$row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "function consultarEstudiantes($codProyecto) {\r\n $variables=array('codProyecto'=>$codProyecto,\r\n 'ano'=> $this->ano,\r\n 'periodo'=> $this->periodo);\r\n $cadena_sql=$this->sql->cadena_sql(\"consultarEstudiantes\",$variables);\r\n $resultado=$this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql,\"busqueda\");\r\n return $resultado;\r\n }", "function consultar_opedidos(){\n \n $query_RecordsetResumo = \"SELECT * FROM CAIXACUPOM \";\n $query_RecordsetResumo .= \" WHERE TIPOATENDIMENTO = 'DELIVERY' \";\n #$query_RecordsetResumo .= \" AND STATUS_GO4YOU != '4' \";\n $query_RecordsetResumo .= \" ORDER BY CAIXACUPOM_CONTROLE DESC\";\n $query_RecordsetResumo .= \" LIMIT 20\";\n $RecordsetResumo = mysql_query($query_RecordsetResumo, $con) or die(mysql_error());\n $row_RecordsetResumo = mysql_fetch_assoc($RecordsetResumo);\n $totalRows_RecordsetResumo = mysql_num_rows($RecordsetResumo);\n \n $tempo = $_SESSION['TEMPO_PREPARACAO'];\n $pedidos = array();\n $i = 0;\n if($totalRows_RecordsetResumo != 0 ){\n do {\n \n # Checa se percisa alterar o status\n if(dif_hora(acrescenta_min($row_RecordsetResumo['DATAHORA' ], $tempo)) == 2 && $row_RecordsetResumo['STATUS_GO4YOU'] == \"0\"){\n update_status($row_RecordsetResumo['CAIXACUPOM_CONTROLE'], 2);\n }\n \n # Condicao para gerar contador de Tempo\n $status = \" excedido \";\n if($row_RecordsetResumo['STATUS_GO4YOU'] == \"0\" && dif_hora(acrescenta_min($row_RecordsetResumo['DATAHORA' ], $tempo)) != 2){\n $status = dif_hora_draw(acrescenta_min($row_RecordsetResumo['DATAHORA'], $tempo), date('Y-m-d H:i:s'));\n }\n \n $pedidos[$i]['CAIXACUPOM_CONTROLE'] = $row_RecordsetResumo['CAIXACUPOM_CONTROLE' ];\n $pedidos[$i]['DATAHORA' ] = dataMySql2BR($row_RecordsetResumo['DATAHORA' ]);\n $pedidos[$i]['TEMPO_PREVISTO' ] = acrescenta_min($row_RecordsetResumo['DATAHORA' ], $tempo);\n $pedidos[$i]['STATUS_GO4YOU' ] = trata_texto(status($row_RecordsetResumo['STATUS_GO4YOU']));\n $pedidos[$i]['TEMPO' ] = $status;\n $pedidos[$i]['STATUS_BTN' ] = $row_RecordsetResumo['STATUS_GO4YOU'] < 4 ? \n '<input type=\"submit\" value=\"'.trata_texto(status($row_RecordsetResumo['STATUS_GO4YOU'] + 1)).'\" onClick=\"update_status('.$row_RecordsetResumo['CAIXACUPOM_CONTROLE'].', '.$row_RecordsetResumo['STATUS_GO4YOU'].')\" style=\"cursor: pointer;\" />' :\n '<input type=\"button\" value=\"Entregue\" disabled />' ;\n ++$i;\n } while ($row_RecordsetResumo = mysql_fetch_assoc($RecordsetResumo)); \n }\n \n return json_encode($pedidos);\n \n}", "public function BuscarArqueosCajasFechas() \n\t{\n\t\tself::SetNames();\n\t\t$sql = \" select * FROM arqueocaja INNER JOIN cajas ON arqueocaja.codcaja = cajas.codcaja WHERE DATE_FORMAT(arqueocaja.fechaapertura,'%Y-%m-%d') >= ? AND DATE_FORMAT(arqueocaja.fechaapertura,'%Y-%m-%d') <= ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\n\t\t\techo \"<div class='alert alert-danger'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN ARQUEOS DE CAJAS PARA EL RANGO DE FECHA SELECCIONADO</center>\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[]=$row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function DetallesVentasPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codcliente as cliente, detalleventas.codproducto, detalleventas.producto, detalleventas.codcategoria, detalleventas.cantventa, detalleventas.precioventa, detalleventas.preciocompra, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, productos.ivaproducto, productos.existencia, clientes.codcliente, clientes.cedcliente, clientes.nomcliente, usuarios.nombres FROM detalleventas LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN clientes ON detalleventas.codcliente = clientes.codcliente LEFT JOIN productos ON detalleventas.codproducto = productos.codproducto LEFT JOIN usuarios ON detalleventas.codigo = usuarios.codigo WHERE detalleventas.coddetalleventa = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"coddetalleventa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function consultar_cuerpo_consulta_destinatarios($f_nom,$f_num,$offset,$limit)\n\t{\n\t\t$where=\"\";\n\t\tif($f_nom!=\"\")\n\t\t{\n\t\t\t$where.=\" AND upper(contactos.nombre) like '%\".$f_nom.\"%'\";\n\t\t}\n\t\tif($f_num!=\"\")\n\t\t{\n\t\t\t$where.=\" AND upper(contactos.tlf1) like '%\".$f_num.\"%'\";\n\t\t}\t\n\t\tif(($offset!=\"\")&&($limit!=\"\"))\t\n\t\t{\n\t\t\t$where2=\"limit '\".$limit.\"' \n offset '\".$offset.\"' \";\n\t\t}\n\t\t$this->sql=\"SELECT \n\t\t\t\t\t\t\tcontactos.id,\n\t\t\t\t\t\t\tcontactos.nombre,\n\t\t\t\t\t\t\tcontactos.tlf1\n\t\t\t\t\tFROM\n\t\t\t\t\t\t\tcontactos\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t1=1\n\t\t\t\t\t\".$where.\" \n\t\t\t\t\t\".$where2.\" \n\t\t\t\t\t;\";\n\t\t$this->rs=$this->procesar_query($this->sql);\n\t\t//calculo cuantos son...\n\t\t$this->cuantos_son($where);\n\t\treturn \t$this->rs;\t\t\n\t}", "function f_get_permisos_modulos($cod_perfil_pk){\n\t\tglobal $db;\n\t\t\n\t\t$query = \"\tselect \tspta.*,\n\t\t\t\t\t\t\tcc.cod_entidad as cod_entidad_pk,\n\t\t\t\t\t\t\tcc.fec_consulta\n\t\t\t\t\tfrom \tseg_permiso_tabla_autonoma spta left join condicion_consulta cc on (spta.cod_perfil = cc.cod_perfil)\n\t\t\t\t\twhere \tspta.cod_perfil = $cod_perfil_pk \n\t\t\t\t\tgroup \tby cod_tabla\";\n\n\t\t$cursor = $db->consultar($query);\t\t\n\t\treturn $cursor;\n\t\t\t\n\t}", "function contarReprobados($espacios_por_cursar){\n $cantidad=0;\n if(count($espacios_por_cursar)>0){\n foreach ($espacios_por_cursar as $key => $espacio) {\n if($espacio['REPROBADO']==1){\n $cantidad++;\n \t }\n }\n }\n return $cantidad; \n }", "function fmodulo(){\n\t\t$this->sentencia=\"SELECT modulo_id,modulo_nombre FROM modulo ORDER BY modulo_orden ASC\";\n\t\t$this->fsentencia();\n\t\t$this->modulo=$this->resultado;\n\t}", "function consultarNotas(){ \n $cadena_sql=$this->cadena_sql(\"notas\",$this->codProyecto);\n $estudiantes=$this->funcionGeneral->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql,\"busqueda\" );\n return $estudiantes;\n }", "function recuperaDadosAdesaoPAR($exercicio) {\n\n $sql = \"SELECT pfa.pfavalortotalprograma\n FROM par3.proadesao pfa\n INNER JOIN par3.programa prg ON prg.prgid = pfa.prgid\n INNER JOIN par3.programaorigem po ON po.pgoid = prg.pgoid\n WHERE prg.prganoreferencia = '{$exercicio}'\n AND pfa.pfaano = '{$exercicio}' AND po.pgoid = 12 \";\n \n return $this->pegaLinha($sql);\n }", "function consultarProyectos() {\n $cadena_sql = $this->sql->cadena_sql(\"consultaProyectos\",\"\");\n return $resultadoProyectos = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\n }", "function consulta_registro_ventas_imprimir($w_anio, $w_mes, $w_anexo) {\n $sql = \"SELECT\n prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.pago_comprobante\n , prosic_tipo_comprobante.sunat_tipo_comprobante\n , prosic_comprobante.serie_comprobante\n , prosic_comprobante.anio_dua_comprobante\n , prosic_comprobante.nro_comprobante\n , prosic_tipo_documento.sunat_tipo_documento\n , prosic_anexo.codigo_anexo\n , SUBSTRING(prosic_anexo.descripcion_anexo,1,20)\n , prosic_comprobante.afecto_comprobante\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.igv_comprobante\n , prosic_comprobante.total_comprobante \t\n , prosic_comprobante.id_operacion\n , prosic_comprobante.no_gravadas_igv\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.isc_comprobante\n , prosic_comprobante.otros_tributos\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.tipo_cambio_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n , prosic_comprobante.id_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_tipo_comprobante ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_tipo_documento ON (prosic_anexo.id_tipo_documento = prosic_tipo_documento.id_tipo_documento)\n WHERE prosic_comprobante.id_subdiario=2\";\n if ($w_anio != '')$sql.=\" AND prosic_comprobante.id_anio=\" . $w_anio;\n if ($w_mes != '')$sql.=\" AND prosic_comprobante.id_mes=\" . $w_mes;\n if ($w_anexo != '')$sql.=\" AND prosic_comprobante.id_anexo='\" . $w_anexo . \"'\";\n $sql.=\" ORDER BY prosic_tipo_comprobante.sunat_tipo_comprobante,CAST(prosic_comprobante.codigo_comprobante AS UNSIGNED)\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "private function query_facturas_ordenes_servicios_usuarios($co_usuario, \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t $fecha_inicio, \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t $fecha_fin)\n {\n \t$respuesta = false;\n\n\t\ttry {\n\n\t\t\t$this->db->select('cao_fatura.co_os');\n\t\t\t$this->db->select('cao_fatura.co_fatura');\t\t\t\n\t\t\t$this->db->select('cao_fatura.valor');\t\t\t\n\t\t\t$this->db->select('cao_fatura.data_emissao');\n\t\t\t$this->db->select('cao_fatura.comissao_cn');\n\t\t\t$this->db->select('cao_fatura.total_imp_inc');\n\t\t\t$this->db->select('cao_usuario.co_usuario');\n\t\t\t$this->db->from('cao_fatura');\n\t\t\t$this->db->join('cao_os', 'cao_os.co_os = cao_fatura.co_os');\n\t\t\t$this->db->join('cao_usuario', 'cao_usuario.co_usuario = cao_os.co_usuario');\n\t\t\t$this->db->where('cao_fatura.co_os is NOT NULL', NULL, FALSE);\n\t\t\t$this->db->where('cao_fatura.co_fatura is NOT NULL', NULL, FALSE);\t\t\t\n\t\t\t$this->db->where('cao_fatura.data_emissao >=', $fecha_inicio);\n\t\t\t$this->db->where('cao_fatura.data_emissao <=', $fecha_fin);\n\t\t\t$this->db->where_in('cao_os.co_usuario',$co_usuario);\t\t\n\t\t\t$this->db->order_by(\"cao_fatura.data_emissao\", \"asc\");\n\n\t\t\t$query = $this->db->get();\n\n\t\t if ($query && $query->num_rows() > 0)\n\t\t {\n\t\t\t\t$respuesta = $query->result_array();\n\n\t\t }else{\n\n\t\t throw new Exception('Error al intentar listar las facturas asociadas a los consultores');\n\t\t\t log_message('error', 'Error al intentar listar las facturas asociadas a los consultores');\t\t\t \n\n\t\t $respuesta = false;\t\t\t\t\n\t\t\t}\n\n\t\t} catch (Exception $e) {\n\n\t\t\t$respuesta = false;\n\t\t}\t\t\t\n\n\t\treturn $respuesta;\n }", "public function consultaSeguimientos(){\n\t\t$conect= Yii::app()->db;\n\t\t$sqlConsSegPaiDer=\"select fecha_seguim_compderecho,seguim_compderecho from seguimiento_compderecho \n\t\twhere id_pai=:id_pai and id_derechocespa=:id_derechocespa and num_doc=:num_doc order by fecha_seguim_compderecho desc\";\n\t\t$segCompDer=$conect->createCommand($sqlConsSegPaiDer);\n\t\t$segCompDer->bindParam(\":id_pai\",$this->id_pai,PDO::PARAM_INT);\n\t\t$segCompDer->bindParam(\":id_derechocespa\",$this->id_derechocespa,PDO::PARAM_INT);\n\t\t$segCompDer->bindParam(\":num_doc\",$this->num_doc,PDO::PARAM_STR);\n\t\t$readConsSegPaiDer=$segCompDer->query();\n\t\t$resConsSegPaiDer=$readConsSegPaiDer->readAll();\n\t\t$readConsSegPaiDer->close();\n\t\treturn $resConsSegPaiDer;\n\t}", "function ConsultarAntecedentesAPH(){\n $sql = \"CALL spConsultarAntecedentesAPH(?)\";\n $query = $this->_CONEXION->prepare($sql);\n $query->bindParam(1, $this->idReporteAPH);\n $query->execute();\n if ($query->rowCount() > 0) {\n return array('antecedentes' => $query->fetchAll());\n }else{\n return array('antecedentes' => null);\n }\n }", "public function ConsultarMesas($request, $response, $args)\n {\n $listado = $request->getParam('listado');\n $idMesa = $request->getParam('idMesa');\n $fechaInicio = $request->getParam('fechaInicio');\n $fechaFin = $request->getParam('fechaFin');\n $informacion = null;\n \n switch($listado)\n {\n case \"mas_usada\":\n $informacion = factura::select('id_mesa')\n ->groupBy('id_mesa')\n ->orderByRaw('COUNT(*) DESC')\n ->selectRaw(\"COUNT(*) as veces_usada\")\n ->limit(1)\n ->get();\n break;\n case \"menos_usada\":\n $informacion = factura::select('id_mesa')\n ->groupBy('id_mesa')\n ->orderByRaw('COUNT(*) ASC')\n ->selectRaw(\"COUNT(*) as veces_usada\")\n ->limit(1)\n ->get();\n break;\n case \"mas_facturo\":\n $informacion = factura::select('id_mesa')\n ->groupBy('id_mesa')\n ->orderByRaw('SUM(monto) desc')\n ->selectRaw(\"SUM(monto) as monto_total\")\n ->limit(1)\n ->get();\n break;\n case \"menos_facturo\":\n $informacion = factura::select('id_mesa')\n ->groupBy('id_mesa')\n ->orderByRaw('SUM(monto) asc')\n ->selectRaw(\"SUM(monto) as monto_total\")\n ->limit(1)\n ->get();\n break;\n case \"mayor_importe\":\n $informacion = factura::orderBy('monto', 'desc')\n ->select('id_mesa', 'monto')\n ->first();\n break;\n case \"menor_importe\":\n $informacion = factura::orderBy('monto', 'asc')\n ->select('id_mesa', 'monto')\n ->first();\n break; \n // case \"entre_dos_fechas\":\n // if($idMesa != null)\n // {\n // $informacion = factura::where('id_mesa', $idMesa)\n // ->where('hora', '>=', $fechaInicio)\n // ->where('hora', '<=', $fechaFin)\n // ->get();\n // }\n break; \n case \"mejores_comentarios\":\n $informacion = encuesta::select('id_cliente', 'texto_experiencia')\n ->selectRaw(\"(puntaje_mesa + puntaje_restaurante + puntaje_mozo + puntaje_cocinero) as puntaje_total\")\n ->orderByRaw('(puntaje_mesa + puntaje_restaurante + puntaje_mozo + puntaje_cocinero) desc')\n ->limit(3)\n ->get();\n break; \n case \"peores_comentarios\":\n $informacion = encuesta::select('id_cliente', 'texto_experiencia')\n ->selectRaw(\"(puntaje_mesa + puntaje_restaurante + puntaje_mozo + puntaje_cocinero) as puntaje_total\")\n ->orderByRaw('(puntaje_mesa + puntaje_restaurante + puntaje_mozo + puntaje_cocinero) asc')\n ->limit(3)\n ->get();\n break; \n }\n if($informacion == null)\n {\n $informacion = 'No hay pedidos';\n }\n\n $newResponse = $response->withJson($informacion, 200);\n \n return $newResponse;\n }", "function buscar_comprobante_doc_venta($id_cuenta, $id_anexo, $id_serie, $id_numero ) {\n $sql = \"SELECT\n\t\t\t\t\t prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\t, sum(if(prosic_moneda.id_moneda=1,prosic_detalle_comprobante.importe_soles,prosic_detalle_comprobante.importe_dolares*prosic_tipo_cambio.venta_financiero)*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)) as importe_soles\n\t\t\t\t\t, sum(if(prosic_moneda.id_moneda=1,prosic_detalle_comprobante.importe_soles*prosic_tipo_cambio.venta_financiero,prosic_detalle_comprobante.importe_dolares)*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)) as importe_dolares\n\t\t\t\tFROM prosic_detalle_comprobante\n\t\t\t\tINNER JOIN prosic_plan_contable ON prosic_detalle_comprobante.id_plan_contable=prosic_plan_contable.id_plan_contable\n\t\t\t\tINNER JOIN prosic_anexo ON prosic_detalle_comprobante.id_anexo = prosic_anexo.id_anexo\n\t\t\t\tINNER JOIN prosic_moneda ON prosic_detalle_comprobante.id_moneda = prosic_moneda.id_moneda\n\t\t\t\tLEFT JOIN prosic_tipo_cambio ON prosic_detalle_comprobante.fecha_doc_comprobante=prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\tWHERE 1=1 \";\n\t\t\t\tif ($id_cuenta != '')$sql.=\" AND prosic_plan_contable.cuenta_plan_contable LIKE '%\" . $id_cuenta . \"%'\";\n if ($id_anexo != '')$sql.=\" AND prosic_anexo.codigo_anexo LIKE '%\" . $id_anexo . \"%'\";\n if ($id_numero != '')$sql.=\" AND prosic_detalle_comprobante.nro_doc_comprobante LIKE '%\" . $id_numero . \"%'\";\n\t\t\t$sql.=\" group by prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\thaving importe_soles>0\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "public function RelatorioContasPagarEmissao($where,$dtemi){\n\t\t\t\t\n\t\t$dba = $this->dba;\n\n\t\t$vet = array();\n\n\n\t\t$sql =\"SELECT \n\t\t\t\td.emissao,\n\t\t\t\td.vencimento,\n\t\t\t\td.numero,\n\t\t\t\tsum(d.valordoc) as valordoc,\n\t\t\t\td.numero_nota,\n\t\t\t\tf.codigo,\n\t\t\t\tf.nome\n\t\t\tFROM\n\t\t\t\tduplic d\n\t\t\t\t\tinner join\n\t\t\t\tfornecedores f ON (f.codigo = d.cedente)\n\t\t\t\".$where.\" and d.emissao = '\".$dtemi.\"'\n\t\t\tgroup by d.numero , d.numero_nota , d.emissao , f.codigo , f.nome , d.tipo,d.vencimento\";\n\t\t\n\t\t$res = $dba->query($sql);\n\n\t\t$num = $dba->rows($res); \n\n\t\t$i = 0;\n\t\t\t\n\t\twhile($dup = ibase_fetch_object($res)){\t\t\n\t\t\t\n\t\t\t$numero = $dup->NUMERO;\n\t\t\t$valordoc = $dup->VALORDOC;\n\t\t\t$numnota = $dup->NUMERO_NOTA;\n\t\t\t$emissao\t = $dup->EMISSAO;\n\t\t\t$codfor = $dup->CODIGO;\n\t\t\t$nomfor = $dup->NOME;\t\t\t\t\t\n\t\t\t$vencimento = $dup->VENCIMENTO;\n\t\t\t\n\t\t\t$duplic = new Duplic();\t\t\t\n\n\t\t\t$duplic->setNumero($numero);\n\t\t\t$duplic->setValorDoc($valordoc);\n\t\t\t$duplic->setNumeroNota($numnota);\n\t\t\t$duplic->setCodFornecedor($codfor);\n\t\t\t$duplic->setNomeFornevedor($nomfor);\n\t\t\t$duplic->setEmissao($emissao);\n\t\t\t$duplic->setVencimento($vencimento);\n\t\t\t\n\t\t\t$vet[$i++] = $duplic;\n\n\t\t}\n\n\t\treturn $vet;\n\n\t}", "public function busquedaEstudianteplanificacion() {\n $con = \\Yii::$app->db_academico;\n $estado = 1;\n \n $sql = \"SELECT est.per_id as id, concat(/*est.per_id, ' - ',*/ pers.per_cedula, ' - ', \n ifnull(pers.per_pri_nombre, ' ') ,' ', \n ifnull(pers.per_pri_apellido,' ')) as name\n FROM db_academico.estudiante est\n JOIN db_asgard.persona pers ON pers.per_id = est.per_id\n WHERE pers.per_estado = :estado AND\n pers.per_estado_logico = :estado AND\n est.est_estado = :estado AND\n est.est_estado_logico = :estado;\";\n\n $comando = $con->createCommand($sql);\n $comando->bindParam(\":estado\", $estado, \\PDO::PARAM_STR);\n $resultData = $comando->queryAll();\n return $resultData;\n }", "public function permisos()\n {\n\n $conectar = parent::conexion();\n\n $sql = \"select * from permisos;\";\n\n $sql = $conectar->prepare($sql);\n $sql->execute();\n return $resultado = $sql->fetchAll();\n }", "public function pesquisa(array $filtros){\n if(empty($filtros)){\n return FALSE;\n }\n //Monta clasula where e seus paramentros\n $this->where = 'i.id <> :id';\n $this->parameters['id'] = 'null';\n \n if(isset($filtros['rua'])){\n $this->where .= ' AND i.rua LIKE :rua';\n $this->parameters['rua'] = $filtros['rua'] . '%'; \n }\n \n if(isset($filtros['refImovel'])){\n $this->where .= ' AND i.refImovel LIKE :refImovel';\n $this->parameters['refImovel'] = $filtros['refImovel'] . '%'; \n }\n \n if(isset($filtros['locador'])){\n $this->where .= ' AND i.locador = :locador';\n $this->parameters['locador'] = $filtros['locador']; \n }\n \n if(isset($filtros['locatario'])){\n $this->where .= ' AND i.locatario = :locatario';\n $this->parameters['locatario'] = $filtros['locatario']; \n }\n \n $query = $this->getEntityManager()\n ->createQueryBuilder()\n ->select('i,ld,lt')\n ->from('Livraria\\Entity\\Imovel', 'i')\n ->join('i.locador', 'ld')\n ->join('i.locatario', 'lt')\n ->where($this->where)\n ->orderBy('i.rua')\n ->setParameters($this->parameters)\n ->getQuery();\n $list = $query->getResult();\n \n if (!empty($list))\n return $query;\n \n //Nova pesquisa pesquisando por qualquer ocorrencia \n if(isset($filtros['rua'])){\n $this->parameters['rua'] = '%' . $filtros['rua'] . '%'; \n }else{\n //Apenas para retornar uma query vazia\n $this->parameters['id'] = '0'; \n }\n $query = $this->getEntityManager()\n ->createQueryBuilder()\n ->select('i,ld,lt')\n ->from('Livraria\\Entity\\Imovel', 'i')\n ->join('i.locador', 'ld')\n ->join('i.locatario', 'lt')\n ->where($this->where)\n ->orderBy('i.rua')\n ->setParameters($this->parameters)\n ->getQuery();\n \n return $query;\n }", "function ProjetosPendentes() {\n\n $count = 0;\n $conexao = new classeConexao();\n\n //selecionando id dos projetos\n $projetos = $conexao::fetch(\"SELECT id FROM tb_projetos\");\n\n foreach ($projetos as $projeto) {\n\n //Qtd tarefas a fazer\n $tarefasFazer = $conexao::fetchuniq(\"SELECT COUNT(id) as qtd FROM tb_tarefas WHERE tb_tarefas_status=0 AND tb_tarefas_projeto = \".$projeto['id']);\n\n //Qtd tarefas feitas\n $tarefasFeitas = $conexao::fetchuniq(\"SELECT COUNT(id) as qtd FROM tb_tarefas WHERE tb_tarefas_status=1 AND tb_tarefas_projeto = \".$projeto['id']);\n\n //Porcentagem\n if(($tarefasFeitas['qtd'] + $tarefasFazer['qtd']) == 0){\n $qtd3 = 1;\n }else{\n $qtd3 = ($tarefasFeitas['qtd'] + $tarefasFazer['qtd']);\n }\n $porcentagem = ($tarefasFeitas['qtd'] * 100) / ($qtd3);\n\n if($porcentagem!=100) {\n $count++;\n }\n }\n\n return $count;\n}", "function dadosCadastros(){//função geral que será chamada na index\n pegaCadastrosJson();//pega os valores dos cadastros do arquivo JSON e salva em um array\n contaNumeroCadastros();//conta Quantos cadastros existem\n }", "public function listServRequetes($idFournisseur){\n $requete = \" SELECT idForfaitFournisseur, (SELECT count(idservice) FROM bitvoix_db.services WHERE idFournisseur = ?) AS nroServ\n FROM fournisseur WHERE idFournisseur = ?\";\n // var_dump($requete);\n $stmt = $this->_pdo->prepare($requete);\n $stmt->execute(array($idFournisseur,$idFournisseur));\n $result = $stmt->fetchAll(PDO::FETCH_OBJ);\n return $result;\n }", "public function buscarDadosParaImpressao($where = array(), $order = array(), $tamanho = -1, $inicio = -1)\n {\n $slct = $this->select();\n\n $slct->setIntegrityCheck(false);\n\n $slct->from(\n array('pr' => $this->_name),\n array('*',\n 'dbo.fnFormataProcesso(pr.idPronac) as Processo')\n );\n\n $slct->joinInner(\n array('ar' => 'Area'),\n \"ar.Codigo = pr.Area\",\n array('ar.descricao as dsArea')\n );\n $slct->joinInner(\n array('sg' => 'Segmento'),\n \"sg.Codigo = pr.Segmento\",\n array('sg.descricao as dsSegmento')\n );\n $slct->joinInner(\n array('mc' => 'Mecanismo'),\n \"mc.Codigo = pr.Mecanismo\",\n array('mc.Descricao as dsMecanismo')\n );\n $slct->joinInner(\n array('i' => 'Interessado'),\n \"pr.CgcCPf = i.CgcCPf\"\n );\n\n // adicionando clausulas where\n foreach ($where as $coluna => $valor) {\n $slct->where($coluna, $valor);\n }\n\n return $this->fetchAll($slct);\n }", "function contar(){\n $sql = \"Select (select count(cita.id) from cita) as Citas,( select count(medico.id) from medico) as Medicos, (select count(paciente.id) from paciente)as Pacientes\";\n $conexion = new Conexion();\n return $conexion->executeQuery($sql)->fetch_object();\n }", "function listarPartidaEjecucion(){\n\t\t$this->procedimiento='pre.ft_partida_ejecucion_sel';\n\t\t$this->transaccion='PRE_PAREJE_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_tipo_cc','id_tipo_cc','int4');\n\t\t\n\t\t$this->capturaCount('total_egreso_mb','numeric');\n\t\t$this->capturaCount('total_ingreso_mb','numeric');\n\t\t$this->capturaCount('total_monto_anticipo_mb','numeric');\n\t\t$this->capturaCount('total_monto_desc_anticipo_mb','numeric');\n\t\t$this->capturaCount('total_monto_iva_revertido_mb','numeric');\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_partida_ejecucion','int4');\n\t\t$this->captura('id_int_comprobante','int4');\n\t\t$this->captura('id_moneda','int4');\n $this->captura('moneda','varchar');\n\t\t$this->captura('id_presupuesto','int4');\n $this->captura('desc_pres','varchar');\n $this->captura('codigo_categoria','varchar');\n\t\t$this->captura('id_partida','int4');\n $this->captura('codigo','varchar');\n $this->captura('nombre_partida','varchar');\n\t\t$this->captura('nro_tramite','varchar');\n\t\t$this->captura('tipo_cambio','numeric');\n\t\t$this->captura('columna_origen','varchar');\n\t\t$this->captura('tipo_movimiento','varchar');\n\t\t$this->captura('id_partida_ejecucion_fk','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('fecha','date');\n\t\t$this->captura('egreso_mb','numeric');\n\t\t$this->captura('ingreso_mb','numeric');\n\t\t$this->captura('monto_mb','numeric');\n\t\t$this->captura('monto','numeric');\n\t\t$this->captura('valor_id_origen','int4');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\t\t\n\t\t$this->captura('id_tipo_cc','int4');\n\t\t$this->captura('desc_tipo_cc','varchar');\n\t\t\n\t\t$this->captura('nro_cbte','varchar');\n\t\t$this->captura('id_proceso_wf','int4');\n\t\t\n\t\t$this->captura('monto_anticipo_mb','numeric');\n\t\t$this->captura('monto_desc_anticipo_mb','numeric');\n\t\t$this->captura('monto_iva_revertido_mb','numeric');\n\t\t\n\t\t$this->captura('glosa1','varchar');\t\t\n\t\t$this->captura('glosa','varchar');\n\t\t\n\t\t$this->captura('cantidad_descripcion','numeric');\n\n $this->captura('total_pago','numeric');\n $this->captura('desc_contrato','varchar');\n $this->captura('obs','varchar');\n $this->captura('tipo_ajuste_formulacion','varchar'); //#41\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function contarServiciosNombre($nombre_buscado)\n\t{\n\t\treturn \"select count(*) as number\nfrom trabajadores, servicios,sucursales where servicios.nombre_servicio like '%$nombre_buscado%'\nand servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 1 \nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}", "public function forfaitServic($idFournisseur){\n $requete = \" SELECT idForfaitFournisseur, (SELECT count(idservice) FROM bitvoix_db.services WHERE idFournisseur = ?) AS nroServ,\n DATEDIFF(now(),fournisseur.datInsFournisseur) as jours, DATEDIFF(datEcheFournisseur,now()) as jouract \n FROM fournisseur WHERE idFournisseur = ?\";\n // var_dump($requete);\n $stmt = $this->_pdo->prepare($requete);\n $stmt->execute(array($idFournisseur,$idFournisseur));\n $result = $stmt->fetchAll(PDO::FETCH_OBJ);\n if (!$result){\n $requete = \" SELECT '' AS idService, 0 AS nroServ, idForfaitFournisseur,datEcheFournisseur, idForfaitFournisseur,\n DATEDIFF(now(),fournisseur.datInsFournisseur) as jours, DATEDIFF(datEcheFournisseur,now()) as jouract \n FROM fournisseur\n WHERE idFournisseur = ? \";\n // var_dump($requete);\n $stmt = $this->_pdo->prepare($requete);\n $stmt->execute(array($idFournisseur));\n $result = $stmt->fetchAll(PDO::FETCH_OBJ);\n }\n return $result;\n\n }", "public function desparasitantes_TotalAplicarFiltrosDesparasitantes($fechaInicial, $fechaFinal, $fechaInicialProximo, $fechaFinalProximo, $idDesparasitante, $idPropietario, $paciente){\n \t\n\t\t\t$resultado = 0;\n\t\t\t$adicionQuery = \"WHERE 1 \";\n\t\t\t\n\t\t\tif($idDesparasitante != '0'){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND D.idDesparasitante = '$idDesparasitante' \";\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif($fechaInicial != \"\" AND $fechaFinal != \"\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND ( D.fecha BETWEEN '$fechaInicial' AND '$fechaFinal')\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($fechaInicialProximo != \"\" AND $fechaFinalProximo != \"\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND ( D.fechaProximoDesparasitante BETWEEN '$fechaInicialProximo' AND '$fechaFinalProximo')\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\n\t\t\tif($idPropietario != \"0\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND P.idPropietario = '$idPropietario' \";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($paciente != \"\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND D.idMascota = '$paciente' \";\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\t$query = \"SELECT \n\t\t\t\t\t\t count(D.idDesparasitanteMascota) as totalRegistros\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t tb_desparasitantesMascotas AS D\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_mascotas AS M ON D.idMascota = M.idMascota\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_propietarios AS P ON P.idPropietario = M.idPropietario\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_desparasitantes AS DD ON DD.idDesparasitante = D.idDesparasitante\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\".$adicionQuery.\"\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$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado = $filas['totalRegistros'];\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado;\n\t\t\t\n\t\t\t\n }", "public function reporte1($pos)\n {\n //declarando variables del filtro\n $accioncentralizada=\"\";\n $accespecifica=\"\";\n $proyecto=\"\";\n $proyectoespecifica=\"\";\n $materiales=\"\";\n $unidades=\"\";\n $partida=\"\"; \n\n //print_r($pos); exit();\n //verificacion de filtros acciones centrales\n if($pos['accion_centralizada']!='-1')\n {\n if($pos['accion_centralizada']!='x999')\n {\n $accioncentralizada=\" and a.id=\".$pos['accion_centralizada'];\n }\n \n\n if(isset($pos['acc_especifica']) && $pos['acc_especifica']!='x999' && $pos['acc_especifica']!='')\n {\n $accespecifica=\" and b.id=\".$pos['acc_especifica'];\n }\n }\n else\n {\n $accioncentralizada=\" and a.id=-1 \";\n }\n //verificacion de filtros proyectos\n if($pos['proyectos']!='-1')\n {\n if($pos['proyectos']!='x999')\n {\n $proyecto=\" and a.id=\".$pos['proyectos'];\n }\n \n if(isset($pos['proyectos_especifica']) && $pos['proyectos_especifica']!='x999' && $pos['proyectos_especifica']!='')\n {\n $proyectoespecifica=\" and b.id=\".$pos['proyectos_especifica'];\n }\n }\n else\n {\n $proyecto=\" and a.id=-1 \";\n }\n\n //verificando Filtros de materiales o servicios\n if($pos['materiales-servicios']!='x999')\n {\n $materiales=\" and f.id=\".$pos['materiales-servicios'];\n }\n\n //verificando Filtros de unidad ejecutora\n if($pos['unidadessejecutoras']!='x999')\n {\n $unidades=\" and i.id=\".$pos['unidadessejecutoras'];\n }\n\n //filtro partida\n if(isset($pos['partida']) && $pos['partida']!=\"\")\n {\n $array_partida=explode(\",\", $pos['partida']);\n $partida=\" and (\";\n foreach ($array_partida as $key => $value) \n {\n $partida.= \"concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) like '%\".$value.\"%' || \";\n }\n $partida=substr($partida, 0, -3);\n $partida.=\") \";\n }\n\n //construyendo el query\n //Agrupar por partida\n if(isset($pos['partida_agrupar']))\n {\n $sql=\"\n\n select a.cod_proyecto_central, a.nombre_proyecto_central, a.cod_especifica, a.nombre_especifica, a.nombre_unidad_ejecutora, a.partida, \n sum(a.trim1) as trim1,\n format(sum(a.total_trim1),2,'de_DE') as total_trim1, \n sum(a.trim2) as trim2, \n format(sum(a.total_trim2),2,'de_DE') as total_trim2, \n sum(a.trim3) as trim3, \n format(sum(a.total_trim3),2,'de_DE') as total_trim3, \n sum(a.trim4) as trim4, \n format(sum(a.total_trim4),2,'de_DE') as total_trim4, \n format(sum(a.total_iva),2, 'de_DE') as total_iva, \n format(sum(a.total), 2, 'de_DE') as total \n from \n ( \n\n select a.codigo_accion as cod_proyecto_central, a.nombre_accion as nombre_proyecto_central, b.cod_ac_espe as cod_especifica, b.nombre as nombre_especifica, concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) as partida, i.nombre as nombre_unidad_ejecutora,\n (e.enero+e.febrero+e.marzo) as trim1, \n ((e.enero+e.febrero+e.marzo) * e.precio) as total_trim1, \n (e.abril+e.mayo+e.junio) as trim2, \n ((e.abril+e.mayo+e.junio) * e.precio) as total_trim2, \n (e.julio+e.agosto+e.septiembre) as trim3, \n ((e.julio+e.agosto+e.septiembre) * e.precio) as total_trim3, \n (e.octubre+e.noviembre+e.diciembre) as trim4, \n ((e.octubre+e.noviembre+e.diciembre) * e.precio) as total_trim4, \n (round((((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio)/e.iva))) as total_iva, \n (((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio) + round((((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio)/e.iva))) as total \n from \n accion_centralizada as a \n inner join accion_centralizada_accion_especifica as b on a.id=b.id_ac_centr \n inner join accion_centralizada_ac_especifica_uej as c on b.id=c.id_ac_esp \n inner join accion_centralizada_asignar as d on c.id=d.accion_especifica_ue \n inner join accion_centralizada_pedido as e on d.id=e.asignado \n inner join materiales_servicios as f on e.id_material=f.id \n inner join unidad_medida as g on f.unidad_medida=g.id \n inner join presentacion as h on f.presentacion=h.id \n inner join unidad_ejecutora as i on c.id_ue=i.id \n where 1=1 \n \".$accioncentralizada.$accespecifica.$materiales.$unidades.$partida.\"\n\n union all\n\n SELECT a.codigo_proyecto as cod_proyecto_central, a.nombre as nombre_proyecto_central, b.codigo_accion_especifica as cod_especifica, b.nombre as nombre_especifica, concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) partida, i.nombre as nombre_unidad_ejecutora, \n (d.enero+d.febrero+d.marzo) as trim1, \n ((d.enero+d.febrero+d.marzo) * d.precio) as total_trim1, \n (d.abril+d.mayo+d.junio) as trim2, \n ((d.abril+d.mayo+d.junio) * d.precio) as total_trim2, \n (d.julio+d.agosto+d.septiembre) as trim3, \n ((d.julio+d.agosto+d.septiembre) * d.precio) as total_trim3, \n (d.octubre+d.noviembre+d.diciembre) as trim4, \n ((d.octubre+d.noviembre+d.diciembre) * d.precio) as total_trim4, \n (((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio)/d.iva) as total_iva, \n (((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio) + round((((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio)/d.iva))) as total \n FROM proyecto as a \n inner join proyecto_accion_especifica as b on a.id=b.id_proyecto \n inner join proyecto_usuario_asignar as c on b.id=c.accion_especifica_id \n inner join proyecto_pedido as d on c.id=d.asignado \n inner join materiales_servicios as f on d.id_material=f.id \n inner join unidad_medida as g on f.unidad_medida=g.id \n inner join presentacion as h on f.presentacion=h.id \n inner join unidad_ejecutora as i on b.id_unidad_ejecutora=i.id \n where 1=1 \n \".$proyecto.$proyectoespecifica.$materiales.$unidades.$partida.\"\n\n ) \n as a \n where a.cod_proyecto_central is not null group by a.partida \n \"; \n }\n else\n {\n $sql=\"\n\n select a.cod_proyecto_central, a.nombre_proyecto_central, a.cod_especifica, a.nombre_especifica, a.nombre_unidad_ejecutora, a.partida, a.material, a.unidad_medida, a.presentacion, a.precio, a.iva, a.trim1, a.total_trim1, a.trim2, a.total_trim2, a.trim3, a.total_trim3, a.trim4, a.total_trim4, format(a.total_iva,2, 'de_DE') as total_iva, format(a.total, 2, 'de_DE') as total\n from \n (\n select a.codigo_accion as cod_proyecto_central, a.nombre_accion as nombre_proyecto_central, b.cod_ac_espe as cod_especifica, b.nombre as nombre_especifica, concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) partida, f.nombre as material, g.unidad_medida as unidad_medida, h.nombre as presentacion, e.precio,\n e.iva, i.nombre as nombre_unidad_ejecutora,\n (e.enero+e.febrero+e.marzo) as trim1, ((e.enero+e.febrero+e.marzo) * e.precio) as total_trim1, \n (e.abril+e.mayo+e.junio) as trim2, \n ((e.abril+e.mayo+e.junio) * e.precio) as total_trim2, \n (e.julio+e.agosto+e.septiembre) as trim3, \n ((e.julio+e.agosto+e.septiembre) * e.precio) as total_trim3, \n (e.octubre+e.noviembre+e.diciembre) as trim4, \n ((e.octubre+e.noviembre+e.diciembre) * e.precio) as total_trim4,\n round((((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio)/e.iva)) as total_iva,\n ((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio) + round((((e.enero+e.febrero+e.marzo+e.abril+e.mayo+e.junio+e.julio+e.agosto+e.septiembre+e.octubre+e.noviembre+e.diciembre) * e.precio)/e.iva)) as total\n from accion_centralizada as a\n inner join accion_centralizada_accion_especifica as b on a.id=b.id_ac_centr \n inner join accion_centralizada_ac_especifica_uej as c on b.id=c.id_ac_esp \n inner join accion_centralizada_asignar as d on c.id=d.accion_especifica_ue \n inner join accion_centralizada_pedido as e on d.id=e.asignado\n inner join materiales_servicios as f on e.id_material=f.id\n inner join unidad_medida as g on f.unidad_medida=g.id\n inner join presentacion as h on f.presentacion=h.id\n inner join unidad_ejecutora as i on c.id_ue=i.id\n where\n 1=1\n \".$accioncentralizada.$accespecifica.$materiales.$unidades.$partida.\" \n\n\n union all\n\n SELECT a.codigo_proyecto as cod_proyecto_central, a.nombre as nombre_proyecto_central, b.codigo_accion_especifica as cod_especifica, b.nombre as nombre_especifica, concat(f.cuenta, f.partida, f.generica, f.especifica, f.subespecifica) partida, f.nombre as material, g.unidad_medida as unidad_medida, h.nombre as presentacion, d.precio,\n d.iva, i.nombre as nombre_unidad_ejecutora,\n (d.enero+d.febrero+d.marzo) as trim1, ((d.enero+d.febrero+d.marzo) * d.precio) as total_trim1, \n (d.abril+d.mayo+d.junio) as trim2, \n ((d.abril+d.mayo+d.junio) * d.precio) as total_trim2, \n (d.julio+d.agosto+d.septiembre) as trim3, \n ((d.julio+d.agosto+d.septiembre) * d.precio) as total_trim3, \n (d.octubre+d.noviembre+d.diciembre) as trim4, \n ((d.octubre+d.noviembre+d.diciembre) * d.precio) as total_trim4,\n (((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio)/d.iva) as total_iva,\n ((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio) + round((((d.enero+d.febrero+d.marzo+d.abril+d.mayo+d.junio+d.julio+d.agosto+d.septiembre+d.octubre+d.noviembre+d.diciembre) * d.precio)/d.iva)) as total\n FROM proyecto as a\n inner join proyecto_accion_especifica as b on a.id=b.id_proyecto\n inner join proyecto_usuario_asignar as c on b.id=c.accion_especifica_id\n inner join proyecto_pedido as d on c.id=d.asignado\n inner join materiales_servicios as f on d.id_material=f.id\n inner join unidad_medida as g on f.unidad_medida=g.id\n inner join presentacion as h on f.presentacion=h.id\n inner join unidad_ejecutora as i on b.id_unidad_ejecutora=i.id\n where\n 1=1\n \".$proyecto.$proyectoespecifica.$materiales.$unidades.$partida.\"\n\n ) as a\n where a.cod_proyecto_central is not null order by partida\n \n \";\n\n }\n\n \n //print_r($sql); exit();\n //Arreglo para el DataProvider\n $query = Yii::$app->db->createCommand($sql)->queryAll();\n //DataProvider\n $dataProvider = new ArrayDataProvider([\n 'allModels' => $query,\n ]);\n return $dataProvider;\n }", "public function consultarFacturaIniciada($idUsuario){\n\t\t\t\t\n\t\t$resultado = array();\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n\t\t$query = \"SELECT \n\t\t\t\t F.idFactura,\n\t\t\t\t F.numeroFactura,\n\t\t\t\t F.fecha,\n\t\t\t\t F.hora,\n\t\t\t\t F.iva,\n\t\t\t\t F.valorIva,\n\t\t\t\t F.descuento,\n\t\t\t\t F.metodopago,\n\t\t\t\t F.observaciones,\n\t\t\t\t F.idPropietario,\n\t\t\t\t F.idFacturador,\n\t\t\t\t F.idResolucionDian,\n\t\t\t\t P.identificacion as identificacionPropietario,\n \t\t\t\tP.nombre as nombrePropietario,\n\t\t\t\t P.apellido,\n\t\t\t\t FACT.nombre AS nombreFacturador,\n\t\t\t\t RE.numeroResolucion,\n\t\t\t\t PFCD.idPagoFacturaCajaDetalle,\n\t\t\t\t PFCD.tipoDetalle,\n\t\t\t\t PFCD.idTipoDetalle,\n\t\t\t\t PFCD.valorUnitario,\n\t\t\t\t PFCD.cantidad,\n \t\t\t\tPFCD.descuento\n\t\t\t\tFROM\n\t\t\t\t tb_facturas AS F\n\t\t\t\t INNER JOIN\n\t\t\t\t tb_propietarios AS P ON P.idPropietario = F.idPropietario\n\t\t\t\t INNER JOIN\n\t\t\t\t tb_facturadores AS FACT ON FACT.idFacturador = F.idFacturador\n\t\t\t\t INNER JOIN\n\t\t\t\t tb_resolucionDian AS RE ON RE.idResolucionDian = F.idResolucionDian\n\t\t\t\t INNER JOIN\n\t\t\t\t tb_pago_factura_caja AS PFC ON PFC.idTipoElemento = F.idFactura\n\t\t\t\t AND PFC.tipoElemento = 'Factura'\n\t\t\t\t INNER JOIN\n\t\t\t\t tb_pago_factura_caja_detalle AS PFCD ON PFCD.idPagoFacturaCaja = PFC.idPagoFacturaCaja\n\t\t\t\t AND PFCD.estado = 'Activo'\n\t\t\t\tWHERE\n\t\t\t\t F.idUsuario = '$idUsuario'\n\t\t\t\t AND F.estado = 'Iniciada'\";\n\t\t\n\t\tif($res = $conexion->query($query)){\n\t\t\twhile ($filas = $res->fetch_assoc()) {\n\t\t\t\t\t\t\t\n\t\t\t\t$resultado[] = $filas;\n\t\t\t\t\t\n\t\t\t}//fin while\n\t\t\t\n\t\t\t/* liberar el conjunto de resultados */\n\t\t\t$res->free();\n\t\t\t\n\t\t}//fin if\n\t\t\n\t\treturn $resultado;\n\t\t\t\t\t\n\t\t\n\t}", "public function DetallesComprasPorId()\n\t{\n\t\tif(base64_decode($_GET['tipoentrada'])==\"PRODUCTO\"){\n\n\t\t\tself::SetNames();\n\t\t\t$sql = \" SELECT * FROM detallecompras LEFT JOIN categorias ON detallecompras.categoria = categorias.codcategoria LEFT JOIN productos ON detallecompras.codproducto = productos.codproducto WHERE detallecompras.coddetallecompra = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"coddetallecompra\"])) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num==0)\n\t\t\t{\n\t\t\t\techo \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t} else {\n\n\t\t\t$sql = \" SELECT * FROM detallecompras LEFT JOIN ingredientes ON detallecompras.codproducto = ingredientes.codingrediente WHERE detallecompras.coddetallecompra = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"coddetallecompra\"])) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num==0)\n\t\t\t{\n\t\t\t\techo \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\n\t\t}\n\t}", "function consultarPedido (){\n\t\t$x = $this->pdo->prepare('SELECT * FROM pedido');\n\t\t$x->execute();\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "public function consulta_asistencia()\n {\n $fecha_reporte = cambiaf_a_mysql($this->txt_fecha_desde->Text);\n $dir = $this->drop_direcciones->SelectedValue;\n $cod_organizacion = usuario_actual('cod_organizacion');\n\n // se obtienen las justificaciones del día seleccionado\n $sql=\"SELECT (p.cedula) as cedula_just, p.nombres, p.apellidos, j.codigo, jd.fecha_desde, jd.hora_desde,\n jd.fecha_hasta, jd.hora_hasta, jd.observaciones, jd.lun, jd.mar, jd.mie, jd.jue, jd.vie,\n tf.descripcion as descripcion_falta, tj.descripcion as descripcion_tipo_justificacion\n\t\t\t\t\t FROM asistencias.justificaciones as j, asistencias.justificaciones_dias as jd,\n\t\t\t\t\t\t asistencias.justificaciones_personas as jp, organizacion.personas as p, organizacion.personas_nivel_dir as n, asistencias.tipo_faltas tf, asistencias.tipo_justificaciones tj\n\t\t\t\t\t\tWHERE ((p.cedula = jp.cedula) and\n\t\t\t\t\t\t (p.cedula = n.cedula) and (jd.codigo_tipo_falta = tf.codigo) and (tj.id = jd.codigo_tipo_justificacion) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%') and\n\t\t\t\t\t\t (p.fecha_ingreso <= '$fecha_reporte') and\n\t\t\t\t\t\t (jd.fecha_desde <= '$fecha_reporte') and\n\t\t\t\t\t\t\t (jd.fecha_hasta >= '$fecha_reporte') and\n\t\t\t\t\t\t\t (j.estatus='1') and (j.codigo=jd.codigo_just) and (j.codigo=jp.codigo_just))\n\t\t\t\t\t\tORDER BY p.nombres, p.apellidos, jp.cedula \";\n $this->justificaciones=cargar_data($sql,$this); \n\n // se obtiene el horario vigente para la fecha seleccionada\n $this->horario_vigente = obtener_horario_vigente($cod_organizacion,$fecha_reporte,$this);\n \n // se realizan las consultas para mostrar los listados\n // Se consultan los asistentes\n $sql=\"SELECT (p.cedula) as cedula_integrantes, CONCAT(p.nombres,' ',p.apellidos) as nombre,\n e.cedula, e.fecha, MIN(e.hora) as entrada, MAX(e.hora) as salida\n FROM asistencias.entrada_salida as e, organizacion.personas as p, organizacion.personas_nivel_dir as n\n WHERE ((p.cedula = e.cedula) and\n (p.cedula = n.cedula) and\n (n.cod_direccion LIKE '$dir%') and\n (p.fecha_ingreso <= '$fecha_reporte') and\n (e.fecha <= '$fecha_reporte') and\n (e.fecha >= '$fecha_reporte'))\n GROUP BY e.cedula\n ORDER BY entrada, p.nombres, p.apellidos \";\n $this->asistentes=cargar_data($sql,$this);\n $this->ind_asistentes = count($this->asistentes);\n\n // se consultan los inasistentes\n $sql2=\"SELECT p.cedula as cedula_integrantes, CONCAT(p.nombres,' ',p.apellidos) as nombre\n\t\t\t\t\t\t\t\t\t FROM organizacion.personas as p, asistencias.personas_status_asistencias as s,\n\t\t\t\t\t\t\t\t\t organizacion.personas_nivel_dir as n\n\t\t\t\t\t\t\t\t\t WHERE ((s.status_asistencia = '1') and\n\t\t\t\t\t\t\t\t\t \t\t (s.cedula = p.cedula) and\n\t\t\t\t\t\t\t\t\t\t\t (p.cedula = n.cedula) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%') and\n\t\t\t\t\t\t\t\t\t (p.fecha_ingreso <= '$fecha_reporte') and\n\t\t\t\t\t\t\t\t\t (p.cedula not in\n\t\t\t\t\t\t\t\t\t (SELECT e.cedula\n\t\t\t\t\t\t\t\t\t\t FROM asistencias.entrada_salida as e, organizacion.personas_nivel_dir as n\n\t\t\t\t\t\t\t\t\t\t \t WHERE ((e.fecha = '$fecha_reporte') and\n\t\t\t\t\t\t\t\t\t\t\t\t (p.cedula = n.cedula) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%'))\n\t\t\t\t\t\t\t\t\t\t\t GROUP BY e.cedula)))\n\t\t\t\t\t\t\t\t\t ORDER BY p.nombres, p.apellidos\";\n $this->inasistentes=cargar_data($sql2,$this);\n\n\n // Se consultan los asistentes para comparar inconsistencia de horas en el marcado\n // Si le falta hora\n $inconsistentes = array();\n foreach($this->asistentes as $arreglo){\n \n $sql2=\"SELECT COUNT(*) as n_horas FROM asistencias.entrada_salida as e\n\t\t\t WHERE e.fecha = '$fecha_reporte' AND e.cedula = '$arreglo[cedula_integrantes]' \";\n $resultado2=cargar_data($sql2,$this);\n if(!empty($resultado2)){\n if ($resultado2[0][n_horas]%2!=0) {//impar\n array_unshift($inconsistentes, array('cedula'=>$arreglo[cedula_integrantes], 'nombre'=>$arreglo[nombre],'salida'=>$arreglo[salida]));\n }//fin si\n }//fin si\n }//fin each\n\n\n\n // Se enlaza el nuevo arreglo con el listado de Direcciones\n //$this->DataGrid_fj->Caption=\"Reporte de Asistencias del \".$this->txt_fecha_desde->Text;\n if(!empty($inconsistentes)){\n $this->DataGrid_fh->DataSource=$inconsistentes;\n $this->DataGrid_fh->dataBind();\n }\n\n // Se enlaza el nuevo arreglo con el listado de Direcciones\n $this->DataGrid->Caption=\"Reporte de Asistencias del \".$this->txt_fecha_desde->Text;\n $this->DataGrid->DataSource=$this->asistentes;\n $this->DataGrid->dataBind();\n\n\n $this->DataGrid_ina->Caption=\"Inasistentes el d&iacute;a \".$this->txt_fecha_desde->Text;\n $this->DataGrid_ina->DataSource=$this->inasistentes;\n $this->DataGrid_ina->dataBind();\n\n /* Por un error que no supe identificar, el cual suma un numero adicional a la variable\n * de inasistentes no justificados, he tenido que sacarla del procedimiento donde normalmente\n * se contaba y tuve que realizarla por resta en esta sección.\n */\n $this->ind_inasistentes_no_just = count($this->inasistentes) - $this->ind_inasistentes_si_just;\n\n $this->Repeater->DataSource = $this->justificaciones;\n $this->Repeater->dataBind();\n\n $xale=rand(100,99999);\n // Se realiza la construcción del gráfico para indicadores\n\n $chart = new PieChart();\n $dataSet = new XYDataSet();\n if ($this->ind_asistentes>=1) {$dataSet->addPoint(new Point(\"Funcionarios Asistentes: (\".$this->ind_asistentes.\")\", $this->ind_asistentes));};\n if ($this->ind_inasistentes_no_just>=1) {$dataSet->addPoint(new Point(\"Inasistentes NO JUSTIFICADOS: (\".$this->ind_inasistentes_no_just.\")\", $this->ind_inasistentes_no_just));};\n if ($this->ind_inasistentes_si_just>=1) {$dataSet->addPoint(new Point(\"Inasistentes JUSTIFICADOS: (\".$this->ind_inasistentes_si_just.\")\", $this->ind_inasistentes_si_just));};\n $chart->setDataSet($dataSet);\n $chart->setTitle(\"Porcentajes de Asistencias / Inasistencias del: \".$this->txt_fecha_desde->Text);\n elimina_grafico($xale.\"_01.png\");\n $chart->render(\"imagenes/temporales/\".$xale.\"_01.png\");\n $this->grafico1->ImageUrl = \"imagenes/temporales/\".$xale.\"_01.png\";\n\n\n $chart2 = new PieChart();\n $dataSet2 = new XYDataSet();\n $this->ind_asistentes_no_retrasados=$this->ind_asistentes-$this->ind_asistentes_tarde_no_just-$this->ind_asistentes_tarde_si_just;\n if ($this->ind_asistentes_no_retrasados>=1) {$dataSet2->addPoint(new Point(\"Puntuales: (\".$this->ind_asistentes_no_retrasados.\")\", $this->ind_asistentes_no_retrasados));};\n if ($this->ind_asistentes_tarde_no_just>=1) {$dataSet2->addPoint(new Point(\"Impuntuales NO JUSTIFICADOS: (\".$this->ind_asistentes_tarde_no_just.\")\", $this->ind_asistentes_tarde_no_just));};\n if ($this->ind_asistentes_tarde_si_just>=1) {$dataSet2->addPoint(new Point(\"Impuntuales JUSTIFICADOS: (\".$this->ind_asistentes_tarde_si_just.\")\", $this->ind_asistentes_tarde_si_just));};\n $chart2->setDataSet($dataSet2);\n $chart2->setTitle(\"Porcentajes de Retrasos del: \".$this->txt_fecha_desde->Text);\n elimina_grafico($xale.\"_02.png\");\n $chart2->render(\"imagenes/temporales/\".$xale.\"_02.png\");\n $this->grafico2->ImageUrl = \"imagenes/temporales/\".$xale.\"_02.png\";\n\n // si la consulta de asistentes tiene resultados se habilita la impresion, sino, se deshabilita\n if (!empty($this->asistentes)) {$this->btn_imprimir->Enabled = true;} else {$this->btn_imprimir->Enabled = false;}\n\n }", "function afficher_produits_commande($id_resto) {\n global $connexion;\n try {\n $select = $connexion -> prepare(\"SELECT * \n FROM lunchr_commandes as lc, \n lunchr_ligne_commande as lcl, \n lunchr_produits as lp\n WHERE lc.lc_id = lcl.lc_id\n AND lp.lp_id = lcl.lp_id\n AND lc.lc_id = :id_resto\");\n $select -> execute(array(\"id_resto\" => $id_resto));\n $select -> setFetchMode(PDO::FETCH_ASSOC);\n $resultat = $select -> fetchAll();\n return $resultat;\n }\n \n catch (Exception $e) {\n print $e->getMessage();\n return false;\n }\n }", "function guardaoe(){\n\t\t$m = intval($_POST['totalitem']);\n\t\t$t = 0;\n\t\t// calcula el total de\n\t\tfor ( $i=0; $i < $m; $i++ ){\n\t\t\t$t += $_POST['cana_'.$i];\n\t\t}\n\t\tif ( $t <= 0 ) {\n\t\t\techo \"No hay pedido\";\n\t\t\treturn;\n\t\t}\n\n\t\t// Crea encabezado\n\t\t$numero = $this->datasis->fprox_numero('nprdo');\n\t\t$data['numero'] = $numero;\n\t\t$data['fecha'] = date('Y-m-d');\n\t\t$data['almacen'] = $_POST['almacen'];\n\t\t$data['status'] = 'A';\n\t\t$data['usuario'] = $this->secu->usuario();\n\t\t$data['estampa'] = date('Ymd');\n\t\t$data['hora'] = date('H:i:s');\n\n\t\t$data['instrucciones'] = $_POST['instrucciones'];\n\n\t\t$this->db->insert('prdo',$data);\n\n\t\t// Crea Detalle\n\t\t$ids = '';\n\t\tfor ( $i=0; $i < $m; $i++ ){\n\t\t\t$cana = $_POST['cana_'.$i];\n\t\t\tif ( $cana > 0 ){\n\t\t\t\t// Guarda\n\t\t\t\t$id = intval($_POST['idpfac_'.$i]);\n\t\t\t\t$mSQL = \"\n\t\t\t\tINSERT INTO itprdo (numero, pedido, codigo, descrip, cana, ordenado, idpfac )\n\t\t\t\tSELECT '${numero}' numero, a.numa pedido, a.codigoa codigo, a.desca descrip, a.cana, ${cana} ordenado, ${id} idpfac\n\t\t\t\tFROM itpfac a JOIN pfac b ON a.numa = b.numero\n\t\t\t\tWHERE a.id= ${id}\";\n\t\t\t\t$this->db->query($mSQL);\n\t\t\t}\n\t\t}\n\n\t\t// Crea totales\n\t\t$mSQL = \"\n\t\tINSERT INTO itprdop ( numero, codigo, descrip, ordenado, producido)\n\t\tSELECT '${numero}' numero, codigo, descrip, sum(ordenado) ordenado, 0 producido\n\t\tFROM itprdo\n\t\tWHERE numero = '${numero}'\n\t\tGROUP BY codigo\";\n\t\t$this->db->query($mSQL);\n\n\t}", "function idiomas_disponibles($id_palabra,$estado) {\n\t\n\t\tif ($estado==0) { $sql_estado='AND traducciones.estado = 0'; }\n\t\telseif ($estado==1) { $sql_estado='AND traducciones.estado = 1'; }\n\t\telseif ($estado==2) { $sql_estado='AND traducciones.estado = 2'; }\n\t\telse { $sql_estado=''; } \n\t\t$query = \"SELECT \n\t\ttraducciones.estado,traducciones.id_palabra,traducciones.id_idioma,\n\t\tidiomas.id_idioma,idiomas.idioma \n\t\tFROM traducciones, idiomas\n\t\tWHERE traducciones.id_palabra = '$id_palabra'\n\t\tAND traducciones.id_idioma = idiomas.id_idioma\n\t\t$sql_estado\n\t\tGROUP BY idiomas.id_idioma\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\tmysql_close($connection);\n\t\treturn $result;\n\t}", "function listarPais(){\n $this->procedimiento='rec.ft_cliente_sel';\n $this->transaccion='CLI_LUG_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n $this->setCount(false);\n //Definicion de la lista del resultado del query\n $this->captura('id_lugar','int4');\n $this->captura('codigo','varchar');\n $this->captura('estado_reg','varchar');\n $this->captura('id_lugar_fk','int4');\n $this->captura('nombre','varchar');\n $this->captura('sw_impuesto','varchar');\n $this->captura('sw_municipio','varchar');\n $this->captura('tipo','varchar');\n $this->captura('fecha_reg','timestamp');\n $this->captura('id_usuario_reg','int4');\n $this->captura('fecha_mod','timestamp');\n $this->captura('id_usuario_mod','int4');\n $this->captura('usr_reg','varchar');\n $this->captura('usr_mod','varchar');\n $this->captura('es_regional','varchar');\n\n //$this->captura('nombre_lugar','varchar');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n //var_dump($this->consulta); exit;\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function ProjetosRealizadosCliente($empresa = null) {\n\n $count = 0;\n $conexao = new classeConexao();\n\n //selecionando id dos projetos\n $projetos = $conexao::fetch(\"SELECT id FROM tb_projetos WHERE id_projetos_empresas_id = {$empresa}\");\n\n foreach ($projetos as $projeto) {\n\n //Qtd tarefas a fazer\n $tarefasFazer = $conexao::fetchuniq(\"SELECT COUNT(id) as qtd FROM tb_tarefas WHERE tb_tarefas_status=0 AND tb_tarefas_projeto = \".$projeto['id']);\n\n //Qtd tarefas feitas\n $tarefasFeitas = $conexao::fetchuniq(\"SELECT COUNT(id) as qtd FROM tb_tarefas WHERE tb_tarefas_status=1 AND tb_tarefas_projeto = \".$projeto['id']);\n\n //Porcentagem\n if(($tarefasFeitas['qtd'] + $tarefasFazer['qtd']) == 0){\n $qtd2 = 1;\n }else{\n $qtd2 = ($tarefasFeitas['qtd'] + $tarefasFazer['qtd']);\n }\n $porcentagem = ($tarefasFeitas['qtd'] * 100) / ($qtd2);\n\n if($porcentagem==100) {\n $count++;\n }\n }\n\n return $count;\n}", "public function AbonosCreditosId() \n{\n\tself::SetNames();\n\t$sql = \" SELECT clientes.codcliente, clientes.cedcliente, clientes.nomcliente, ventas.idventa, ventas.codventa, ventas.totalpago, ventas.statusventa, abonoscreditos.codventa as codigo, abonoscreditos.fechaabono, SUM(montoabono) AS abonototal FROM (clientes INNER JOIN ventas ON clientes.codcliente = ventas.codcliente) LEFT JOIN abonoscreditos ON ventas.codventa = abonoscreditos.codventa WHERE abonoscreditos.codabono = ? AND clientes.cedcliente = ? AND ventas.codventa = ? AND ventas.tipopagove ='CREDITO'\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(base64_decode($_GET['codabono'])));\n\t$stmt->bindValue(2, trim(base64_decode($_GET['cedcliente'])));\n\t$stmt->bindValue(3, trim(base64_decode($_GET['codventa'])));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function lista_proveedores($ubicacion,$idfamilia,$idservicio,$interno,$activo,$texto)\n\t{\n\n\t\t$condicion =\" WHERE 1 \";\n\n\t\tif ($idfamilia!='') $condicion.= \" AND cs.IDFAMILIA ='$idfamilia'\";\n\t\tif ($activo!='') $condicion.= \" AND (cp.ACTIVO = $activo)\";\n\t\tif ($idservicio!='') $condicion.= \" AND (cps.IDSERVICIO = '$idservicio' OR cps.IDSERVICIO ='0' )\";\n\t\tif ($interno!='') $condicion.= \" AND cp.INTERNO = '$interno' \";\n\t\tif ($texto!='') $condicion.= \" AND (cp.NOMBRECOMERCIAL like '%$texto%' OR cp.NOMBREFISCAL like '%$texto%')\";\n\n\t\t/* QUERY BUSCA LOA PROVEEDORES QUE PRESTAN EL SERVICIO*/\n\n\t\t$sql=\"\n\t\t\tSELECT \n\t\t\t\tcp.IDPROVEEDOR\n\t\t\tFROM \n\t\t\t$this->catalogo.catalogo_proveedor cp\n\t\t\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_servicio cps ON cps.IDPROVEEDOR = cp.IDPROVEEDOR \n\t\t\t\tLEFT JOIN $this->catalogo.catalogo_servicio cs ON cs.IDSERVICIO = cps.IDSERVICIO\n\t\t\t\t$condicion\n\t\t\t\t\n\t\t\tGROUP BY cps.IDPROVEEDOR\n\t\t\torder by cp.INTERNO DESC, cp.NOMBRECOMERCIAL ASC\n\t\t\";\n\n\n\t\t\t//\techo $sql;\n\t\t\t\t$res_prv= $this->query($sql);\n\t\t\t\t$lista_prov= array();\n\t\t\t\t$prov = new proveedor();\n\t\t\t\t$poli = new poligono();\n\t\t\t\t$circulo = new circulo();\n\t\t\t\t$point= array('lat'=>$ubicacion->latitud,'lng'=>$ubicacion->longitud);\n\n\t\t\t\tif ($ubicacion->cveentidad1==0){\n\t\t\t\t\twhile ($reg=$res_prv->fetch_object())\n\t\t\t\t\t{\n\t\t\t\t\t\t$lista_prov[$reg->IDPROVEEDOR][DISTANCIA]='';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\twhile ($reg_prv=$res_prv->fetch_object())\n\t\t\t\t\t{\n\t\t\t\t\t\t$prov->carga_datos($reg_prv->IDPROVEEDOR);\n\t\t\t\t\t\t$distancia= geoDistancia($ubicacion->latitud,$ubicacion->longitud,$prov->latitud,$prov->longitud,$prov->lee_parametro('UNIDAD_LONGITUD'));\n\t\t\t\t\t\t$sw=0;\n\n\t\t\t\t\t\t$condicion=\"\";\n\t\t\t\t\t\t$condicion.= \" cuf.CVEPAIS = '$ubicacion->cvepais'\";\n\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD1 in ('$ubicacion->cveentidad1','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD2 in ('$ubicacion->cveentidad2','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD3 in ('$ubicacion->cveentidad3','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD4 in ('$ubicacion->cveentidad4','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD5 in ('$ubicacion->cveentidad5','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD6 in ('$ubicacion->cveentidad6','0'))\";\n\t\t\t\t\t\t$condicion.= \" AND (cuf.CVEENTIDAD7 in ('$ubicacion->cveentidad7','0'))\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$condicion.= \" OR (\"; \n\n\t\t\t\t\t\tif ($ubicacion->cveentidad1!='0') $condicion.= \" (cuf.CVEENTIDAD1 = '$ubicacion->cveentidad1')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad2!='0') $condicion.= \" AND (cuf.CVEENTIDAD2 = '$ubicacion->cveentidad2')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad3!='0') $condicion.= \" AND (cuf.CVEENTIDAD3 = '$ubicacion->cveentidad3')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad4!='0') $condicion.= \" AND (cuf.CVEENTIDAD4 = '$ubicacion->cveentidad4')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad5!='0') $condicion.= \" AND (cuf.CVEENTIDAD5 = '$ubicacion->cveentidad5')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad6!='0') $condicion.= \" AND (cuf.CVEENTIDAD6 = '$ubicacion->cveentidad6')\";\n\t\t\t\t\t\tif ($ubicacion->cveentidad7!='0') $condicion.= \" AND (cuf.CVEENTIDAD7 = '$ubicacion->cveentidad7')\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$condicion .= \" )\";\n\n\t\t\t\t\t\t/* QUERY BUSCA LAS UNIDADES FEDERATIVAS QUE COINCIDAN CON LA UBICACION PARA CADA PROVEEDOR*/\n\t\t\t\t\t\t$sql=\"\n\t\t\tSELECT \n\t\t\t\tcpsxuf.IDPROVEEDOR, cpsxuf.IDUNIDADFEDERATIVA,cpsxuf.ARRAMBITO\n\t\t\tFROM\n\t\t\t $this->catalogo.catalogo_proveedor_servicio_x_unidad_federativa cpsxuf\n\t\t\t\tLEFT JOIN $this->catalogo.catalogo_unidadfederativa cuf ON $condicion\n\t\t\tWHERE \n\t\t\t\tcpsxuf.IDUNIDADFEDERATIVA = cuf.IDUNIDADFEDERATIVA\n\t\t\t\tAND\tcpsxuf.IDPROVEEDOR ='$reg_prv->IDPROVEEDOR'\n\t\t\t\tand cpsxuf.IDSERVICIO IN ('$idservicio', '0')\n\t\t\t\tORDER BY 3 DESC\n\t\t\t\";\n\t\t\t\t\t//echo $sql;\n\t\t\t$res_prv_entid= $this->query($sql);\n\t\t\twhile ($reg_prv_entid= $res_prv_entid->fetch_object())\n\t\t\t{\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][DISTANCIA]= $distancia;\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][AMBITO]=\t$reg_prv_entid->ARRAMBITO;\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][TIPOPOLIGONO] ='ENTIDAD';\n\t\t\t\t$lista_prov[$reg_prv_entid->IDPROVEEDOR][ID] = $reg_prv_entid->IDUNIDADFEDERATIVA;\n\t\t\t\tif ($reg_prv_entid->ARRAMBITO=='LOC') $sw=1; // si hubo algun entidad LOC se activa el sw\n\n\t\t\t}\n\t\t\tif (($ubicacion->latitud !='' )&& ($ubicacion->longitud!=''))\n\t\t\t{\n\t\t\t\t$sql=\"\n\t\t\t\tSELECT \n\t\t\t\t\tcpsxp.IDPROVEEDOR, cpsxp.IDPOLIGONO\n\t\t\t\tFROM \n\t\t\t\t$this->catalogo.catalogo_proveedor_servicio_x_poligono cpsxp\n\t\t\t\tWHERE\n\t\t\t\t\tcpsxp.IDPROVEEDOR ='$reg_prv->IDPROVEEDOR'\n\t\t\t\t\";\n\t\t\t\t$res_prv_poli= $this->query($sql);\n\t\t\t\twhile ($reg_prv_poli = $res_prv_poli->fetch_object())\n\t\t\t\t{\n\t\t\t\t\t// verifica si el punto esta incluido en el poligono\n\t\t\t\t\t$in = pointInPolygon($point,$poli->lee_vertices($reg_prv_poli->IDPOLIGONO));\n\t\t\t\t\tif (( $in ) && ($sw==0))\n\t\t\t\t\t{\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][DISTANCIA]= $distancia;\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][AMBITO]=\t$reg_prv_poli->ARRAMBITO;\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][TIPOPOLIGONO] ='POLIGONO';\n\t\t\t\t\t\t$lista_prov[$reg_prv_poli->IDPROVEEDOR][ID] = $reg_prv_poli->IDPOLIGONO;\n\t\t\t\t\t\tif ($reg_prv_poli->ARRAMBITO=='LOC') $sw=1; // si hubo algun poligono LOC se activa el sw\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$sql=\"\n\t\t\t\tSELECT \n\t\t\t\t\tcpsxc.IDPROVEEDOR, cpsxc.IDCIRCULO\n\t\t\t\tFROM\n\t\t\t\t$this->catalogo.catalogo_proveedor_servicio_x_circulo cpsxc\n\t\t\t\tWHERE\n\t\t\t\t\tcpsxc.IDPROVEEDOR='$res_prv->IDPROVEEDOR'\n\t\t\t\t\";\n\n\t\t\t\t$res_prv_circ = $this->query($sql);\n\t\t\t\twhile ($reg_prv_circ = $res_prv_circ->fetch_object())\n\t\t\t\t{\n\t\t\t\t\t$circulo->leer($reg_prv_circ->IDCIRCULO);\n\t\t\t\t\t$vertices = $circulo->verticesCircle($circulo->latitud,$circulo->longitud,$circulo->radio,$circulo->idmedida);\n\t\t\t\t\t$in= pointInPolygon($point,$vertices);\n\n\t\t\t\t\tif (($in ) && ($sw==0))\n\t\t\t\t\t{\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][DISTANCIA]= $distancia;\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][AMBITO]=\t$reg_prv_circ->ARRAMBITO;\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][TIPOPOLIGONO] ='CIRCULO';\n\t\t\t\t\t\t$lista_prov[$reg_prv_circ->IDPROVEEDOR][ID] = $reg_prv_circ->IDCIRCULO;\n\t\t\t\t\t\tif ($reg_prv_circ->ARRAMBITO=='LOC') $sw=1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // fin de la busqueda por LATITUD Y LONGITUD\n\n\n\n\n\n\t\t\t\t\t} // fin del while del proveedor\n\t\t\t\t}\n\n\t\t\t\t/* LEE LAS PROPORCIONES DE LA FORMULA DEL RANKING */\n\t\t\t\t$sql=\"\n\t\t\tSELECT \t\n\t\t\t\tELEMENTO,PROPORCION \n\t\t\tFROM \n\t\t\t$this->catalogo.catalogo_proporciones_ranking\n\t\t\t\";\n\t\t\t$result=$this->query($sql);\n\n\t\t\twhile($reg = $result->fetch_object())\n\t\t\t$proporcion[$reg->ELEMENTO] = $reg->PROPORCION;\n\n\n\t\t\t$max_costo_int=0;\n\t\t\t$max_costo_ext=0;\n\n\n\t\t\t/* OBTENER DATOS PARA EVALUAR EL RANKING */\n\t\t\tforeach ($lista_prov as $idproveedor=>$proveedor)\n\t\t\t{\n\t\t\t\t$sql=\"\n\t\tSELECT \n\t\t\tIF (cp.ARREVALRANKING='SKILL',IF (cp.SKILL>0,cp.SKILL/100,0), IF (cp.CDE>0,cp.CDE/100,0)) VALRANKING,\n\t\t\tIF (cpscn.MONTOLOCAL IS NULL,0,cpscn.MONTOLOCAL) COSTO,\n\t\t\tIF (cp.EVALSATISFACCION>0,cp.EVALSATISFACCION/100,0) EVALSATISFACCION ,\n\t\t\tcp.EVALINFRAESTRUCTURA EVALINFRAESTRUCTURA,\n\t\t\tcp.EVALFIDELIDAD EVALFIDELIDAD,\n\t\t\tcp.INTERNO\n\t\tFROM \n\t\t$this->catalogo.catalogo_proveedor cp\n\t\t\tLEFT JOIN $this->catalogo.catalogo_proveedor_servicio_costo_negociado cpscn ON cpscn.IDPROVEEDOR = cp.IDPROVEEDOR AND cpscn.IDSERVICIO = '$idservicio' AND cpscn.IDCOSTO = 1\n\t\tWHERE \n\t\t\tcp.IDPROVEEDOR = '$idproveedor' \n\t\t\";\n\t\t//\t\t\t\techo $sql;\n\t\t$result = $this->query($sql);\n\n\t\twhile ($reg=$result->fetch_object())\n\t\t{\n\t\t\tif ($reg->INTERNO){\n\t\t\t\t$temp_prov_int[$idproveedor][VALRANKING] = $reg->VALRANKING;\n\t\t\t\t$temp_prov_int[$idproveedor][COSTO] = $reg->COSTO;\n\t\t\t\t$temp_prov_int[$idproveedor][EVALSATISFACCION] = $reg->EVALSATISFACCION;\n\t\t\t\t$temp_prov_int[$idproveedor][EVALINFRAESTRUCTURA] = $reg->EVALINFRAESTRUCTURA;\n\t\t\t\t$temp_prov_int[$idproveedor][EVALFIDELIDAD] = $reg->EVALFIDELIDAD;\n\t\t\t\tif ($reg->COSTO > $max_costo_int) $max_costo_int= $reg->COSTO;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$temp_prov_ext[$idproveedor][VALRANKING] = $reg->VALRANKING;\n\t\t\t\t$temp_prov_ext[$idproveedor][COSTO] = $reg->COSTO;\n\t\t\t\t$temp_prov_ext[$idproveedor][EVALSATISFACCION] = $reg->EVALSATISFACCION;\n\t\t\t\t$temp_prov_ext[$idproveedor][EVALINFRAESTRUCTURA] = $reg->EVALINFRAESTRUCTURA;\n\t\t\t\t$temp_prov_ext[$idproveedor][EVALFIDELIDAD] = $reg->EVALFIDELIDAD;\n\t\t\t\tif ($reg->COSTO > $max_costo_ext) $max_costo_ext= $reg->COSTO;\n\t\t\t}\n\t\t}\n\n\t\t\t}\n\n\t\t\t/*calcula el Ranking de proveedores internos */\n\n\t\t\tforeach ($temp_prov_int as $idproveedor=>$proveedor)\n\t\t\t{\n\t\t\t\t$valranking = round($proveedor[VALRANKING] * $proporcion[CDE_SKILL],4);\n\t\t\t\t$valcosto = ($proveedor[COSTO]==0)?0:(1-($proveedor[COSTO]/$max_costo_int))*$proporcion[COSTO];\n\t\t\t\t$evalsatisfaccion = round($proveedor[EVALSATISFACCION] * $proporcion[SATISFACCION],2);\n\t\t\t\t$evalinfraestructura = round($proveedor[EVALINFRAESTRUCTURA] * $proporcion[INFRAESTRUCTURA],2);\n\t\t\t\t$evalfidelidad = round($proveedor[EVALFIDELIDAD] * $proporcion[FIDELIDAD],2);\n\t\t\t\t$lista_prov_int[$idproveedor][RANKING] = ($valranking + $valcosto+$evalsatisfaccion + $evalinfraestructura + $evalfidelidad)*100;\n\t\t\t}\n\n\t\t\t/*calcula el Ranking de proveedores externos */\n\t\t\tforeach ($temp_prov_ext as $idproveedor=>$proveedor)\n\t\t\t{\n\t\t\t\t$valranking = round($proveedor[VALRANKING] * $proporcion[CDE_SKILL],4);\n\t\t\t\t$valcosto = ($proveedor[COSTO]==0)?0:(1-($proveedor[COSTO]/$max_costo_ext))*$proporcion[COSTO];\n\t\t\t\t$evalsatisfaccion = round($proveedor[EVALSATISFACCION] * $proporcion[SATISFACCION],2);\n\t\t\t\t$evalinfraestructura = round($proveedor[EVALINFRAESTRUCTURA] * $proporcion[INFRAESTRUCTURA],2);\n\t\t\t\t$evalfidelidad = round($proveedor[EVALFIDELIDAD] * $proporcion[FIDELIDAD],2);\n\t\t\t\t$lista_prov_ext[$idproveedor][RANKING] = ($valranking + $valcosto+$evalsatisfaccion + $evalinfraestructura + $evalfidelidad)*100;\n\t\t\t}\n\n\t\t\t$temp_prov_int = ordernarArray($lista_prov_int,'RANKING',1);\n\t\t\t$temp_prov_ext = ordernarArray($lista_prov_ext,'RANKING',1);\n\n\n\t\t\tforeach ($temp_prov_int as $idproveedor => $proveedor)\n\t\t\t{\n\t\t\t\t$lista_ordenada[$idproveedor] = $lista_prov[$idproveedor];\n\t\t\t\t$lista_ordenada[$idproveedor][RANKING] = $lista_prov_int[$idproveedor][RANKING];\n\t\t\t}\n\t\t\tforeach ($temp_prov_ext as $idproveedor => $proveedor)\n\t\t\t{\n\t\t\t\t$lista_ordenada[$idproveedor] = $lista_prov[$idproveedor];\n\t\t\t\t$lista_ordenada[$idproveedor][RANKING] = $lista_prov_ext[$idproveedor][RANKING];\n\t\t\t}\n\t\t\t/* DEVUELVE EL ARRAY*/\n\t\t\treturn $lista_ordenada ;\n\n\t}", "function listar($camposMostrar,$campo,$operador,$valor,$separador,$inicio,$fin)\n\t\t{\n\t\t\t$tablas=\"menciones*\".$this->tabla;\n\t\t\t$campos=\"en.mencion*en.apellidos*en.mencion\".$campo;\n\t\t\t$operadores=\"=*=*=\".$operador;\n\t\t\t$valores=\"me.id*\".$valor;\n\t\t\t$config=new config($tablas,$this->id,\"en.codigo*en.apellidos*en.nombres*en.maestria*me.nombre*en.anoEgreso*en.ofEnlace\",$campos,$operadores,$valores,\"AND*AND\",\"\",\"\",\"me*en\",$inicio,$fin);\n\t\t\t$config->enlazar();\n\t\t\t$a=$config->conn->crearConsultaMultiple();\n\t\t\treturn $a;\n\t\t}", "function ConsultarMedicamentosAPH(){\n $sql = \"CALL spConsultarMedicamentosAPH(?)\";\n $query = $this->_CONEXION->prepare($sql);\n $query->bindParam(1, $this->idReporteAPH);\n $query->execute();\n if ($query->rowCount() > 0) {\n return array('medicamentos' => $query->fetchAll());\n }else{\n return array('medicamentos' => null);\n }\n }", "public function BuscarComprasFechas() \n\t{\n\t\tself::SetNames();\n\t\t$sql = \" SELECT compras.codcompra, compras.subtotalivasic, compras.subtotalivanoc, compras.ivac, compras.totalivac, compras.descuentoc, compras.totaldescuentoc, compras.totalc, compras.statuscompra, compras.fechavencecredito, compras.fechacompra, proveedores.ritproveedor, proveedores.nomproveedor, SUM(detallecompras.cantcompra) AS articulos FROM (compras INNER JOIN proveedores ON compras.codproveedor = proveedores.codproveedor) INNER JOIN usuarios ON compras.codigo = usuarios.codigo LEFT JOIN detallecompras ON detallecompras.codcompra = compras.codcompra WHERE DATE_FORMAT(compras.fechacompra,'%Y-%m-%d') >= ? AND DATE_FORMAT(compras.fechacompra,'%Y-%m-%d') <= ? GROUP BY compras.codcompra\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"<div class='alert alert-danger'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN COMPRAS DE PRODUCTOS PARA EL RANGO DE FECHA INGRESADO</center>\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[]=$row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function IngredientesPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM ingredientes LEFT JOIN proveedores ON ingredientes.codproveedor = proveedores.codproveedor WHERE ingredientes.codingrediente = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codingrediente\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function gestionPedidos(){\n Utils::isAdmin();\n $gestion = true;\n\n $oPedido = new Pedido();\n $pedidos = $oPedido->getAll();\n\n require_once 'views/pedido/mis_pedidos.php';\n }", "public function pesquisa($nome){\n\t\t\t$Oconn = new conexaoClass();\n\t\t\t$Oconn -> abrir_conexao();\n\t\t\t$sql = \"SELECT * FROM noticias WHERE id='\".$nome.\"'\";\n\t\t\t$conn = $Oconn -> getconn();\n\t\t\t$this -> resultado = $conn -> query($sql);\n\t\t}", "public function projetosFiscalizacaoPesquisar($where)\n {\n $tbFiscalizacao = $this->select();\n $tbFiscalizacao->setIntegrityCheck(false);\n $tbFiscalizacao->from(array(\"tbFiscalizacao\" => 'tbFiscalizacao'), array('*'));\n $tbFiscalizacao->where('stFiscalizacaoProjeto = ?', '0');\n $tbFiscalizacao->orWhere('stFiscalizacaoProjeto = ?', '1');\n\n $select = $this->select();\n $select->setIntegrityCheck(false);\n $select->from(\n array(\"p\" => $this->_name),\n array(\n 'p.IdPRONAC',\n 'p.AnoProjeto',\n 'p.Sequencial',\n 'p.idProjeto',\n 'p.NomeProjeto',\n 'p.CgcCpf'\n )\n );\n $select->joinLeft(\n array('i' => 'Interessado'),\n 'p.CgcCpf = i.CgcCpf',\n array('Nome as Proponente'),\n \"SAC.dbo\"\n );\n $select->joinLeft(\n array('tf' => 'tbFiscalizacao'),\n 'tf.IdPRONAC = p.IdPRONAC',\n array('idFiscalizacao',\n 'dtInicioFiscalizacaoProjeto',\n 'dtFimFiscalizacaoProjeto',\n 'stFiscalizacaoProjeto',\n 'dsFiscalizacaoProjeto',\n 'dtRespostaSolicitada',\n 'idUsuarioInterno AS idTecnico'\n ),\n \"SAC.dbo\"\n );\n $select->joinLeft(\n array('tbNm' => 'Nomes'),\n \"tf.idAgente = tbNm.idAgente\",\n array('Descricao AS nmTecnico'),\n 'Agentes.dbo'\n );\n $select->joinLeft(\n array('trf' => 'tbRelatorioFiscalizacao'),\n 'tf.idFiscalizacao = trf.idFiscalizacao',\n array('stAvaliacao'),\n \"SAC.dbo\"\n );\n $select->joinLeft(\n array('AUXF' => $tbFiscalizacao),\n 'AUXF.IdPRONAC = tf.IdPRONAC',\n array()\n );\n\n foreach ($where as $coluna => $valor) {\n $select->where($coluna, $valor);\n }\n\n $select->order('p.AnoProjeto');\n\n return $this->fetchAll($select);\n }" ]
[ "0.64708805", "0.6157248", "0.61484003", "0.6116223", "0.6113456", "0.6052083", "0.6030047", "0.60179204", "0.6017553", "0.6004943", "0.6003943", "0.59942424", "0.59890795", "0.59845006", "0.59797084", "0.59740126", "0.59704584", "0.59461904", "0.5944612", "0.5936868", "0.5933021", "0.59241766", "0.592368", "0.5908676", "0.5899547", "0.5897043", "0.5890264", "0.5884285", "0.5878479", "0.5872756", "0.5864775", "0.58636963", "0.5854048", "0.5843302", "0.5842137", "0.5840908", "0.5839079", "0.583675", "0.58349407", "0.58345515", "0.58283037", "0.5818897", "0.5815167", "0.5810896", "0.58024776", "0.57852805", "0.5776992", "0.57686293", "0.57672423", "0.576537", "0.5760586", "0.57561034", "0.57549334", "0.57518125", "0.57507753", "0.57474643", "0.5744911", "0.57345665", "0.57340133", "0.5728192", "0.572429", "0.5723714", "0.57204664", "0.5720088", "0.5718129", "0.57176125", "0.570596", "0.57033914", "0.57029855", "0.5701232", "0.5693859", "0.56928974", "0.5689513", "0.56858575", "0.56846493", "0.56836724", "0.5682274", "0.56798106", "0.56741095", "0.5670479", "0.5669053", "0.5665078", "0.56619346", "0.56601304", "0.56595504", "0.5657425", "0.5656919", "0.56554174", "0.5653072", "0.56519777", "0.56505823", "0.56499755", "0.5649893", "0.56480736", "0.56480217", "0.5645395", "0.56415164", "0.5639181", "0.56384873", "0.563792", "0.56336313" ]
0.0
-1
suma el total del pedido de un cliente
function SumaTotal($CardCode){ $Total_Pedido = 0; if($this->con->conectar()==true){ $Resultado = mysql_query("SELECT `Total` FROM `Carrito` WHERE `CardCode` = '" .$CardCode. "'"); if($Resultado){ while( $Articulos = mysql_fetch_array($Resultado) ) { $Total_Pedido = $Total_Pedido + (int) $Articulos['Total'] ; }} echo number_format($Total_Pedido, 2) ; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetSaldoTotalClientes()\n {\n \t$q\t=\tDoctrine_Query::create()\n \t->from('Cliente c');\n \t\n \t$cli\t=\t$q->execute();\n \t$total = 0;\n \tforeach ($cli as $c)\n \t{\n \t\t\t$saldoActual\t=\t$c->GetSaldo();\n \t\t\t$c->SaldoActual\t=\t$saldoActual;\n \t\t\t$c->save();\n\t\t\t\t\t// sumar saldo total de cada cliente\n \t\t\t$total\t+= $saldoActual;\n \t}\n \t\n \treturn $total;\n }", "public function totaliza_pedido()\r\n {\r\n\r\n $valor_desconto = 0;\r\n $valor_pedido = 0;\r\n $valor_ipi = 0;\r\n $valor_total = 0;\r\n $desconto = $this->mgt_pedido_cliente_desconto->Text;\r\n $frete = $this->mgt_pedido_valor_frete->Text;\r\n\r\n if($desconto < 0)\r\n {\r\n $desconto = 0;\r\n }\r\n\r\n if($frete < 0)\r\n {\r\n $frete = 0;\r\n }\r\n\r\n $this->mgt_pedido_valor_desconto->Text = '0.00';\r\n $this->mgt_pedido_valor_pedido->Text = '0.00';\r\n $this->mgt_pedido_valor_ipi->Text = '0.00';\r\n $this->mgt_pedido_valor_total->Text = '0.00';\r\n\r\n $Comando_SQL = \"select * from mgt_cotacoes_produtos where mgt_cotacao_produto_numero_cotacao = '\" . trim($this->mgt_pedido_numero->Text) . \"' order by mgt_cotacao_produto_numero\";\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Close();\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->SQL = $Comando_SQL;\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Open();\r\n\r\n if((GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->EOF) != 1)\r\n {\r\n while((GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->EOF) != 1)\r\n {\r\n $valor_ipi = $valor_ipi + GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Fields['mgt_cotacao_produto_valor_ipi'];\r\n $valor_pedido = $valor_pedido + GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Fields['mgt_cotacao_produto_valor_total'];\r\n\r\n GetConexaoPrincipal()->SQL_MGT_Cotacoes_Produtos->Next();\r\n }\r\n }\r\n\r\n if($desconto > 0)\r\n {\r\n $valor_desconto = (($valor_pedido * $desconto) / 100);\r\n }\r\n else\r\n {\r\n $valor_desconto = 0;\r\n }\r\n\r\n $valor_total = ((($valor_pedido + $valor_ipi) + $frete) - $valor_desconto);\r\n\r\n $this->mgt_pedido_valor_desconto->Text = number_format($valor_desconto, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_pedido->Text = number_format($valor_pedido, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_ipi->Text = number_format($valor_ipi, \"2\", \".\", \"\");\r\n $this->mgt_pedido_valor_total->Text = number_format($valor_total, \"2\", \".\", \"\");\r\n }", "public function GetSaldoTotalProveedores()\n {\n \t\n \n \t// No mostrar Insumos a contabilizar, exite otro procedimiento para tratarlas\n \t// Insumos a contabilizar\n \t$CONST_InsumosAContabilizarId = 5;\n \t\n \t$q\t=\tDoctrine_Query::create()\n \t->from('Proveedor c')\n \t->innerJoin('c.FacturasCompra f')\n \t->andWhere('f.TipoGastoId <> ?', $CONST_InsumosAContabilizarId)\n \t->groupBy('c.Id');\n //echo $q->getSqlQuery();\n \t$cli\t=\t$q->execute();\n \t$total=0;\n \tforeach ($cli as $c)\n \t{\n \t\t\t$saldoActual\t=\t$c->GetSaldo();\n \t\t\t$c->SaldoActual\t=\t$saldoActual;\n \t\t\t$c->save();\n\t\t\t\t\t// sumar saldo total de cada cliente\n \t\t\t$total\t+= $saldoActual;\n \t}\n \n \treturn $total;\n }", "public function getMontoTotalByClitente($clinete_id) {\n $command = Yii::app()->db->createCommand()\n ->select('sum(t.monto) as total')\n ->from('pago t')\n ->where('t.cliente_id=:cliente_id', array(':cliente_id' => $clinete_id));\n return $command->queryRow()['total'];\n }", "function datosCliente()\n{\n $usuario = existeEmail($_SESSION['usuario'])['id'];\n $sql = \"SELECT SUM(total) AS total FROM ventas AS v WHERE v.id_cliente = '$usuario'\";\n $statement = conexion()->query($sql);\n $statement->execute();\n $resultado = $statement->fetch();\n return $resultado;\n}", "public function getMontoTotal() {\n $command = Yii::app()->db->createCommand()\n ->select('sum(t.monto) as total')\n ->from('pago t');\n return $command->queryRow()['total'];\n }", "public function totClientesCadastrados(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT ifnull(count(*),0) as total FROM tbclientes \";\n $rsclitot = $this->conexao->query($sql);\n $result = $rsclitot->fetch_array();\n $rstotcli = $result['total'];\n\n return $rstotcli;\n }", "function getTotalOrderSumByClientID($clientID) {\r\n\t\tglobal $DBTABLEPREFIX, $menuvar, $clms_config;\r\n\t\t$total_order_value = 0;\r\n\t\t\r\n\t\t$sql = \"SELECT sum(orders_total) AS total_ordered FROM `\" . $DBTABLEPREFIX . \"orders` WHERE orders_client_id = '\" . $clientID . \"'\";\r\n\t\t$result = mysql_query($sql);\r\n\t\t\t\t\r\n\t\tif ($result && mysql_num_rows($result) > 0) {\r\n\t\t\twhile ($row = mysql_fetch_array($result)) {\t\r\n\t\t\t\t$total_order_value = $row['total_ordered'];\r\n\t\t\t}\r\n\t\t\tmysql_free_result($result);\r\n\t\t}\r\n\t\t\r\n\t\treturn $total_order_value;\r\n\t}", "public function listar_subtotal_envio_total_pedido($cod_pedido) {\n \n try {\n $sql = \" \n select \n sum(e.cantidad_productos) as num_producto,\n sum(i.total_venta) as precio_total,\n e.gravado,\n e.inafecto,\n e.exonerado,\n e.igv,\n e.redondeo,\n (SELECT tarifa from tarifario_transportista where id_pedido = $cod_pedido) as tarifa_distrito,\n (select truncate(e.importe_total, 2)) as p_total\n from \n al_producto p inner join al_inventario i\n on\n p.id_producto = i.id_producto inner join pedido e\n on\n i.id_pedido = e.id_pedido \n where\n e.id_pedido = $cod_pedido; \n \";\n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n return $resultado;\n } catch (Exception $exc) {\n throw $exc;\n }\n }", "public function ctrSumaTotalVentas(){\n\n\t\t$tabla = \"ventas\";\n\n\t\t$respuesta = ModeloVentas::mdlSumaTotalVentas($tabla);\n\n\t\treturn $respuesta;\n\n\t}", "static public function ctrSumaTotalVentas(){\n\n\t\t$tabla = \"ventas\";\n\n\t\t$respuesta = ModeloVentas::mdlSumaTotalVentas($tabla);\n\n\t\treturn $respuesta;\n\n\t}", "public function get_total_items(){\n\t \t$total = 0;\n\t \t//Si no esta vacio va sumando la cantidad de articulos\n\t \tif(!empty($this->cart)){\n\t \t\tforeach ($this->cart as $linea){\n\t\t\t\t\t$total += $linea['amount'];\n\t\t\t\t}\n\t \t}\n\t \techo $total;\n\t }", "function sumarServiciosxTareas($servicio_id)\n\t{\n\t\treturn \"SELECT SUM(tareas.valor) as number\nFROM tareas, servicios, tareas_as_servicios \nWHERE tareas.tarea_id = tareas_as_servicios.tarea_id \nand servicios.servicio_id = tareas_as_servicios.servicio_id \nAND servicios.servicio_id = $servicio_id\";\n\t}", "public static function ctrMostrarTotalCliente(){\n\n\t\t$tabla = 'clientes';\n\n\t\t$respuesta = ModeloCliente::mdlMostrarTotalCliente($tabla);\n\n\t\treturn $respuesta;\n\n\t}", "public function estoque_total($codigo){\n\n\t\t$total = 0;\n\n\t\t$db = new mysql();\n\t\t$exec = $db->executar(\"SELECT quantidade FROM \".$this->tab_estoque.\" where produto='$codigo' \");\n\t\twhile($data = $exec->fetch_object()) {\n\n\t\t\t$total = $total + $data->quantidade;\n\n\t\t}\n\n\t\treturn $total;\n\t}", "function sumarServiciosxProdutos($servicio_id)\n\t{\n\t\treturn \"SELECT SUM(servicios_as_productos.valor_servicio) as numberProductos FROM servicios, servicios_as_productos, productos WHERE servicios.servicio_id = servicios_as_productos.servicio_id and servicios_as_productos.producto_id = productos.producto_id AND servicios.servicio_id = $servicio_id\";\n\t}", "private function total()\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t$total = 0;\n\t\t//\tSumando el precio de cada producto.\n\t\tforeach($cart as $item){\n\t\t\t$total += $item->precio * $item->cantidad;\n\t\t}\n\t\treturn $total;\n\t}", "public function getTotalAmount();", "function suma_monto_total($requerimientos){\n $i=0; $suma=0;\n foreach ($requerimientos as $linea_num => $linea){ \n if($i != 0){\n $datos = explode(\";\",$linea);\n \n if(count($datos)==21){\n $suma=$suma+(float)$datos[7];\n }\n }\n\n $i++;\n }\n\n return $suma;\n }", "public static function ctrSumaTotalEgresos()\n {\n\n $tabla = \"finanzas\";\n\n $respuesta = ModeloFinanzas::mdlSumaTotalEgresos($tabla);\n\n return $respuesta;\n\n }", "private function getTotalVendas()\n {\n return $vendas = DB::table('vendas')->where('confirmado', '=' ,'S')->sum('valor_total');\n }", "public function total_articulos(){\r\n\t\t\tif (count($this->listArticulos)==0) return 0;\r\n\t\t\t$total = 0;\r\n\t\t\tforeach ($this->listArticulos as $elArticulo)\r\n\t\t\t\t$total+=$elArticulo->unidades;\r\n\t\t\treturn $total;\r\n\t\t}", "public function getMaduracionTotal(){\n \n $q = Doctrine_Query::create();\n $q->select('SUM(cantidad_actual) as suma');\n $q->from('Lote');\n $q->where('producto_id = ?', $this->getId());\n $q->andWhere('accion = \"En Maduración\"');\n $cantidad = $q->fetchOne();\n if($cantidad->getSuma() != 0){\n return $cantidad->getSuma();\n }\n else{\n return 0;\n }\n \n }", "public function total()\n {\n // $this->line_items\n $total_price = 0;\n foreach ($this->line_items as $key => $value) {\n $total_price = $total_price + $value->product->price_amount;\n }\n // dd();\n return $total_price;\n }", "public function getValorTotal(){\n $sum = 0;\n foreach($this->itens as $i):\n $sum += $i->getPreco() * $i->getQuantidade();\n endforeach;\n\n return $sum;\n }", "function calculerTotal () {\n\t $total = 0;\n\t \n\t foreach ($this->lignes as $lp) {\n\t $prod = $lp->prod;\n\t $prixLigne = $prod->prix * $lp->qte ;\n\t $total = $total + $prixLigne ;\n\t }\n\t \n\t return $total;\n\t }", "public function totalColecao(){\r\n\t\t$oSicasSalarioMinimoBD = new SicasSalarioMinimoBD();\r\n\t\treturn $oSicasSalarioMinimoBD->totalColecao();\r\n\t}", "public function get_total(){\n $total = 0;\n \n // récupert tous les articles de la commande\n $articles = $this->get_all_articles();\n \n // parcourt ces articles\n foreach($articles as $a){\n $price = $a->get_price(true);\n \n // puis calcul le prix\n $total += $a->nb * $price;\n }\n \n return $total;\n }", "public function filtrarTotal($ccliente, $tipoProducto, $busqueda)\n\t{\n\t\t$this->db->select(\"COUNT(MPRODUCTOCLIENTE.CPRODUCTOFS) AS total\");\n\t\t$this->_filtro($ccliente, $tipoProducto, $busqueda);\n\t\t$query = $this->db->get();\n\t\tif (!$query) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn ($query->num_rows()) ? (int)$query->row()->total : 0;\n\t}", "public function getTotal(){\n $total=0;\n\n foreach ( $this->getOrderLines() as $ol){\n $total += $ol->getSubTotal();\n }\n \n return $total;\n }", "public function totcarte()\n {\n $detalle = FacturaDet::join('factura_cab', 'factura_cab.numfac', '=', 'factura_det.numfac')\n ->select(DB::raw('sum(cantserv*valserv) as total'))\n ->where('factura_cab.estfac','<>','0')\n ->where('factura_cab.estfac','<>','1')\n ->first();\n $total=$detalle->total+0;\n $pagos = Pago::select(DB::raw('sum(valpago) as total'))\n ->first();\n if($pagos)\n $pagado = $pagos->total;\n else\n $pagado=0;\n $total = $total - $pagado;\n return $total;\n }", "function cocinar_pago_total() {\n\t\tglobal $bd;\n\t\tglobal $x_idpedido;\n\t\tglobal $x_idcliente;\n\t\t\n\t\t\n\t\t$x_array_pedido_header = $_POST['p_header'];\n\t\t$x_array_tipo_pago = $_POST['p_tipo_pago'];\n\t\t$x_array_subtotales=$_POST['p_subtotales'];\n\t\t$x_array_comprobante=$_POST['p_comprobante'];\n\t\t\n\t\t$id_pedido = $x_idpedido ? $x_idpedido : $x_array_pedido_header['idPedidoSeleccionados'];\n\n\t\t$tipo_consumo = $x_array_pedido_header['tipo_consumo'];\n\t\t$idc=$x_array_pedido_header['idclie'] == ''? ($x_idcliente == '' ? 0 : $x_idcliente) : $x_array_pedido_header['idclie'];\n\t\t// $tt=$x_array_pedido_header['ImporteTotal'];\n\t\t\n\n\t\t// subtotales\n\t\t$sql_subtotales = '';\n\t\t$importe_total=0; // la primera fila es subtotal o total si no hay adicionales\n\t\t$importe_subtotal = $x_array_subtotales[0]['importe'];\n\t\tforeach ( $x_array_subtotales as $sub_total ) {\n\t\t\t$tachado = $sub_total['tachado'] === \"true\" ? 1 : 0; \n\t\t\t$importe_row = $tachado === 1 ? $sub_total['importe_tachado'] : $sub_total['importe'];\n\t\t\t$importe_total = $sub_total['importe'];\n\t\t\t$sql_subtotales = $sql_subtotales.\"(?,\".$_SESSION['ido'].\",\".$_SESSION['idsede'].\",'\".$sub_total['descripcion'].\"','\".$importe_row.\"',\".$tachado.\"),\";\t\t\t\n\t\t}\n\n\t\t/// buscamos el ultimo correlativo\n\t\t/// buscamos el ultimo correlativo\n\t\t$correlativo_comprobante = 0; \n\t\t$idtipo_comprobante_serie = $x_array_comprobante['idtipo_comprobante_serie'];\n\t\tif ($x_array_comprobante['idtipo_comprobante'] != \"0\"){ // 0 = ninguno | no imprimir comprobante\n\n\t\n\t\t\t$sql_doc_correlativo=\"select correlativo + 1 from tipo_comprobante_serie where idtipo_comprobante_serie = \".$idtipo_comprobante_serie;\n\t\t\t$correlativo_comprobante = $bd->xDevolverUnDato($sql_doc_correlativo);\t\t\n\t\t\t\n\t\t\t// if ($x_array_comprobante['codsunat'] == \"0\") { // si no es factura electronica\n\t\t\t\t// guardamos el correlativo //\n\t\t\t\t$sql_doc_correlativo = \"update tipo_comprobante_serie set correlativo = \".$correlativo_comprobante.\" where idtipo_comprobante_serie = \".$idtipo_comprobante_serie;\n\t\t\t\t$bd->xConsulta_NoReturn($sql_doc_correlativo);\n\t\t\t// } \n\t\t\t// si es factura elctronica guarda despues tigger ce \n\t\t} else {\n\t\t\t$correlativo_comprobante='0';\n\t\t}\n\n\t\t$sqlrp=\"insert into registro_pago(idorg,idsede,idusuario,idcliente,fecha,total,idtipo_consumo, idtipo_comprobante_serie, correlativo) values (\".$_SESSION['ido'].\",\".$_SESSION['idsede'].\",\".$_SESSION['idusuario'].\",\".$idc.\",DATE_FORMAT(now(),'%d/%m/%Y %H:%i:%s'),'\".$importe_total.\"',\".$tipo_consumo.\",\".$idtipo_comprobante_serie.\",'\".$correlativo_comprobante.\"');\";\n\t\t$idregistro_pago=$bd->xConsulta_UltimoId($sqlrp);\n\t\t\n\n \n //registro tipo de pago // efectivo / tarjeta / etc\n $cadena_tp='';\n foreach($x_array_tipo_pago as $item){\n $cadena_tp=$cadena_tp.\"(\".$idregistro_pago.\",\".$item['id'].\",'\".$item['importe'].\"'),\";\n }\n\n $cadena_tp=substr($cadena_tp,0,-1);\n\t\t$cadena_tp=\"insert into registro_pago_detalle (idregistro_pago,idtipo_pago,importe) values \".$cadena_tp.\"; \";\n\t\t\n // registro pago pedido - detalle\n\t\t$sql_idpd=\"select idpedido,idpedido_detalle, cantidad,ptotal from pedido_detalle where idpedido in (\".$id_pedido.\") and (estado=0 and pagado=0)\";\n\t\t$rows_pedido_detalle=$bd->xConsulta2($sql_idpd);\n\t\t$sql_pago_pedido='';\n\t\t//echo $sql_idpd;\n\t\tforeach($rows_pedido_detalle as $fila){ // sacamos el idpedido_detalle y los demas datos\n\t\t\t$sql_pago_pedido=$sql_pago_pedido.\"(\".$idregistro_pago.\",\".$fila['idpedido'].\",\".$fila['idpedido_detalle'].\",'\".$fila['cantidad'].\"','\".$fila['ptotal'].\"'),\";\n }\n \n $sql_pago_pedido=substr($sql_pago_pedido,0,-1);\n $sql_pago_pedido='insert into registro_pago_pedido(idregistro_pago,idpedido,idpedido_detalle,cantidad,total) values '.$sql_pago_pedido.'; ';\n\t\t\n\t\t// subtotal // primero se obtiene $idregistro_pago\n\t\t$sql_subtotales = str_replace(\"?\", $idregistro_pago, $sql_subtotales);\n\t\t$sql_subtotales = substr($sql_subtotales,0,-1);\n\t\t$sql_subtotales = 'insert into registro_pago_subtotal (idregistro_pago,idorg,idsede,descripcion,importe,tachado) values '.$sql_subtotales.'; '; \n\t\n\n\t\t// comprobante de pago | datos\n\t\t// $sql_devolver_correlativo = \"update tipo_comprobante_serie set correlativo=correlativo+1 where (idrog=\".$_SESSION['ido'].\" and idsede=\".$_SESSION['ido'].\") and idtipo_comprobante=\".$x_array_comprobante['idtipo_comprobante'].\" and estado=0;\";\n\n\n\t\t// echo $sql_pago_pedido;\n $bd->xConsulta_NoReturn($sql_pago_pedido);\n\t\t$bd->xConsulta_NoReturn($cadena_tp);\n\t\t$bd->xConsulta_NoReturn($sql_subtotales);\n\t\t\n\t\t// print $correlativo_comprobante.\"|\";\n\n\t\t// $x_respuesta->b = $correlativo_comprobante;\n\t\t// $x_respuesta = ['correlativo_comprobante' => $correlativo_comprobante];\n\t\t$x_respuesta = json_encode(array('correlativo_comprobante' => $correlativo_comprobante, 'idregistro_pago' => $idregistro_pago));\n\t\tprint $x_respuesta.'|';\n\t\t//+++++ info+++++++++ el update pedido idregistropago es un triggers en la tabla registro_pago_pedido\n\n\t}", "public function totalColecao(){\r\n $oSicasEspecialidadeMedicaBD = new SicasEspecialidadeMedicaBD();\r\n return $oSicasEspecialidadeMedicaBD->totalColecao();\r\n }", "public function totalColecao(){\r\n\t\t$oSicasAtendimentoBD = new SicasAtendimentoBD();\r\n\t\treturn $oSicasAtendimentoBD->totalColecao();\r\n\t}", "public function totalMes(){\n //$conexao = $c->conexao();\n\n $sql = \" SELECT ifnull(sum(c.valor+c.troco),0) as total from tbpedido_pagamento c WHERE MONTH(c.data_pagamento) = MONTH(now()) and c.status = 'F';\";\n $rstotal = $this->conexao->query($sql);\n $result = $rstotal->fetch_assoc();\n $totalgeral = $result['total'];\n\n return $totalgeral;\n }", "function sumarServiciosxTareas2($servicio_id)\n\t{\n\t\treturn \"SELECT SUM(tareas.valor) as number2\nFROM tareas, servicios, tareas_as_servicios \nWHERE tareas.tarea_id = tareas_as_servicios.tarea_id \nand servicios.servicio_id = tareas_as_servicios.servicio_id \nAND servicios.servicio_id = $servicio_id\";\n\t}", "protected function get_totalVentas()\n {\n $ventas = DB::SELECT(\"SELECT SUM(subtotal) AS t_mes \n FROM pedidos \n WHERE extract(month FROM current_date) = extract(month FROM created_at);\");\n foreach($ventas as $venta)\n {\n $totalMes = $venta->t_mes;\n }\n return $totalMes;\n }", "public function prixtotal(){\r\n\t\t\t\trequire(\"connexiondatabase.php\");\r\n\t\t/*on fait ici une somme des différent object commandé et on reourne*/\r\n\t\t$prixtotal=0;\r\n\t\t//on recupere les id des produis sélectionner pour faire la requette\r\n\t\t$ids = array_keys($_SESSION['panier']);\r\n\t\tif (empty($ids)) {//si les id sont vide, \r\n\t\t\t$produits=array(); // \r\n\t\t}else{\r\n\r\n\t\t$produits = $connexion->prepare('SELECT id, prix FROM produits WHERE id IN ('.implode(',' ,$ids).')');\r\n\t\t$produits->execute();\r\n\t\t}\r\n\r\n\t\twhile ($produit=$produits->fetch(PDO::FETCH_OBJ)){\r\n\t\t\t$prixtotal +=$produit->prix*$_SESSION['panier'][$produit->id];\r\n\t\t}\r\n\t\treturn $prixtotal;\r\n\t}", "function sumarServiciosxTareas3($servicio_id)\n\t{\n\t\treturn \"SELECT SUM(tareas.valor) as number3\nFROM tareas, servicios, tareas_as_servicios \nWHERE tareas.tarea_id = tareas_as_servicios.tarea_id \nand servicios.servicio_id = tareas_as_servicios.servicio_id \nAND servicios.servicio_id = $servicio_id\";\n\t}", "public function total() {\n\t\t$query = \"select count(us.sentimento_id) as total\n\t\t\t\t from usuario_sentimento us where us.sentimento_id = \" . $this->id;\n\t\t$this->db->ExecuteSQL($query);\n\t\t$res = $this->db->ArrayResult();\n\t\treturn $res['total'];\n\t}", "protected function get_totalPedidos()\n {\n $pedidos = DB::SELECT(\"SELECT COUNT(*) AS t_pedidos \n FROM pedidos \n WHERE extract(month FROM current_date) = extract(month FROM created_at);\");\n foreach($pedidos as $pedido)\n {\n $pedid_mes = $pedido->t_pedidos; \n }\n return $pedid_mes;\n }", "static public function mdlSumaTotalAutoconsumos($tabla){\t\n\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT SUM(neto) as total FROM $tabla\");\n\n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetch();\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n\t}", "function getTotalVoucher($id){\n\t\t$t=0;\n\t\t$a = Voucher::all();\n\t\tforeach($a as $n){\n\t\t$dur= $a->amount;\n\t\t\n\t\t$r=$dur;\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}", "static public function mdlSumaTotalEntradas($tabla){\t\n\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT SUM(neto) as total FROM $tabla\");\n\n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetch();\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n\t}", "public function listar_productos_resumen_carrito_precio_total() {\n \n try {\n $sql = \"\n select \n sum(i.total_venta) as precio_total,\n e.redondeo\n from \n al_producto p inner join al_inventario i\n on\n p.id_producto = i.id_producto inner join pedido e\n on\n i.id_pedido = e.id_pedido \n where\n e.id_cliente = '$_SESSION[cliente_id]' and e.estado is null; \n \";\n $sentencia = $this->dblink->prepare($sql);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n return $resultado;\n } catch (Exception $exc) {\n throw $exc;\n }\n }", "public function getTotal()\n {\n return $this->service()->getTotalOfOrder();\n }", "public function totalSeccional()\n {\n return $this->total_mes_1 + $this->total_mes_2 + $this->total_mes_3;\n }", "public function totalColecao(){\r\n\t\t$oSicasConsultaMedicaBD = new SicasConsultaMedicaBD();\r\n\t\treturn $oSicasConsultaMedicaBD->totalColecao();\r\n\t}", "protected function getTotalOrders()\n {\n\n if (auth()->user()) {\n $userId = auth()->user()->id;\n return \\Cart::session($userId)->getTotal();\n }\n return \\Cart::getTotal();\n }", "public function getSumaRecibos($idEstado = '') {\n\n $suma = 0.0;\n\n $filtro = \"IDFactura='{$this->IDFactura}'\";\n if ($idEstado != '')\n $filtro .= \" AND IDEstado='{$idEstado}'\";\n\n $recibo = new RecibosClientes();\n $rows = $recibo->cargaCondicion(\"Sum(Importe) as Suma\", $filtro);\n $suma = $rows[0]['Suma'];\n\n return $suma;\n }", "public function total()\n {\n return $this->subtotal() + $this->shipping() + $this->vat()->sum();\n }", "public function getMonto(){\n\n $var_sum = CarritoProductosWeb::model()->findBySql('select ROUND(sum(`precio_total`), 2) as `precio_total` from carrito_productos_web \n WHERE id_pedido ='.$this->id_pedido, array());\n\n return $var_sum->precio_total;\n }", "public static function GetTotalVendas(){\n self::$results = self::query(\"SELECT sum(vlTotal) from tbComanda\");\n if (is_array(self::$results) || is_object(self::$results)){\n foreach(self::$results as $result){\n $result[0] = str_replace('.', ',', $result[0]);\n array_push(self::$resultRetorno, $result);\n return $result[0];\n }\n }\n return 0;\n }", "static public function mdlSumaTotalIngresos($tabla){\t\n\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT SUM(total) as total FROM $tabla WHERE banco = 'MercadoPago'\" );\n\n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetch();\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n\t}", "public static function sumar($uno,$dos)\n {\n # code...\n return $uno+$dos;\n }", "public function total();", "public function total();", "public function total();", "public function getResultMontantTotalActes($id){\n\t\t$adapter = $this->tableGateway->getAdapter();\n\t\t$sql = new Sql($adapter);\n\t\t$select = $sql->select();\n\t\t$select->columns(array('*'));\n\t\t$select->from(array('d'=>'demande_acte'));\n\t\t$select->join( array( 'a' => 'actes' ), 'd.idActe = a.id' , array ( '*' ) );\n\t\t$select->where(array('d.idCons' => $id));\n\t\n\t\t$stat = $sql->prepareStatementForSqlObject($select);\n\t\t$result = $stat->execute();\n\t\n\t\t$somme = 0;\n\t\tforeach ($result as $resultat){\n\t\t\t$somme += $resultat['tarif'];\n\t\t}\n\t\n\t\treturn $somme;\n\t}", "public function getTotalInvoiced();", "public function getTotal(){\n\t\t\t$sql = \"SELECT COUNT(*) as c FROM clientes\";\n\t\t\t$sql = $this->db->query($sql);\n\t\t\t$sql = $sql->fetch();\n\t\n\t\t\treturn $sql['c'];\n\t\t}", "public function getCoti_total(){\n return $this->coti_total;\n }", "public function calcularCosto(){\n $detalles = DetalleOrden::where('codOrden','=',$this->codOrden)->get();\n $sumaTotal = 0;\n foreach ($detalles as $x) {\n $sumaTotal = $sumaTotal + ($x->precio*$x->cantidad);\n }\n\n return $sumaTotal;\n\n }", "function valore_totale_lordo_mio_ordine($id_ordine,$id_user){\r\n return (float)valore_costi_totali($id_ordine,$id_user)+\r\n valore_arrivato_netto_ordine_user($id_ordine,$id_user);\r\n}", "public function totalDia(){\n //$conexao = $c->conexao();\n\n $sql = \" SELECT ifnull(sum(c.valor),0) as total, ifnull(sum(c.troco),0) as troco from tbpedido_pagamento c WHERE DAY(c.data_pagamento) = DAY(now()) and c.status = 'F';\";\n $rstotal = $this->conexao->query($sql);\n $result = $rstotal->fetch_array();\n $totalvendas = $result['total'];\n $totaltroco = $result['troco'];\n\n $total = array(\n 'totalvendas' => '',\n 'totaltroco' => '',\n );\n\n $total['totalvendas'] = $totalvendas;\n $total['totaltroco'] = $totaltroco;\n\n //print_r($total);\n return $total;\n\n }", "public function getTotalAttribute()\n {\n $incremento =$this->monto*($this->interes/100);\n\n return $this->monto+$incremento;\n }", "public function getTotal() \n {\n $tax = $this->getTax(); \n return $this->_subtotal + $tax; \n }", "public function getMontoTotalRechazado() {\n return $this->montoTotalRechazado;\n }", "public function getTotal();", "public function getTotal();", "public function getTotal(){\n $cantidad = $this->cantidad;\n\t\treturn $this->productos\n\t\t\t\t\t\t->map(function($prod){return $prod->precio;})\n\t\t\t\t\t\t->reduce(function($acum, $elem)use($cantidad){\n return $acum + ($elem * $cantidad);\n });\n\t}", "function getTotalMeGustas($id) {\n $c = new Conexion();\n $resultado = $c->query(\"SELECT SUM(megusta) FROM valoracion_mg where id_contenido=$id && megusta=1\");\n\n if ($objeto = $resultado->fetch(PDO::FETCH_OBJ)) {\n return $objeto;\n }\n else{\n return 0;\n } \n}", "public function get_total()\n {\n }", "public function gerencial_valorInventario(){\n\t\t\n\t\t$resultado = 0;\n\t\t\n\t\t$query = \"SELECT cantidad, idProducto\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t tb_productos_sucursal\";\n\t\t\n\t\t\n\t\t$conexion = parent::conexionCliente();\n\t\t\n \tif($res = $conexion->query($query)){\n \n /* obtener un array asociativo */\n while ($filas = $res->fetch_assoc()) {\n \t\n\t\t\t\t$idproducto = $filas['idProducto'];\n\t\t\t\t$cantidad\t= $filas['cantidad']; \n\t\t\t\t\n\t\t\t\t$query2 = \"SELECT precio \n\t\t\t\t\t\t\tFROM tb_productos WHERE idProducto = '$idproducto'\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif($res2 = $conexion->query($query2)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t while ($filas2 = $res2->fetch_assoc()) {\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t$precio = str_replace('.', '',$filas2['precio']);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$subtotal = $precio * $cantidad;\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $resultado = $resultado + $subtotal;\n\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\n\t\t\t\t\t\t}\t\n\t\t\t\t\n } \n \n }//fin if\n\t\t\n return $resultado;\t\n\t\t\n\t}", "static public function mdlTotalingresoegreso($item, $valor, $cerrado, $id_fecha){\n\n\tif($id_fecha!=null){\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT ing.monto_ingreso, egr.monto_egreso FROM \n\t\t(SELECT SUM(importe_ingreso) AS monto_ingreso FROM ingresos WHERE fecha_ingreso='\".$id_fecha.\"' AND $item = :$item AND id_corte=:id_corte) ing \n\t\tCROSS JOIN \n\t\t(SELECT SUM(importe_egreso) AS monto_egreso FROM egresos WHERE fecha_egreso='\".$id_fecha.\"' AND $item = :$item AND id_corte=:id_corte) egr\"); \n\n\t\t$stmt -> bindParam(\":\".$item, $valor, PDO::PARAM_INT);\n\t\t$stmt -> bindParam(\":id_corte\", $cerrado, PDO::PARAM_INT);\n\t\t$stmt -> execute();\n\t\t\n\t\t\treturn $stmt -> fetch();\n\n\n\t\t$stmt = null;\n\t}else{\n\t\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT ing.monto_ingreso, egr.monto_egreso FROM \n\t\t(SELECT SUM(importe_ingreso) AS monto_ingreso FROM ingresos WHERE fecha_ingreso=curdate() AND $item = :$item AND id_corte=:id_corte) ing \n\t\tCROSS JOIN \n\t\t(SELECT SUM(importe_egreso) AS monto_egreso FROM egresos WHERE fecha_egreso=curdate() AND $item = :$item AND id_corte=:id_corte) egr\"); \n\n\t\t$stmt -> bindParam(\":\".$item, $valor, PDO::PARAM_INT);\n\t\t$stmt -> bindParam(\":id_corte\", $cerrado, PDO::PARAM_INT);\n\t\t$stmt -> execute();\n\t\t\n\t\t\treturn $stmt -> fetch();\n\n\n\t\t$stmt = null;\n\t}\n}", "function get_pedido_total_ventas()\n {\n $date = Carbon::now();\n $currentDate = $date->format('Y-m-d');\n $total_pedidos = DB::table('pedidos')->select(DB::raw('SUM(subtotal) as ventas_total'))->whereRaw('DATE(\"created_at\") = ?',[$currentDate])->first();\n return $total_pedidos;\n }", "public function conteoPedidos($cliente_id)\n {\n //contar todos los pedidos en curso (Estado 1 2 3)\n $enCurso = \\App\\Pedido::\n where('usuario_id',$cliente_id)\n ->where('estado_pago','aprobado')\n ->where(function ($query) {\n $query\n ->where('estado',1)\n ->orWhere('estado',2)\n ->orWhere('estado',3);\n })\n ->count();\n\n //contar todos los pedidos en finalizados (Estado 4)\n $enFinalizados = \\App\\Pedido::\n where('usuario_id',$cliente_id)\n ->where('estado',4)\n ->count();\n\n return response()->json(['enCurso'=>$enCurso, 'enFinalizados'=>$enFinalizados], 200);\n \n }", "public function getTotal()\n {\n $db = self::getInstance();\n $db = $db->prepare(\"SELECT count(*) as count FROM paciente\");\n $db->execute();\n return $db->fetch(\\PDO::FETCH_ASSOC);\n }", "function cocinar_pedido() {\n\t\tglobal $bd;\n\t\tglobal $x_from;\n\t\tglobal $x_idpedido;\n\t\tglobal $x_idcliente;\n\t\t\n\t\t$x_array_pedido_header = $_POST['p_header'];\n \t$x_array_pedido_body = $_POST['p_body'];\n\t\t$x_array_subtotales=$_POST['p_subtotales'];\n\t\t\n\t\t$idc=$x_array_pedido_header['idclie'] == '' ? ($x_idcliente == '' ? 0 : $x_idcliente) : $x_array_pedido_header['idclie'];\n\t\t// $idc = cocinar_registro_cliente();\n\t\t// $x_array_pedido_footer = $_POST['p_footer'];\n\t\t// $x_array_tipo_pago = $_POST['p_tipo_pago'];\n\n\t\t //sacar de arraypedido || tipo de consumo || local || llevar ... solo llevar\n\t\t $count_arr=0;\n\t\t $count_items=0;\n\t\t $item_antes_solo_llevar=0;\n\t\t $solo_llevar=0;\n\t\t $tipo_consumo;\n\t\t $categoria;\n\t\t \n\t\t $sql_pedido_detalle='';\n\t\t $sql_sub_total='';\n\n\t\t $numpedido='';\n\t\t $correlativo_dia='';\n\t\t $viene_de_bodega=0;// para pedido_detalle\n\t\t $id_pedido;\n\n\t\t \t\t \n\t\t // cocina datos para pedidodetalle\n\t\t foreach ($x_array_pedido_body as $i_pedido) {\n\t\t\tif($i_pedido==null){continue;}\n\t\t\t// tipo de consumo\n\t\t\t//solo llevar\n\t\t\t$pos = strrpos(strtoupper($i_pedido['des']), \"LLEVAR\");\n\t\t\t\n\t\t\t\n\t\t\t//subitems // detalles\n\t\t\tforeach ($i_pedido as $subitem) {\n\t\t\t\tif(is_array($subitem)==false){continue;}\n\t\t\t\t$count_items++;\n\t\t\t\tif($pos!=false){$solo_llevar=1;$item_antes_solo_llevar=$count_items;}\n\t\t\t\t$tipo_consumo=$subitem['idtipo_consumo'];\n\t\t\t\t$categoria=$subitem['idcategoria'];\n\n\t\t\t\t$tabla_procede=$subitem['procede']; // tabla de donde se descuenta\n\n\t\t\t\t$viene_de_bodega=0;\n\t\t\t\tif($tabla_procede===0){$viene_de_bodega=$subitem['procede_index'];}\n\n\t\t\t\t//armar sql pedido_detalle con arrPedido\n\t\t\t\t$precio_total=$subitem['precio_print'];\n\t\t\t\tif($precio_total==\"\"){$precio_total=$subitem['precio_total'];}\n\n\t\t\t\t//concatena descripcion con indicaciones\n\t\t\t\t$indicaciones_p=\"\";\n\t\t\t\t$indicaciones_p=$subitem['indicaciones'];\n\t\t\t\tif($indicaciones_p!==\"\"){$indicaciones_p=\" (\".$indicaciones_p.\")\";$indicaciones_p=strtolower($indicaciones_p);}\n\t\t\t\t\n\t\t\t\t$sql_pedido_detalle=$sql_pedido_detalle.'(?,'.$tipo_consumo.','.$categoria.','.$subitem['iditem'].','.$subitem['iditem2'].',\"'.$subitem['idseccion'].'\",\"'.$subitem['cantidad'].'\",\"'.$subitem['cantidad'].'\",\"'.$subitem['precio'].'\",\"'.$precio_total.'\",\"'.$precio_total.'\",\"'.$subitem['des'].$indicaciones_p.'\",'.$viene_de_bodega.','.$tabla_procede.'),'; \n\n\t\t\t}\n\n\t\t\t$count_arr++;\n\t\t}\t\t\n\t\t\n\t\tif($count_items==0){return false;}//si esta vacio\n\n\t\tif($item_antes_solo_llevar>1){$solo_llevar=0;} // >1 NO solo es para llevar\n\n\t\t//armar sql pedido_subtotales con arrTotales\t\t\n\t\t// $importe_total=0; // la primera fila es subtotal o total si no hay adicionales\n\t\t// $importe_subtotal = $x_array_subtotales[0]['importe'];\n\t\t// for ($z=0; $z < count($x_array_subtotales); $z++) {\t\n\t\t// \t$importe_total = $x_array_subtotales[$z]['importe'];\t\t\n\t\t// \t$sql_sub_total=$sql_sub_total.'(?,\"'.$x_array_subtotales[$z]['descripcion'].'\",\"'.$x_array_subtotales[$z]['importe'].'\"),';\n\t\t// }\n\t\t\n\t\t// subtotales\t\t\n\t\t$sql_subtotales = '';\n\t\t$importe_total=0; // la primera fila es subtotal o total si no hay adicionales\n\t\t$importe_subtotal = $x_array_subtotales[0]['importe'];\n\t\tforeach ( $x_array_subtotales as $sub_total ) {\n\t\t\t$tachado = $sub_total['tachado'] === \"true\" ? 1 : 0; \n\t\t\t$importe_row = $tachado === 1 ? $sub_total['importe_tachado'] : $sub_total['importe'];\n\t\t\t$importe_total = $sub_total['importe'];\n\t\t\t$sql_subtotales = $sql_subtotales.\"(?,\".$_SESSION['ido'].\",\".$_SESSION['idsede'].\",'\".$sub_total['descripcion'].\"','\".$importe_row.\"',\".$tachado.\"),\";\n\t\t}\n\n //guarda primero pedido para obtener el idpedio\n\t\tif(!isset($_POST['estado_p'])){$estado_p=0;}else{$estado_p=$_POST['estado_p'];}//para el caso de venta rapida si ya pago no figura en control de pedidos\n\t\tif(!isset($_POST['idpedido'])){$id_pedido=0;}else{$id_pedido=$_POST['idpedido'];}//si se agrea en un pedido / para control de pedidos al agregar\t\t\n\n if($id_pedido==0){ // nuevo pedido\n\t\t\t//num pedido\n\t\t\t$sql=\"select count(idpedido) as d1 from pedido where idorg=\".$_SESSION['ido'].\" and idsede=\".$_SESSION['idsede'];\n\t\t\t$numpedido=$bd->xDevolverUnDato($sql);\n\t\t\t$numpedido++;\n\n\t\t\t//numcorrelativo segun fecha\n\t\t\t$sql=\"SELECT count(fecha) AS d1 FROM pedido WHERE (idorg=\".$_SESSION['ido'].\" and idsede=\".$_SESSION['idsede'].\") and STR_TO_DATE(fecha,'%d/%m/%Y')=curdate()\";\n\t\t\t$correlativo_dia=$bd->xDevolverUnDato($sql);\n\t\t\t$correlativo_dia++;\n\n\t\t\t// si es delivery y si trae datos adjuntos -- json-> direccion telefono forma pago\n\t\t\t$json_datos_delivery=array_key_exists('arrDatosDelivery', $x_array_pedido_header) ? $x_array_pedido_header['arrDatosDelivery'] : '';\n\t\t\t\n\n // guarda pedido\n $sql=\"insert into pedido (idorg, idsede, idcliente, fecha,hora,fecha_hora,nummesa,numpedido,correlativo_dia,referencia,total,total_r,solo_llevar,idtipo_consumo,idcategoria,reserva,idusuario,subtotales_tachados,estado,json_datos_delivery)\n\t\t\t\t\tvalues(\".$_SESSION['ido'].\",\".$_SESSION['idsede'].\",\".$idc.\",DATE_FORMAT(now(),'%d/%m/%Y'),DATE_FORMAT(now(),'%H:%i:%s'),now(),'\".$x_array_pedido_header['mesa'].\"','\".$numpedido.\"','\".$correlativo_dia.\"','\".$x_array_pedido_header['referencia'].\"','\".$importe_subtotal.\"','\".$importe_total.\"',\".$solo_llevar.\",\".$tipo_consumo.\",\".$x_array_pedido_header['idcategoria'].\",\".$x_array_pedido_header['reservar'].\",\".$_SESSION['idusuario'].\",'\". $x_array_pedido_header['subtotales_tachados'] .\"',\".$estado_p.\",'\".$json_datos_delivery.\"')\";\n $id_pedido=$bd->xConsulta_UltimoId($sql);\n \n\t\t}else{\n\t\t\t//actualiza monto\n\t\t\t$sql=\"update pedido set total=FORMAT(total+\".$xarr['ImporteTotal'].\",2), subtotales_tachados = '\".$x_array_pedido_header['subtotales_tachados'].\"' where idpedido=\".$id_pedido;\n\t\t\t$bd->xConsulta_NoReturn($sql);\n }\n\n //armar sql completos\n\t\t//remplazar ? por idpedido\n\t\t$sql_subtotales = str_replace(\"?\", $id_pedido, $sql_subtotales);\n\t\t$sql_pedido_detalle = str_replace(\"?\", $id_pedido, $sql_pedido_detalle);\n\n\t\t//saca el ultimo caracter ','\n\t\t$sql_subtotales=substr ($sql_subtotales, 0, -1);\n\t\t$sql_pedido_detalle=substr ($sql_pedido_detalle, 0, -1);\n\n\t\t//pedido_detalle\n\t\t$sql_pedido_detalle='insert into pedido_detalle (idpedido,idtipo_consumo,idcategoria,idcarta_lista,iditem,idseccion,cantidad,cantidad_r,punitario,ptotal,ptotal_r,descripcion,procede,procede_tabla) values '.$sql_pedido_detalle;\n\t\t//pedido_subtotales\n\t\t$sql_subtotales='insert into pedido_subtotales (idpedido,idorg,idsede,descripcion,importe, tachado) values '.$sql_subtotales;\n\t\t// echo $sql_pedido_detalle;\n\t\t//ejecutar\n //$sql_ejecuta=$sql_pedido_detalle.'; '.$sql_sub_total.';'; // guarda pedido detalle y pedido subtotal\n $bd->xConsulta_NoReturn($sql_pedido_detalle.';');\n\t\t$bd->xConsulta_NoReturn($sql_subtotales.';');\n\t\t\n\t\t// $x_array_pedido_header['id_pedido'] = $id_pedido; // si viene sin id pedido\n\t\t$x_idpedido = $id_pedido;\n\n\t\t// SI ES PAGO TOTAL\n\t\tif ( strrpos($x_from, \"b\") !== false ) { $x_from = str_replace('b','',$x_from); cocinar_pago_total(); }\n\n\t\t\n\t\t// $x_respuesta->idpedido = $id_pedido; \n\t\t// $x_respuesta->numpedido = $numpedido; \n\t\t// $x_respuesta->correlativo_dia = $correlativo_dia; \n\t\t\n\t\t$x_respuesta = json_encode(array('idpedido' => $id_pedido, 'numpedido' => $numpedido, 'correlativo_dia' => $correlativo_dia));\n\t\tprint $x_respuesta.'|';\n\t\t// $x_respuesta = ['idpedido' => $idpedido];\n\t\t// print $id_pedido.'|'.$numpedido.'|'.$correlativo_dia;\n\t\t\n\t}", "function total_pagado($ven_id) {\n// sum(ind_capital_desc) as descuento, sum(ind_capital_inc) as incremento ,\n// sum(ind_costo_pagado) as costo\n// from interno_deuda where ind_tabla='venta' and ind_tabla_id=$ven_id \n// \";\n// $pagado = FUNCIONES::objeto_bd_sql($sql_pag);\n $pagado = FUNCIONES::total_pagado($ven_id);\n return $pagado;\n }", "function valore_costi_totali($id_ordine,$id_user){\r\n $costo_trasporto = valore_costo_trasporto_ordine_user($id_ordine,$id_user);\r\n $costo_gestione = valore_costo_gestione_ordine_user($id_ordine,$id_user);\r\n $costo_mio_gas = valore_costo_mio_gas($id_ordine,$id_user);\r\n $costo_maggiorazione = valore_costo_maggiorazione_mio_gas($id_ordine,$id_user);\r\n $costi_totali = $costo_trasporto +\r\n $costo_gestione +\r\n $costo_mio_gas +\r\n $costo_maggiorazione;\r\n return (float)$costi_totali; \r\n}", "public function get_total_payment(){\n\t \t$total = 0;\n\t \t//Si no esta vacio va sumando el importe\n\t \tif(!empty($this->cart)){\n\t \t\tforeach ($this->cart as $linea){\n\t\t\t\t\t$total += $linea['subtotal'];\n\t\t\t\t}\n\t \t}\n\n\t \t$_SESSION['importe'] = $total;\n\n\t \treturn number_format($total, 2,',','.');\n\t }", "public static function getQtdTotalIngressos()\n {\n $conteudo = self::getConteudo();\n return $conteudo->sum('quantidade');\n }", "public function total(){\n $total = $this->qualification + $this->referee_report + $this->interview;\n }", "public function total()\n {\n \treturn $this->price()*$this->quantity;\n }", "function montant_total(){\n\n\t$total = 0;\n\n\tfor( $i = 0; $i < sizeof( $_SESSION['panier']['id_produit']); $i++ ){\n\n\t\t$total += $_SESSION['panier']['quantite'][$i] * $_SESSION['panier']['prix'][$i];\n\t\t//A chaque tour de boucle (qui correspond au nombre de produit dans le panier), on ajoute le montant (quantite * prix ) pour chaque produit dans la variable $total\n\t}\n\n\treturn $total;\n}", "function get_reptotal_cobroscredito($fecha1, $fecha2, $usuario_id)\r {\r if($usuario_id == 0){\r $cadusuario = \"\";\r }else{\r $cadusuario = \" and i.usuario_id = \".$usuario_id.\" \";\r }\r $ingresos = $this->db->query(\"\r select\r SUM(c.cuota_cancelado) as total\r from\r\r cuota c, credito cr\r\r where\r\r date(c.cuota_fecha) >= '\".$fecha1.\"'\r\r and date(c.cuota_fecha) <= '\".$fecha2.\"'\r\r and c.credito_id = cr.credito_id\r and c.estado_id = 9\r\r and (cr.venta_id > 0 or cr.venta_id <>null )\r\r \".$cadusuario.\"\r order by c.cuota_fecha desc, c.cuota_hora desc\r \")->row_array();\r \r return $ingresos['total'];\r }", "function totalboaralla(){\n\n\t$crud = new CRUD();\n\t$crud->disconnect();\n\n\t$crud -> sql(\"select SUM(native_boar) as totalboaralla from farmers_tbl\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['totalboaralla'];\n\t}\n\t$crud->disconnect();\n}", "function sumaDosNumeros($valorUno, $valorDos){\n\t\t$resultado = 0;\n\t\t$resultado = $valorUno + $valorDos;\n\t\treturn $resultado;\n\t}", "public function modelTotal(){\n\t\t\t//---\n\t\t\t$conn = Connection::getInstance();\n\t\t\t$query = $conn->query(\"select id from orders\");\n\t\t\t//lay tong so ban ghi\n\t\t\treturn $query->rowCount();\n\t\t\t//---\n\t\t}", "function ProjetosRealizadosCliente($empresa = null) {\n\n $count = 0;\n $conexao = new classeConexao();\n\n //selecionando id dos projetos\n $projetos = $conexao::fetch(\"SELECT id FROM tb_projetos WHERE id_projetos_empresas_id = {$empresa}\");\n\n foreach ($projetos as $projeto) {\n\n //Qtd tarefas a fazer\n $tarefasFazer = $conexao::fetchuniq(\"SELECT COUNT(id) as qtd FROM tb_tarefas WHERE tb_tarefas_status=0 AND tb_tarefas_projeto = \".$projeto['id']);\n\n //Qtd tarefas feitas\n $tarefasFeitas = $conexao::fetchuniq(\"SELECT COUNT(id) as qtd FROM tb_tarefas WHERE tb_tarefas_status=1 AND tb_tarefas_projeto = \".$projeto['id']);\n\n //Porcentagem\n if(($tarefasFeitas['qtd'] + $tarefasFazer['qtd']) == 0){\n $qtd2 = 1;\n }else{\n $qtd2 = ($tarefasFeitas['qtd'] + $tarefasFazer['qtd']);\n }\n $porcentagem = ($tarefasFeitas['qtd'] * 100) / ($qtd2);\n\n if($porcentagem==100) {\n $count++;\n }\n }\n\n return $count;\n}", "public function getTotalParticipantesNoConfirmadosByEvento($eventos_id) {\n//\t\t$query = $this->db->query(\"SELECT COUNT(DISTINCT ep.eventos_participantes_id_cliente) as total FROM `\" . DB_PREFIX . \"eventos_participantes` ep LEFT JOIN solicitud s ON (ep.eventos_participantes_id_pedido = s.order_id) WHERE ep.eventos_participantes_id_evento = '\" . (int)$eventos_id . \"' AND ep.eventos_participantes_numero = 0 AND ep.eventos_participantes_inscripcion = 'Internet' AND ep.eventos_participantes_id_pedido IN (SELECT order_id FROM solicitud WHERE (order_status_id = 0 OR order_status_id = 1 OR order_status_id = 2) AND payment_number <> '')\");\n\t\t\n\t\t$query = $this->db->query(\"SELECT COUNT(*) as total FROM `\" . DB_PREFIX . \"eventos_participantes` ep WHERE ep.eventos_participantes_id_evento = '\" . (int)$eventos_id . \"' AND ep.eventos_participantes_numero = 0\");\n\t\t\n\t\treturn $query->row['total'];\n\t\t\n\t}", "public function totCadastrosMes(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT ifnull(count(*),0) as total FROM tbclientes a WHERE MONTH(a.data_cadastro) = Month(now());\";\n $rsclimes = $this->conexao->query($sql);\n $result = $rsclimes->fetch_array();\n $rstotclimes = $result['total'];\n\n return $rstotclimes;\n }", "function totalvacantes_reclutador($idReclutador){\r\n $funciones = new funciones;\r\n $funciones->conectar();\r\n $sql=\"select \r\n tblmeses.descmes,ifnull(total,0) as total\r\n from\r\n tblmeses\r\n left join\r\n (select \r\n count(tblvacante.folSolici) as total,\r\n idmes,\r\n descmes,\r\n idReclutador\r\n from\r\n tblmeses\r\n left join tblsolicitud ON month(tblsolicitud.iniSolici) = tblmeses.idmes\r\n left join tblvacante ON tblvacante.folSolici = tblsolicitud.folSolici\r\n where\r\n idReclutador =\".$idReclutador.\"\r\n group by idmes , idReclutador) as t1 ON t1.idmes = tblmeses.idmes\r\n group by tblmeses.idmes\r\n \";\r\n $result = mysql_query($sql) or die(mysql_error());\r\n $datos = array();\r\n while($fila = mysql_fetch_array($result)){\r\n $datos[]=$fila;\r\n }\r\n return $datos;\r\n \r\n }", "public function getTotal(){\n\t\t\t$sql = \"SELECT COUNT(*) as c FROM servico\";\n\t\t\t$sql = $this->db->query($sql);\n\t\t\t$sql = $sql->fetch();\n\t\n\t\t\treturn $sql['c'];\n\t\t}", "function suma( $resultado, $valor) {\n\t$resultado += $valor;\n\treturn $resultado;\n}", "static function retourParClient($id,$year){\n $sum = 0;\n $alerts = Alert::where(\"type\",\"=\",'Retour client')\n ->whereYear('created_at','=',$year)->get();// retour client\n \n foreach( $alerts as $alert){\n if ($alert->client_id == $id)\n {\n $sum += $alert->lot->quantite;\n }\n }\n return $sum;\n }", "public function mostrar($partido){\r\n $conexion= new mysqli(\"localhost\",\"root\",\"\",\"votaciones\");\r\n $sql=\"SELECT SUM(cantidad_votos) as totalVotos from detalle_acta WHERE id_partido=$partido\";\r\n $result=$conexion->query($sql);\r\n while ($registro=mysqli_fetch_array($result)) {\r\n echo $registro['totalVotos'];\r\n }\r\n $conexion->close();\r\n }", "static public function mdlSumaTotales($tabla, $item, $valor, $cerrado, $fechacutvta){\t\n\t$campo=\"id_caja\";\n\t$rsp=array();\n\t\n\t$ventas=self::mdlSumaTotalVentas($tabla, $item, $valor, $cerrado, $fechacutvta);\n\t$ventasgral=$ventas[\"sinpromo\"]>0?$ventas[\"sinpromo\"]:0;\n\t$ventaspromo=$ventas[\"promo\"]>0?$ventas[\"promo\"]:0;\n\t$sumaventasgral=$ventasgral+$ventaspromo;\n\t//array_push($rsp, \"ventasgral\", $sumaventasgral);\n\t$rsp[\"ventasgral\"]=$sumaventasgral; // Se crea la key \n\n\t$vtaEnv = self::mdlSumTotVtasEnv($tabla, $item, $valor, $cerrado,$fechacutvta);\n\t$ventasenvases=$vtaEnv[\"total\"]>0?$vtaEnv[\"total\"]:0;\n\t//array_push($rsp, \"ventasenvases\", $ventasenvases);\n\t$rsp[\"ventasenvases\"]=$ventasenvases; // Se crea la key \n\n\t$vtaServ = self::mdlSumTotVtasServ($tabla, $item, $valor, $cerrado,$fechacutvta);\n\t$ventasservicios=$vtaServ[\"total\"]>0?$vtaServ[\"total\"]:0;\n\t//array_push($rsp, \"ventaservicios\", $ventasservicios);\n\t$rsp[\"ventaservicios\"]=$ventasservicios; // Se crea la key \n\t\t\t\t\t \n\t$ventasaba=self::mdlSumTotVtasOtros($tabla, $item, $valor, $cerrado,$fechacutvta);\n\t$ventasgralaba=$ventasaba[\"sinpromo\"]>0?$ventasaba[\"sinpromo\"]:0;\n\t$ventaspromoaba=$ventasaba[\"promo\"]>0?$ventasaba[\"promo\"]:0;\n\t$ventasabarrotes=$ventasgralaba+$ventaspromoaba;\n\t//array_push($rsp, \"ventasabarrotes\", $ventasabarrotes);\n\t$rsp[\"ventasabarrotes\"]=$ventasabarrotes; // Se crea la key \n\n\t$vtaCred = self::mdlSumTotVtasCred($tabla, $item, $valor, $cerrado,$fechacutvta);\n\t$ventascredito=$vtaCred[\"sinpromo\"]+$vtaCred[\"promo\"]>0?$vtaCred[\"sinpromo\"]+$vtaCred[\"promo\"]:0;\n\t//array_push($rsp, \"ventascredito\", $ventascredito);\n\t$rsp[\"ventascredito\"]=$ventascredito; // Se crea la key \n\n\t$totingyegr=self::mdlTotalingresoegreso($campo, $valor, $cerrado, $fechacutvta);\n\t$ingresodia=$totingyegr[\"monto_ingreso\"]>0?$totingyegr[\"monto_ingreso\"]:0;\n\t//array_push($rsp, \"ingresodia\", $ingresodia);\n\t$rsp[\"ingresodia\"]=$ingresodia; // Se crea la key \n\t$egresodia=$totingyegr[\"monto_egreso\"]>0?$totingyegr[\"monto_egreso\"]:0;\n\t//array_push($rsp, \"egresodia\", $egresodia);\n\t$rsp[\"egresodia\"]=$egresodia; // Se crea la key \n\n\t$totVentaDia=$ventasgral+$ventaspromo+$ventasenvases+$ventasservicios+$ventasgralaba+$ventaspromoaba+$ventascredito;\n\t//array_push($rsp, \"totalventadia\", $totVentaDia);\n\t$rsp[\"totalventadia\"]=$totVentaDia; // Se crea la key \n\n\treturn $rsp;\n \n}", "function get_total() {\n\t\t\treturn cmdeals_price($this->total);\n\t\t}" ]
[ "0.78377634", "0.7443144", "0.73047245", "0.68369436", "0.6812505", "0.6801924", "0.6795666", "0.6689438", "0.6674467", "0.6620387", "0.65996027", "0.6570822", "0.6554332", "0.6501052", "0.64981157", "0.6493565", "0.64752024", "0.643997", "0.64246446", "0.6399232", "0.6398141", "0.6390473", "0.63738763", "0.63570786", "0.63570696", "0.63569564", "0.6347711", "0.6334205", "0.6329881", "0.63171417", "0.6308063", "0.6300028", "0.6296954", "0.62941104", "0.6288901", "0.6286861", "0.62734413", "0.62666744", "0.6234268", "0.6231558", "0.6220635", "0.62119466", "0.6204732", "0.6193939", "0.619031", "0.61884075", "0.61870766", "0.6183207", "0.6178739", "0.61756", "0.61712", "0.61608225", "0.61602986", "0.61564785", "0.6141157", "0.6129862", "0.6129862", "0.6129862", "0.6125138", "0.6115306", "0.61084586", "0.61074704", "0.60933566", "0.6058482", "0.60560155", "0.60405827", "0.6013543", "0.6004217", "0.59981364", "0.59981364", "0.5994004", "0.5990422", "0.59826756", "0.59768903", "0.59754735", "0.5975439", "0.59717333", "0.5971442", "0.5968317", "0.5963237", "0.5956913", "0.59546924", "0.5940941", "0.5934352", "0.59317404", "0.59311813", "0.59204876", "0.59204024", "0.5911087", "0.5888868", "0.58812964", "0.58810866", "0.58661246", "0.58627516", "0.585977", "0.58518165", "0.58509433", "0.5849755", "0.5844318", "0.5842636" ]
0.6429448
18
Elimina un articulo del carrito de un cliente
function VerificaArticuloRepetido($Cod_Articulo,$CardCode){ if($this->con->conectar()==true){ $Resultado = mysql_query("SELECT COUNT( * )as 'Existe',Cantidad FROM `Carrito` WHERE `CardCode` = '" .$CardCode. "' and `CodArticulo`='" . $Cod_Articulo."'"); return $Resultado; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eliminarCliente(){\n\t\t$this->procedimiento='rec.ft_cliente_ime';\n\t\t$this->transaccion='REC_CLI_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cliente','id_cliente','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function removeAction()\n {\n if ( $this->_hasParam('razaoSocialTomador') == false )\n {\n $this->_redirect('clientes/list');\n }\n \t\t$modelo = new Application_Model_Clientes();\n $razaoSocialTomador = $this->_getParam('razaoSocialTomador');\n $modelo->removeByRazaoSocial($razaoSocialTomador);\n\n// $cnte = $modelo->removeByRazaoSocial($razaoSocialTomador);\n\t\t$this->_redirect('clientes/list');\n // action body\n }", "public function tarifClientRemoveAction(Request $request)\n {\n if ($request->isXmlHttpRequest()) {\n $id = $request->request->get('id', '');\n\n $em = $this->getDoctrine()\n ->getManager();\n if ($id != '') {\n try {\n //Suppression\n if ($id != 'new_row') {\n $tarif = $this->getDoctrine()\n ->getRepository('AppBundle:FactTarifClient')\n ->find($id);\n if ($tarif) {\n $em->remove($tarif);\n $em->flush();\n $data = array(\n 'erreur' => false,\n );\n return new JsonResponse(json_encode($data));\n }\n }\n } catch (\\Exception $ex) {\n return new Response($ex->getMessage(), 500);\n }\n\n }\n throw new NotFoundHttpException(\"Tarif introuvable.\");\n } else {\n throw new AccessDeniedException('Accès refusé.');\n }\n }", "function deletePreDetalle(){\n $sql='DELETE FROM predetalle WHERE idCliente = ?';\n $params=array($this->cliente);\n return Database::executeRow($sql, $params);\n }", "public function eliminarPreDetalle(){\n $sql='DELETE FROM predetalle WHERE idCliente = ?';\n $params=array($this->idCliente);\n return Database::executeRow($sql, $params);\n }", "public function delete(){\n return (new Database('cliente'))->delete('id = '.$this->id);\n }", "public function cliente_delete(){\n\t\t$cliente_id = $this->uri->segment(3);\n\n\t\t$respuesta = $this->Cliente_model->delete($cliente_id);\n\t\t\n\t\t$this->response($respuesta);\n\t}", "function EliminaDetallePedido($NumPedido,$CodArti){\n\t\tif($this->con->conectar()==true){\n\t\treturn mysql_query(\"DELETE * FROM `DET_PedidosSolicitados` WHERE `NumPedido` = '\" .$NumPedido. \"' and `NumPedido` = '\" .$CodArti. \"'\");\n\t\t}\n\t}", "public function destroy($id_cliente){}", "function remove() {\n\t\t$option = JRequest::getCmd('option');\n\t\t// Se obtienen los ids de los registros a borrar\n\t\t$cids = JRequest::getVar('cid', array(0), 'post', 'array');\n $product_type_code = JRequest::getVar('product_type_code');\n\n\t\t// Lanzar error si no se ha seleccionado al menos un registro a borrar\n if (count($cids) < 1 || !$product_type_code) {\n\t\t\tJError::raiseError(500, JText::_('CP.SELECT_AN_ITEM_TO_DELETE'));\n\t\t}\n\n\t\t// Se obtiene el modelo\n\t\t$model = $this->getModel('comments');\n\t\t// Se intenta el borrado\n\t\tif ($model->delete($cids, $product_type_code)) {\n\t\t\t$msg = JText::_('CP.DATA_DELETED');\n\t\t\t$type = 'message';\n\t\t} else {\n\t\t\t// Si hay algún error se ajusta el mensaje\n\t\t\t$msg = $model->getError();\n\t\t\tif (!$msg) {\n\t\t\t\t$msg = JText::_('CP.ERROR_ONE_OR_MORE_DATA_COULD_NOT_BE_DELETED');\n\t\t\t}\n\t\t\t$type = 'error';\n\t\t}\n\n\t\t$this->setRedirect('index.php?option=' . $option . '&view=comments', $msg, $type);\n\t}", "function removeServico($campos){\n\t\t\t$itemID = $campos['InputDelServico'];\n\t\t\tfor($i=0;$i<sizeof($itemID);$i++){\n\t\t\t\t\t\t$sql=\" DELETE FROM vekttor_venda_servico WHERE id = '$itemID[$i]'\";\n\t\t\t\t\t\tmysql_query($sql);\n\t\t\t}\n}", "public function excluir(){\r\n return (new Database('cartao'))->delete('id = '.$this->id);\r\n }", "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}", "public function remover() {\n \n $queryVerificaInscricao = '\n select * from tb_inscricao_atividade where id_atividade = :id_atividade \n ';\n \n $stmtInscAtt = $this->conexao->prepare($queryVerificaInscricao);\n $stmtInscAtt->bindValue(':id_atividade', $_GET['id_att']);\n $stmtInscAtt->execute();\n \n $inscAtt = $stmtInscAtt->fetchAll(PDO::FETCH_OBJ);\n \n // echo '<pre>';\n // print_r($inscAtt);\n // echo '</pre>';\n \n if (!empty($inscAtt)) {\n foreach ($inscAtt as $inscAttInd) {\n $queryDeleteInscAtt = 'delete from tb_inscricao_atividade where \n id_atividade = :id_atividadeDel and \n id_evento = :id_eventoDel and \n id_usuario = :id_usuarioDel';\n \n $stmtInscAttDel = $this->conexao->prepare($queryDeleteInscAtt);\n $stmtInscAttDel->bindValue(':id_atividadeDel', $inscAttInd->id_atividade);\n $stmtInscAttDel->bindValue(':id_eventoDel', $inscAttInd->id_evento);\n $stmtInscAttDel->bindValue(':id_usuarioDel', $inscAttInd->id_usuario);\n $stmtInscAttDel->execute();\n }\n }\n\n $queryInscCupomAtt = '\n select * from tb_cupom where id_atividade = :id_atividadeCupDel\n ';\n\n $stmtInscCupomAtt = $this->conexao->prepare($queryInscCupomAtt);\n $stmtInscCupomAtt->bindValue(':id_atividadeCupDel', $_GET['id_att']);\n $stmtInscCupomAtt->execute();\n\n $cupomAtt = $stmtInscCupomAtt->fetchAll(PDO::FETCH_OBJ);\n\n // echo '<pre>';\n // print_r($cupomAtt);\n // echo '</pre>';\n\n if (!empty($cupomAtt)) {\n foreach ($cupomAtt as $cupomAttInd) {\n $queryDeleteCupomAtt = '\n delete from tb_cupom where id = :id_cupomDel\n ';\n\n echo $cupomAttInd->id;\n\n $stmtInscCupomAttDel = $this->conexao->prepare($queryDeleteCupomAtt);\n $stmtInscCupomAttDel->bindValue(':id_cupomDel', $cupomAttInd->id);\n $stmtInscCupomAttDel->execute();\n }\n }\n \n $query = '\n delete from tb_atividade \n where id = :id';\n\n $stmt = $this->conexao->prepare($query);\n $stmt->bindValue(':id', $_GET['id_att']);\n\n return $stmt->execute();\n }", "public function EliminarClientes()\n\t{\n\t\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\t\t$sql = \" select codcliente from ventas where codcliente = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"codcliente\"])) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num == 0)\n\t\t\t{\n\n\t\t\t\t$sql = \" delete from clientes where codcliente = ? \";\n\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t$stmt->bindParam(1,$codcliente);\n\t\t\t\t$codcliente = base64_decode($_GET[\"codcliente\"]);\n\t\t\t\t$stmt->execute();\n\necho \"<div class='alert alert-info'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<center><span class='fa fa-check-square-o'></span> EL CLIENTE FUE ELIMINADO EXITOSAMENTE </center>\"; \necho \"</div>\";\n\t\t\t\texit;\n\n\t\t\t} else {\n\necho \"<div class='alert alert-warning'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<center><span class='fa fa-info-circle'></span> ESTE CLIENTE NO PUEDE SER ELIMINADO, TIENE VENTAS ASOCIADAS ACTUALMENTE </center>\"; \necho \"</div>\"; \n\t\t\t\texit;\n\t\t\t} \n\n\t\t} else {\n\necho \"<div class='alert alert-warning'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<center><span class='fa fa-info-circle'></span> USTED NO TIENE ACCESO PARA ELIMINAR CLIENTES, NO ERES EL ADMINISTRADOR DEL SISTEMA </center>\";\necho \"</div>\";\n\t\t\texit;\n\t\t}\t\n\t}", "public function eliminar($con){\r\n\t\t$sql = \"DELETE FROM lineaspedidos WHERE idPedido='$this->idPedido' AND idProducto='$this->idProducto'\";\r\n\t\t// Ejecuta la consulta y devuelve el resultado\r\n\t\treturn ($con->query($sql));\r\n\t}", "public function eliminar($objeto){\r\n\t}", "public function EliminarDetallesCompras()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\tself::SetNames();\n\t\t$sql = \" select * from detallecompras where codcompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcompra\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num > 1)\n\t\t{\n\n\t\t\t$sql = \" delete from detallecompras where coddetallecompra = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$coddetallecompra);\n\t\t\t$coddetallecompra = base64_decode($_GET[\"coddetallecompra\"]);\n\t\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN INGREDINTE ###################\n\tif($_POST['tipoentrada']==\"INGREDIENTE\"){\n\n\t\t$sql2 = \"select cantingrediente from ingredientes where cantingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"cantingrediente\"];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN PRODUCTO ###################\n\t\t\t} else {\n\n\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"existencia\"];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update productos set \"\n\t\t.\" existencia = ? \"\n\t\t.\" where \"\n\t\t.\" codproducto = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n\t\t\t}\n\n\t\t$sql4 = \"select * from compras where codcompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $row;\n\t\t\t}\n\t\t$subtotalivasic = $paea[0][\"subtotalivasic\"];\n\t\t$subtotalivanoc = $paea[0][\"subtotalivanoc\"];\n\t\t$iva = $paea[0][\"ivac\"]/100;\n\t\t$descuento = $paea[0][\"descuentoc\"]/100;\n\t\t$totalivac = $paea[0][\"totalivac\"];\n\t\t$totaldescuentoc = $paea[0][\"totaldescuentoc\"];\n\n\t$sql3 = \"select sum(importecompra) as importe from detallecompras where codcompra = ? and ivaproductoc = 'SI'\";\n $stmt = $this->dbh->prepare($sql3);\n $stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n $num = $stmt->rowCount();\n \n if($rowp = $stmt->fetch())\n {\n $p[] = $rowp;\n }\n $importeivasi = ($rowp[\"importe\"]== \"\" ? \"0\" : $rowp[\"importe\"]);\n\n$sql5 = \"select sum(importecompra) as importe from detallecompras where codcompra = ? and ivaproductoc = 'NO'\";\n $stmt = $this->dbh->prepare($sql5);\n $stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n $num = $stmt->rowCount();\n \n if($roww = $stmt->fetch())\n {\n $pw[] = $roww;\n }\n $importeivano = ($roww[\"importe\"]== \"\" ? \"0\" : $roww[\"importe\"]);\n\n if(base64_decode($_GET[\"ivaproductoc\"])==\"SI\"){\t\n\t\n\t\t$sql = \" update compras set \"\n\t\t\t .\" subtotalivasic = ?, \"\n\t\t\t .\" totalivac = ?, \"\n\t\t\t .\" totaldescuentoc = ?, \"\n\t\t\t .\" totalc= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codcompra = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaliva);\n\t\t$stmt->bindParam(3, $totaldescuentoc);\n\t\t$stmt->bindParam(4, $total);\n\t\t$stmt->bindParam(5, $codcompra);\n\t\t\n\t\t$subtotal= strip_tags($importeivasi);\n $totaliva= rount($subtotal*$iva,2);\n\t\t$tot= rount($subtotal+$subtotalivanoc+$totaliva,2);\n\t\t$totaldescuentoc= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentoc,2);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$stmt->execute();\n\t\t\n\t\t } else {\n\t\t\n\t\t$sql = \" update compras set \"\n\t\t\t .\" subtotalivanoc = ?, \"\n\t\t\t .\" totaldescuentoc = ?, \"\n\t\t\t .\" totalc= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codcompra = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaldescuentoc);\n\t\t$stmt->bindParam(3, $total);\n\t\t$stmt->bindParam(4, $codcompra);\n\t\t\n\t\t$subtotal= strip_tags($importeivano);\n\t\t$tot= rount($subtotal+$subtotalivasic+$totalivac,2);\n\t\t$totaldescuentoc= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentoc,2);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$stmt->execute();\t\t\n\t\t }\t\t\t\t\t\n\n\t\theader(\"Location: detallescompras?mesage=2\");\n\t\texit;\n\n\t\t}\n\t\telse\n\t\t{\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN INGREDINTE ###################\n\tif($_POST['tipoentrada']==\"INGREDIENTE\"){\n\n\t\t$sql2 = \"select cantingrediente from ingredientes where cantingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"cantingrediente\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN PRODUCTO ###################\n\t\t\t} else {\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"existencia\"];\n\n\t\t$sql = \" update productos set \"\n\t\t.\" existencia = ? \"\n\t\t.\" where \"\n\t\t.\" codproducto = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from compras where codcompra = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$codcompra = base64_decode($_GET[\"codcompra\"]);\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from detallecompras where coddetallecompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$coddetallecompra);\n\t\t$coddetallecompra = base64_decode($_GET[\"coddetallecompra\"]);\n\t\t$stmt->execute();\n\n\t\t\t}\n\n\t\t\theader(\"Location: detallescompras?mesage=2\");\n\t\t\texit;\n\t\t}\n\t}\n\telse\n\t{\n\t\theader(\"Location: detallescompras?mesage=3\");\n\t\texit;\n\t}\n}", "function Eliminar()\n{\n /**\n * Se crea una instanica a Concesion\n */\n $Concesion = new Titulo();\n /**\n * Se coloca el Id del acuifero a eliminar por medio del metodo SET\n */\n $Concesion->setId_titulo(filter_input(INPUT_GET, \"ID\"));\n /**\n * Se manda a llamar a la funcion de eliminar.\n */\n echo $Concesion->delete();\n}", "function opcion__eliminar()\n\t{\n\t\t$id_proyecto = $this->get_id_proyecto_actual();\n\t\tif ( $id_proyecto == 'toba' ) {\n\t\t\tthrow new toba_error(\"No es posible eliminar el proyecto 'toba'\");\n\t\t}\n\t\ttry {\n\t\t\t$p = $this->get_proyecto();\n\t\t\tif ( $this->consola->dialogo_simple(\"Desea ELIMINAR los metadatos y DESVINCULAR el proyecto '\"\n\t\t\t\t\t.$id_proyecto.\"' de la instancia '\"\n\t\t\t\t\t.$this->get_id_instancia_actual().\"'\") ) {\n\t\t\t\t$p->eliminar_autonomo();\n\t\t\t}\n\t\t} catch (toba_error $e) {\n\t\t\t$this->consola->error($e->__toString());\n\t\t}\n\t\t$this->get_instancia()->desvincular_proyecto( $id_proyecto );\n\t}", "public function eliminar(){\n $dimensiones = $this->descripciones()->distinct()->get()->pluck('id')->all();\n $this->descripciones()->detach($dimensiones);\n DescripcionProducto::destroy($dimensiones);\n $this->categorias()->detach();\n $this->imagenes()->delete();\n $this->delete();\n }", "function removePacote($campos){\n\t\t\t$listDel = $campos['InputDelPacote'];\t\t\t\n\t\t\t\t\n\t\t\t\tif(!empty($listDel)){\n\t\t\t\t\n\t\t\t\tfor($i=0;$i<sizeof($listDel);$i++){\n\t\t\t\t\t\tif($listDel[$i] != 0){\n\t\t\t\t\t\t\t\t$sql = \" DELETE FROM vekttor_venda_pacote WHERE pacotes_id = '$listDel[$i]' AND vekttor_venda_id = '$campos[venda_id]'\";\n\t\t\t\t\t\t\t\t//echo $sql;\n\t\t\t\t\t\t\t\tmysql_query($sql);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t/*Seleciona os pacote para trazer os modulos */\n\t\t\t\t\t$sqlPacote = mysql_query($tn=\" SELECT * FROM pacote_item WHERE pacote_id = '$listDel[$i]' \");\n\t\t\t\t\t\twhile($pct=mysql_fetch_object($sqlPacote)){\n\t\t\t\t\t\t\t\t$modulos[] = $pct->sis_modulo_id;\n\t\t\t\t\t\t}\n\t\t\t\t} /*Fim de For*/\n\t\t\t\t\n\t\t\t\t\tfor($j=0;$j<sizeof($modulos);$j++){\n\t\t\t\t\t\t\t$sqlModulos = \" DELETE FROM usuario_tipo_modulo WHERE modulo_id = '$modulos[$j]' AND usuario_tipo_id = '$campos[id_usuario_tipo]'\";\n\t\t\t\t\t\t\tmysql_query($sqlModulos);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n}", "public function eliminarderivoAction()\n {\n $this->disableAutoRender();\n\n /* Recibo la lista de Ids separado por comas */\n $idList = $this->_getParam('id');\n\n if ($idList) {\n /* Convierto la lista a un Array */\n $idArray = explode (\",\", $idList);\n\n /* Recorro el array eliminando cada Id */\n foreach ($idArray as $id) {\n try {\n $resultado = $this->_modeloDerivotemporal->eliminar($id, $this->_usuario);\n\t\t\t\t\t\n if($resultado == 0) { /* Si no se eliminó */\n echo 'error|No está autorizado a eliminar este registro'; \n exit;\n }\n\t\t\t\t\n\t\t} catch(Exception $ex) {\n $message = $ex->getMessage();\n echo 'error|'.$message;\n }\n }\n }\n }", "public function deletaCliente($id) {\n }", "function eliminaDaDB($ID_cliente, $ID_ordine, $ID_foto) {\n $servername = \"localhost\";\n $username = \"onlinesales\";\n $password = \"Sale0nl1nE\";\n $dbname = \"fmc-db-onlinesales\";\n\n // Create connection\n $conn = new mysqli($servername, $username, $password, $dbname);\n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n $query1 = \"DELETE FROM `Ordine` WHERE `ID_cliente` = '$ID_cliente' AND `ID_ordine` = '$ID_ordine'\";\n $query2 = \"DELETE FROM `Cliente` WHERE `ID_cliente` = '$ID_cliente'\";\n $query3 = \"DELETE FROM `Foto` WHERE `ID_cliente` = '$ID_cliente'\";\n \n unlink(\"../Pagina_iniziale/images/\".$ID_foto);\n eseguiQuery($conn, $query1);\n eseguiQuery($conn, $query2);\n eseguiQuery($conn, $query3);\n // chiusura della connessione\n \n $conn->close();\n }", "public function eliminaPedido($codpedido) {\n $sql = \"SELECT elementoPedido_elementoPedido_id\n FROM tieneElemento\n WHERE pedido_pedido_id = $codpedido\";\n $result = $this->bd->query($sql);\n $numfilas = $result->num_rows;\n /* Elimino las asociaciones del pedido con sus elementos */\n $sql2 = \"DELETE FROM tieneElemento\n WHERE pedido_pedido_id = $codpedido\";\n $result2 = $this->bd->query($sql2);\n /* Elimino los elementos del pedido, con sus elementos de cola y asociaciones */\n for($i=0; $i<$numfilas ; $i++) {\n $row = $result->fetch_assoc();\n $cod = $row[\"elementoPedido_elementoPedido_id\"];\n $sql3 = \"DELETE FROM asociaPlato\n WHERE elementoColaCocina_elementoPedido_elementoPedido_id = $cod\";\n $sql4 = \"DELETE FROM asociaBebida\n WHERE elementoColaBar_elementoPedido_elementoPedido_id = $cod\";\n $sql5 = \"DELETE FROM elementoColaCocina\n WHERE elementoPedido_elementoPedido_id = $cod\";\n $sql6 = \"DELETE FROM elementoColaBar\n WHERE elementoPedido_elementoPedido_id = $cod\";\n $sql7 = \"DELETE FROM elementoPedido\n WHERE elementoPedido_id = $cod\";\n $result3 = $this->bd->query($sql3);\n $result4 = $this->bd->query($sql4);\n $result5 = $this->bd->query($sql5);\n $result6 = $this->bd->query($sql6);\n $result7 = $this->bd->query($sql7);\n }\n /* Elimino el pedido y */\n $sql8 = \"DELETE FROM facturaPedido\n WHERE pedido_pedido_id = $codpedido\";\n// $sql9 = \"DELETE FROM pedido\n// WHERE pedido_id = $codpedido\";\n\n $result8 = $this->bd->query($sql8);\n// $result9 = $this->bd->query($sql9);\n }", "public function borrarArticulo($articulo){\r\n\t\t\tparent::$log->debug(\"Borrar $articulo de la cesta\");\r\n\t\t\t$cesta = new ArrayObject($this->listArticulos);\r\n\t\t\t$iterador = $cesta->getIterator();\r\n\t\t\twhile($iterador->valid()){\r\n\t\t\t\tif (strtolower($iterador->current()->id) == $articulo){\r\n\t\t\t\t\tunset($this->listArticulos[$iterador->key()]);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t$iterador->next();\r\n\t\t\t}\r\n\t\t}", "function EliminarMascotas($nombres, $primer_apellido, $segundo_apellido, $fehca_nacimiento, $lugar_nacimiento, $iddepartamento, $idmunicipio, $telefono_casa, $celular, $direccion, $foto){\n $conexion = Conectar();\n $sql = \"DELETE FROM padrinos WHERE id=:id\";\n $statement = $conexion->prepare($sql);\n $statement->bindParam(':idpadrinos', $idpadrinos);\n $statement->execute();\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n $res=$statement->fetchAll();\n return $res;\n}", "public static function odstraniArtikelIzKosarice() {\n $id = $_SESSION[\"uporabnik_id\"];\n $uporabnik = UporabnikiDB::get($id);\n\n $id_artikla = filter_input(INPUT_POST, \"id\", FILTER_SANITIZE_SPECIAL_CHARS);\n $status = \"kosarica\";\n\n $narocilo = NarocilaDB::getByUporabnikId($id, $status);\n $podrobnost_narocila = PodrobnostiNarocilaDB::getByNarociloAndArtikel($narocilo[\"id\"], $id_artikla);\n\n\n if (PodrobnostiNarocilaDB::delete($podrobnost_narocila[\"id_podrobnosti_narocila\"])) {\n echo ViewHelper::redirect(BASE_URL . \"kosarica\");\n } else {\n echo(\"Napaka\");\n }\n }", "function rimuoviCliente($id_cliente){\nif(trovaCliente($id_cliente)){\n mysql_query(\"DELETE utente,sensore,rilevazione FROM utente\nINNER JOIN sensore ON `utente`.`id_cliente` = `sensore`.`id_clienteFK`\nINNER JOIN rilevazione ON `sensore`.`id_sensore` = `rilevazione`.`id_sensoreFK`\nWHERE id_cliente = '\".$id_cliente.\"' \");\n\nreturn true;\n}\n\nelse {\nreturn false;\n}\n}", "function eliminarClientes($idCliente){\n\t\t\t\t\n\t\t\t//SQL\n\t\t\t$query = \"DELETE FROM users WHERE id = $idCliente;\";\n\t\t\t$rst = $this->db->enviarQuery($query,'CUD');\n\t\t\treturn $rst;\n\t\t}", "public function Excluir(){\n $idMotorista = $_GET['id'];\n\n $motorista = new Motorista();\n\n $motorista->id = $idMotorista;\n\n $motorista::Delete($motorista);\n\n\n }", "function eliminarImagenServidor($campo, $tabla, $idAsignacion)\n {\n $data=$this->analisisRiesgo->getNombreImagen($campo, $tabla, $idAsignacion);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagen($borrar, $tabla, $idAsignacion);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/$nombreImagen\");\n echo \"OK\";\n }\n\n }", "function elimina_vetrina()\n {\n $peer = new VetrinaPeer();\n $do = $peer->find_by_id(Params::get(\"id_vetrina\"));\n $peer->delete($do);\n\n $peer2 = new ProdottoServizioVetrinaPeer();\n $peer2->id_vetrina__EQUAL(Params::get(\"id_vetrina\"));\n $elenco_prodotti_servizi = $peer2->find();\n foreach ($elenco_prodotti_servizi as $ps)\n $peer2->delete($ps);\n\n if (is_html())\n return Redirect::success();\n else\n return Result::ok();\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 excluir(){\r\n\t\t$instancia = ServicoDAO::getInstancia();\r\n\t\t// executando o metodo //\r\n\t\t$servico = $instancia->excluir($this->getId());\r\n\t\t// retornando o resultado //\r\n\t\treturn $servico;\r\n\t}", "function EliminaAunArticulo($Cod_Articulo,$CardCode){\n\t\tif($this->con->conectar()==true){\n\t\treturn mysql_query(\"DELETE FROM `Carrito` WHERE `CardCode` = '\" .$CardCode. \"' AND `CodArticulo` = '\".$Cod_Articulo.\"'\");\n\t\t}\n\t}", "public static function deletar_animal_cliente(int $cliente_code): array{\r\n $db = new db_connect;\r\n // Puxando a tabela pet da classe db_connect;\r\n $tbl_pet = $db->tbl_pet;\r\n\r\n\r\n try {\r\n $stmt = $db->conn->prepare(\"DELETE FROM $tbl_pet WHERE COD_CLIENTE = :cliente_cod\");\r\n $stmt->bindParam(':cliente_cod', $cliente_code, \\PDO::PARAM_INT);\r\n $stmt->execute();\r\n\r\n $result['status'] = true;\r\n $result['message'] = \"Animal excludo com sucesso\";\r\n } catch (\\PDOException $e) {\r\n\r\n $result['status'] = false;\r\n $result['message'] = \"Error: \" . $e->getMessage();\r\n } \r\n\r\n return $result;\r\n\r\n }", "public function deleteByid(Request $req , Response $res , $args)\n{\n //$pizzaid = $this->em->find('App\\Model\\Categorias' , $args['id']);\n\n $categorias = $this->em->find('App\\Model\\Categorias' , $args['id']);\n \n\n foreach ($categorias->getPizza() as $key => $value) {\n echo $value->getValorM().\"<br>\";\n echo $value->getId().\"<br>\";\n\n if($value->getId() == 113){ // a varialvel get com id pizza\n \n $pizza = $this->em->find('App\\Model\\Pizza', 113);\n $this->em->remove($pizza);\n $this->em->flush();\n\n }\n }\n\n\n // $directory = $this->container->get('upload_directory');\n // unlink($directory . $pizza->getUrlimg());\n\n //echo \"<p class='red text-darken-1'>Item excluido com sucesso</p>\";\n\n\n}", "function eliminarRelacionProceso(){\n $this->objFunc=$this->create('MODObligacionPago');\n $this->res=$this->objFunc->eliminarRelacionProceso($this->objParam);\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "public function eliminarCliente($id) {\n $consultaExistenciacliente = $this->db->select(\"SELECT * FROM cliente \"\n . \"WHERE id = '\" . $id . \"' \");\n\n if ($consultaExistenciacliente != null) {\n $this->db->delete('cliente', \"`id` = '{$id}'\");\n } else {\n //Sino Inserto datos de Pre-Matricula del Estudiante\n echo 'Error...</br>Ya existe un cliente con ese ID';\n die;\n }\n }", "public function deleting(Seguimiento $Seguimiento){\n \n }", "public function eliminarDatosAction(Request $request)\n {\n //denegamos el acceso a eliminar a los investigadores\n if ($this->get('security.context')->isGranted('ROLE_ADMIN')){\n $admin=true;}\n else{\n $admin=false;\n }\n \n //obtenemos los datos de esta parte\n $datosForm = $request->request->all();\n if(count($datosForm)){\n $idEstudio = array_shift($datosForm);\n $em = $this->getDoctrine()->getManager();\n $estudio = $em->getRepository('proyectobackendBundle:Estudio')->find($idEstudio);\n $partes = $estudio->getPartesEstudio();\n $idsParticipante = array();\n \n foreach($partes as $parte){\n $preguntas = $parte->getPreguntas();\n foreach($preguntas as $pregunta){\n $subpreguntas = $pregunta->getSubpreguntas();\n foreach($subpreguntas as $subpregunta){\n $respuestas = $em->getRepository('proyectobackendBundle:Respuesta')->findBy(array('idSubpregunta' => $subpregunta->getId()));\n foreach($respuestas as $respuesta){\n if(!in_array($respuesta->getIdParticipante(), $idsParticipante)){\n array_push($idsParticipante, $respuesta->getIdParticipante());\n }\n }\n \n }\n }\n }\n \n foreach($idsParticipante as $id){\n $entity = $em->getRepository('proyectobackendBundle:Participante')->find($id);\n $em->remove($entity);\n \n }\n $em->flush();\n }\n\n if (!$estudio) {\n throw $this->createNotFoundException('Unable to find Estudio entity.');\n }\n\n $deleteForm = $this->createDeleteForm($idEstudio);\n\n $partes = $estudio->getPartesEstudio();\n $arraypartes = array();\n foreach ($partes as $parte){\n array_push($arraypartes, $parte->getNombre());\n }\n \n return $this->render('proyectobackendBundle:Estudio:show.html.twig', array(\n 'admin' => $admin,\n 'entity' => $estudio,\n 'delete_form' => $deleteForm->createView(),\n 'partes' => $arraypartes,\n 'alertDatosEliminados' => 1,\n ));\n }", "function runEliminar(){\n \n $sql = \"DELETE FROM mec_met WHERE id_mecanismos IN (SELECT id_mecanismos FROM mecanismos WHERE id_componente=\".$this->_datos.\")\";\n $this->QuerySql($sql);\n $sql = \"DELETE FROM mecanismos WHERE id_componente=\".$this->_datos;\n $this->QuerySql($sql);\n $sql = \"DELETE FROM componentes WHERE id_componentes=\".$this->_datos;\n $_respuesta = array('Codigo' => 0, \"Mensaje\" => '<strong> OK: </strong> El registro se ha eliminado.');\n try { \n $this->QuerySql($sql);\n }\n catch (exception $e) {\n $_respuesta = array('Codigo' => 99, \"Mensaje\" => $e->getMessage());\n }\n \n print_r(json_encode($_respuesta));\n }", "public function eliminarAction()\n {\n $this->disableAutoRender();\n\n /* Recibo la lista de Ids separado por comas */\n $idList = $this->_getParam('id');\n\n if ($idList) {\n /* Convierto la lista a un Array */\n $idArray = explode (\",\", $idList);\n\n /* Recorro el array eliminando cada Id */\n foreach ($idArray as $id) {\n try {\n $resultado = $this->_modeloMovimiento->eliminar($id, $this->_usuario);\n \n if($resultado == 0) { /* Si no se eliminó */\n echo 'error|No está autorizado a eliminar este registro'; \n exit;\n }\n \n \n } catch(Exception $ex) {\n $message = $ex->getMessage();\n echo 'error|'.$message;\n }\n }\n }\n }", "public function EliminarIngredientesProductos()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\t$sql = \" delete from productosvsingredientes where codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codproducto);\n\t\t$stmt->bindParam(2,$codingrediente);\n\t\t$codproducto = base64_decode($_GET[\"codproducto\"]);\n\t\t$codingrediente = base64_decode($_GET[\"codingrediente\"]);\n\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-check-square-o'></span> EL INGREDIENTE FUE ELIMINADO EXITOSAMENTE </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\n\t} else {\n\n\t\techo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-check-square-o'></span> USTED NO PUEDE ELIMINAR INGREDIENTES AGREGADOS, NO ERES EL ADMINISTRADOR DEL SISTEMA </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\t}\n\n}", "public function deleteSeguimientos(Request $request){\n $this->validate($request,['id' => 'required']);\n $id = $request->input('id');\n $seguimiento = Seguimiento::where('paciente_id',$id)->get()->toArray();\n foreach($seguimiento as $seg){\n $file = storage_path('recursos/seguimientos/'.$seg['foto']);\n unlink($file);\n }\n\n DB::table('seguimientos')->where('paciente_id',$id)->delete();\n\n return response()->json([\n 'status' => 'ok',\n 'code' => 200,\n 'result' => 'Se elimino el seguimiento'\n ],200)\n ->header('Access-Control-Allow-Origin','*')\n ->header('Content-Type', 'application/json');\n\n }", "function eliminarImagenCarpeta($campo, $tabla, $idAsignacion, $carpeta)\n {\n $data=$this->analisisRiesgo->getNombreImagen($campo, $tabla, $idAsignacion);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagen($borrar, $tabla, $idAsignacion);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/$carpeta/$nombreImagen\");\n echo \"OK\";\n }\n\n }", "public function EliminarDetallesVentas()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\tself::SetNames();\n\n\t\t$sql = \" select * from detalleventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num > 1)\n\t\t{\n\n\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t$stmt = $this->dbh->prepare($sql2);\n\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t$num = $stmt->rowCount();\n\n\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t$existenciadb = $p[0][\"existencia\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t$sql = \" update productos set \"\n\t.\" existencia = ? \"\n\t.\" where \"\n\t.\" codproducto = ?;\n\t\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1, $existencia);\n\t$stmt->bindParam(2, $codproducto);\n\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t$existencia = $existenciadb + $cantventa;\n\t$stmt->execute();\n\n\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1,$coddetalleventa);\n\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1,$codventa);\n\t$stmt->bindParam(2,$codproducto);\n\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t$stmt->execute();\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\n if($num>0) {\n\n$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t$array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t$this->p[] = $row;\n\n\t\t$codproducto = $row['codproducto'];\n\t\t$codingrediente = $row['codingrediente'];\n\t\t$cantracion = $row['cantracion'];\n\t\t$cantingrediente = $row['cantingrediente'];\n\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\t\t$update = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($update);\n\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t$stmt->execute();\n\n\t\t }\n}\n############ FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ##############\n\n\t$sql4 = \"select * from ventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$paea[] = $row;\n\t\t}\n\t\t$subtotalivasive = $paea[0][\"subtotalivasive\"];\n\t\t$subtotalivanove = $paea[0][\"subtotalivanove\"];\n\t\t$iva = $paea[0][\"ivave\"]/100;\n\t\t$descuento = $paea[0][\"descuentove\"]/100;\n\t\t$totalivave = $paea[0][\"totalivave\"];\n\t\t$totaldescuentove = $paea[0][\"totaldescuentove\"];\n\t\t$totaldb = $paea[0][\"totalpago\"];\n\t\t$montopagado = $paea[0][\"montopagado\"];\n\t\t\t\n\t\t\n$sql3 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'SI'\";\n\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $row;\n\t\t\t}\n\t\t$preciocompraiva = ($pae[0][\"preciocompra\"]== \"\" ? \"0\" : $pae[0][\"preciocompra\"]);\n\t\t$importeivasi = ($pae[0][\"importe\"]== \"\" ? \"0\" : $pae[0][\"importe\"]);\n\t\t$importe2si = ($pae[0][\"importe2\"]== \"\" ? \"0\" : $pae[0][\"importe2\"]);\n\t\n$sql5 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'NO'\";\n\t\t$stmt = $this->dbh->prepare($sql5);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($roww = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $roww;\n\t\t\t}\n\t\t$preciocompra = ($roww[\"preciocompra\"]== \"\" ? \"0\" : $roww[\"preciocompra\"]);\n\t\t$importeivano = ($roww[\"importe\"]== \"\" ? \"0\" : $roww[\"importe\"]);\n\t\t$importe2 = ($roww[\"importe2\"]== \"\" ? \"0\" : $roww[\"importe2\"]);\n\t\t\nif(base64_decode($_GET[\"ivaproducto\"])==\"SI\"){\t\n\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" subtotalivasive = ?, \"\n\t\t\t .\" totalivave = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" montodevuelto= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaliva);\n\t\t$stmt->bindParam(3, $totaldescuentove);\n\t\t$stmt->bindParam(4, $totalpago);\n\t\t$stmt->bindParam(5, $devuelto);\n\t\t$stmt->bindParam(6, $codventa);\n\t\t\n\t\t$subtotal= strip_tags($importeivasi);\n $totaliva= rount($subtotal*$iva,2);\n\t\t$tot= rount($subtotal+$subtotalivanove+$totaliva,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$totalpago= rount($tot-$totaldescuentove,2);\n\t\t$devuelto= ($montopagado== \"0.00\" ? \"0\" : rount($montopagado-$totalpago,2));\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\nif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$ingreso = ($row['ingresos']== \"\" ? \"0.00\" : $row['ingresos']);\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$calculo=rount($totaldb-$totalpago,2);\n\t\t$txtTotal = rount($ingreso-$calculo,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\t\t\n\t\t } else {\n\n $sql = \" update ventas set \"\n\t\t\t .\" subtotalivanove = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" montodevuelto= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaldescuentove);\n\t\t$stmt->bindParam(3, $totalpago);\n\t\t$stmt->bindParam(4, $devuelto);\n\t\t$stmt->bindParam(5, $codventa);\n\t\t\n\t\t$subtotal= strip_tags($importeivano);\n\t\t$tot= rount($subtotal+$subtotalivasive+$totalivave,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$totalpago= rount($tot-$totaldescuentove,2);\n\t\t$devuelto= ($montopagado== \"0.00\" ? \"0\" : rount($montopagado-$totalpago,2));\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\nif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$ingreso = ($row['ingresos']== \"\" ? \"0.00\" : $row['ingresos']);\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$calculo=rount($totaldb-$totalpago,2);\n\t\t$txtTotal = rount($ingreso-$calculo,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\t\t\n\t } \n\necho \"<div class='alert alert-info'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<center><span class='fa fa-check-square-o'></span> EL DETALLE DE VENTA DE PRODUCTO FUE ELIMINADO EXITOSAMENTE </center>\";\necho \"</div>\";\nexit;\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t\t$existenciadb = $p[0][\"existencia\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$stmt->bindParam(2, $codproducto);\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$existencia = $existenciadb + $cantventa;\n\t\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$stmt->bindParam(2,$codproducto);\n\t\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$stmt->execute();\n\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #######################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t$array=array();\n\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\n\t\t$codproducto = $row['codproducto'];\n\t\t$codingrediente = $row['codingrediente'];\n\t\t$cantracion = $row['cantracion'];\n\t\t$cantingrediente = $row['cantingrediente'];\n\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\n\t\t$update = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($update);\n\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t$stmt->execute();\n\n\n\t\t }\n\n}\n################### FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS ###################\n\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\tif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n\t\t$sql4 = \"select * from ventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($roww = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $roww;\n\t\t\t}\n\t\t$totaldb = $roww[\"totalpago\"];\n\n\t\t$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\tif (isset($row['ingresos'])) { $ingreso = $row['ingresos']; } else { $ingreso ='0.00'; }\n\t\t//$ingreso = $row['ingresos'];\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$txtTotal = rount($ingreso-$totaldb,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\t\t$sql = \" update mesas set \"\n\t\t.\" statusmesa = ? \"\n\t\t.\" where \"\n\t\t.\" codmesa = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $statusmesa);\n\t\t$stmt->bindParam(2, $codmesa);\n\n\t\t$statusmesa = strip_tags('0');\n\t\t$codmesa = base64_decode($_GET[\"codmesa\"]);\n\t\t$stmt->execute();\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\n\t\t$sql = \" delete from ventas where codventa = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$coddetalleventa);\n\t\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t\t$stmt->execute();\n\n\techo \"<div class='alert alert-info'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<center><span class='fa fa-check-square-o'></span> EL DETALLE DE VENTA DE PRODUCTO FUE ELIMINADO EXITOSAMENTE </center>\";\n\techo \"</div>\";\n\texit;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\techo \"<div class='alert alert-info'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<center><span class='fa fa-check-square-o'></span> USTED NO PUEDE ELIMINAR DETALLES EN VENTAS, NO ERES EL ADMINISTRADOR DEL SISTEMA</center>\";\n\techo \"</div>\";\n\texit;\n\t\t}\n\t}", "public function delete () {\n $this->db->delete('emprestimos', array('id_emprestimo' => $this->id_emprestimo));\n }", "public function EliminarDetallesVentasPedidosProductos()\n{\t\t\n\tself::SetNames();\n\t$sql = \" select * from detalleventas where codventa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num > 1)\n\t{\n\n\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t\t$existenciadb = $p[0][\"existencia\"];\n\n\t\t\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$coddetalleventa);\n\t\t\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$stmt->bindParam(2, $codproducto);\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$existencia = $existenciadb + $cantventa;\n\t\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$stmt->bindParam(2,$codproducto);\n\t\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$stmt->execute();\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #######################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t\t$stmt->execute();\n\n\n\t\t }\n\n}\n################### FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #################\n\n\n\t\t\t$sql4 = \"select * from ventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $row;\n\t\t\t}\n\t\t\t$subtotalivasive = $paea[0][\"subtotalivasive\"];\n\t\t\t$subtotalivanove = $paea[0][\"subtotalivanove\"];\n\t\t\t$iva = $paea[0][\"ivave\"]/100;\n\t\t\t$descuento = $paea[0][\"descuentove\"]/100;\n\t\t\t$totalivave = $paea[0][\"totalivave\"];\n\t\t\t$totaldescuentove = $paea[0][\"totaldescuentove\"];\n\t\t\t\n\t\t\n$sql3 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'SI'\";\n\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t$preciocompraiva = $row[\"preciocompra\"];\n\t\t$importeiva = $row[\"importe\"];\n\t\t$importe2iva = $row[\"importe2\"];\n\t\n$sql5 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'NO'\";\n\t\t$stmt = $this->dbh->prepare($sql5);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($rov = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $rov;\n\t\t\t}\n\t\t$preciocompra = $rov[\"preciocompra\"];\n\t\t$importe = $rov[\"importe\"];\n\t\t$importe2 = $rov[\"importe2\"];\n\t\t\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" subtotalivasive = ?, \"\n\t\t\t .\" subtotalivanove = ?, \"\n\t\t\t .\" totalivave = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" totalpago2= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotalivasive);\n\t\t$stmt->bindParam(2, $subtotalivanove);\n\t\t$stmt->bindParam(3, $totaliva);\n\t\t$stmt->bindParam(4, $totaldescuentove);\n\t\t$stmt->bindParam(5, $total);\n\t\t$stmt->bindParam(6, $total2);\n\t\t$stmt->bindParam(7, $codventa);\n\t\t\n\t\t$subtotalivasive= rount($importeiva,2);\n\t\t$subtotalivanove= rount($importe,2);\n $totaliva= rount($subtotalivasive*$iva,2);\n\t\t$tot= rount($subtotalivasive+$subtotalivanove+$totaliva,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentove,2);\n\t\t$total2= rount($preciocompra,2);\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$stmt->execute();\n\n\t\t\t\t\t\tunset($_SESSION[\"CarritoVentas\"]);\n\n\t?>\n\t\t<script type='text/javascript' language='javascript'>\n\t alert('EL PEDIDO DE PRODUCTOS FUE ELIMINADOS, \\nDE LA MESA EXITOSAMENTE') \n </script> \n\t\t<?php \n\t\t\texit;\n\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\n\t\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t\t$existenciadb = $p[0][\"existencia\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$stmt->bindParam(2, $codproducto);\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$existencia = $existenciadb + $cantventa;\n\t\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$stmt->bindParam(2,$codproducto);\n\t\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$stmt->execute();\n\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #######################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t\t$stmt->execute();\n\n\t\t }\n}\n################### FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS ###################\n\n\t\t\t$sql = \" delete from ventas where codventa = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$codventa = base64_decode($_GET[\"codventa\"]);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$coddetalleventa);\n\t\t\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t\t\t$stmt->execute();\n\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\t\t\t$sql = \" update mesas set \"\n\t\t\t.\" statusmesa = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codmesa = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $statusmesa);\n\t\t\t$stmt->bindParam(2, $codmesa);\n\n\t\t\t$statusmesa = strip_tags('0');\n\t\t\t$codmesa = base64_decode($_GET[\"codmesa\"]);\n\t\t\t$stmt->execute();\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\n?>\n\t\t<script type='text/javascript' language='javascript'>\n\t alert('LOS PEDIDOS DE PRODUCTOS HAN SIDO ELIMINADOS, \\nDE LA MESA EXITOSAMENTE') \n </script> \n\t\t<?php \n\t\texit;\n\t}\n}", "public function excluir()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"DELETE FROM EncontroComDeus WHERE id = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->id );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n\n }", "function eliminar_insumos($objeto){\n\t\t$sql=\"\tDELETE FROM\n\t\t\t\t\t app_producto_material\n\t\t\t\tWHERE\n\t\t\t\t\tid_producto =\".$objeto['id'];\n\t\t// return $sql;\n\t\t$result = $this->query($sql);\n\n\t\treturn $result;\n\t}", "private function eliminarEmpleadoRepetido()\n {\n //Sino me los trata como strings\n $this->empleados = array_unique($this->empleados, SORT_REGULAR);\n }", "public function eliminaReserva($cod) {\n // 1ro actualizamos la existencia de los productos adicionando lo que no se ha vendido\n $modelocantidad = $this->db->query(\"SELECT p.modelo,(d.cantidad+p.existencia) as existencia FROM producto p,detalle_venta d WHERE p.modelo LIKE d.modelo AND d.cod_venta LIKE '\" . $cod . \"';\")->result_array(); //obtenemos los datos del detalle\n if (sizeof($modelocantidad) > 0) {\n //actualizamos la existencia en producto\n $this->db->update_batch('producto', $modelocantidad, 'modelo');\n if ($this->db->affected_rows() > 0) {\n //3ro eliminamos el detalle de venta de la venta\n $this->db->query(\"delete from detalle_venta where cod_venta like '\" . $cod . \"'\");\n if ($this->db->affected_rows() > 0) {\n //eliminamos los datos de la venta\n $this->db->query(\"delete from venta where cod_venta like '\" . $cod . \"'\");\n if ($this->db->affected_rows() > 0) {\n return \"Exito! Se ha eliminado la reserva de\"; //el nombre se muestra en jquery\n } else {\n return \"Error: No se ha eliminado la reserva de\";\n }\n } else {\n return \"Error: No se ha eliminado el Detalle de la venta de\";\n }\n } else {\n return \"Error: No se ha actualizado la existencia de productos\";\n }\n } else {\n return \"No se tiene registro del detalle de la venta de\";\n }\n }", "public function EliminarProveedores()\n\t\t{\n\t\t\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\t\t\t$sql = \" select codproveedor from compras where codproveedor = ? \";\n\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t$stmt->execute( array(base64_decode($_GET[\"codproveedor\"])) );\n\t\t\t\t$num = $stmt->rowCount();\n\t\t\t\tif($num == 0)\n\t\t\t\t{\n\n\t\t\t\t\t$sql = \" delete from proveedores where codproveedor = ? \";\n\t\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(1,$codproveedor);\n\t\t\t\t\t$codproveedor = base64_decode($_GET[\"codproveedor\"]);\n\t\t\t\t\t$stmt->execute();\n\n\t\t\t\t\theader(\"Location: proveedores?mesage=1\");\n\t\t\t\t\texit;\n\n\t\t\t\t}else {\n\n\t\t\t\t\theader(\"Location: proveedores?mesage=2\");\n\t\t\t\t\texit;\n\t\t\t\t} \n\n\t\t\t} else {\n\n\t\t\t\theader(\"Location: proveedores?mesage=3\");\n\t\t\t\texit;\n\t\t\t}\t\n\t\t}", "public function excluirAnuncio($id){\n global $pdo;\n $sql = $pdo->prepare(\"DELETE FROM anuncios_imagens WHERE id_anuncio = :id_anuncio\"); // vai remover o registro de imagens\n $sql->bindValue(\":id_anuncio\", $id);\n $sql->execute(); \n\n $sql = $pdo->prepare(\"DELETE FROM anuncios WHERE id = :id\"); \n $sql->bindValue(\":id\", $id);\n $sql->execute(); \n\n \n\n\n\n }", "function removeRegistro($id) {\n GLOBAL $con;\n\n //busca info\n $querybusca = \"select * from kardexs where id='\" . $id . \"'\";\n $qry = mysql_query($querybusca);\n $linha = mysql_fetch_assoc($qry);\n\n //Apagua\n $query = \"delete from kardexs where id='\" . $id . \"'\";\n mysql_query($query, $con) or die(mysql_error());\n\n if (saldoExiste($linha['produto_id'], $linha['estoque_id'])) {\n //atualiza retirando saldo\n $saldoAtual = saldoByEstoque($linha['produto_id'], $linha['estoque_id']);\n if ($linha['sinal'] == '+') {\n $saldoAtual_acerto = $saldoAtual - $linha['qtd'];\n } else {\n $saldoAtual_acerto = $saldoAtual + $linha['qtd'];\n }\n\n\n saldo_atualiza($linha['produto_id'], $linha['estoque_id'], $saldoAtual_acerto);\n }\n}", "public function EliminarProducto($producto_id)\n {\n $resultado = array();\n $em = $this->getDoctrine()->getManager();\n\n $entity = $this->getDoctrine()->getRepository('IcanBundle:Producto')\n ->find($producto_id);\n\n if ($entity != null) {\n\n //Cotizaciones\n $cotizaciones = $this->getDoctrine()->getRepository('IcanBundle:CotizacionProducto')\n ->ListarCotizaciones($producto_id);\n if (count($cotizaciones) > 0) {\n $resultado['success'] = false;\n $resultado['error'] = \"No se pudo eliminar el producto, porque tiene cotizaciones asociadas\";\n return $resultado;\n }\n\n //Eliminar foto\n $foto_eliminar = $entity->getImagen();\n if ($foto_eliminar != \"\") {\n $dir = 'uploads/productos/';\n if (is_file($dir . $foto_eliminar)) {\n unlink($dir . $foto_eliminar);\n //unlink($dir . \"portada-\" . $foto_eliminar);\n //unlink($dir . \"thumb-\" . $foto_eliminar);\n }\n }\n //Eliminar ficha\n $ficha_eliminar = $entity->getFicha();\n if ($ficha_eliminar != \"\") {\n $dir = 'uploads/productos/';\n if (is_file($dir . $ficha_eliminar)) {\n unlink($dir . $ficha_eliminar);\n }\n }\n\n //Eliminar las imagenes\n $productoimagenes = $this->getDoctrine()->getRepository('IcanBundle:ProductoImagen')\n ->ListarImagenes($producto_id);\n foreach ($productoimagenes as $productoimagen) {\n //Eliminar foto\n $foto_eliminar = $productoimagen->getImagen();\n if ($foto_eliminar != \"\") {\n $dir = 'uploads/productos/';\n if (is_file($dir . $foto_eliminar)) {\n unlink($dir . $foto_eliminar);\n //unlink($dir . \"portada-\" . $foto_eliminar);\n //unlink($dir . \"thumb-\" . $foto_eliminar);\n }\n }\n $em->remove($productoimagen);\n }\n\n //Eliminar los productos relacionados\n $relacionados = $this->getDoctrine()->getRepository('IcanBundle:ProductoRelacion')\n ->ListarRelacionados($producto_id);\n foreach ($relacionados as $relacionado) {\n $em->remove($relacionado);\n }\n\n //Eliminar los productos relacionados\n $productorelacionados = $this->getDoctrine()->getRepository('IcanBundle:ProductoRelacion')\n ->ListarProductosRelacionado($producto_id);\n foreach ($productorelacionados as $relacionado) {\n $em->remove($relacionado);\n }\n\n //Eliminar vistas\n $producto_views = $this->getDoctrine()->getRepository('IcanBundle:ProductoView')\n ->ListarViewsDeProducto($producto_id);\n foreach ($producto_views as $producto_view) {\n $em->remove($producto_view);\n }\n\n //Eliminar descuentos\n $descuentos = $this->getDoctrine()->getRepository('IcanBundle:DescuentoProducto')\n ->ListarDescuentos($producto_id);\n foreach ($descuentos as $descuento) {\n $em->remove($descuento);\n }\n\n $em->remove($entity);\n\n $em->flush();\n $resultado['success'] = true;\n } else {\n $resultado['success'] = false;\n $resultado['error'] = \"No existe el registro solicitado\";\n }\n\n return $resultado;\n }", "public function Eliminar()\n {\n $sentenciaSql = \"DELETE FROM \n detalle_orden \n WHERE \n id_detalle_orden = $this->idDetalleOrden\";\n $this->conn->preparar($sentenciaSql);\n $this->conn->ejecutar();\n }", "public function posteliminar() {\n $model = (new PaisRepository())->Obtener($_POST['id']);\n\n $rh = (new PaisRepository())->Eliminar($model);\n\n print_r(json_encode($rh));\n }", "public function delete($id_rekap_nilai);", "public function excluir(){\n\t\n\t\t$idcomentario = $this->uri->segment(3);\n\t\tif ($idcomentario != NULL):\n\t\t\t$query = $this->Comentarios->get_byid($idcomentario);\n\t\t\tif ($query->num_rows()==1):\n\t\t\t\t$query = $query->row();\n\t\t\t\t$this->Comentarios->do_delete(array('id_comentario'=>$query->id_comentario), FALSE);\n\t\t\tendif;\n\t\telse:\n\t\t\tset_msg('msgerro', 'Escolha um comentario para excluir', 'erro');\n\t\tendif;\n\t\t\tredirect('comentarios/gerenciar');\n\t}", "public function delete($producto);", "public function destroy($id)\n {\n if(DB::table('animais')->where('id_cliente', $id)->count())\n {\n $msg = \"Não é possível excluir este Cliente. \n Existe(m) animais com id(s) ( \";\n\n $animais = DB::table('animais')->where('id_cliente', $id)->get();\n foreach($animais as $animal)\n {\n $msg .= $animal->id_animal.\",\";\n }\n $msg .= \" ) que estão relacionado(s) com este Cliente\";\n \\Session::flash('mensagem', ['msg'=>$msg]);\n return redirect()->route('cliente.remove', $id);\n }\n \n Cliente::find($id)->delete();\n return redirect()->route('cliente.index');\n }", "function deleteComentario($id_evento,$id_comentario){\n $mysqli = Conectar();\n seguridad($id_evento);\n seguridad($id_comentario);\n $mysqli->query(\"Delete From comentarios Where id_evento='$id_evento' and id_comentario='$id_comentario'\");\n }", "public function excluir(){\r\n return (new Database('atividades'))->delete('id = '.$this->id);\r\n }", "public function galeriaExcluir_action()\n\t{\n\t\t$bd = new GaleriasImagens_Model();\n\t\t$id = abs((int) $this->getParam(3));\n\t\t$resultado = $bd->read(\"galeria={$id} AND usuario={$this->_usuario}\");\n\t\tforeach($resultado as $dados){\n\t\t\tunlink('uploads/img_'.$dados['imagem']);\n\t\t\tunlink('uploads/tb_'.$dados['imagem']);\n\t\t\tunlink('uploads/destaque_'.$dados['imagem']);\n\t\t}\n\t\t$bd->delete(\"galeria={$id} AND usuario={$this->_usuario}\");\n\t\t\n\t\t$bd = new Galerias_Model();\n\t\t$bd->delete(\"id={$id} AND usuario={$this->_usuario}\");\n\t\t\n\t\tHTML::certo('Galeria exclu&iacute;da.');\n\t\t//POG Temporário\n\t\tHTML::Imprime('<script>Abrir(\"#abreGaleriasListar\",\"#galerias\");</script>');\n\t}", "public function EliminarProductos()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\t$sql = \" select codproducto from detalleventas where codproducto = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\n\t\t\t$sql = \" delete from productos where codproducto = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codproducto);\n\t\t\t$codproducto = base64_decode($_GET[\"codproducto\"]);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" delete from kardexproductos where codproducto = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codproducto);\n\t\t\t$codproducto = base64_decode($_GET[\"codproducto\"]);\n\t\t\t$stmt->execute();\n\n\t\t\theader(\"Location: productos?mesage=1\");\n\t\t\texit;\n\n\t\t}else {\n\n\t\t\theader(\"Location: productos?mesage=2\");\n\t\t\texit;\n\t\t}\n\n\t} else {\n\n\t\theader(\"Location: productos?mesage=3\");\n\t\texit;\n\t}\t\n}", "public function deleteTerritorioAction()\n {\n \n $isAjax = $this->get('Request')->isXMLhttpRequest();\n //var_dump($isAjax);\n $response = new JsonResponse();\n //if($isAjax){\n $idproveedor = $this->get('request')->request->get('idproveedor');\n// $ordenId = $this->get('request')->request->get('ordenId');\n //var_dump($id_territorio);\n \n foreach($idproveedor as $row){\n $em = $this->getDoctrine()->getManager();\n $detalleOrden = $em->getRepository('ERPAdminBundle:InvProveedor')->find($row);\n $detalleOrden->setEstado(0);\n $em->persist($detalleOrden);\n $em->flush();\n \n }\n \n $response->setData(array(\n 'flag' => 0,\n \n )); \n return $response; \n \n \n \n \n }", "public function Eliminar(){\n\t\t\t$enlace = AccesoBD::Conexion();\n\n\t\t\t$sql = \"DELETE FROM denuncia WHERE ID_DENUNCIA = '$this->idDenuncia'\";\n\n\t\t\tif ($enlace->query($sql) !== TRUE) {\n \t\t\techo \"Error al eliminar la denuncia\";\n \t\t\texit();\n\t\t\t}\n\t\t\techo \"Denuncia eliminada\";\n\t\t}", "public function elimiproduc($cod){\n\n $resul=$this->conex->query('DELETE FROM articulos WHERE CODIGO =\"' .$cod .'\"');\n\n return $resul;\n }", "public function destroy(Cliente $cliente)\n {\n //acceder al paquete publico donde estara la ruta.\n $file_path = public_path().'/images/'.$cliente->avatar;\n \\File::delete($file_path);\n\n $cliente->delete();\n return redirect()->route('clientes.index');\n\n// return 'deleted';\n\n //return $cliente;\n }", "public function deleteEntidad(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_entidades WHERE entidad_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }", "function eliminar_poliza($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $conexion){\n $idcompania = base64_decode($_GET['idcompania']);\n $idpoliza = base64_decode($_GET['idpoliza']);\t\n\tif(isset($_POST['btnEliminar'])) {\n\t\t\n\t\t$update =\"delete from s_poliza where id_poliza = \".$idpoliza.\" and id_compania=\".$idcompania.\" LIMIT 1\";\n\t\t\n\n\t\tif($conexion->query($update)===TRUE){\n\t\t\t//SE METIO A TBLHOMENOTICIAS, VAMOS A VER LA NOTICIA NUEVA\n\t\t\t$mensaje='se elimino el numero de poliza correctamente';\n\t\t\theader('Location: index.php?l=des_poliza&var='.$_GET['var'].'&op=1&msg='.$mensaje);\n\t\t} else{\n\t\t\t$mensaje=\"Hubo un error al ingresar los datos, consulte con su administrador \".$conexion->errno. \": \". $conexion->error;\n\t\t\theader('Location: index.php?l=des_poliza&var='.$_GET['var'].'&op=2&msg='.$mensaje);\n\t\t} \n\t}else {\n\t\t//MOSTRAMOS EL FORMULARIO PARA DAR BAJA COMPANIA\n\t\tmostrar_eliminar_poliza($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $conexion);\n\t}\n\t\n}", "public function excluir()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"DELETE FROM EquipeDiscipulos WHERE discipuloId = ?\n AND equipeId = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->discipuloId );\n $stm->bindParam(2, $this->equipeId );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n\n }", "public function excluirCliente($reg){\n //$conexao = $c->conexao();\n\n $sql = \"DELETE FROM tbclientes WHERE reg = '$reg' \"; \n \n $mensagem = \"O Usuário \".$_SESSION['email'].\" excluiu o Cliente com o REG $reg \";\n $this->salvaLog($mensagem);\n\n return $this->conexao->query($sql); \n \n\n }", "public static function deletaProdutoCarrinho(){\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $expPro = explode(';',self::$carrinho->produto_id);\n $expQuant = explode(';',self::$carrinho->quantidade);\n unset($expPro[self::$posicao]);\n unset($expQuant[self::$posicao]);\n\n //VERIFICA SE TEM PRODUTOS NO CARRINHO\n if($expPro and $expQuant !== ''){\n $impPro = implode(';',$expPro);\n $impQuant = implode(';',$expQuant);\n $query = 'UPDATE carrinhos SET produto_id=:pro, quantidade=:qnt, idCliente=:idC WHERE id=:id';\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,$impPro);\n $stmt->bindValue(2,$impQuant);\n $stmt->bindValue(3,self::$carrinho->idCliente);\n $stmt->bindValue(4,self::$carrinho->id);\n $stmt->execute();\n if($stmt->rowcount()){\n return true;\n }throw new \\Exception(\"Erro ao Deletar Produto\");\n\n //SE O CARRINHO ESTIVER VAZIO SERA DELETADO\n }else{\n $query = 'DELETE FROM carrinhos WHERE carrinhos.id LIKE :id';\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,self::$carrinho->id);\n $stmt->execute();\n if($stmt->rowcount()){\n $_SESSION['user']['carrinhoId'] = NULL;\n\n return true;\n }throw new \\Exception(\"Erro ao Deletar Carrinho\");\n }\n }", "public function eliminar()\n {\n // Comprobar si esta logeado como admin\n if( isset($_SESSION['admin']) ){\n\n // Capturar el id enviado por GET\n $id = $_GET['id'];\n\n // Comprobar si no esta siendo utilizado en un reporte\n $comprobarForanea = Reporte::donde('tipo_reporte_id', $id)\n ->resultado();\n\n // Encontra el tipo de reporte por el id y capturarlo\n $tipoReporte = TipoReporte::encontrarPorID($id);\n\n\n if ( empty($comprobarForanea) ) {\n\n // Eliminar el tipo de reporte\n $tipoReporte->eliminar();\n\n\n // Guardar un mensaje de que se elimino correctamente en una cookie\n setcookie('mensaje', \"Se elimino correctamente el tipo de reporte ($tipoReporte->reporte)\", time() + 10, '/' );\n\n } else {\n\n // Guardar un mensaje de que se no se pudo eliminar\n setcookie('mensaje_error', \"El tipo de reporte ($tipoReporte->reporte) esta siendo utilizado en un reporte\", time() + 10, '/' );\n }\n\n\n // Redirigir a la tabla con todos los tipos de reporte\n header('Location: ../reportes/tipos_reporte');\n\n } else {\n\n // Redirigir al perfil\n header('Location: ../perfil');\n }\n }", "static public function ctrEliminarRepuesto(){\n\n\t\tif(isset($_GET[\"idProducto\"])){\n\n\t\t\t$tabla =\"repuestos\";\n\t\t\t$datos = $_GET[\"idProducto\"];\n\n\t\t\tif($_GET[\"imagen\"] != \"\" && $_GET[\"imagen\"] != \"vistas/img/productos/default/anonymous.png\"){\n\n\t\t\t\tunlink($_GET[\"imagen\"]);\n\t\t\t\trmdir('vistas/img/productos/'.$_GET[\"codigo\"]);\n\n\t\t\t}\n\n\t\t\t$respuesta = ModeloProductos::mdlEliminarRepuesto($tabla, $datos);\n\n\t\t\tif($respuesta == \"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: \"El producto ha sido borrado correctamente\",\n\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t confirmButtonText: \"Cerrar\"\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 = \"productos\";\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\n\n\t}", "public function deleteproducto()\n\t{\n\n\t\t$idpedido = $_SESSION['idPedido'];\n\t\t$idproducto = $_POST['id'];\n\n\n\t\t$this->query(\"DELETE FROM producto_has_pedido WHERE Pedido_idPedido=$idpedido and Producto_idProductos=$idproducto\");\n\t\t$this->execute();\n\t}", "public function EliminarCaja()\n\t\t{\n\n\t\t\t$sql = \" select codcaja from ventas where codcaja = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"codcaja\"])) );\n\t\t\t$num = $stmt->rowCount();\n\t\t\tif($num == 0)\n\t\t\t{\n\n\t\t\t\t$sql = \" delete from cajas where codcaja = ? \";\n\t\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t\t$stmt->bindParam(1,$codcaja);\n\t\t\t\t$codcaja = base64_decode($_GET[\"codcaja\"]);\n\t\t\t\t$stmt->execute();\n\n\t\t\t\theader(\"Location: cajas?mesage=1\");\n\t\t\t\texit;\n\n\t\t\t}else {\n\n\t\t\t\theader(\"Location: cajas?mesage=2\");\n\t\t\t\texit;\n\t\t\t}\n\n\t\t}", "public function eliminar($id)\n {\n }", "public function eliminar($id)\n {\n }", "public function eliminar($id)\n {\n }", "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 }", "public static function eliminarServicio($id_servicio){\n \n $eliminar = Neo4Play::client()->getNode($id_servicio);\t\t\n $eliminar->delete();\t\n \n\t}", "public function excluir(){\n\t\tglobal $tabela_links;\n\t\t$consulta = new conexao();\n\t\t$endereco = $consulta->sanitizaString($this->end_link);\n\t\t$funcionalidade_tipo = (int) $this->funcionalidade_tipo;\n\t\t$funcionalidade_id = (int) $this->funcionalidade_id;\n\t\t//echo(\"$endereco\t $funcionalidade_tipo\t$funcionalidade_id\");\n\t\t$consulta->connect();\n\t\t$consulta->solicitar(\"DELETE FROM $tabela_links \n\t\t\t\t\t\t\t\tWHERE endereco = '$endereco'\n\t\t\t\t\t\t\t\tAND funcionalidade_tipo\t= '$funcionalidade_tipo'\n\t\t\t\t\t\t\t\tAND funcionalidade_id\t= '$funcionalidade_id'\");\n\t\t\n\t\n\t}", "public function eliminar()\n\t{\n\t\t$idestado = $_POST['idestado'];\n\t\t//en viamos por parametro el id del estado a eliminar\n\t\tEstado::delete($idestado);\n\t}", "public function eliminarProducto($codigo){\r\n //Preparamos la conexion a la bdd:\r\n $pdo=Database::connect();\r\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n $sql=\"delete from producto where codigo=?\";\r\n $consulta=$pdo->prepare($sql);\r\n //Ejecutamos la sentencia incluyendo a los parametros:\r\n $consulta->execute(array($codigo));\r\n Database::disconnect();\r\n }", "protected\n function eliminar($id)\n {\n }", "public function eliminar($id)\n {\n //\n }", "public function eliminar($id)\n {\n //\n }", "function eliminarHerrajeaccesorio(){\n\t\t$this->procedimiento='snx.ft_herrajeaccesorio_ime';\n\t\t$this->transaccion='SNX_HAC_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_herrajeaccesorio','id_herrajeaccesorio','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }", "function deletePreDetalle2()\n {\n $sql='DELETE FROM predetalle WHERE idPreDetalle = ?';\n $params=array($this->idPre);\n return Database::executeRow($sql, $params);\n }", "public function eliminac($id)\n {\n clientes::find($id)->delete();\n $titulo = \"Desactivar cliente\";\n $mensaje1 = \"El cliente a sido desactivado correctamente\";\n return view ('cliente.mensaje1')\n ->with('titulo',$titulo)\n ->with('mensaje1',$mensaje1);\n \n }", "protected function eliminar_cliente_modelo ($codigo){\n\t\t$query=mainModel::conectar()->prepare(\"DELETE FROM cliente WHERE CuentaCodigo =:Codigo\");\n\t\t$query->bindParam(\":Codigo\",$codigo);\n\t\t$query->execute();\n\t\treturn $query;\n\t}", "public function delete($proveedor);", "function excluirPessoa(){\r\n $banco = conectarBanco();\r\n $sql = \"DELETE FROM pessoa WHERE id = '{$_POST[\"id\"]}'\";\r\n $banco->query($sql); // Passa a query fornecida em $sql para o banco de dados\r\n $banco->close(); // Fecha o banco de dados\r\n voltarMenu(); // Volta para a pagina inicial da agenda\r\n}", "public function eliminarAction()\n {\n $id = (int) $this->getRequest()->getParam(\"id\",0);\n //passo page per quedarnos a la pàgina d'on venim\n $page = (int) $this->getRequest()->getParam(\"page\",0);\n //passo d'on bé per redireccionar després\n $controller = $this->getRequest()->getparam(\"c\",0);\n \n $this->_galeriaDoctrineDao->eliminar($id);\n \n if($controller ==='index'){\n \n $this->_redirect('/admin/index/index/a/2');\n }else{\n $this->_redirect('/admin/galeria/listado/page/'.$page.'/a/1');\n }\n }" ]
[ "0.7065953", "0.6748302", "0.67217517", "0.6690003", "0.6649191", "0.6579007", "0.65606564", "0.65549356", "0.6548986", "0.6543675", "0.65331125", "0.65161234", "0.65058947", "0.6495071", "0.6491683", "0.6472106", "0.6452594", "0.64426535", "0.63995934", "0.63963586", "0.63959616", "0.63931465", "0.6382837", "0.63810027", "0.63802606", "0.6373373", "0.63711345", "0.6334063", "0.63242775", "0.63224566", "0.6316923", "0.63139385", "0.63045025", "0.6300542", "0.62888914", "0.6280478", "0.62719136", "0.62499875", "0.62423456", "0.62367296", "0.6235012", "0.62327904", "0.623049", "0.62277913", "0.6214808", "0.6208377", "0.62046987", "0.6203865", "0.6201903", "0.6197775", "0.6195221", "0.6189197", "0.61817974", "0.6166384", "0.61627537", "0.6161785", "0.6147497", "0.61403966", "0.61275715", "0.6122982", "0.6119322", "0.61164415", "0.61162823", "0.61137164", "0.61098796", "0.6107056", "0.6105647", "0.6091928", "0.6091817", "0.608984", "0.6084462", "0.6075242", "0.6073629", "0.6072479", "0.6066033", "0.6044148", "0.60401523", "0.6033583", "0.60266775", "0.60253966", "0.6016174", "0.6005625", "0.6003081", "0.6003081", "0.6003081", "0.6003052", "0.60017204", "0.60014904", "0.6000867", "0.5995253", "0.5994185", "0.59927785", "0.59927785", "0.5992054", "0.5985537", "0.5982543", "0.5981624", "0.59783477", "0.5978326", "0.5974215", "0.59724176" ]
0.0
-1
Agrega linea al RUTERO
function AgregalineaARutero($ItemCode,$codbarras,$ItemName,$existencia,$lotes,$Unidad,$precio,$PrchseItem,$SellItem,$InvntItem,$AvgPrice,$Price,$frozenFor,$SalUnitMsr,$VATLiable,$lote,$U_Grupo,$SalPackUn,$FAMILIA,$CATEGORIA,$MARCA,$CardCode,$Disponible,$U_Gramaje, $DETALLE_1,$LISTA_A_DETALLE,$LISTA_A_SUPERMERCADO,$LISTA_A_MAYORISTA,$LISTA_A_2_MAYORISTA,$PANALERA,$SUPERMERCADOS,$MAYORISTAS,$HUELLAS_DORADAS,$ALSER,$COSTO,$PRECIO_SUGERIDO,$PuntosWeb,$Ranking,$CodCliente) { if( $this->VerificaExisteEnRutero($CodCliente,$ItemCode)==0) { if($this->con->conectar()==true){ try{ mysql_query("INSERT INTO `RUTEROS`(`ItemCode`, `codbarras`, `ItemName`, `existencia`, `lotes`, `Unidad`, `precio`, `PrchseItem`, `SellItem`, `InvntItem`, `AvgPrice`, `Price`, `frozenFor`, `SalUnitMsr`, `VATLiable`, `lote`, `U_Grupo`, `SalPackUn`, `FAMILIA`, `CATEGORIA`, `MARCA`, `CardCode`, `Disponible`, `U_Gramaje`, `DETALLE 1`, `LISTA A DETALLE`, `LISTA A SUPERMERCADO`, `LISTA A MAYORISTA`, `LISTA A + 2% MAYORISTA`, `PANALERA`, `SUPERMERCADOS`, `MAYORISTAS`, `HUELLAS DORADAS`, `ALSER`, `COSTO`, `PRECIO SUGERIDO`, `PuntosWeb`, `Ranking`, `CodCliente`) VALUES ('".$ItemCode."','".$codbarras."','".$ItemName."','".$existencia."','".$lotes."','".$Unidad."','".$precio."','".$PrchseItem."','".$SellItem."','".$InvntItem."','".$AvgPrice."','".$Price."','".$frozenFor."','".$SalUnitMsr."','".$VATLiable."','".$lote."','".$U_Grupo."','".$SalPackUn."','".$FAMILIA."','".$CATEGORIA."','".$MARCA."','".$CardCode."','".$Disponible."','".$U_Gramaje."','".$DETALLE_1."','".$LISTA_A_DETALLE."','".$LISTA_A_SUPERMERCADO."','".$LISTA_A_MAYORISTA."','".$LISTA_A_2_MAYORISTA."','".$PANALERA."','".$SUPERMERCADOS."','".$MAYORISTAS."','".$HUELLAS_DORADAS."','".$ALSER."','".$COSTO."','".$PRECIO_SUGERIDO."','".$PuntosWeb."','".$Ranking."','".$CodCliente."')"); //return "Agrego linea a rutero"; } catch(Exception $e){ return "Error al linea a rutero" & $e;} }else return "no conecto EN"; }else return "ya existe EN RUTERO"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newLine()\n {\n\n $stock = $this->getStock();\n $randomIndexStock = mt_rand(0, (count($stock)-1));\n $this->line = array_values(array_slice($stock, $randomIndexStock, 1, true));\n unset($stock[$randomIndexStock]);\n $this->stock = array_values($stock);\n }", "private function borraLineas() {\n $ok = true;\n\n $linea = new FemitidasLineas();\n $rows = $linea->cargaCondicion(\"IDLinea\", \"IDFactura='{$this->IDFactura}'\");\n unset($linea);\n foreach ($rows as $lineaFactura) {\n $lineaFactura = new FemitidasLineas($lineaFactura['IDLinea']);\n // Cambia estado linea albaran\n $lineaAlbaran = $lineaFactura->getIDLineaAlbaran();\n $lineaAlbaran->setIDEstado(2);\n $lineaAlbaran->save();\n // Borrar linea factura\n $lineaFactura->erase();\n }\n return $ok;\n }", "public function newLine() {\n\t\t$this->_section=0;\n\t\t$this->_lineNumber++;\n\t\t$this->_text[$this->_lineNumber]=array();\n\t\t$this->_text[$this->_lineNumber][0]['text']='';\n\t\t$this->_text[$this->_lineNumber][0]['encoding']='';\n\t\t$this->_text[$this->_lineNumber][0]['font']=$this->_font;\n\t\t$this->_text[$this->_lineNumber][0]['fontSize']=$this->_fontSize;\n\t\t$this->_text[$this->_lineNumber][0]['width']=0;\n\n\t\t\n\t\t$this->_initializeLine();\n\t\t\n\t\t$this->_text[$this->_lineNumber]['alignment']=$this->_text[$this->_lineNumber-1]['alignment'];\n\t\t//add the last cell's height to the auto height if we have an auto-height box.\n\t\tif ($this->isAutoHeight()) {\n\t\t\t$this->_autoHeight+=$this->_text[$this->_lineNumber-1]['height'];\n\t\t}\n\t}", "public function linea_colectivo();", "public function getLinea()\n {\n return $this->linea;\n }", "function graficoLinha() {\n $maxValue = $this->desenhaBase();\n\n $labelY = $this->margem;\n $idx = 0;\n foreach ($this->vetor as $label => $item) {\n $idx++;\n $color = $this->getColor($idx);\n $this->desenhaLinha($item, $color, $maxValue);\n $this->desenhaLabel($label, $color, $labelY);\n $labelY += ($this->margem * 2);\n }\n }", "private function traceLine() {\n $this->lineJump();\n $this->currentPage->rectangle(self::HMARGIN + $this->hOffset, $this->PAGE_HEIGHT - self::VMARGIN - $this->vOffset, $this->PAGE_WIDTH - 2*$this->hOffset - 2*self::HMARGIN, 1);\n $this->currentPage->stroke();\n }", "public function lerArquivoLog(){\n $ponteiro = fopen(\"C:\\\\temp\\\\teste2.txt\", \"r\");\n\n //Abre o aruqivo .txt\n while(!feof($ponteiro)) {\n $linha = fgets($ponteiro, 4096);\n //Imprime na tela o resultado\n $this->pulaLinha();\n }\n //Fecha o arquivo\n fclose($ponteiro);\n }", "protected function new_line()\n {\n }", "function loadLine($a_row)\n\t{\n\t}", "public function testLineaLectivo() {\n $linea= 420;\n $tiempo = new TiempoFalso();\n $tarjeta = new Tarjeta( $tiempo );\n $colectivo = new Colectivo($linea, NULL, NULL);\n $boleto = new Boleto(NULL, NULL, $tarjeta, NULL, $colectivo ->linea(), NULL, NULL, NULL, NULL);\n\n $this->assertEquals($boleto->obtenerLineadelcolectivo(), $linea);\n }", "protected function get_lines()\n {\n }", "public function getLinha();", "function getMontoLineaDeCredito(){\n\t\t$rlinea = 0;\n\n\t\t$sql \t\t= \"SELECT monto_linea FROM creditos_lineas\n\t\t\t\t\tWHERE numero_socio=\" . $this->mCodigo . \" AND estado=1\";\n\t\t$mlinea \t= mifila($sql, \"monto_linea\");\n\t\t$DCreds\t\t= $this->getTotalColocacionActual();\n\t\t$sdoscreds \t= $DCreds[\"saldo\"];\n\t\t$rlinea\t\t= $mlinea - $sdoscreds;\n\t\treturn $rlinea;\n\t}", "function getLine(){\n return $this->line;\n }", "public function setLine($line);", "public function getLineA();", "function consultarLinea(){\n\t\t\n\t\t$this->mysqli = conectarBD();\n\t\t\n\t\t$sql = \"SELECT Linea_Factura.Id_Linea_Factura,Linea_Factura.Id_Factura,Servicio.Nombre,Linea_Factura.Importe,Linea_Factura.Descripcion FROM Linea_Factura INNER JOIN Servicio WHERE Linea_Factura.Id_Linea_Factura='\".$this->linea.\"' AND Linea_Factura.Id_Servicio=Servicio.Id_Servicio AND Linea_Factura.Borrado='0';\";\n\t\t$resultado = $this->mysqli->query($sql);\t\n\t\tif ($resultado->num_rows == 1){\n\t\t\t$row = $resultado->fetch_array();\n\t\t\treturn $row;\n\t\t}\n\t}", "public function actionAgregarlinea(){\n $linea = new PedidoLinea;\n $linea->attributes = $_POST['PedidoLinea'];\n $ruta = Yii::app()->request->baseUrl.'/images/cargando.gif'; \n \n if($linea->validate()){\n echo '<div id=\"alert\" class=\"alert alert-success\" data-dismiss=\"modal\">\n <h2 align=\"center\">Operacion Satisfactoria</h2>\n </div>\n <span id=\"form-cargado\" style=\"display:none\">';\n $this->renderPartial('form_lineas', \n array(\n 'linea'=>$linea,\n 'ruta'=>$ruta,\n 'Pactualiza'=>isset($_POST['ACTUALIZA']) ? $_POST['ACTUALIZA'] : 0,\n )\n );\n echo '</span>\n \n <div id=\"boton-cargado\" class=\"modal-footer\">';\n $this->widget('bootstrap.widgets.TbButton', array(\n 'buttonType'=>'button',\n 'type'=>'normal',\n 'label'=>'Aceptar',\n 'icon'=>'ok',\n 'htmlOptions'=>array('id'=>'nuevo','onclick'=>'agregar(\"'.$_POST['SPAN'].'\")')\n ));\n echo '</div>';\n Yii::app()->end();\n }else{\n $this->renderPartial('form_lineas', \n array(\n 'linea'=>$linea,\n 'ruta'=>$ruta, \n )\n );\n Yii::app()->end();\n }\n }", "public function recalcula() {\n\n //Si el cliente no está sujeto a iva\n //pongo el iva a cero en las líneas para evitar que por cambio\n //de cliente se aplique indebidamente\n $cliente = new Clientes($this->IDCliente);\n if ($cliente->getIva()->getIDTipo() == '0') {\n $lineas = new FemitidasLineas();\n $lineas->queryUpdate(array(\"Iva\" => 0, \"Recargo\" => 0), \"`IDFactura`= '{$this->IDFactura}'\");\n unset($lineas);\n }\n //Si el cliente no está sujeto a recargo de equivalencia\n //lo pongo a cero en las líneas para evitar que por cambio\n //de cliente se aplique indebidamente\n elseif ($cliente->getRecargoEqu()->getIDTipo() == '0') {\n $lineas = new FemitidasLineas();\n $lineas->queryUpdate(array(\"Recargo\" => 0), \"`IDFactura`= '{$this->IDFactura}'\");\n unset($lineas);\n }\n unset($cliente);\n\n //SI TIENE DESCUENTO, CALCULO EL PORCENTAJE QUE SUPONE RESPECTO AL IMPORTE BRUTO\n //PARA REPERCUTUIRLO PORCENTUALMENTE A CADA BASE\n $pordcto = 0;\n if ($this->getDescuento() != 0)\n $pordcto = round(100 * ($this->getDescuento() / $this->getImporte()), 2);\n\n //Calcular los totales, desglosados por tipo de iva.\n $this->conecta();\n if (is_resource($this->_dbLink)) {\n $lineas = new FemitidasLineas();\n $tableLineas = \"{$lineas->getDataBaseName()}.{$lineas->getTableName()}\";\n $articulos = new Articulos();\n $tableArticulos = \"{$articulos->getDataBaseName()}.{$articulos->getTableName()}\";\n unset($lineas);\n unset($articulos);\n\n $query = \"select sum(Importe) as Bruto,sum(ImporteCosto) as Costo from {$tableLineas} where (IDFactura='\" . $this->getIDFactura() . \"')\";\n $this->_em->query($query);\n $rows = $this->_em->fetchResult();\n $bruto = $rows[0]['Bruto'];\n\n $query = \"select Iva,Recargo, sum(Importe) as Importe from {$tableLineas} where (IDFactura='\" . $this->getIDFactura() . \"') group by Iva,Recargo order by Iva\";\n $this->_em->query($query);\n $rows = $this->_em->fetchResult();\n $totbases = 0;\n $totiva = 0;\n $totrec = 0;\n $bases = array();\n\n foreach ($rows as $key => $row) {\n $importe = $row['Importe'] * (1 - $pordcto / 100);\n $cuotaiva = round($importe * $row['Iva'] / 100, 2);\n $cuotarecargo = round($importe * $row['Recargo'] / 100, 2);\n $totbases += $importe;\n $totiva += $cuotaiva;\n $totrec += $cuotarecargo;\n\n $bases[$key] = array(\n 'b' => $importe,\n 'i' => $row['Iva'],\n 'ci' => $cuotaiva,\n 'r' => $row['Recargo'],\n 'cr' => $cuotarecargo\n );\n }\n\n $subtotal = $totbases + $totiva + $totrec;\n\n // Calcular el recargo financiero según la forma de pago\n $formaPago = new FormasPago($this->IDFP);\n $recFinanciero = $formaPago->getRecargoFinanciero();\n $cuotaRecFinanciero = $subtotal * $recFinanciero / 100;\n unset($formaPago);\n\n $total = $subtotal + $cuotaRecFinanciero;\n\n //Calcular el peso, volumen y n. de bultos de los productos inventariables\n switch ($_SESSION['ver']) {\n case '0': //Estandar\n $columna = \"Unidades\";\n break;\n case '1': //Cristal\n $columna = \"MtsAl\";\n break;\n }\n $em = new EntityManager($this->getConectionName());\n $query = \"select sum(a.Peso*l.{$columna}) as Peso,\n sum(aVolumen*l.{$columna}) as Volumen,\n sum(Unidades) as Bultos \n from {$tableArticulos} as a,{$tableLineas} as l\n where (l.IDArticulo=a.IDArticulo)\n and (a.Inventario='1')\n and (l.IDFactura='{$this->IDFactura}')\";\n $em->query($query);\n $rows = $em->fetchResult();\n $em->desConecta();\n\n $this->setImporte($bruto);\n $this->setBaseImponible1($bases[0]['b']);\n $this->setIva1($bases[0]['i']);\n $this->setCuotaIva1($bases[0]['ci']);\n $this->setRecargo1($bases[0]['r']);\n $this->setCuotaRecargo1($bases[0]['cr']);\n $this->setBaseImponible2($bases[1]['b']);\n $this->setIva2($bases[1]['i']);\n $this->setCuotaIva2($bases[1]['ci']);\n $this->setRecargo2($bases[1]['r']);\n $this->setCuotaRecargo2($bases[1]['cr']);\n $this->setBaseImponible3($bases[2]['b']);\n $this->setIva3($bases[2]['i']);\n $this->setCuotaIva3($bases[2]['ci']);\n $this->setRecargo3($bases[2]['r']);\n $this->setCuotaRecargo3($bases[2]['cr']);\n $this->setTotalBases($totbases);\n $this->setTotalIva($totiva);\n $this->setTotalRecargo($totrec);\n $this->setRecargoFinanciero($recFinanciero);\n $this->setCuotaRecargoFinanciero($cuotaRecFinanciero);\n $this->setTotal($total);\n $this->setPeso($rows[0]['Peso']);\n $this->setVolumen($rows[0]['Volumen']);\n $this->setBultos($rows[0]['Bultos']);\n\n $this->save();\n }\n }", "private function add_new_line() {\n\n\t\t$this->fields[] = array( 'newline' => true );\n\n\t}", "protected function lineToPdf(): void\n {\n $this->pdf->SetDrawColor($this->color['r'], $this->color['g'], $this->color['b']);\n $this->Line($this->x1, $this->y1, $this->x2, $this->y2);\n }", "function Header(){\n\t\t$linha = 5;\n\t\t// define o X e Y na pagina\n\t\t$this->SetXY(10,10);\n\t\t// cria um retangulo que comeca na coordenada X,Y e\n\t\t// tem 190 de largura e 265 de altura, sendo neste caso,\n\t\t// a borda da pagina\n\t\t$this->Rect(10,10,190,265);\n\t\t\n\t\t// define a fonte a ser utilizada\n\t\t$this->SetFont('Arial', 'B', 8);\n\t\t$this->SetXY(11,11);\n\t\t\n\t\t// imprime uma celula com bordas opcionais, cor de fundo e texto.\n\t\t$agora = date(\"G:i:s\");\n\t\t$hoje = date(\"d/m/Y\");\n\t\t$this->Cell(10,$linha,$agora,0,0,'C');\n\t\t$this->Cell(150,$linha,'..:: Fatec Bauru - Relatorio de Cursos da Fatec ::..',0,0,'C');\n\t\t$this->Cell(30,$linha,$hoje,0,0,'C');\n\t\t\n\t\t// quebra de linha\n\t\t$this->ln();\n\t\t$this->SetFillColor(232,232,232);\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->SetFont('Arial', 'B', 8);\n\n\t\t$this->Cell(10,4,'ID','LTR',0,'C',1);\n\t\t$this->Cell(140,4,'Nome do Curso','LTR',0,'C',1);\n\t\t$this->Cell(40,4,'Periodo','LTR',0,'C',1);\n\t}", "function addLines2Caddie($lines){\n $caddie = $this->getCaddie();\n $caddie['lines'] = array_merge($caddie['lines'], $lines);\n $this->consolidateCaddie($caddie);\n }", "function loadLine($a_row)\n\t{\n\t\t$this->lineID=$a_row['LineID'];\n\t\t$this->sheetID=$a_row['SheetID'];\n\t\t$this->text=$a_row['Text'];\n\t}", "function Header() //Encabezado\r\n {\r\n $this->SetFont('Arial','B',9);\r\n \r\n \r\n $this->Line(10,10,206,10);\r\n $this->Line(10,35.5,206,35.5);\r\n \r\n // $this->Cell(30,25,'',0,0,'C',$this->Image('imagenes/logo_publistika.jpg', 152,12, 19));\r\n $this->Cell(111,25,'',0,0,'C', $this->Image('imagenes/logo_publistika.jpg',70,12,80));\r\n //$this->Cell(40,25,'',0,0,'C',$this->Image('images/logoDerecha.png', 175, 12, 19));\r\n \r\n //Se da un salto de línea de 25\r\n $this->Ln(25);\r\n }", "public function clearLine();", "public function save_Linea()\n {\n //con un campo AUTO_INCREMENT, podemos obtener \n //el ID del último registro insertado / actualizado inmediatamente. \"\n\n\n $sql = \"SELECT LAST_INSERT_ID() AS 'pedido'\";\n $query = $this->db->query($sql);\n $pedidoId = $query->fetch_object()->pedido;\n\n\n $carritoData = $_SESSION['carrito'];\n\n foreach ($carritoData as $valor) {\n $item = $valor['producto'];\n\n $insert = \"INSERT INTO lineaspedidos VALUES (NULL,\n {$pedidoId},\n {$item->id},\n {$valor['unidades']})\";\n\n $producto = $this->db->query($insert);\n\n $result = false;\n }\n if ($producto) {\n $result = true;\n }\n return $result;\n }", "function Header() {\n $this->AddFont('Gotham-M','B','gotham-medium.php'); \n //seteamos el titulo que aparecera en el navegador \n $this->SetTitle(utf8_decode('Toma de Protesta Candidato PVEM'));\n\n //linea que simplemente me marca la mitad de la hoja como referencia\n \t$this->Line(139.5,$this->getY(),140,250);\n\n \t//bajamos la cabecera 13 espacios\n $this->Ln(10);\n //seteamos la fuente, el color de texto, y el color de fondo de el titulo\n $this->SetFont('Gotham-M','B',11);\n $this->SetTextColor(255,255,255);\n $this->SetFillColor(73, 168, 63);\n //escribimos titulo\n $this->Cell(0,5,utf8_decode('Toma de Protesta Candidato PVEM'),0,0,'C',1); //el completo es 279 bueno 280 /2 = 140 si seran 10 de cada borde, entonces 120\n\n $this->Ln();\n }", "private function _initializeLine() {\n\t\t$this->_text[$this->_lineNumber]['x']=0;\n\t\t$this->_text[$this->_lineNumber]['width']=0;\n\t\t$this->_text[$this->_lineNumber]['height']=0;\n\t\t$this->_text[$this->_lineNumber]['alignment']=null;\n\t}", "public function reducirSaldo($valor, $linea, $bandera);", "public function addLine($quantity, $productName, $price, $type, $duty)\n {\n $line = new Line($quantity, $productName, $price, $type, $duty);\n $this->lines[] = $line;\n\n //in contemporanea aggiungo progressivamente il netto, le tasse e il totale \n $this->net = $this->addNet($line->getNet());\n $this->addTaxes($line->getTaxes());\n $this->addTotal($line->getTotal());\n \n //Ritorna la linea che mi servirà per la stampa\n return $line;\n }", "private function appendLineToRewrites($line){\n\t\t$this->rewrites .= \"\\n\" . $line;\n\t}", "public function checkTrasbordo($linea, $bandera);", "protected function _getLines() {}", "public static function lineBreakCorrectlyTransformedOnWayToRteProvider() {}", "public function Header(){\n\t\t$this->lineFeed(10);\n\t}", "function RellenarIndice()\r\n {\r\n $this->AddPage();\r\n\r\n $this->Imprimir('2. Revisión y Análisis de las siguientes interrupciones:', 20, 10);\r\n\r\n $cont_causa500 = 1;\r\n $cont_imp = 1;\r\n $cont_pro = 1;\r\n\r\n foreach ($this->eventos as $evento)\r\n {\r\n if (Doctrine_Core::getTable('SAF_EVENTO_CONVOCATORIA')->getEventoConvocatoria($evento, $this->convocatoria)->getStatus() == 'analizado')\r\n {\r\n $this->ImprimirSubtituloIndice($evento, $cont_causa500, $cont_imp, $cont_pro);\r\n\r\n $fecha_evento = strftime(\"%A, %d/%m/%Y\", strtotime($evento->getFHoraIni()));\r\n $text = \"RI. \" . $evento->getCEventoD() . \" - Circuito \" . $evento->getCircuito() . \". \" . $fecha_evento . '. MVAmin: ' . $evento->getMvaMin();\r\n $this->Imprimir($text, 40, 10);\r\n }\r\n }\r\n }", "public function importacionLinea($tipo) {\n //echo \"llego2\";\n $codLin = '02';\n $tipConsult = $tipo;\n $dtActFecha = date(\"Y-m\", strtotime(date()));//'2019-02';//\n //$dtAntFecha = date(\"Y-m\", strtotime(date()));//restarle 1 mes//'2019-01';//\n\t$dtAntFecha = date(\"Y-m\", strtotime('-1 month', strtotime(date())));//Se resta 1 mes.\n //Generar Manualmente\n //$dtActFecha ='2019-04';\n //$dtAntFecha ='2019-03';\n \n \n try {\n $obj_con = new cls_Base();\n $obj_var = new cls_Global();\n $con = $obj_con->conexionServidor();\n //$rawDataANT = array();\n $rawDataACT = array();\n \n $sql = \"SELECT A.COD_LIN, A.COD_TIP, A.COD_MAR, D.NOM_LIN, E.NOM_TIP, F.NOM_MAR,\"\n . \"SUM(A.P_PROME*B.EXI_TOT) AS COS_ACT, \";\n $sql .= \"IFNULL((SELECT X.COSTO_T FROM \" . $obj_con->BdServidor . \".IG0007 X \"\n . \" WHERE X.COD_LIN=A.COD_LIN AND X.COD_MAR=A.COD_MAR AND TIP_CON='$tipConsult' \"\n . \" AND ANO_MES='$dtAntFecha'),0) COS_ANT \"; \n $sql .= \" FROM \" . $obj_con->BdServidor . \".IG0020 A \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0022 B ON A.COD_ART=B.COD_ART \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0001 D ON A.COD_LIN=D.COD_LIN \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0002 E ON A.COD_TIP=E.COD_TIP \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0003 F ON A.COD_MAR=F.COD_MAR \";\n $sql .= \" WHERE B.EXI_TOT <> 0 \"; \n $sql .=($codLin!='')?\" AND A.COD_LIN='$codLin' \":\"\";\n $sql .=($tipConsult!='TD')?\" AND A.COD_TIP='$tipConsult' \":\"\";\n $sql .=\" GROUP BY A.COD_LIN,A.COD_MAR ORDER BY COD_LIN,COD_MAR \";\n $sentencia = $con->query($sql);\n if ($sentencia->num_rows > 0) {\n while ($fila = $sentencia->fetch_assoc()) {//Array Asociativo\n $rawDataACT[] = $fila;\n }\n }\n //cls_Global::putMessageLogFile($sql);\n for ($i = 0; $i < sizeof($rawDataACT); $i++) {\n \n $sql=\"INSERT INTO \" . $obj_con->BdServidor . \".IG0007 \n (COD_LIN,COD_TIP,COD_MAR,NOM_MAR,COST_ANT,COST_ACT,COSTO_T,FEC_SIS,TIP_CON,ANO_MES)VALUES \n ('\" . $rawDataACT[$i]['COD_LIN'] . \"',\n '\" . $rawDataACT[$i]['COD_TIP'] . \"',\n '\" . $rawDataACT[$i]['COD_MAR'] . \"',\n '\" . $rawDataACT[$i]['NOM_MAR'] . \"',\n '\" . $rawDataACT[$i]['COS_ANT'] . \"',\n '\" . $rawDataACT[$i]['COS_ACT'] . \"',\n '\" . $rawDataACT[$i]['COS_ACT'] . \"',\n '\" . $dtActFecha . \"-01',\n '\" . $tipConsult . \"',\n '\" . $dtActFecha . \"')\";\n //cls_Global::putMessageLogFile($rawDataACT[$i]['COS_ACT']);\n //cls_Global::putMessageLogFile($sql);\n $command = $con->prepare($sql); \n $command->execute();\n \n \n } \n\n $con->commit();\n $con->close();\n return true;\n } catch (Exception $e) { // se arroja una excepción si una consulta falla\n //return VSexception::messageSystem('NO_OK', $e->getMessage(), 41, null, null);\n $con->rollback();\n $con->close();\n throw $e;\n return false;\n }\n }", "function esprLineeID($con) {\n $result = mysqli_query($con,\"SELECT line_id, line_nome FROM esposizioni_prodotti JOIN linee ON linee.line_nome = esposizioni_prodotti.espr_line\");\n while($row= mysqli_fetch_array($result)) {\n $line_id = $row['line_id'];\n $line_nome = $row['line_nome'];\n $sql=\"UPDATE esposizioni_prodotti SET espr_line_id='$line_id' WHERE espr_line = '$line_nome'\";\n mysqli_query($con,$sql);\n }\n}", "public function getLine();", "public function getLine();", "public function getLine();", "public function getLine();", "private function _agrergarLineaPractica($ln_titulo, $ln_desc,$id_facultad,$id_programa, $id_usu_cp,$id_conf_linea,$id_linea = NULL,$id_empre = null) {\n // consultar la linea de practica del coordiandor\n /*$_objUsuarios = new cprogresa\\DAO_Usuarios();\n $_objUsuarios->set_id_usu_cp($id_usu_cp);\n $_objUsuarios->consultar();\n */\n //print_r($_POST);die();\n $_objLP = new DAO_LineasPractica();\n if (!empty($id_linea)) {\n $_objLP->set_id_linea($id_linea);\n }\n if (!empty($id_empre)) {\n $_objLP->set_id_emp($id_empre);\n }\n $_objLP->set_id_usu_cp($id_usu_cp);\n $_objLP->set_ln_titulo($ln_titulo);\n $_objLP->set_ln_desc($ln_desc);\n $_objLP->set_id_conf_linea($id_conf_linea);\n $_objLP->set_id_facultad(is_array($id_facultad) ? implode(\",\",$id_facultad) : $id_facultad);\n $_objLP->set_id_programa(is_array($id_programa) ? implode(\",\",$id_programa) : $id_programa );\n if (!$_objLP->guardar()) {\n $this->_mensaje = $_objLP->getMysqlError();\n throw new ControllerException(\"No se pudo crear una línea de practica. \", 0);\n }\n\n // almacenar configuracion generada por el admin de linea\n $this->_guardarLog($_SESSION['id_usu_cent'], ['accion' => 'agregar seguimiento', 'metodo' => get_class() . ':_agregarConfiguracionLineaPractica', 'parametros' => ['ln_titulo'=>$ln_titulo,'ln_desc'=>$ln_desc,'id_facultad'=>$id_facultad,'id_programa'=>$id_programa,'id_usu_cp'=>$id_usu_cp,'id_linea'=>$id_linea,'id_empre'=>$id_empre]]);\n $this->_ok = 1;\n $this->_mensaje = \"Se ha agregado una linea exitosamente\";\n return $_objLP->getArray();\n }", "function Header(){\r\n\t\t//Aqui va el encabezado\r\n\t\tif ($this->iSector==98){\r\n\t\t\tp_FuenteGrandeV2($this,'B');\r\n\t\t\t$this->Cell($this->iAnchoLibre,5,utf8_decode('Información de depuración'), 0, 0, 'C');\r\n\t\t\t$this->Ln();\r\n\t\t\treturn;\r\n\t\t\t}\r\n\t\t$iConFondo=0;\r\n\t\tif ($this->sFondo!=''){\r\n\t\t\tif (file_exists($this->sFondo)){\r\n\t\t\t\t$this->Image($this->sFondo, 0, 0, $this->iAnchoFondo);\r\n\t\t\t\t$iConFondo=1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t$yPos=$this->GetY();\r\n\t\tif ($yPos<$this->iBordeEncabezado){\r\n\t\t\t$this->SetY($this->iBordeEncabezado);\r\n\t\t\t}\r\n\t\tif ($iConFondo==0){\r\n\t\t\tp_TituloEntidad($this, false);\r\n\t\t\t}else{\r\n\t\t\tp_FuenteGrandeV2($this,'B');\r\n\t\t\t}\r\n\t\tif ($this->iReporte==1902){\r\n\t\t\t//Ubique aqui los componentes adicionales del encabezado\r\n\t\t\t$this->Cell($this->iAnchoLibre,5,'Eventos '.$this->sRefRpt, 0, 0, 'C');\r\n\t\t\t$this->Ln();\r\n\t\t\t}\r\n\t\t$yPos=$this->GetY();\r\n\t\tif ($yPos<$this->iBordeSuperior){\r\n\t\t\t$this->SetY($this->iBordeSuperior);\r\n\t\t\t}\r\n\t\t}", "public function lineTo($x, $y) {}", "private function makeLines()\n\t{\n\t\t$line = 1;\n\t\t/** @var Token $token */\n\t\tforeach ($this->tokens as $token)\n\t\t{\n\t\t\t$token->line = $line;\n\t\t\tif (preg_match_all(\"/\\\\n/\", $token->text, $m))\n\t\t\t{\n\t\t\t\t$line += count($m[0]);\n\t\t\t}\n\t\t}\n\t}", "public function verAtrilEnPizarra( ) {\n $this->setComando(self::$PIZARRA_DIGITAL, \"ATRIL\");\n\n }", "public function textLine($value)\n {\n }", "public function transferencia($row){\n\n // Data de Saida\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Data Saída: \"), 'LTB', 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->data_saida), 'TBR', 0, '');\n // Origem\n $this->SetFont('Times','B',10);\n $this->Cell(20, 6, utf8_decode(\"Origem: \"), 'LTB', 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(40, 6, utf8_decode($row->origem_nome), 'TBR', 0, '');\n\n $this->Ln();\n\n // Data de Entrada\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Data Entrada: \"), 'LTB', 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->data_saida), 'TBR', 0, '');\n // Destino\n $this->SetFont('Times','B',10);\n $this->Cell(20, 6, utf8_decode(\"Destino: \"), 'LTB', 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(40, 6, utf8_decode($row->destino_nome), 'TBR', 0, '');\n\n $this->Ln(10);\n\n\n // Status\n $this->SetFont('Times','B',10);\n $this->Cell(20, 6, utf8_decode(\"Status: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(30, 6, utf8_decode($row->status_nome), 'TBR', 0, '');\n\n // Peso Total\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Peso Total: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->saida_peso_total), 'TBR', 0, '');\n\n // Permanencia\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Perm. Média: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->permanencia_media), 'TBR', 0, '');\n\n // Machos\n $this->Ln();\n $this->SetFont('Times','B',10);\n $this->Cell(20, 6, utf8_decode(\"Machos: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(30, 6, utf8_decode($row->machos), 'TBR', 0, '');\n\n // Peso Medio\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Peso Médio: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->saida_peso_medio), 'TBR', 0, '');\n\n // Ganho Dia Medio\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Ganho/Dia: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->ganho_medio_media), 'TBR', 0, '');\n\n // Femeas\n $this->Ln();\n $this->SetFont('Times','B',10);\n $this->Cell(20, 6, utf8_decode(\"Femeas:\"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(30, 6, utf8_decode($row->femeas), 'TBR', 0, '');\n\n // Ganho Total\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Ganho Total: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->ganho_total), 'TBR', 0, '');\n\n // Maior Peso \n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Maior Peso: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->saida_maior_peso), 'TBR', 0, '');\n\n // Total\n $this->Ln();\n $this->SetFont('Times','B',10);\n $this->Cell(20, 6, utf8_decode(\"Total:\"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(30, 6, utf8_decode($row->quantidade), 'TBR', 0, '');\n\n // Ganho Total Medio\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Ganho Médio: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->ganho_total_media), 'TBR', 0, '');\n \n // Menor Peso\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Menor Peso: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->saida_menor_peso), 'TBR', 0, '');\n\n $this->Ln(6);\n }", "private function adicionarLinhaArquivo($aLinha)\n {\n fputs($this->oArquivo, implode('|', (array) $aLinha).\"\\n\");\n }", "function Row($data,$alineacion,$tipo)\n {\n //Calculate the height of the row\n $nb=0;\n for($i=0;$i<count($data);$i++){\n $nb=max($nb,$this->NbLines($this->widths[$i],$data[$i]));\n }\n $h=5*$nb;\n //Emitir un salto de página en primer lugar, si es necesario\n $this->CheckPageBreak($h);\n //Dibuje las celdas de la fila\n for($i=0;$i<count($data);$i++)\n {\n if($tipo == 1){\n if($i == 0){\n $this->SetFont('Arial', 'B');\n }else{\n $this->SetFont('Arial', '');\n }\n }\n\n if($tipo == 2){\n $this->SetFont('Arial', 'B');\n }\n\n if($tipo == 0){\n $this->SetFont('Arial', '');\n }\n $w=$this->widths[$i];\n $a=isset($this->aligns[$i]) ? $this->aligns[$i] :$alineacion[$i];\n //Save the current position\n $x=$this->GetX();\n $y=$this->GetY();\n //Draw the border\n $this->Rect($x,$y,$w,$h);\n //Print the text\n /*if (($i==1) && ($tipo==\"subseries\"))\n $this->SetFont('Arial','B',8);\n else\n $this->SetFont('Arial','',8);*/\n\n $this->MultiCell($w,5,$data[$i],0,$a);\n //Put the position to the right of the cell\n $this->SetXY($x+$w,$y);\n }\n //Go to the next line\n $this->Ln($h);\n }", "public function ln()\n {\n $this->entries[] = '';\n }", "function linebreak() {\n $this->doc .= '<br/>'.DOKU_LF;\n }", "public function moveToStartOfNextLine() {}", "public function moveToStartOfNextLine() {}", "function displayLine($a_dbc, $a_lineCount)\n\t{\n\t\t// lines without an idea are new. Class 'em so the js script knows it\n\t\tif($this->lineID)\n\t\t\techo \"<tr class='existingLine'>\\n\";\n\t\telse\n\t\t\techo \"<tr class='newLine'>\\n\";\n//\t \techo \"<td>{$this->taskID}</td>\\n\";\n\t\techo \"<td>\";\n\t \t$this->taskIDSelectBox($a_dbc, $this->taskID);\n\t\techo \"</td>\\n\";\n\t\techo \"<td class='inTableData'><input class='inSubCon' type='text' maxlength='400' name='fname' value='\" . htmlspecialchars($this->subcontractorBidUsed, ENT_QUOTES) . \"'></td>\\n\";\n\t\techo \"<td><input class='inAmtInput' type='number' name='fname' value='\" . $this->amount . \"'></td>\\n\";\n\t\t//echo \"<td>{$this->generalNotes}<span class='ui-icon ui-icon-info' title='Notes about this task.'></span></td>\\n\";\n\t\techo \"<td class='inTableData'><input class='inSubCon' type='text' maxlength='1000' name='fname' value='\" . htmlspecialchars($this->generalNotes, ENT_QUOTES) . \"'></td>\\n\";\n\t\techo \"</tr>\\n\";\n\t\treturn $this->amount;\n\t}", "function loadLine($a_row)\n\t{\n\t\t$this->lineID=$a_row['LineID'];\n\t\t$this->sheetID= $a_row['SheetID'];\n\t\t$this->taskID= $a_row['TaskID'];\n\t\t$this->amount= $a_row['Amount'];\n\t\t$this->subcontractorBidUsed= $a_row['SubcontractorBidUsed'];\n\t\t$this->generalNotes= $a_row['GeneralNotes'];\n\t}", "function displayLine($a_dbc, $a_lineCount)\n\t{\n\t\tif($this->lineID)\n\t\t\techo \"<textarea>{$this->text}</textarea>\\n\";\n\t\telse\n\t\t \techo \"<textarea class='newLine'>{$this->text}</textarea>\\n\";\n\n\t\treturn null;\n\t}", "function setLineBetweenColumns() {\t \r\n\t \t$this->lineBetweenColumns = true;\t\r\n\t}", "function add_line_return($file_path)\n {\n file_put_contents($file_path, \"\\n\", FILE_APPEND);\n }", "function ChapterBody() {\n //$conn->SQL(\"select * from esquema.almacen_ubicacion\");\n\n\n\n\n //aqui metemos los parametros del contenido\n //$this->SetWidths(array(25,25,30,22,40,20));\n $this->SetWidths(array(10,30,22,22,25,21,23,25,32,20));\n //$this->SetAligns(array(\"C\",\"C\",\"C\",\"C\",\"C\",\"C\"));\n $this->SetAligns(array(\"C\",\"C\",\"C\",\"C\",\"C\",\"C\",\"C\",\"C\",\"C\",\"C\"));\n //$this->SetFillColor(232,232,232,232,232,232);\n $this->SetFillColor(232,232,232,232,232,232,232,232,232,232);\n // $cantidaditems = $this->array_movimiento[0][\"numero_item\"];\n\n $subtotal = 0;\n // for($i=0;$i<$cantidaditems;$i++) {\n // $this->SetLeftMargin(30);\n // $width = 5;\n // $this->SetX(14);\n // $this->SetFont('Arial','',7);\n\n // $this->Row(\n // array( $this->array_movimiento[$i][\"cod_item\"],\n // $this->array_movimiento[$i][\"descripcion1\"],\n // $this->array_movimiento[$i][\"cantidad_item\"]),1);\n\n // }\n $i = 0;\n foreach ($this->array_mercadeo as $key => $value) {\n $i++;\n $this->SetLeftMargin(30);\n $width = 7;\n $this->SetX(14);\n $this->SetFont('Arial','',9);\n $this->Row(\n array(//$value[\"fecha\"],\n $i,\n $value[\"COD\"],\n $value[\"nombre\"],\n //$value[\"precio\"],\n number_format($value[\"costo_unitario\"], 2, ',', ''),\n $value[\"costo_operativo\"],\n //number_format($value[\"costo_operativo\"], 2, ',', ''),\n number_format($value[\"costo_sin_iva\"], 2, ',', ''),\n //$value[\"costo_iva\"],\n number_format($value[\"costo_iva\"], 2, ',', ''),\n //$value[\"precio_sugerido\"],\n number_format($value[\"precio_sugerido\"], 2, ',', ''),\n $value[\"margen_ganancia\"],\n //number_format($value[\"margen_ganancia\"], 2, ',', ''),\n //$value[\"pvp\"]),\n number_format($value[\"pvp\"], 2, ',', '')),\n 1);\n //$this->SetX(14);\n /*if( $value[\"cantidad_item\"] != $value[\"c_esperada\"] && $this->array_mercadeo[0][\"tipo_movimiento_almacen\"]==3){\n $this->Cell(196,5,'Observacion : '.$value[\"observacion_dif\"],1,1,'L');\n }*/\n \n\n }\n\n }", "function loadLine($a_row)\n\t{\n\t\t$this->lineID=$a_row['LineID'];\n\t\t$this->sheetID=$a_row['SheetID'];\n\t\t$this->workDescription=$a_row['WorkDescription'];\n\t\t$this->amount=$a_row['Amount'];\n\t}", "public function setLineJoin($lineJoin = self::LINE_JOIN_MITER) {}", "public function add($line) {\r\n if(is_string($line)) $line .= \"\\n\";\r\n $this->body[]=$line;\r\n }", "function stesLineeID($con) {\n $result = mysqli_query($con,\"SELECT line_id, line_nome FROM settori_esposizioni JOIN linee ON linee.line_nome = settori_esposizioni.stes_line\");\n while($row= mysqli_fetch_array($result)) {\n $line_id = $row['line_id'];\n $line_nome = $row['line_nome'];\n $sql=\"UPDATE settori_esposizioni SET stes_line_id='$line_id' WHERE stes_line = '$line_nome'\";\n mysqli_query($con,$sql);\n }\n}", "function espLineeID($con) {\n $result = mysqli_query($con,\"SELECT line_id, line_nome FROM esposizioni JOIN linee ON linee.line_nome = esposizioni.esp_line\");\n while($row= mysqli_fetch_array($result)) {\n $line_id = $row['line_id'];\n $line_nome = $row['line_nome'];\n $sql=\"UPDATE esposizioni SET esp_line_id='$line_id' WHERE esp_line = '$line_nome'\";\n mysqli_query($con,$sql);\n }\n}", "function update( $line, $name)\n\t{\n\t\tdb::init();\n\t\t$query = \"update centrocostos set centrocostos = '$name' where cliente_id = '$this->userid' and linea = '$line->number'\";\n\t\treturn db::DoIt($query);\n\t}", "public function AddLine(cCartLine_base $oLine) {\n\t$this->AddItem($oLine);\n\t$this->nTotSale += $oLine->Price_forQty();\n\t$this->nTotShItm += $oLine->SH_perItem_forQty();\n\t$this->nMaxShPkg = $oLine->SH_perPkg_Larger($this->nMaxShPkg);\n }", "function grava()\n {\n $conteudo = '';\n \n foreach ($this->_registros as $reg)\n {\n $conteudo .= $reg->geraLinha();\n }\n \n $arquivo = $this->_diretorio . DIRECTORY_SEPARATOR . $this->_arquivo;\n \n file_put_contents($arquivo, $conteudo);\n \n return true;\n }", "private function terminateLine()\n {\n if ($this->isInline) {\n $this->isInline = false;\n $this->writeToFile('<br>');\n }\n }", "public function gera_linhas_somatorios()\n\t{\n\t\tif(count($this->somatorios) > 0)\n\t\t{\n\t\t\techo \"<tr class=totalizadores>\";\n\t\t\tfor($i=0; $i < count($this->nome_colunas); $i++)\n\t\t\t{\n\t\t\t\t$alinhamento = $this->nome_colunas[$i][alinhamento];\n\n\t\t\t\tfor($b=0; $b < count($this->somatorios); $b++)\n\t\t\t\t{\n\t\t\t\t\tif($this->nome_colunas[$i][nome_coluna] == $this->somatorios[$b][nome_coluna])\n\t\t\t\t\t{\n\t\t\t\t\t\t$valor = $this->somatorios[$b][total];\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// \tVERIFICO SE E PARA IMPRIMIR O VALOR\n\t\t\t\tif($this->nome_colunas[$i][somatorio] == 's')\n\t\t\t\t{\n\t\t\t\t\t//\t ESCOLHO O TIPO DE DADO\n\t\t\t\t\tswitch($this->nome_colunas[$i][tipo])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'moeda':\n\t\t\t\t\t\t\t$valor = Util::exibe_valor_moeda($valor);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'data':\n\t\t\t\t\t\t\t$valor = Util::data_certa($valor);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$valor = $valor;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\techo \"\n\t\t\t\t\t\t \t<td align=$alinhamento>\n\t\t\t\t\t\t\t\t\" . $valor . \"\n\t\t\t\t\t\t \t</td>\n\t\t\t\t\t\t \";\n\t\t\t\t\t$valor = '';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"<td align=$alinhamento></td>\";\n\t\t\t\t}\n\n\n\n\t\t\t}\n\t\t\techo '</tr>';\n\t\t}\n\t}", "protected function deleteNewLines()\r\n {\r\n if (isset($this->data['event'])) {\r\n $this->data['event'] = str_replace(\"\\r\", '', $this->data['event']);\r\n $this->data['event'] = str_replace(\"\\n\", '', $this->data['event']);\r\n }\r\n }", "function Contenido($imagenlogo) {\n \t$this->SetMargins(10,10,151.5);\n\n \t//declaramos las fuentes a usar o tentativamente a usar ya que no sabemos cual es la original\n\t $this->AddFont('Gotham-B','','gotham-book.php');\n\t $this->AddFont('Gotham-B','B','gotham-book.php');\n\t $this->AddFont('Gotham-M','','gotham-medium.php');\n\t $this->AddFont('Helvetica','','helvetica.php');\n\n //variables locales\n $numero_de_presidiums=6;\n\n $presidium_orden=\"1\";\n $presidium_nombre=\"Cesar Gibran Cadena Espinosa de los Monteros\";\n $presidium_cargo=\"Dirigente de Redes y Enlaces \";\n\n \t//la imagen del PVEM\n \t$this->Image($imagenlogo, $this->GetX()+10, $this->GetY()+10, 100,40);\n\n \t//el primer espacio\n \t$this->Ln(3);\n $this->SetFillColor(231, 234,243); //color de fondo donde se va a rellenar los campos (como azul claro)\n $this->SetFont('Helvetica', '', 9); //font de cuando se va a rellenar la informacion\n $this->SetTextColor(0,0,0); //color gris para las letras\n $this->Cell(35, 5,utf8_decode(\"Distribución Logística:\"), 0,0, 'C', 1);\n\n $this->setY($this->GetY()+45);\n $this->Ln();\n $this->SetFillColor(231, 234,243); //color de fondo donde se va a rellenar los campos (como azul claro)\n $this->SetFont('Helvetica', '', 9); //font de cuando se va a rellenar la informacion\n $this->SetTextColor(0,0,0); //color gris para las letras\n $this->Cell(40, 5,utf8_decode(\"Presídium (Primera Fila):\"), 0,0, 'C', 1);\n\n $this->Ln(); \n $this->Ln(); \n\n $this->SetFillColor(160,68,68); //color de fondo donde se va a rellenar los campos (como azul claro)\n $this->SetTextColor(255); //color gris para las letras\n $tamano= ($numero_de_presidiums*7.5)/2;\n $this->setX((120/2)-$tamano);\n\n if ( ($numero_de_presidiums) % 2 ==1){ //es impar\n $candidato=($numero_de_presidiums/2)+.5;\n }else{\n $candidato=($numero_de_presidiums/2)+1;\n }\n\n for($i=0;$i<=$numero_de_presidiums;$i++){\n\n if ( ($i+1) == $candidato ){\n $this->Cell(7, 7,utf8_decode(\"*\"), 1, 0, 'C', 1);\n }else{\n $this->Cell(7, 7,utf8_decode(\"\"), 1, 0, 'C', 1); \n }\n }\n $this->Ln(); \n $this->Ln(5); \n\n\n //CONFIGURACION DE COLOR VERDE CON BLANCO\n $this->SetFont('Gotham-B','',6.5);\n $this->SetFillColor(73, 168, 63);\n $this->SetTextColor(255);\n $this->Cell(9, 5,utf8_decode(\"Orden\"), 'LR', 0, 'C', 1);\n $this->Cell(55, 5,utf8_decode(\"Nombre\"), 'LR', 0, 'C', 1);\n $this->Cell(0, 5,utf8_decode(\"Cargo\"), 'LR', 0, 'C', 1);\n\n\n $this->Ln(); \n\n\n //CONFIGURACION SIN COLOR de fondo\n $this->SetFont('Helvetica', '', 6.5); //font de cuando se va a rellenar la informacion\n $this->SetFillColor(255, 255, 255);\n $this->SetTextColor(0);\n\n\n //ESTO ES LO QUE IRIA EN UN FOR\n for($i=0;$i<=7;$i++){\n \n $this->Cell(9, 5,utf8_decode($presidium_orden), 1, 0, 'C', 1);\n $this->Cell(55, 5,utf8_decode($presidium_nombre), 1, 0, 'C', 1);\n $this->MultiCell(0, 5,utf8_decode($presidium_cargo), 1, 'C', 1);\n $this->Ln(1);\n } \n \n }", "private function _addLines() {\r\n\t\t// Reset line thickness to one pixel.\r\n\t\timagesetthickness($this->_resource, 1);\r\n\t\t\r\n\t\t// Reset foreground color to default. \r\n\t\t$foreground = imagecolorallocate($this->_resource, $this->_fg_color['R'], $this->_fg_color['G'], $this->_fg_color['B']);\r\n\t\t\r\n\t\t// Get dimension of image\r\n\t\t$width = imagesx($this->_resource);\r\n\t\t$height = imagesy($this->_resource);\r\n\t\t\r\n\t\tfor ($i = 0; $i < abs($this->_linesModifier); $i++) {\r\n\t\t\t// Set random foreground color if desired.\r\n\t\t\t($this->useRandomColorLines) ? $foreground = $this->_setRandomColor() : null;\r\n\t\t\t\r\n\t\t\t// Add some randomly colored lines.\r\n\t\t\timageline($this->_resource, 0, rand(0, $height), $width, rand(0, $height), $foreground); // horizontal\r\n\t\t\timageline($this->_resource, rand(0, $width), 0, rand(0, $width), $height, $foreground); // vertical\r\n\t\t}\r\n\t}", "function generarRecibo15_txt() {\n $ids = $_REQUEST['ids'];\n $id_pdeclaracion = $_REQUEST['id_pdeclaracion'];\n $id_etapa_pago = $_REQUEST['id_etapa_pago'];\n//---------------------------------------------------\n// Variables secundarios para generar Reporte en txt\n $master_est = null; //2;\n $master_cc = null; //2;\n\n if ($_REQUEST['todo'] == \"todo\") { // UTIL PARA EL BOTON Recibo Total\n $cubo_est = \"todo\";\n $cubo_cc = \"todo\";\n }\n\n $id_est = $_REQUEST['id_establecimientos'];\n $id_cc = $_REQUEST['cboCentroCosto'];\n\n if ($id_est) {\n $master_est = $id_est;\n } else if($id_est=='0') {\n $cubo_est = \"todo\";\n }\n\n if ($id_cc) {\n $master_cc = $id_cc;\n } else if($id_cc == '0'){\n $cubo_cc = \"todo\";\n }\n //\n $dao = new PlameDeclaracionDao();\n $data_pd = $dao->buscar_ID($id_pdeclaracion);\n $fecha = $data_pd['periodo'];\n\n //---\n $dao_ep = new EtapaPagoDao();\n $data_ep = $dao_ep->buscar_ID($id_etapa_pago);\n ;\n\n $_name_15 = \"error\";\n if ($data_ep['tipo'] == 1):\n $_name_15 = \"1RA QUINCENA\";\n elseif ($data_ep['tipo'] == 2):\n $_name_15 = \"2DA QUINCENA\";\n endif;\n\n\n $nombre_mes = getNameMonth(getFechaPatron($fecha, \"m\"));\n $anio = getFechaPatron($fecha, \"Y\");\n\n\n $file_name = '01.txt';//NAME_COMERCIAL . '-' . $_name_15 . '.txt';\n $file_name2 = '02.txt';//NAME_COMERCIAL . '-BOLETA QUINCENA.txt';\n $fpx = fopen($file_name2, 'w');\n $fp = fopen($file_name, 'w');\n \n //..........................................................................\n $FORMATO_0 = chr(27).'@'.chr(27).'C!';\n $FORMATO = chr(18).chr(27).\"P\";\n $BREAK = chr(13) . chr(10);\n //$BREAK = chr(14) . chr(10);\n //chr(27). chr(100). chr(0)\n $LINEA = str_repeat('-', 80);\n//..............................................................................\n// Inicio Exel\n//.............................................................................. \n fwrite($fp,$FORMATO); \n \n\n\n // paso 01 Listar ESTABLECIMIENTOS del Emplearo 'Empresa'\n $dao_est = new EstablecimientoDao();\n $est = array();\n $est = $dao_est->listar_Ids_Establecimientos(ID_EMPLEADOR);\n $pagina = 1;\n\n // paso 02 listar CENTROS DE COSTO del establecimento. \n if (is_array($est) && count($est) > 0) {\n //DAO\n $dao_cc = new EmpresaCentroCostoDao();\n $dao_pago = new PagoDao();\n $dao_estd = new EstablecimientoDireccionDao();\n\n // -------- Variables globales --------// \n $TOTAL = 0;\n $SUM_TOTAL_CC = array();\n $SUM_TOTAL_EST = array();\n\n\n\n for ($i = 0; $i < count($est); $i++) { // ESTABLECIMIENTO\n //echo \" i = $i establecimiento ID=\".$est[$i]['id_establecimiento'];\n //echo \"<br>\";\n //$SUM_TOTAL_EST[$i]['establecimiento'] = strtoupper(\"Establecimiento X ==\" . $est[$i]['id_establecimiento']);\n $bandera_1 = false;\n if ($est[$i]['id_establecimiento'] == $master_est) {\n $bandera_1 = true;\n } else if ($cubo_est == \"todo\") {\n $bandera_1 = true;\n }\n\n if ($bandera_1) {\n \n // if($bander_ecc){\n \n $SUM_TOTAL_EST[$i]['monto'] = 0;\n //Establecimiento direccion Reniec\n $data_est_direc = $dao_estd->buscarEstablecimientoDireccionReniec($est[$i]['id_establecimiento']/* $id_establecimiento */);\n\n $SUM_TOTAL_EST[$i]['establecimiento'] = $data_est_direc['ubigeo_distrito'];\n\n $ecc = array();\n $ecc = $dao_cc->listar_Ids_EmpresaCentroCosto($est[$i]['id_establecimiento']);\n // paso 03 listamos los trabajadores por Centro de costo \n\n for ($j = 0; $j < count($ecc); $j++) {\n\n $bandera_2 = false;\n if ($ecc[$j]['id_empresa_centro_costo'] == $master_cc) {\n $bandera_2 = true;\n } else if ($cubo_est == 'todo' || $cubo_cc == \"todo\") { // $cubo_est\n $bandera_2 = true;\n }\n \n if ($bandera_2) {\n //$contador_break = $contador_break + 1;\n // LISTA DE TRABAJADORES\n $data_tra = array();\n $data_tra = $dao_pago->listar_2($id_etapa_pago, $est[$i]['id_establecimiento'], $ecc[$j]['id_empresa_centro_costo']);\n\n if (count($data_tra)>0) {\n \n $SUM_TOTAL_CC[$i][$j]['establecimiento'] = $data_est_direc['ubigeo_distrito'];\n $SUM_TOTAL_CC[$i][$j]['centro_costo'] = strtoupper($ecc[$j]['descripcion']);\n $SUM_TOTAL_CC[$i][$j]['monto'] = 0;\n\n //fwrite($fp, $LINEA); \n fwrite($fp, NAME_EMPRESA); \n //$worksheet->write(($row + 1), ($col + 1), NAME_EMPRESA);\n //$data_pd['periodo'] $data_pd['fecha_modificacion']\n $descripcion1 = date(\"d/m/Y\");\n \n fwrite($fp, str_pad(\"FECHA : \", 56, \" \", STR_PAD_LEFT));\n fwrite($fp, str_pad($descripcion1, 11, \" \", STR_PAD_LEFT));\n fwrite($fp, $BREAK);\n\n fwrite($fp, str_pad(\"PAGINA :\", 69, \" \", STR_PAD_LEFT)); \n fwrite($fp, str_pad($pagina, 11, \" \", STR_PAD_LEFT));\n fwrite($fp, $BREAK);\n\n fwrite($fp, str_pad($_name_15/*\"1RA QUINCENA\"*/, 80, \" \", STR_PAD_BOTH));\n fwrite($fp, $BREAK);\n\n fwrite($fp, str_pad(\"PLANILLA DEL MES DE \" . strtoupper($nombre_mes) . \" DEL \" . $anio, 80, \" \", STR_PAD_BOTH));\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n\n fwrite($fp, \"LOCALIDAD : \" . $data_est_direc['ubigeo_distrito']);\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n\n fwrite($fp, \"CENTRO DE COSTO : \" . strtoupper($ecc[$j]['descripcion']));\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n //$worksheet->write($row, $col, \"##################################################\");\n \n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(\"N \", 4, \" \", STR_PAD_LEFT));\n fwrite($fp, str_pad(\"DNI\", 12, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"APELLIDOS Y NOMBRES\", 40, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"IMPORTE\", 9, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"FIRMA\", 15, \" \", STR_PAD_RIGHT));\n fwrite($fp, $BREAK);\n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n \n $pag = 0;\n $num_trabajador = 0;\n for ($k = 0; $k < count($data_tra); $k++) {\n $num_trabajador = $num_trabajador +1; \n if($num_trabajador>24):\n fwrite($fp,chr(12));\n $num_trabajador=0;\n endif;\n \n $data = array();\n $data = $data_tra[$k]; \n //$DIRECCION = $SUM_TOTAL_EST[$i]['establecimiento'];\n // Inicio de Boleta \n \n generarRecibo15_txt2($fpx, $data, $nombre_mes, $anio,$pag);\n $pag = $pag +1;\n\n \n // Final de Boleta\n $texto_3 = $data_tra[$k]['apellido_paterno'] . \" \" . $data_tra[$k]['apellido_materno'] . \" \" . $data_tra[$k]['nombres']; \n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(($k + 1) . \" \", 4, \" \", STR_PAD_LEFT));\n fwrite($fp, str_pad($data_tra[$k]['num_documento'], 12, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(limpiar_caracteres_especiales_plame($texto_3), 40, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad($data_tra[$k]['sueldo'], 9, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"_______________\", 15, \" \", STR_PAD_RIGHT));\n fwrite($fp, $BREAK);\n \n // por persona\n $SUM_TOTAL_CC[$i][$j]['monto'] = $SUM_TOTAL_CC[$i][$j]['monto'] + $data_tra[$k]['sueldo'];\n }\n\n\n $SUM_TOTAL_EST[$i]['monto'] = $SUM_TOTAL_EST[$i]['monto'] + $SUM_TOTAL_CC[$i][$j]['monto'];\n \n //--- LINE\n fwrite($fp, $BREAK);\n //fwrite($fp, $LINEA);\n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(\"TOTAL \" . $SUM_TOTAL_CC[$i][$j]['centro_costo'] . \" \" . $SUM_TOTAL_EST[$i]['establecimiento'], 56, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM_TOTAL_CC[$i][$j]['monto'], 2));\n fwrite($fp, $BREAK);\n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n\n fwrite($fp,chr(12));\n $pagina = $pagina + 1;\n //fwrite($fp, $BREAK . $BREAK . $BREAK . $BREAK);\n $TOTAL = $TOTAL + $SUM_TOTAL_CC[$i][$j]['monto'];\n //$row_a = $row_a + 5;\n }//End Trabajadores\n }//End Bandera.\n }//END FOR CCosto\n\n\n // CALCULO POR ESTABLECIMIENTOS\n /* $SUM = 0.00;\n for ($z = 0; $z < count($SUM_TOTAL_CC[$i]); $z++) {\n\n fwrite($fp, str_pad($SUM_TOTAL_CC[$i][$z]['centro_costo'], 59, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM_TOTAL_CC[$i][$z]['monto'], 2));\n fwrite($fp, $BREAK);\n\n\n $SUM = $SUM + $SUM_TOTAL_CC[$i][$z]['monto'];\n }\n fwrite($fp, str_pad(\"T O T A L G E N E R A L --->>>\", 59, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM, 2));\n */\n\n //fwrite($fp, $BREAK . $BREAK);\n \n }\n }//END FOR Est\n\n /*\n fwrite($fp, str_repeat('*', 85));\n fwrite($fp, $BREAK);\n fwrite($fp, \"CALCULO FINAL ESTABLECIMIENTOS \");\n fwrite($fp, $BREAK);\n\n //$worksheet->write(($row+4), ($col + 1), \".::RESUMEN DE PAGOS::.\");\n $SUM = 0;\n for ($z = 0; $z < count($SUM_TOTAL_EST); $z++) {\n\n fwrite($fp, str_pad($SUM_TOTAL_EST[$z]['establecimiento'], 59, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM_TOTAL_EST[$z]['monto'], 2));\n fwrite($fp, $BREAK);\n $SUM = $SUM + $SUM_TOTAL_EST[$z]['monto'];\n }\n */\n \n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(\"T O T A L G E N E R A L --->>>\", 56, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(number_format_var($TOTAL), 15, ' ',STR_PAD_RIGHT));\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n \n \n }//END IF\n//..............................................................................\n// Inicio Exel\n//..............................................................................\n //|---------------------------------------------------------------------------\n //| Calculos Finales\n //|\n //|---------------------------------------------------------------------------\n //\n //fwrite($fp, $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK);\n //fwrite($fp, $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK);\n\n\n fclose($fp);\n fclose($fpx);\n // $workbook->close();\n // .........................................................................\n // SEGUNDO ARCHIVO\n //..........................................................................\n\n\n\n\n\n\n\n\n\n\n $file = array();\n $file[] = $file_name;\n $file[] = ($file_name2);\n ////generarRecibo15_txt2($id_pdeclaracion, $id_etapa_pago);\n\n\n $zipfile = new zipfile();\n $carpeta = \"file-\" . date(\"d-m-Y\") . \"/\";\n $zipfile->add_dir($carpeta);\n\n for ($i = 0; $i < count($file); $i++) {\n $zipfile->add_file(implode(\"\", file($file[$i])), $carpeta . $file[$i]);\n //$zipfile->add_file( file_get_contents($file[$i]),$carpeta.$file[$i]);\n }\n\n header(\"Content-type: application/octet-stream\");\n header(\"Content-disposition: attachment; filename=zipfile.zip\");\n\n echo $zipfile->file();\n}", "function toString()\n {\n return \"Data rinnovo: \".$this->date.\"\\n\".\n \"Stato: \".$this->stato;\n }", "function RellenarTitulo()\r\n {\r\n $this->Imprimir('ANÁLSIS DE FALLAS DE DISTRIBUCIÓN');\r\n\r\n $this->Imprimir($this->convocatoria->getLugar(), 93, 10);\r\n\r\n $this->Imprimir(strftime(\"%A %d de %B de %Y\", strtotime($this->convocatoria->getFecha())) .\r\n ' - Hora: ' . $this->convocatoria->getHoraIni() . ' a ' .\r\n $this->convocatoria->getHoraFin(), 95, 10, 16);\r\n }", "function modoExpandidoLinha($lModoExpandido) {\n\n if ($lModoExpandido) {\n $sComando = chr(14);\n } else {\n $sComando = chr(20);\n }\n parent::addComando($sComando);\n }", "public function updateRootline() {}", "function pushHeadline ($text) {\n\t\t$this->_roof[\"cuerpo\"][] = $text;\n\t}", "public function edit(LineasFactura $lineasFactura)\n {\n //\n }", "private function setHeaderLine($type) {\n $this -> types = EfrontExport::getTypes($type);\n if ($type == \"users\") {\n unset($this -> types['password']);\n }\n $this -> lines[] = implode($this -> separator, array_keys($this -> types));\n }", "function Header() {\n //$this->Ln(2);\n date_default_timezone_set('America/Lima');\n $this->SetFont('Arial', 'B', 7.5);\n $this->Image(\"view/img/logo.png\", null, 5, 22, 17);\n $this->Image(\"view/img/logo.png\", 385, 5, 20, 20);\n $this->Cell(400,2, \"EL AGUILA SRL\", 0, 0, 'C');\n $this->Ln(4);\n $this->Cell(400,1, \"DIR1: Av. Bolivar # 395 Moshoqueque - Chiclayo - Peru\", 0, 0, 'C');\n $this->Ln(3);\n $this->Cell(400, 2, \"DIR1: Via Evitamiento km 2.5 Sector Chacupe - La Victoria\", 0, 0, 'C');\n $this->Ln(15);\n $this->SetFont('Arial','B',9);\n// $this->Cell(400, 2, utf8_decode(\"Cumplimiento de entrega de las ordenes de Pedido\"), 0, 0, 'C');\n $this->ln(4); \n $this->Line(45,25,380,25);\n \n }", "function Header() {\n //$this->Ln(2);\n date_default_timezone_set('America/Lima');\n $this->SetFont('Arial', 'B', 7.5);\n $this->Image(\"view/img/logo.png\", null, 5, 22, 17);\n $this->Image(\"view/img/logo.png\", 385, 5, 20, 20);\n $this->Cell(400,2, \"EL AGUILA SRL\", 0, 0, 'C');\n $this->Ln(4);\n $this->Cell(400,1, \"DIR1: Av. Bolivar # 395 Moshoqueque - Chiclayo - Peru\", 0, 0, 'C');\n $this->Ln(3);\n $this->Cell(400, 2, \"DIR1: Via Evitamiento km 2.5 Sector Chacupe - La Victoria\", 0, 0, 'C');\n $this->Ln(15);\n $this->SetFont('Arial','B',9);\n $this->Cell(400, 2, utf8_decode(\"Detalle de Producción\"), 0, 0, 'C');\n $this->ln(4); \n $this->Line(45,25,380,25);\n \n }", "private function datosHorizontal($productosDelUsuario)\n {\n $this->SetTextColor(0,0,0);\n $this->SetFont('Arial','B',16);\n $top_datos=105;\n $this->SetXY(35, $top_datos);\n $this->Cell(190, 10, utf8_decode(\"DATOS DE LA TIENDA\"), 0, 2, \"J\");\n $this->SetFont('Arial','',10);\n $this->MultiCell(190, //posición X\n 5, //posición Y\n utf8_decode(\n \"ID Vendedor: \".\"1.\".\"\\n\".\n \"Vendedor: \".\"Mr. X.\".\"\\n\".\n \"Dirección: \".\"Medrano 951.\".\"\\n\".\n \"Provincia: \".\"C.A.B.A.\".\"\\n\".\n \"Telefono: \".\"+54 9 11 4867-7511.\".\"\\n\".\n \"Código Postal: \".\"1437.\"),\n 0, // bordes 0 = no | 1 = si\n \"J\", // texto justificado \n false);\n\n\n // Datos del cliente\n $this->SetFont('Arial','B',16);\n $this->SetXY(120, $top_datos);\n $this->Cell(190, 10, utf8_decode(\"DATOS DEL CLIENTE\"), 0, 2, \"J\");\n $this->SetFont('Arial','',10);\n $this->MultiCell(\n 190, //posición X\n 5, //posicion Y\n utf8_decode(\n \"DNI: \".\"20.453.557\".\"\\n\".\n \"Nombre y Apellido: \".\"Chuck Norris.\".\"\\n\".\n \"Dirección: \".\"Rivadavia 5227.\".\"\\n\".\n \"Provincia: \".\"C.A.B.A.\".\"\\n\".\n \"Telefono: \".\"+54 9 11 4741-7219.\".\"\\n\".\n \"Código Postal: \".\"3714.\"),\n 0, // bordes 0 = no | 1 = si\n \"J\", // texto justificado\n false);\n\n //Salto de línea\n $this->Ln(2);\n\n\n //Creación de la tabla de los detalles de los productos productos\n $top_productos = 165;\n $this->SetFont('Arial','B',16);\n $this->SetXY(30, $top_productos);\n $this->Cell(40, 5, utf8_decode('UNIDAD'), 0, 1, 'C');\n $this->SetXY(75, $top_productos);\n $this->Cell(40, 5, utf8_decode('PRODUCTO'), 0, 1, 'C');\n $this->SetXY(115, $top_productos);\n $this->Cell(70, 5, utf8_decode('PRECIO X UNIDAD'), 0, 1, 'C'); \n \n \n $this->SetXY(25, 150);\n $this->SetTextColor(241,241,241);\n $this->Cell(70, 5, '____________________________________________________', 0, 1, 'L'); \n\n $this->SetTextColor(0,0,0);\n $y = 170; // variable para la posición top desde la cual se empezarán a agregar los datos\n\n $precioTotal = 0;\n foreach($productosDelUsuario as $productoX)\n {\n $nombreProducto = $productoX['nombre'];\n $precioProducto = $productoX['precio'];\n \n $this->SetFont('Arial','',10);\n \n $this->SetXY(40, $y);\n $this->Cell(20, 5, utf8_decode(\"1\"), 0, 1, 'C');\n $this->SetXY(80, $y);\n $this->Cell(30, 5, utf8_decode(\"$nombreProducto\"), 0, 1, 'C');\n $this->SetXY(135, $y);\n $this->Cell(30, 5, utf8_decode(\"$$precioProducto\"), 0, 1, 'C');\n\n // aumento del top 5 cm\n $y = $y + 5;\n\n $precioTotal += $precioProducto;\n }\n\n $this->SetFont('Arial','B',16);\n $this->SetXY(100, 215);\n $this->Cell(0, 10, utf8_decode(\"Gastos de envío: $\".\"XXXX\"), 0, 1, \"C\");\n $this->SetXY(100, 223);\n $this->Cell(0, 10, utf8_decode(\"PRECIO TOTAL: $$precioTotal\"), 0, 1, \"C\");\n\n $this->Image('img/pdf/footer.jpg' , 0, 242, 210 , 55,'JPG');\n }", "public function getLine($line);", "function escribir_pedido($cliente) {\r\n\t$conn = mysql_connect(BD_HOST, BD_USERNAME, BD_PASSWORD);\r\n\tmysql_select_db(BD_DATABASE1);\r\n\t//busco la serie para pedidos de clientes\r\n\t$ssql = 'SELECT SPCCFG FROM F_CFG';\r\n\t$rs1 = mysql_query($ssql, $conn);\r\n\t$datos1 = mysql_fetch_array($rs1);\r\n\t//busco los pedidos por serie, cliente y estado \r\n\t$ssql = 'SELECT * FROM F_PCL WHERE CLIPCL=' . $cliente . ' AND TIPPCL=\\'' . $datos1['SPCCFG'] . '\\' AND ESTPCL=\\'0\\'';\r\n\tmysql_select_db(BD_DATABASE1);\r\n\t$rs = mysql_query($ssql, $conn);\r\n\techo (mysql_error());\r\n\tif (mysql_num_rows($rs) != 0) {\r\n\t\t$datos = mysql_fetch_array($rs);\r\n\t\t//cojo el detalle del pedido por orden de lineas\r\n\t\t$ssql = 'SELECT * FROM F_LPC WHERE CODLPC=' . $datos['CODPCL'] . ' AND TIPLPC=\\'' . $datos['TIPPCL'] . '\\' ORDER BY POSLPC ASC'; \r\n\t\t$rs1 = mysql_query($ssql, $conn);\r\n\t\tif (mysql_num_rows($rs1) != 0) {\r\n\t\t\t$total = 0;\r\n\t\t\t$colorcelda = COLOROSCUROCELDA;\r\n\t\t\twhile ($linea = mysql_fetch_array($rs1)) {\r\n\t\t\t\tif($colorcelda == COLORCLAROCELDA) {\r\n\t\t\t\t\t$colorcelda = COLOROSCUROCELDA;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$colorcelda = COLORCLAROCELDA;\r\n\t\t\t\t}\r\n\t\t\t\t//compruebo que el producto no tenga 0 en cantidad y si es así lo borro\r\n\t\t\t\techo('<tr bordercolor=\"#cccccc\" bgcolor=\"#ffffff\">');\r\n\t\t\t\techo('<td bgcolor=\"' . $colorcelda . '\">' . $linea['ARTLPC'] . '</td>');\r\n\t\t\t\techo('<td bgcolor=\"' . $colorcelda . '\">' . $linea['DESLPC'] . '</td>');\r\n\t\t\t\techo('<td align=\"right\" bgcolor=\"' . $colorcelda . '\">');\r\n\t\t\t\tprintf(\"%.2f\", $linea['PRELPC']);\r\n\t\t\t\techo('</td>');\r\n\t\t\t\techo('<td align=\"right\" nowrap bgcolor=\"' . $colorcelda . '\"><img src=\"plantillas/' . PLANTILLA . '/imagenes/menos.gif\" border=\"0\" style=\"cursor:pointer\" onclick=\"sumaresta2(\\'num' . $linea['POSLPC'] . '\\',\\'-\\');actualizar.submit();\" >&nbsp;<input value=\"');\r\n\t\t\t\techo(decimal($linea['CANLPC']));\r\n\t\t\t\techo('\" name=\"num' . $linea['POSLPC'] . '\" id=\"num' . $linea['POSLPC'] . '\" size=\"10\" maxlength=\"10\" type=\"text\" onfocus=\"this.blur()\" style=\"text-align:right;\">&nbsp;<img src=\"plantillas/' . PLANTILLA . '/imagenes/mas.gif\" border=\"0\" onclick=\"sumaresta2(\\'num' . $linea['POSLPC'] . '\\',\\'+\\');actualizar.submit();\" style=\"cursor:pointer\"></td>');\r\n\t\t\t\techo('<td align=\"right\" bgcolor=\"' . $colorcelda . '\">');\r\n\t\t\t\tprintf(\"%.2f\", $linea['DT1LPC']);\r\n\t\t\t\techo('%</td>');\r\n\t\t\t\techo('<td align=\"right\" bgcolor=\"' . $colorcelda . '\">');\r\n\t\t\t\t$total = number_format($total + ($linea['TOTLPC']), 2, '.', '');\r\n\t\t\t\tprintf(\"%.2f\", ($linea['TOTLPC']));\r\n\t\t\t\techo('</td>');\r\n\t\t\t\tif ($linea['IINLPC'] != 0) {\r\n\t\t\t\t\techo('<td align=\"center\" bgcolor=\"' . $colorcelda . '\">SI</td>');\r\n\t\t\t\t}else{\r\n\t\t\t\t\techo('<td align=\"center\" bgcolor=\"' . $colorcelda . '\">NO</td>');\r\n\t\t\t\t}\r\n\t\t\t\techo('<td align=\"center\" bgcolor=\"' . $colorcelda . '\"><img src=\"plantillas/' . PLANTILLA . '/imagenes/nor.gif\" border=\"0\" align=\"middle\" style=\"cursor:pointer\" onclick=\"borrarart(' . $linea['POSLPC'] . ')\" alt=\"Borrar art&iacute;culo\">&nbsp;</td>');\r\n\t\t\t\techo('</tr>');\r\n\t\t\t}\r\n\t\t\techo('<tr bordercolor=\"#999999\" align=\"right\" bgcolor=\"#cccccc\">');\r\n\t\t\techo('<td colspan=\"6\"><font color=\"#000000\" face=\"Verdana\" size=\"2\"><b>Total:</b></font></td>');\r\n\t\t\techo('<td colspan=\"2\"><font color=\"#000000\" face=\"Verdana\" size=\"2\"><b>');\r\n\t\t\tprintf(\"%.2f\", $total);\r\n\t\t\techo('</b></font></td>');\r\n\t\t\techo('</tr>');\r\n\t\t}else{\r\n\t\t\techo('<tr bordercolor=\"#cccccc\" align=\"center\" bgcolor=\"#ffffff\">');\r\n\t\t\techo('<td colspan=\"7\" align=\"center\">NO SE HAN ENCONTRADO ARTICULOS</td>');\r\n\t\t\techo('</tr>');\r\n\t\t\techo('<tr bordercolor=\"#999999\" align=\"center\" bgcolor=\"#cccccc\">');\r\n\t\t\techo('<td colspan=\"2\"><font color=\"#000000\" face=\"Verdana\" size=\"2\"><b>Total:</b></font></td>');\r\n\t\t\techo('<td></td><td>&nbsp;</td><td>&nbsp;</td>');\r\n\t\t\techo('<td><font color=\"#cccccc\">.</font></td>');\r\n\t\t\techo('<td><font color=\"#cccccc\">.</font></td>');\r\n\t\t\techo('<td><font color=\"#cccccc\">.</font></td>');\r\n\t\t\techo('</tr>');\r\n\t\t} \r\n\t}else{\r\n\t\techo('<tr bordercolor=\"#cccccc\" align=\"center\" bgcolor=\"#ffffff\">');\r\n\t\techo('<td height=\"30\" colspan=\"8\">NO SE HAN ENCONTRADO ARTICULOS EN EL PEDIDO</td></tr>');\r\n\t\techo('<tr bordercolor=\"#999999\" align=\"center\" bgcolor=\"#cccccc\">');\r\n\t\techo('<td colspan=\"8\"><font color=\"#000000\" face=\"Verdana\" size=\"2\"><b>&nbsp;</b></font></td>');\r\n\t\techo('</tr>');\r\n\t}\r\n}", "function WriteLine($data=null) \r\n{ \r\nreturn $this->Write($data . $this->NewLine); \r\n}", "function r_line($atts, $content = null) {\r\n return '<div class=\"line\"></div>';\r\n}", "function Header()\n\t\t{\n\t\t\t$this->SetFont('Helvetica','B',18);\n\t\t\t$this->SetTextColor(184,10,10);\n\t\t\t$this->Cell(30);\n\t\t\t$this->Cell(120,10,utf8_decode(\"Mensajes Contestados\"),0,0,'C');\n\t\t\t$this->Ln(20);\n\t\t}", "function Cuerpo($acceso,$where)\n\t{\n\t\t$acceso->objeto->ejecutarSql(\"select id_persona from vista_orden order By id_orden desc LIMIT 1 offset 0\");\n\t\tif($row=row($acceso))\n\t\t{\n\t\t\t$tecnico=trim($row[\"id_persona\"]);\n\t\t}\n\t\telse{\n\t\t\t$acceso->objeto->ejecutarSql(\"select *from vista_tecnico LIMIT 1 offset 0\");\n\t\t\tif($row=row($acceso))\n\t\t\t{\n\t\t\t\t$tecnico=trim($row[\"id_persona\"]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\n\t\n\t\n\t\t$w=$this->TituloCampos();\n\t\t\n\t\t$dato=lectura($acceso,$where);\n\t\n\t\t$this->SetFont('Arial','',8);\n\t\t$cont=1;\n\t\t\n\t\t\n\t\t$salto=0;\n\t\t$f_act=date(\"d/m/Y\");\n\t\t$h_act=date(\"h:i:s A\");\n\t\t$nombre_zona=utf8_decode(trim($dato[0][\"nombre_zona\"]));\n\t\t$nombre_sector=utf8_decode(trim($dato[0][\"nombre_sector\"]));\n\t\t\n\t\t$cad=\"{\\\\rtf1\\\\ansi\\\\ansicpg1252\\\\deff0\\\\deflang11274{\\\\fonttbl{\\\\f0\\\\fswiss\\\\fcharset0 Arial;}}\n{\\\\*\\\\generator Msftedit 5.41.15.1512;}\\\\viewkind4\\\\uc1\\\\pard\\\\tx1988\\\\f0\\\\fs32 hola\\\\par\n\";\n\t\tfor($i=0;$i<count($dato);$i++){\n\t\t\t$this->SetTextColor(0);\n\t\t\t$this->SetFillColor(249,249,249);\n\t\t\t\n\t\t\t$id_contrato=trim($dato[$i][\"id_contrato\"]);\n\t\t//\tordenDeCorte($acceso,$id_contrato,$tecnico);\n\t\t\t\n\t\t\t$this->SetX(10);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetFont('Arial','',8);\n\t\t\t$this->SetX(10);\n\t\t\t$this->Cell($w[0],5,$cont,\"1\",0,\"C\",$fill);\n\t\t\t$nro_contrato=trim($dato[$i][\"nro_contrato\"]);\n\t\t\t$cedula=trim($dato[$i][\"cedula\"]);\n\t\t\t$nombre=utf8_decode(trim($dato[$i][\"nombre\"]).\" \".trim($dato[$i][\"apellido\"]));\n\t\t\t$etiqueta=utf8_decode(trim($dato[$i][\"etiqueta\"]));\n\t\t\t$telefono=utf8_decode(trim($dato[$i][\"telefono\"]));\n\t\t\t$deuda=number_format(trim($dato[$i][\"deuda\"])+0, 2, ',', '.');\n\t\t\t\n\t\t\t$this->Ln();\n\t\t\t$this->SetFont('Arial','B',8);\n\t\t\t$this->Cell(12,5,strtoupper(_(\"zona\")).\": \",\"TLB\",0,\"J\",$fill);\n\t\t\t$this->SetFont('Arial','',8);\n\t\t\t$this->Cell(40,5,utf8_decode(trim($dato[$i][\"nombre_zona\"])),\"TBR\",0,\"J\",$fill);\n\t\t\t$nombre_zona=utf8_decode(trim($dato[$i][\"nombre_zona\"]));\n\t\t\t$this->SetFont('Arial','B',8);\n\t\t\t$this->Cell(14,5,strtoupper(_(\"sector\")).\": \",\"TLB\",0,\"J\",$fill);\n\t\t\t$this->SetFont('Arial','',8);\n\t\t\t$nombre_sector=utf8_decode(trim($dato[$i][\"nombre_sector\"]));\n\t\t\t$this->SetFont('Arial','B',8);\n\t\t\t$this->Cell(12,5,strtoupper(_(\"calle\")).\": \",\"TLB\",0,\"J\",$fill);\n\t\t\t$this->SetFont('Arial','',8);\n\t\t\t$nombre_calle=utf8_decode(trim($dato[$i][\"nombre_calle\"]));\n\t\t\t\n\t\t\t\n\t\t\t$this->Ln();\n\t\t\t$this->SetFont('Arial','B',8);\n\t\t\t$this->Cell(17,5,strtoupper(_(\"nro casa\")).\": \",\"TLB\",0,\"J\",$fill);\n\t\t\t$this->SetFont('Arial','',8);\n\t\t\t$num_casa=utf8_decode(trim($dato[$i][\"numero_casa\"]));\n\t\t\n\t\t\t$this->SetFont('Arial','B',8);\n\t\t\t$this->Cell(10,5,strtoupper(_(\"edif\")).\": \",\"TLB\",0,\"J\",$fill);\n\t\t\t$this->SetFont('Arial','',8);\n\t\t\t$edificio=utf8_decode(trim($dato[$i][\"edificio\"]));\n\t\t\n\t\t\t$this->SetFont('Arial','B',8);\n\t\t\t$this->Cell(10,5,strtoupper(_(\"piso\")).\": \",\"TLB\",0,\"J\",$fill);\n\t\t\t$this->SetFont('Arial','',8);\n\t\t\t$n_p=utf8_decode(trim($dato[$i][\"numero_piso\"]));\n\t\t\n\t\t\t$this->SetFont('Arial','B',8);\n\t\t\t$this->Cell(8,5,strtoupper(_(\"ref\")).\": \",\"TLB\",0,\"J\",$fill);\n\t\t\t$this->SetFont('Arial','',8);\n\t\t\t$direc_adicional=utf8_decode(trim($dato[$i][\"direc_adicional\"]));\n\t\t\t//$this->MultiCell(81,5,utf8_decode(trim($dato[$i][\"direc_adicional\"])),'TR','J');\n\t\t\t$this->SetFont('Arial','',2);\n\t\t\t$this->Ln();\n\t\t\t$this->SetX(114);\n\t\t//\t$this->Cell(89,3,'',\"LR\",0,\"C\",$fill);\n\t\t\t//$this->Cell(array_sum($w),3,'',\"RL\",0,\"C\",$fill);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->Ln();\n\t\t\t$fill=!$fill;\n\t\t\t\n\t\t\t$salto++;\n\t\t\tif($salto==11 && $salto!=count($dato)){\n\t\t\t\t$this->AddPage();\n\t\t\t\t\n\t\t\t\t$w=$this->TituloCampos();\n\t\t\t\t$salto=0;\n\t\t\t}\n\t\t\t\n\t\t\t$cad.=\"$nro_contrato \\\\tab $nro_contrato \\\\tab\n\";\n\t\t$cont++;\n\t\t}\n\t\t\n\t\t$this->SetX(10);\n\t\t$this->Cell(array_sum($w),5,'','T');\n\t\t$cad.=\"}\n\";\n\t\treturn $cad;\n\t}", "private function setNewLine() {\n $extension = pathinfo($this->path, PATHINFO_EXTENSION);\n if ($extension === Lexer::LINUX_FILE_EXTENSION) {\n $this->newLine = \"\\n\";\n } else {\n $this->newLine = \"\\r\\n\";\n }\n }", "function FooterRR()\n {\n //Posición: a 2 cm del final\n $this->Ln();\n $this->SetY(-12);\n $this->SetFont('Arial','B',6);\n //Número de página\n $this->Cell(190,4,'Sistema de Control de Ventas y Facturacion \"BOUTIQUE DE ZAPATERIA\"','T',0,'L');\n $this->AliasNbPages();\n $this->Cell(0,4,'Pagina '.$this->PageNo(),'T',1,'R');\n }", "public function getLines();", "public function getLines();", "public function writeLine($line);", "public function getAllLines();", "public function getAllLines();", "private function addLines()\n {\n\n $lines = rand(1, 3);\n for ($i = 0; $i < $lines; $i++) {\n imageline($this->imageResource, rand(0, 200), rand(0, -77), rand(0, 200), rand(77, 144), imagecolorallocate($this->imageResource, rand(0, 240), rand(0, 240), rand(0, 240)));\n }\n\n for ($i = 0; $i < 5 - $lines; $i++) {\n imageline($this->imageResource, rand(0, -200), rand(0, 77), rand(200, 400), rand(0, 77), imagecolorallocate($this->imageResource, rand(0, 240), rand(0, 240), rand(0, 240)));\n }\n }" ]
[ "0.6354664", "0.62507415", "0.6205322", "0.61445916", "0.5861204", "0.58325744", "0.58082145", "0.5759924", "0.57483983", "0.57270235", "0.5657175", "0.563837", "0.56062865", "0.55931914", "0.55268854", "0.5525172", "0.55222684", "0.55101484", "0.55045736", "0.54924804", "0.54867685", "0.54785275", "0.5468343", "0.5443759", "0.54417425", "0.5439665", "0.5437722", "0.54376954", "0.5397599", "0.53934216", "0.5390186", "0.53820777", "0.5374115", "0.5372231", "0.53664917", "0.536054", "0.53470266", "0.53378284", "0.53377336", "0.5335036", "0.5332981", "0.5332981", "0.5332981", "0.5332981", "0.5332923", "0.53251624", "0.5317113", "0.53065944", "0.5303515", "0.5303191", "0.529428", "0.5293744", "0.52920485", "0.5276899", "0.52744323", "0.52717537", "0.52717537", "0.5271167", "0.5262411", "0.5258273", "0.52541363", "0.5248816", "0.5245388", "0.5244737", "0.52406806", "0.5238684", "0.5222969", "0.52188814", "0.5216357", "0.52135485", "0.52094835", "0.5205387", "0.5205048", "0.5204555", "0.5193628", "0.51793396", "0.5177583", "0.51767087", "0.5173526", "0.5171522", "0.5166883", "0.51645225", "0.51578", "0.51508355", "0.5146655", "0.51458716", "0.5144572", "0.51442957", "0.5144164", "0.51404935", "0.51351035", "0.51346076", "0.51339257", "0.51300764", "0.5123078", "0.51191354", "0.51191354", "0.5118902", "0.51162183", "0.51162183", "0.51102996" ]
0.0
-1
Agrega un articulo al carrito de un cliente
function Agrega($Cod_Articulo,$Descripcion,$Cantidad,$Precio,$Total,$CardCode,$Agente,$ComdicionPago,$Fecha,$Impuesto,$MontoImpuesto,$Descuento,$MontoDescuento,$ItemCode,$codbarras,$ItemName,$existencia,$lotes,$Unidad,$precio,$PrchseItem,$SellItem,$InvntItem,$AvgPrice,$Price,$frozenFor,$SalUnitMsr,$VATLiable,$lote,$U_Grupo,$SalPackUn,$FAMILIA,$CATEGORIA,$MARCA,$CardCode,$Disponible,$U_Gramaje, $DETALLE_1,$LISTA_A_DETALLE,$LISTA_A_SUPERMERCADO,$LISTA_A_MAYORISTA,$LISTA_A_2_MAYORISTA,$PANALERA,$SUPERMERCADOS,$MAYORISTAS,$HUELLAS_DORADAS,$ALSER,$COSTO,$PRECIO_SUGERIDO,$PuntosWeb,$Ranking,$CodCliente){ try{ $valor = false; $Existe = 0; //Antes de agregar va a verificar si el articulo ya fue insertado $valor = $this->VerificaArticuloRepetido($Cod_Articulo,$CardCode); if(mysql_num_rows($valor)) { $car = mysql_fetch_array($valor); $Existe =$car['Existe']; } if($Existe > 0 ) echo "Articulo " .$Descripcion. " ya existe, si desea agregar mas unidades vaya a su carrito y Actualice las Unidades a solicitar" ; else { if($this->con->conectar()==true){ // $Total= $Precio*$Cantidad; // $Total=$Total+$MontoImpuesto-$MontoDescuento; mysql_query("INSERT INTO `arquitect_bourne`.`Carrito` (`CodArticulo`, `Descripcion`, `cantidad`, `Precio`, `Total`, `CardCode`, `Fecha`, `Descuento`, `MontoDescuento`,`Impuesto` ,`MontoImpuesto`,`Agente`, `CondicionPago`) VALUES ('". $Cod_Articulo . "','".$Descripcion ."','".$Cantidad."','".$Precio."','".$Total."','" . $CardCode ."','" . date("Y-m-d") ."','".$Descuento."','".$MontoDescuento."','".$Impuesto."','".$MontoImpuesto."','" . $Agente ."','" . $ComdicionPago ."');"); $this->AumentaRanking($Cod_Articulo); //Agrega el articulo al rutero del cliente si aun no existe //return $this->AgregalineaARutero($ItemCode,$codbarras,$ItemName,$existencia,$lotes,$Unidad,$precio,$PrchseItem,$SellItem,$InvntItem,$AvgPrice,$Price,$frozenFor,$SalUnitMsr,$VATLiable,$lote,$U_Grupo,$SalPackUn,$FAMILIA,$CATEGORIA,$MARCA,$CardCode,$Disponible,$U_Gramaje, $DETALLE_1,$LISTA_A_DETALLE,$LISTA_A_SUPERMERCADO,$LISTA_A_MAYORISTA,$LISTA_A_2_MAYORISTA,$PANALERA,$SUPERMERCADOS,$MAYORISTAS,$HUELLAS_DORADAS,$ALSER,$COSTO,$PRECIO_SUGERIDO,$PuntosWeb,$Ranking,$CodCliente); // return "Agregado Correctamente"; } } } catch(Exception $e){ return "Error al agrega" & $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function altaCliente ($cliente){\r\n $this->clientes[] = $cliente; /// Este es el ejemplo de altaCliente que ha echo Jesús.\r\n }", "public function obtenerArticulosPorTipo(){\n log_message('DEBUG', \"#TRAZA | #TRAZ-PROD-TRAZASOFT | Camion | obtenerArticulosPorTipo()\");\n $rsp = $this->Materias->listar('TODOS');\n if($rsp['status']){\n $materiasPrimas = json_decode($rsp['data']);\n $data['status'] = $rsp['status'];\n $data['data'] = selectBusquedaAvanzada(false, false, $materiasPrimas->articulos->articulo, 'arti_id', 'barcode',array('descripcion','um'));\n echo json_encode($data);\n }else{\n $rsp['msj'] = \"Fallo el servicio que obtiene los articulos tipo materia prima.\";\n json_encode($rsp);\n }\n }", "public function getArticulos() {\r\n\t\t$gerencia = $this->input->post('_gerencia');\r\n\t\techo json_encode($this->articulos_model->buscar(NULL, NULL, NULL, $gerencia, NULL));\r\n\t}", "private function getPrecosPorClientes($produtos)\n {\n\n $menus = [];\n $cursos = [];\n $precosCurso = [];\n $precosMenus = [];\n\n foreach ($produtos as $produto) {\n if ($produto->produto_tipo == BuscaConstants::BUSCA_TIPO_MENU) {\n $menus[] = $produto->produto_id;\n } else {\n $cursos[] = $produto->produto_id;\n }\n }\n\n if (count($menus) > 0) {\n $precosMenus = Query::fetch('Busca/QryBuscarPrecosMenus', ['id_menu' => $menus]);\n }\n\n if (count($cursos) > 0) {\n $precosCurso = Query::fetch('Busca/QryBuscarPrecosCursos', ['id_curso' => $cursos]);\n }\n\n $agrupadoPorIdMenu = [];\n $agrupadoPorIdCurso = [];\n\n foreach ($precosMenus as $precoMenu) {\n $agrupadoPorIdMenu[$precoMenu->id_menu][$precoMenu->qtd_minima_clientes] = $precoMenu->preco;\n }\n\n foreach ($precosCurso as $precoCurso) {\n $agrupadoPorIdCurso[$precoCurso->id_curso][$precoCurso->qtd_minima_clientes] = $precoCurso->preco;\n }\n\n foreach ($produtos as &$produto) {\n $preco = $produto->produto_preco;\n $precosFinais = [];\n $agrupadorLoop = null;\n $counter = 0;\n $ultimoQtdPessoas = 1;\n\n if ($produto->produto_tipo == BuscaConstants::BUSCA_TIPO_MENU && isset($agrupadoPorIdMenu[$produto->produto_id])) {\n $agrupadorLoop = $agrupadoPorIdMenu[$produto->produto_id];\n } else if ($produto->produto_tipo == BuscaConstants::BUSCA_TIPO_CURSO && isset($agrupadoPorIdCurso[$produto->produto_id])) {\n $agrupadorLoop = $agrupadoPorIdCurso[$produto->produto_id];\n }\n\n if (is_null($agrupadorLoop)) {\n continue;\n }\n\n foreach ($agrupadorLoop as $qtdPessoas => $valor) {\n $counter++;\n if ($qtdPessoas == 1) continue;\n $descricao = \"$ultimoQtdPessoas a \" . ($qtdPessoas - 1);\n\n if ($ultimoQtdPessoas == ($qtdPessoas - 1)) {\n $descricao = $ultimoQtdPessoas;\n }\n\n if ($counter == count($agrupadorLoop)) {\n if (empty($precosFinais)) {\n $precosFinais[] = ['preco' => $preco, 'qtd' => $descricao];\n } else {\n $precosFinais[] = ['preco' => $valor, 'qtd' => $descricao];\n }\n\n $precosFinais[] = ['preco' => $valor, 'qtd' => \"$qtdPessoas+\"];\n } else {\n $precosFinais[] = ['preco' => empty($precosFinais) ? $preco : $valor, 'qtd' => $descricao];\n }\n\n $ultimoQtdPessoas = $qtdPessoas;\n }\n\n $produto->precos = $precosFinais;\n\n }\n\n return $produtos;\n\n }", "public function mostrarDados(){\n\t\t$sql = \"SELECT cliente.cod_cliente, cliente.nome_cliente, categoria.cod_categoria, categoria.desc_categoria, servico.cod_servico, servico.desc_servico, servico.foto\t\n\t\t\t\tFROM cliente INNER JOIN (categoria INNER JOIN servico ON categoria.cod_categoria = servico.cod_categoria) ON cliente.cod_cliente = servico.cod_cliente\n\t\t\t\twhere cod_servico = '$this->cod_servico'\";\n\t\t$qry= self:: executarSQL($sql);\n\t\t$linha = self::listar($qry);\n\t\t\n\t\t$this-> cod_servico = $linha['cod_servico'];\n\t\t$this-> cod_categoria = $linha['cod_categoria'];\n\t\t$this-> desc_categoria = $linha['desc_categoria'];\n\t\t$this-> cod_cliente = $linha['cod_cliente'];\n\t\t$this-> nome_cliente = $linha['nome_cliente'];\n\t\t$this-> desc_servico = $linha['desc_servico'];\n\t\t$this-> foto = $linha['foto'];\n\t}", "function fd_cliente_articulos(&$Sesion,&$oSearch){\n global $nom_bus;\n global $nombre;\n global $id_empresa;\n global $id_articulo;\n\tglobal $id_art;\n\tglobal $id_ag;\n\tglobal $hp;\n\n\t$usuario = identifica_usuarios($Sesion);\n\tif (!strcasecmp($usuario['desktop_name'],'Agentes')) {\n\t\t$id_ag = $usuario['valor'];\n\t}\n\t$id_articulo_sesion = $Sesion->get_var(\"id_articulo_promocion\");\n\n if (empty($id_empresa)) {\n $id_empresa =(int)$usuario['id'];\n\t}\n if (empty($id_articulo)) {\n $id_articulo =(int)$id_articulo_sesion;\n\t}\n if (!empty($nombre)) {\n $st_nombre = $nombre;\n\t\tif (is_numeric($nombre)) {\n\t\t\t$id_cli = (int)$nombre;\n\t\t\t$nombre= NULL;\n\t\t\tunset($nombre);\n\t\t}\n\t}\n\n\tif (!empty($st_nombre)) {\n\t\t$Sesion->set_var('st_nombre',$st_nombre,'SUBSECCION');\n\t} else {\n\t\t$Sesion->unset_var('st_nombre');\n\t}\n\tif (!empty($hp) AND is_numeric($hp)) {\n\t\t$Sesion->set_var('st_hp',$hp,'SUBSECCION');\n\t\t$oSearch->set_hits_page($hp);\n\t} else {\n\t\t$Sesion->set_var('st_hp',$oSearch->get_hits_page(),'SUBSECCION');\n\t}\n}", "function escribir_pedido($cliente) {\r\n\t$conn = mysql_connect(BD_HOST, BD_USERNAME, BD_PASSWORD);\r\n\tmysql_select_db(BD_DATABASE1);\r\n\t//busco la serie para pedidos de clientes\r\n\t$ssql = 'SELECT SPCCFG FROM F_CFG';\r\n\t$rs1 = mysql_query($ssql, $conn);\r\n\t$datos1 = mysql_fetch_array($rs1);\r\n\t//busco los pedidos por serie, cliente y estado \r\n\t$ssql = 'SELECT * FROM F_PCL WHERE CLIPCL=' . $cliente . ' AND TIPPCL=\\'' . $datos1['SPCCFG'] . '\\' AND ESTPCL=\\'0\\'';\r\n\tmysql_select_db(BD_DATABASE1);\r\n\t$rs = mysql_query($ssql, $conn);\r\n\techo (mysql_error());\r\n\tif (mysql_num_rows($rs) != 0) {\r\n\t\t$datos = mysql_fetch_array($rs);\r\n\t\t//cojo el detalle del pedido por orden de lineas\r\n\t\t$ssql = 'SELECT * FROM F_LPC WHERE CODLPC=' . $datos['CODPCL'] . ' AND TIPLPC=\\'' . $datos['TIPPCL'] . '\\' ORDER BY POSLPC ASC'; \r\n\t\t$rs1 = mysql_query($ssql, $conn);\r\n\t\tif (mysql_num_rows($rs1) != 0) {\r\n\t\t\t$total = 0;\r\n\t\t\t$colorcelda = COLOROSCUROCELDA;\r\n\t\t\twhile ($linea = mysql_fetch_array($rs1)) {\r\n\t\t\t\tif($colorcelda == COLORCLAROCELDA) {\r\n\t\t\t\t\t$colorcelda = COLOROSCUROCELDA;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$colorcelda = COLORCLAROCELDA;\r\n\t\t\t\t}\r\n\t\t\t\t//compruebo que el producto no tenga 0 en cantidad y si es así lo borro\r\n\t\t\t\techo('<tr bordercolor=\"#cccccc\" bgcolor=\"#ffffff\">');\r\n\t\t\t\techo('<td bgcolor=\"' . $colorcelda . '\">' . $linea['ARTLPC'] . '</td>');\r\n\t\t\t\techo('<td bgcolor=\"' . $colorcelda . '\">' . $linea['DESLPC'] . '</td>');\r\n\t\t\t\techo('<td align=\"right\" bgcolor=\"' . $colorcelda . '\">');\r\n\t\t\t\tprintf(\"%.2f\", $linea['PRELPC']);\r\n\t\t\t\techo('</td>');\r\n\t\t\t\techo('<td align=\"right\" nowrap bgcolor=\"' . $colorcelda . '\"><img src=\"plantillas/' . PLANTILLA . '/imagenes/menos.gif\" border=\"0\" style=\"cursor:pointer\" onclick=\"sumaresta2(\\'num' . $linea['POSLPC'] . '\\',\\'-\\');actualizar.submit();\" >&nbsp;<input value=\"');\r\n\t\t\t\techo(decimal($linea['CANLPC']));\r\n\t\t\t\techo('\" name=\"num' . $linea['POSLPC'] . '\" id=\"num' . $linea['POSLPC'] . '\" size=\"10\" maxlength=\"10\" type=\"text\" onfocus=\"this.blur()\" style=\"text-align:right;\">&nbsp;<img src=\"plantillas/' . PLANTILLA . '/imagenes/mas.gif\" border=\"0\" onclick=\"sumaresta2(\\'num' . $linea['POSLPC'] . '\\',\\'+\\');actualizar.submit();\" style=\"cursor:pointer\"></td>');\r\n\t\t\t\techo('<td align=\"right\" bgcolor=\"' . $colorcelda . '\">');\r\n\t\t\t\tprintf(\"%.2f\", $linea['DT1LPC']);\r\n\t\t\t\techo('%</td>');\r\n\t\t\t\techo('<td align=\"right\" bgcolor=\"' . $colorcelda . '\">');\r\n\t\t\t\t$total = number_format($total + ($linea['TOTLPC']), 2, '.', '');\r\n\t\t\t\tprintf(\"%.2f\", ($linea['TOTLPC']));\r\n\t\t\t\techo('</td>');\r\n\t\t\t\tif ($linea['IINLPC'] != 0) {\r\n\t\t\t\t\techo('<td align=\"center\" bgcolor=\"' . $colorcelda . '\">SI</td>');\r\n\t\t\t\t}else{\r\n\t\t\t\t\techo('<td align=\"center\" bgcolor=\"' . $colorcelda . '\">NO</td>');\r\n\t\t\t\t}\r\n\t\t\t\techo('<td align=\"center\" bgcolor=\"' . $colorcelda . '\"><img src=\"plantillas/' . PLANTILLA . '/imagenes/nor.gif\" border=\"0\" align=\"middle\" style=\"cursor:pointer\" onclick=\"borrarart(' . $linea['POSLPC'] . ')\" alt=\"Borrar art&iacute;culo\">&nbsp;</td>');\r\n\t\t\t\techo('</tr>');\r\n\t\t\t}\r\n\t\t\techo('<tr bordercolor=\"#999999\" align=\"right\" bgcolor=\"#cccccc\">');\r\n\t\t\techo('<td colspan=\"6\"><font color=\"#000000\" face=\"Verdana\" size=\"2\"><b>Total:</b></font></td>');\r\n\t\t\techo('<td colspan=\"2\"><font color=\"#000000\" face=\"Verdana\" size=\"2\"><b>');\r\n\t\t\tprintf(\"%.2f\", $total);\r\n\t\t\techo('</b></font></td>');\r\n\t\t\techo('</tr>');\r\n\t\t}else{\r\n\t\t\techo('<tr bordercolor=\"#cccccc\" align=\"center\" bgcolor=\"#ffffff\">');\r\n\t\t\techo('<td colspan=\"7\" align=\"center\">NO SE HAN ENCONTRADO ARTICULOS</td>');\r\n\t\t\techo('</tr>');\r\n\t\t\techo('<tr bordercolor=\"#999999\" align=\"center\" bgcolor=\"#cccccc\">');\r\n\t\t\techo('<td colspan=\"2\"><font color=\"#000000\" face=\"Verdana\" size=\"2\"><b>Total:</b></font></td>');\r\n\t\t\techo('<td></td><td>&nbsp;</td><td>&nbsp;</td>');\r\n\t\t\techo('<td><font color=\"#cccccc\">.</font></td>');\r\n\t\t\techo('<td><font color=\"#cccccc\">.</font></td>');\r\n\t\t\techo('<td><font color=\"#cccccc\">.</font></td>');\r\n\t\t\techo('</tr>');\r\n\t\t} \r\n\t}else{\r\n\t\techo('<tr bordercolor=\"#cccccc\" align=\"center\" bgcolor=\"#ffffff\">');\r\n\t\techo('<td height=\"30\" colspan=\"8\">NO SE HAN ENCONTRADO ARTICULOS EN EL PEDIDO</td></tr>');\r\n\t\techo('<tr bordercolor=\"#999999\" align=\"center\" bgcolor=\"#cccccc\">');\r\n\t\techo('<td colspan=\"8\"><font color=\"#000000\" face=\"Verdana\" size=\"2\"><b>&nbsp;</b></font></td>');\r\n\t\techo('</tr>');\r\n\t}\r\n}", "public function articulo ($id_articulo) {\n\t\t$this->load->model(\"Modgastosper\");\n\t\t$id_formulario = $this->session->userdata(\"id_formulario\");\n\t\t$id_persona = $this->session->userdata(\"id_persona\");\n\t\t$data = $this->Modgastosper->buscarArticulo($id_formulario, $id_persona, $id_articulo);\n\t\techo json_encode($data);\n\t}", "function cocinar_registro_cliente() {\n\t\tglobal $bd;\n\t\tglobal $x_idcliente;\n\t\tglobal $x_idpedido;\n\n\t\t\n\t\t// $x_arr_cliente = $_POST['p_cliente'];\n\t\t// $datos_cliente = $x_arr_cliente['cliente'];\n\t\t$datos_cliente = $_POST['p_cliente'];\n\n\t\t$nomclie=$datos_cliente['nombres'];\n\t\t$idclie=$datos_cliente['idcliente'];\n\t\t$num_doc=$datos_cliente['num_doc'];\n\t\t$direccion=$datos_cliente['direccion'];\n\t\t$f_nac=$datos_cliente['f_nac'];\n\t\t// $idpedidos=$x_arr_cliente['i'] == '' ? $x_idpedido : $x_arr_cliente['i'];\n\n\t\tif($idclie==''){\n\t\t\tif($nomclie==''){//publico general\n\t\t\t\t$idclie=0;\n\t\t\t}else{\n\t\t\t\t$sql=\"insert into cliente (idorg,nombres,direccion,ruc,f_nac)values(\".$_SESSION['ido'].\",'\".$nomclie.\"','\".$direccion.\"','\".$num_doc.\"','\".$f_nac.\"')\";\n\t\t\t\t$idclie=$bd->xConsulta_UltimoId($sql);\n\t\t\t}\n\t\t} else {\n\t\t\t// update cliente\n\t\t\t$sql=\"update cliente set nombres='\".$nomclie.\"',ruc='\".$num_doc.\"',direccion='\".$direccion.\"' where idcliente = \".$idclie;\n\t\t\t$bd->xConsulta_NoReturn($sql);\n\t\t}\n\n\t\t// $bd->xConsulta_NoReturn($sql);\n\t\t// $sql=\"update pedido set idcliente=\".$idclie.\" where idpedido in (\".$idpedidos.\")\";\n\t\t\n\t\t$x_idcliente = $idclie;\n\t\t$x_idpedido = $idpedidos;\n\n\t\techo $idclie;\n\n\t\t// $rptclie = json_encode(array('idcliente' => $idclie));\n\t\t// print $rptclie.'|';\n\n\t\t// 031218 // cambio: ahora se graba primero el cliente se devuelve el idcliete, \n\n\t\t// $GLOBALS['x_idcliente'] = $idclie;\n\t\t// return $x_idcliente;\n\t\t// echo $idclie;\n\t}", "function listarCliente(){\n\t\t$this->procedimiento='rec.ft_cliente_sel';\n\t\t$this->transaccion='REC_CLI_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cliente','int4');\n\t\t$this->captura('genero','varchar');\n\t\t$this->captura('ci','varchar');\n\t\t$this->captura('email','varchar');\n\t\t$this->captura('email2','varchar');\n\t\t$this->captura('direccion','varchar');\n\t\t$this->captura('celular','varchar');\n\t\t$this->captura('nombre','varchar');\n\t\t$this->captura('lugar_expedicion','varchar');\n\t\t$this->captura('apellido_paterno','varchar');\n\t\t$this->captura('telefono','varchar');\n\t\t$this->captura('ciudad_residencia','varchar');\n\t\t$this->captura('id_pais_residencia','int4');\n\t\t$this->captura('nacionalidad','varchar');\n\t\t$this->captura('barrio_zona','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('apellido_materno','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\n $this->captura('nombre_completo1','text');\n $this->captura('nombre_completo2','text');\n\t\t$this->captura('pais_residencia','varchar');\n\t\t//$this->captura('nombre','varchar');\n\n\n\n\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function linea_colectivo();", "public function RicercaPerIngredienti(){\n $pm = FPersistentManager::getInstance();\n $cibi = $pm->loadAllObjects();\n $view = new VRicerca();\n $view->mostraIngredienti($cibi);\n }", "function loadArticulo(){\n\t\t\t$r = $this->ar->getArticuloById($this->id);\n\t\t\tif($r != -1){\n\t\t\t\t$this->id \t\t\t= $r['doa_id'];\n\t\t\t\t$this->alcance \t\t= $r['alc_id'];\n\t\t\t\t$this->documento \t= $r['doc_id'];\n\t\t\t\t$this->nombre \t\t= $r['doa_nombre'];\n\t\t\t\t$this->descripcion\t= $r['doa_descripcion'];\n\t\t\t}else{\n\t\t\t\t$this->id \t\t\t= \"\";\n\t\t\t\t$this->alcance \t\t= \"\";\n\t\t\t\t$this->documento \t= \"\";\n\t\t\t\t$this->nombre \t\t= \"\";\n\t\t\t\t$this->descripcion\t= \"\";\n\t\t\t}\n\t}", "private function get_precios_articulo()\n {\n $this->template = 'ajax/nueva_compra_precios';\n \n $articulo = new articulo();\n $this->articulo = $articulo->get($_POST['referencia4precios']);\n }", "function pre_descuento_familia_articulos(&$Sesion) {\n\t$id_cliente=$Sesion->fetchVar('id_cliente','GET');\n\t$descuentos_familia_borrar=$Sesion->fetchVar('descuentos_familia_borrar','POST');\n\t$descuentos_familia_modificar=$Sesion->fetchVar('descuentos_familia_modificar','POST');\n\t$accion_ejecutar=$Sesion->fetchVar('accion_ejecutar','POST');\n\n\t$id_cliente_sesion = $Sesion->get_var(\"id_cliente_promocion\");\n\t$oDb = $Sesion->get_db('data');\n\n\t//debug(\"glob $id_cliente\");\n\t//debug(\"ses $id_cliente_sesion\");\n\n\tif(isset($id_cliente) AND $id_cliente_sesion != $id_cliente)\n\t\t$Sesion->set_var(\"id_cliente_promocion\",$id_cliente);\n\telse {\n\t\t$id_cliente = $Sesion->get_var(\"id_cliente_promocion\");\n\t\tif(!isset($id_cliente)){\n\t\t\t// debug(\"no hay cliente\");\n\t\t\treturn;\n\t\t}\n\t}\n\n\t//$id_cliente = $Sesion->get_var(\"id_cliente_promocion\");\n\t$usuario = identifica_usuarios($Sesion);\n\t//debug($id_cliente);\n\n\tswitch($accion_ejecutar){\n\t\tcase \"Modificar\" :\n\t\t\tif ($Sesion->verifyVar('descuentos_familia_modificar',IKRN_VAR_CRC_CHANGE) AND $Sesion->verifyVar('descuentos_familia_modificar',IKRN_VAR_CRC_AUTHED)) {\n\t\t\t\tif(isset($descuentos_familia_modificar)) {\n\t\t\t\t\tforeach($descuentos_familia_modificar as $clave => $valor){\n\t\t\t\t\t\t$aTmp = array();\n\t\t\t\t\t\t$aTmp['descuento'] = $descuentos_familia_modificar[$clave];\n\t\t\t\t\t\t$aTmp['id_familia'] = $clave;\n\t\t\t\t\t\t$aTmp['id_cliente'] = $id_cliente;\n\t\t\t\t\t\t$aTmp['id_empresa'] = $usuario['id'];\n\t\t\t\t\t\t$oDb->tb_update('Cliente_familia_articulos',$aTmp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\n\t\tcase \"Borrar\" :\n\t\t\tif(isset($descuentos_familia_borrar)){\n\t\t\t\tforeach($descuentos_familia_borrar as $clave => $valor)\n\t\t\t\t\tif($valor == 1 ){\n\t\t\t\t\t\t$aTmp = array();\n\t\t\t\t\t\t$aTmp['id_familia'] = $clave;\n\t\t\t\t\t\t$aTmp['id_cliente'] = $id_cliente;\n\t\t\t\t\t\t$aTmp['id_empresa'] = $usuario['id'];\n\t\t\t\t\t\t$oDb->tb_delete('Cliente_familia_articulos',$aTmp);\n\t\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\n\t\tcase \"Anyadir\" :\n\t\t\tif ($Sesion->verifyVar('descuentos_familia_modificar',IKRN_VAR_CRC_CHANGE) AND $Sesion->verifyVar('descuentos_familia_modificar',IKRN_VAR_CRC_AUTHED)) {\n\t\t\t\tif(isset($descuentos_familia_modificar)){\n\t\t\t\t\tforeach($descuentos_familia_modificar as $clave => $valor){\n\t\t\t\t\t\tif($descuentos_familia_modificar[$clave] != 0){\n\t\t\t\t\t\t\t$aTmp['id_empresa'] = $usuario['id'];\n\t\t\t\t\t\t\t$aTmp['id_cliente'] = $id_cliente;\n\t\t\t\t\t\t\t$aTmp['id_familia'] = $clave;\n\t\t\t\t\t\t\t$aTmp['descuento'] = $descuentos_familia_modificar[$clave];\n\t\t\t\t\t\t\t$oDb->tb_replace('Cliente_familia_articulos',$aTmp);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\n\t}//fin de acciones\n}", "public function articulos()\n {\n return $this->hasMany('PlanificaMYPE\\Articulo', 'idMarca', 'idMarca');\n }", "public function buscarclientecuit($cliente = null){\n\n if(sizeof($this->request->getData()) > 0){\n\n $data = $this->request->getData();\n\n if(ctype_digit ($data['id'])){\n\n $auth = $this->request->session()->read('Auth');\n\n try {\n\n $conditions[] = array('Clientes.cuit = ' => $data['id']);\n \n $c = $this->Clientes->find(\n 'all', \n array('recursive' => -1,\n 'conditions' => $conditions)\n )->first();\n\n if (!is_null($c)){\n\n $cliente = $c->toArray();\n\n return $this->redirect(['action' => 'view', $cliente['id']]);\n \n }else{\n\n $this->Flash->error(__('No existe un Cliente con ese CUIT/DNI.'));\n }\n\n } catch (RecordNotFoundException $e) {\n\n $this->Flash->error(__('No existe un Cliente con ese CUIT/DNI.'));\n }\n\n }else{\n\n $this->Flash->error(__('Solo ingresar Numeros sin \".\" ni \"-\".'));\n }\n }\n\n $this->set('cliente', $cliente);\n }", "function listar_producto_vendido(){\n\t\t$sql=\"SELECT SUM(cantidad_det) AS TotalVentas, claves_pro, categoria_pro, producto_det, detal_pro, mayor_pro, id_pro, id_pro AS directorio_image FROM producto, detalle_pedido WHERE producto_det=id_pro GROUP BY producto_det ORDER BY SUM(cantidad_det) DESC LIMIT 0 , 5\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$aux=\"\";\n\t\t\t$id_buscar=$resultado['id_pro'];\n\t\t\t$sql2=\"SELECT directorio_image FROM imagen WHERE galeria_image='$id_buscar'\";\n\t\t\t$buscar=mysql_query($sql2)\tor die(mysql_error());\n\t\t\t$resultados=mysql_fetch_array($buscar);\n\t\t\t$resultado['directorio_image']=$resultados['directorio_image'];\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$resultado['detal_pro']=$this->convertir_moneda($resultado['detal_pro']);\n\t\t\t$resultado['mayor_pro']=$this->convertir_moneda($resultado['mayor_pro']);\n\t\t\t\n\t\t\t$cat=$resultado['categoria_pro'];\n\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat'\";\n\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\t\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "public function show(cliente $cliente) {\n\t\t//\n\t}", "public function listarVehiculosMantenimientosController(){\n\n\t\t\t$respuesta = GestorMantenimientosModel::listarVehiculosMantenimientosModel(\"vehiculo\", \"cliente\");\n\n\t\t\tforeach ($respuesta as $row => $item) {\n\n\t\t\t\techo '\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"text-center\">'.$item[\"nombre_cliente\"]. ' '.$item[\"apellido_cliente\"].'</td>\n\t\t\t \t\t\t<td class=\"text-center\">'.$item[\"placas_vehiculo\"].'</td>\n\t\t\t \t\t\t<td class=\"text-center\">'.$item[\"marca_vehiculo\"].'</td>\n\t\t\t \t\t\t<td class=\"text-center\">'.$item[\"modelo_vehiculo\"].'</td>\n\t\t\t \t\t\t<td class=\"text-center\">'.$item[\"anio_vehiculo\"].'</td>\n\t\t\t \t\t\t<td class=\"text-center\">'.$item[\"kilometraje_vehiculo\"].'</td>\n\t\t\t \t\t\t<td class=\"text-center class=\"acciones\"\"><a href=\"#\" onclick=\"agregarVehiculo(\\''.$item[\"id_vehiculo\"].'\\', \\''.$item[\"placas_vehiculo\"].'\\', \\''.$item[\"marca_vehiculo\"].'\\', \\''.$item[\"modelo_vehiculo\"].'\\', \\''.$item[\"kilometraje_vehiculo\"].'\\', \\''.$item[\"nombre_cliente\"].'\\', \\''.$item[\"apellido_cliente\"].'\\')\" class=\"btn btn-info\"><span class=\"fa fa-car\"></span> Agregar </a></td>\n\t\t\t \t\t</tr>\n\t\t \t\t';\n\t\t \t\t\n\t\t\t}\n\n\t\t}", "public function cliente($key, $value=null)\n {\n if (is_array($key) || is_object($key)) {\n \tsettype($key, 'array');\n foreach ($key as $k=>$v) {\n $this->cliente((string) $k, (string) $v);\n }\n return;\n }\n foreach (self::$_substitutos_cliente as $chave=>$valores) {\n foreach ($valores as $item) {\n \tif ($key==$item) {\n \t$key = $chave;\n }\n }\n }\n if (in_array($key, self::$_itens_cliente)) {\n $this->cliente[$key] = $value;\n }\n }", "public function set_clientes(objeto_cliente $cliente){\n\t$consulta_insertar = new Conectar();\n\t$consulta_insertar = $consulta_insertar->conexion();\n\t$query=\"insert into clientes (cliente_id, nombre, celular, pais, correo) values (:cl_id, :nom, :cel, :pais, :corr)\";\n\n\t$resultado=$consulta_insertar->prepare($query);\n\n\t$resultado->execute(array(\":cl_id\"=>$cliente->get_cliente_id(),\":nom\"=>$cliente->get_nombre(),\":cel\"=>$cliente->get_celular(),\":pais\"=>$cliente->get_pais(),\":corr\"=>$cliente->get_correo()));\n\n\n\t}", "function cosultarItem($id) {\n global $textos, $sql, $sesion_configuracionGlobal;\n\n if (!isset($id) || (isset($id) && !$sql->existeItem('facturas_venta', 'id', $id))) {\n $respuesta = array();\n $respuesta['error'] = true;\n $respuesta['mensaje'] = $textos->id('NO_HA_SELECCIONADO_ITEM');\n\n Servidor::enviarJSON($respuesta);\n return NULL;\n }\n\n $objeto = new FacturaVenta($id);\n $respuesta = array();\n $regimenEmpresa = $sesion_configuracionGlobal->empresa->regimen;\n \n $codigo = '';\n\n $codigo .= HTML::campoOculto('id', $id);\n\n $codigo1 = HTML::parrafo($textos->id('CLIENTE') . ': ' . HTML::frase($objeto->cliente, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo1 .= HTML::parrafo($textos->id('NIT') . ': ' . HTML::frase($objeto->idCliente, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo1 .= HTML::parrafo($textos->id('FECHA_FACTURA') . ': ' . HTML::frase($objeto->fechaFactura, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo1 .= HTML::parrafo($textos->id('USUARIO_QUE_FACTURA') . ': ' . HTML::frase($objeto->usuario, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo1 .= HTML::parrafo('', 'negrilla margenSuperior');\n\n if ($objeto->fechaVtoFactura != \"\" && $objeto->fechaVtoFactura != \"0000-00-00\") {\n $codigo2 = HTML::parrafo($textos->id('FECHA_VENCIMIENTO') . ': ' . HTML::frase($objeto->fechaVtoFactura, 'sinNegrilla'), 'negrilla margenSuperior');\n }\n \n $codigo2 = '';\n \n $codigo2 .= HTML::parrafo($textos->id('SEDE') . ': ' . HTML::frase($objeto->sede, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo2 .= HTML::parrafo($textos->id('VALOR_FLETE') . ': ' . HTML::frase('$ '.Recursos::formatearNumero($objeto->valorFlete, '$'), 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo2 .= HTML::parrafo($textos->id('CAJA') . ': ' . HTML::frase($objeto->caja, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo2 .= HTML::parrafo($textos->id('OBSERVACIONES') . ': ' . HTML::frase($objeto->observaciones, 'sinNegrilla'), 'negrilla margenSuperior');\n\n //verificar el identificador escogido para los articulos en la configuracion global y usarlo para mostrar los datos\n $idPrincipalArticulo = (string)$sesion_configuracionGlobal->idPrincipalArticulo;\n \n $arrayIdArticulo = array('id' => $textos->id('ID_AUTOMATICO'), 'codigo_oem' => $textos->id('CODIGO_OEM'), 'plu_interno' => $textos->id('PLU')); \n\n\n $datosTabla = array(\n HTML::frase($textos->id($arrayIdArticulo[$idPrincipalArticulo]), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('ARTICULO'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('CANTIDAD'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('DESCUENTO'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('IVA'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('PRECIO'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('SUBTOTAL'), 'negrilla margenIzquierda')\n );\n\n //si el regimen es simplificado quito el iva del arreglo\n if ($regimenEmpresa == \"1\"){\n $datosTabla = array_diff($datosTabla, array(HTML::frase($textos->id('IVA'), 'negrilla margenIzquierda')));\n }\n \n $subtotalFactura = 0;\n\n $listaArticulos = array();\n \n foreach ($objeto->listaArticulos as $article) {\n\n $object = new stdClass();\n\n $object->plu = $article->$idPrincipalArticulo;\n $object->articulo = $article->articulo;\n $object->cantidad = $article->cantidad; \n $object->descuento = $article->descuento;\n \n if ($regimenEmpresa != \"1\"){\n $object->iva = $article->iva;\n }\n \n $object->precio = $article->precio; \n $object->subtotal = ''; \n \n if (strlen($object->articulo) > 80) {\n $object->articulo = substr($object->articulo, 0, 80) . '.';\n } \n \n \n if ($object->descuento == 0 || $object->descuento == '0') {\n $object->subtotal = $object->cantidad * $object->precio;\n } else {\n $object->subtotal = ($object->cantidad * $object->precio) - ( ( ($object->cantidad * $object->precio) * $object->descuento) / 100 );\n }\n $object->descuento = Recursos::formatearNumero($object->descuento, '%', '0');\n $object->precio = '$' . Recursos::formatearNumero($object->precio, '$');\n \n// $subtotalFactura += $object->subtotal;\n\n $object->subtotal = '$' . Recursos::formatearNumero($object->subtotal, '$');\n\n $listaArticulos[] = $object;\n }\n\n\n\n $idTabla = 'tablaListaArticulosConsulta';\n $clasesColumnas = array('', '', '', '', '');\n $clasesFilas = array('centrado', 'centrado', 'centrado', 'centrado', 'centrado', 'centrado');\n $opciones = array('cellpadding' => '5', 'cellspacing' => '5', 'border' => '2');\n $clase = 'tablaListaArticulosConsulta';\n $contenedorListaArticles = HTML::tabla($datosTabla, $listaArticulos, $clase, $idTabla, $clasesColumnas, $clasesFilas, $opciones);\n\n //si el regimen es diferente al regimen simplificado muestro el iva\n if ($regimenEmpresa != \"1\"){\n $codigo4 = HTML::parrafo($textos->id('IVA') . '$ '.HTML::frase($objeto->iva . '$ ', 'sinNegrilla'), 'negrilla margenSuperior');\n }\n \n $codigo4 .= HTML::parrafo($textos->id('DESCUENTOS') . ': ', 'negrilla margenSuperior letraVerde');\n\n $totalFactura = $objeto->subtotal;\n\n if (!empty($objeto->concepto1) && !empty($objeto->descuento1)) {\n\n $pesosDcto1 = ($totalFactura * $objeto->descuento1) / 100;\n $codigo4 .= HTML::parrafo($objeto->concepto1 . ': ' . HTML::frase($objeto->descuento1 . '%', 'sinNegrilla') . HTML::frase('$' . Recursos::formatearNumero($pesosDcto1, '$'), 'sinNegrilla margenIzquierdaDoble'), 'negrilla margenSuperior');\n \n }\n\n if (!empty($objeto->concepto2) && !empty($objeto->descuento2)) {\n $pesosDcto2 = ($totalFactura * $objeto->descuento2) / 100;\n $codigo4 .= HTML::parrafo($objeto->concepto2 . ': ' . HTML::frase($objeto->descuento2 . '%', 'sinNegrilla') . HTML::frase('$' . Recursos::formatearNumero($pesosDcto2, '$'), 'sinNegrilla margenIzquierdaDoble'), 'negrilla margenSuperior');\n \n }\n \n if (!empty($objeto->fechaLimiteDcto1) && !empty($objeto->porcentajeDcto1)) {\n $pesosDctoExtra1 = ($totalFactura * $objeto->porcentajeDcto1) / 100;\n $codigo4 .= HTML::parrafo($textos->id('FECHA_LIMITE_PAGO_PARA_DESCUENTO') . ': ' . $objeto->fechaLimiteDcto1 . ' ' . $textos->id('PORCENTAJE_DESCUENTO') . ': ' . HTML::frase($objeto->porcentajeDcto1 . '%', 'sinNegrilla') . HTML::frase('$'.Recursos::formatearNumero($pesosDctoExtra1, '$'), 'sinNegrilla margenIzquierdaDoble'), 'negrilla margenSuperior');\n\n }\n\n if (!empty($objeto->fechaLimiteDcto2) && !empty($objeto->porcentajeDcto2)) {\n $pesosDctoExtra2 = ($totalFactura * $objeto->porcentajeDcto2) / 100;\n $codigo4 .= HTML::parrafo($textos->id('FECHA_LIMITE_PAGO_PARA_DESCUENTO') . ': ' . $objeto->fechaLimiteDcto2 . ' ' . $textos->id('PORCENTAJE_DESCUENTO') . ': ' . HTML::frase($objeto->porcentajeDcto2 . '%', 'sinNegrilla') . HTML::frase('$'.Recursos::formatearNumero($pesosDctoExtra2, '$'), 'sinNegrilla margenIzquierdaDoble'), 'negrilla margenSuperior');\n \n } \n\n $codigo5 = HTML::parrafo($textos->id('SUBTOTAL') . ': $' . HTML::frase(Recursos::formatearNumero($objeto->subtotal, '$'), 'sinNegrilla titulo'), 'negrilla margenSuperior parrafoTotal');\n $codigo5 .= HTML::parrafo('', 'negrilla margenSuperior');\n $codigo5 .= HTML::parrafo('', 'negrilla margenSuperior');\n $codigo5 .= HTML::parrafo($textos->id('TOTAL') . '$' . HTML::frase(Recursos::formatearNumero($objeto->total, '$'), 'sinNegrilla letraAzul grande'), 'negrilla margenSuperiorDoble titulo parrafoTotal');\n\n $contenedor1 = HTML::contenedor($codigo1, 'contenedorIzquierdo');\n $contenedor2 = HTML::contenedor($codigo2, 'contenedorDerecho');\n $contenedor3 = HTML::contenedor($contenedorListaArticles, 'contenedorListadoArticulos');\n $contenedor4 = HTML::contenedor($codigo4, 'contenedorIzquierdo');\n $contenedor5 = HTML::contenedor($codigo5, 'contenedorDerecho');\n\n $pestana1 = $contenedor1 . $contenedor2 . $contenedor3 . $contenedor4 . $contenedor5;\n \n \n /**\n * NOTAS CREDITO DE LA FACTURA\n */\n $pestana2 = '';\n \n $notaCredito = new NotaCreditoCliente();\n \n $listaNotas = $notaCredito->listar($id); \n \n foreach ($listaNotas as $lista) {\n $lista->botonConsultar = HTML::contenedor('', 'consultarRegistro');\n }\n\n $datosTabla = array(\n HTML::parrafo($textos->id('ID_FACTURA'), 'centrado') => 'idFactura',\n HTML::parrafo($textos->id('CONCEPTO_NOTA'), 'centrado') => 'conceptoNota',\n HTML::parrafo($textos->id('TOTAL_NOTA'), 'centrado') => 'totalNota',\n HTML::parrafo($textos->id('FECHA_NOTA'), 'centrado') => 'fechaNota',\n HTML::parrafo($textos->id('CONSULTAR'), 'centrado') => 'botonConsultar',\n ); \n \n $rutas = array(\n 'ruta_consultar' => '/ajax/facturas_venta/consultarNotaCredito',\n ); \n \n $idTabla = 'tablaListaNotasCredito';\n $clasesColumnas = array('centrado', 'centrado', 'centrado', 'centrado');\n $tablaListaNotasCredito = Recursos::generarTablaRegistrosInterna($listaNotas, $datosTabla, $rutas, $idTabla, $clasesColumnas); \n \n $pestana2 = $tablaListaNotasCredito;\n \n /**\n * NOTAS DEBITO DE LA FACTURA\n */ \n $notaDebito = new NotaDebitoCliente();\n \n $listaNotas = $notaDebito->listar($id); \n \n foreach ($listaNotas as $lista) {\n $lista->botonConsultar = HTML::contenedor('', 'consultarRegistro');\n }\n\n $datosTabla = array(\n HTML::parrafo($textos->id('ID_FACTURA'), 'centrado') => 'idFactura',\n HTML::parrafo($textos->id('CONCEPTO_NOTA'), 'centrado') => 'conceptoNota',\n HTML::parrafo($textos->id('TOTAL_NOTA'), 'centrado') => 'totalNota',\n HTML::parrafo($textos->id('FECHA_NOTA'), 'centrado') => 'fechaNota',\n HTML::parrafo($textos->id('CONSULTAR'), 'centrado') => 'botonConsultar',\n ); \n \n $rutas = array(\n 'ruta_consultar' => '/ajax/facturas_venta/consultarNotaDebito',\n ); \n \n $idTabla = 'tablaListaNotasDebito';\n $clasesColumnas = array('centrado', 'centrado', 'centrado', 'centrado');\n $tablaListaNotasDebito = Recursos::generarTablaRegistrosInterna($listaNotas, $datosTabla, $rutas, $idTabla, $clasesColumnas); \n\n $pestana3 = $tablaListaNotasDebito;\n \n /**\n * ASIENTOS CONTABLES GENERADOS POR LA FACTURA\n */ \n $asientoContable = new AsientoContable();\n \n $tablaListaRegistroContable = $asientoContable->generarTablaRegistroContable(\"2\", $id);\n\n $pestana4 = $tablaListaRegistroContable; \n \n $pestanas = array(\n HTML::frase($textos->id('INFORMACION_FACTURA'), 'letraBlanca') => $pestana1,\n HTML::frase($textos->id('NOTAS_CREDITO'), 'letraBlanca') => $pestana2,\n HTML::frase($textos->id('NOTAS_DEBITO'), 'letraBlanca') => $pestana3,\n HTML::frase($textos->id('REGISTRO_CONTABLE'), 'letraBlanca') => $pestana4,\n \n );\n\n $codigo .= HTML::pestanas2('pestanasAgregar', $pestanas); \n\n $respuesta['generar'] = true;\n $respuesta['codigo'] = $codigo;\n $respuesta['titulo'] = HTML::parrafo($textos->id('CONSULTAR_ITEM'), 'letraBlanca negrilla subtitulo');\n $respuesta['destino'] = '#cuadroDialogo';\n $respuesta['ancho'] = 800;\n $respuesta['alto'] = 600;\n\n Servidor::enviarJSON($respuesta);\n \n}", "public function accionPerfilArtista(){\n // (si es que hay alguno logueado)\n $sw = false;\n $codRole = 0;\n \n if(Sistema::app()->Acceso()->hayUsuario()){\n $sw = true;\n \n $nick = Sistema::app()->Acceso()->getNick();\n $codRole = Sistema::app()->ACL()->getUsuarioRole($nick);\n \n }\n \n // Si el usuario que intenta acceder es un restaurante, administrador\n // o simplemente no hay usuario validado, lo mando a una página de\n // error. Los artistas tienen el rol 5\n if(!$sw || $codRole != 5){\n Sistema::app()->paginaError(403, \"No tiene permiso para acceder a esta página.\");\n exit();\n }\n \n // Una vez comprobado que está accediendo un artista, procedo a\n // obtener los datos del artista\n $art = new Artistas();\n \n // El nick del usuario es el correo electrónico. Es un valor\n // único, por lo que puedo buscar al artista por\n // su dirección de correo\n if(!$art->buscarPor([\"where\"=>\"correo='$nick'\"])){\n \n Sistema::app()->paginaError(300,\"Ha habido un problema al encontrar tu perfil.\");\n return;\n \n }\n \n $imagenAntigua = $art->imagen;\n $nombre=$art->getNombre();\n \n // Si se modifican los datos del artista, esta variable\n // pasará a true para notificar a la vista\n $artistaModificado = false;\n if (isset($_POST[$nombre]))\n {\n $hayImagen = true;\n // Si ha subido una nueva imagen, recojo su nombre\n if($_FILES[\"nombre\"][\"name\"][\"imagen\"]!=\"\"){\n $_POST[\"nombre\"][\"imagen\"] = $_FILES[\"nombre\"][\"name\"][\"imagen\"];\n }\n else{\n $hayImagen = false;\n $_POST[\"nombre\"][\"imagen\"] = $art->imagen;\n }\n // El coreo es una clave foránea, así que tengo\n // que cambiar el correo en la tabla ACLUsuarios\n Sistema::app()->ACL()->setNick($nick, $_POST[\"nombre\"][\"correo\"]);\n \n $art->setValores($_POST[$nombre]);\n \n if ($art->validar())\n {\n // Si se ha guardado correctamente, actualizo la imagen de perfil\n // e inicio sesión con el nuevo correo automáticamente\n if ($art->guardar()){\n $artistaModificado = true;\n if($hayImagen){\n // Obtengo la carpeta destino de la imagen\n $carpetaDestino = $_SERVER['DOCUMENT_ROOT'].\"/imagenes/artistas/\";\n // Elimino la imagen antigua\n unlink($carpetaDestino.$imagenAntigua);\n \n // Y guardo la nueva\n move_uploaded_file($_FILES['nombre']['tmp_name']['imagen'], $carpetaDestino.$_POST[\"nombre\"][\"imagen\"]);\n }\n Sistema::app()->Acceso()->registrarUsuario(\n $_POST[\"nombre\"][\"correo\"],\n mb_strtolower($art->nombre),\n 0,\n 0,\n [1,1,1,1,1,0,0,0,0,0]);\n }\n \n }\n }\n \n $this->dibujaVista(\"perfilArtista\",\n [\"art\"=>$art, \"artistaModificado\"=>$artistaModificado],\n \"Perfil\");\n \n }", "public function viewArt(){\r\n\t\t\r\n\t\t$strTabla= \"<table border='1' id='customers'><tr> <th>ID</th><th>Nombre </th><th>correo</th><th>saldo </th><th>Dar de alta </th></tr>\";\r\n\t\t\t$articulos = $this->db->query(\"select * from Cliente WHERE alta like '0';\");\r\n\t\t\t//recorro los arituclos y los introduzco en la tabla\r\n\t\t\tforeach ($articulos->result() as $row)\r\n\t\t\t{\r\n\t\t\t\t$strTabla.= \"<tr><td>\". $row->ID .\"</td> <td>\". $row->nombre .\"</td> <td>\". $row->correo .\"</td> <td>\". $row->saldo .\"</td> <td><a href=\". base_url(\"index.php/Tiendamerch/alta/\". $row->ID .\"\") .\">DAR DE ALTA</a></td> </tr>\";\r\n\t\t\t}\r\n\t\t\t$strTabla.= \"</table>\";\r\n\t\treturn $strTabla;\r\n\t\t\r\n\t}", "public function setArticulo($articulo)\n {\n $this->articulo = $articulo;\n }", "public function DevuelveArticulosEnTienda($id) {\n if (is_numeric($id)) {\n $productos = DB::table('articles')\n -> select('articles.id', 'articles.name', 'articles.description', 'articles.price', 'articles.total_in_shelf','articles.total_in_vault', 'articles.store_id', 'stores.name as store_name')\n -> leftJoin('stores', 'articles.store_id','=', 'stores.id')\n -> where('store_id', $id);\n\n if (!$productos-> get()) {\n return response()->json(['error_msg'=>'Record not Found', 'error_code'=>'404', 'success'=>false], 404);\n }\n if ($productos->count()>1) $RESP = 'articles';\n else $RESP='article';\n return response()->json([$RESP=>$productos-> get(), 'success'=>true,'total_elements'=>$productos->count()],200);\n } else {\n return response()->json(['error_msg'=>'Bad Request', 'error_code'=>'400', 'success'=>false], 400);\n }\n }", "public static function odstraniArtikelIzKosarice() {\n $id = $_SESSION[\"uporabnik_id\"];\n $uporabnik = UporabnikiDB::get($id);\n\n $id_artikla = filter_input(INPUT_POST, \"id\", FILTER_SANITIZE_SPECIAL_CHARS);\n $status = \"kosarica\";\n\n $narocilo = NarocilaDB::getByUporabnikId($id, $status);\n $podrobnost_narocila = PodrobnostiNarocilaDB::getByNarociloAndArtikel($narocilo[\"id\"], $id_artikla);\n\n\n if (PodrobnostiNarocilaDB::delete($podrobnost_narocila[\"id_podrobnosti_narocila\"])) {\n echo ViewHelper::redirect(BASE_URL . \"kosarica\");\n } else {\n echo(\"Napaka\");\n }\n }", "function listarClienteLibro()\n {\n $this->procedimiento='rec.ft_cliente_sel';\n $this->transaccion='REC_RELIBRO_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n\n $this->setParametro('id_oficina_registro_incidente','id_oficina_registro_incidente','integer');\n $this->setParametro('fecha_ini','fecha_ini','date');\n $this->setParametro('fecha_fin','fecha_fin','date');\n $this->setCount(false);\n\n $this->captura('id_reclamo','int4');\n $this->captura('nro_frd','varchar');\n $this->captura('correlativo_preimpreso_frd','int4');\n $this->captura('fecha_hora_incidente','timestamp');\n $this->captura('fecha_hora_recepcion','timestamp');\n $this->captura('fecha_hora_recepcion_sac','date');\n $this->captura('detalle_incidente','text');\n $this->captura('nombre','text');\n $this->captura('celular','varchar');\n $this->captura('telefono','varchar');\n $this->captura('nombre_incidente','varchar');\n $this->captura('sub_incidente','varchar');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n\t\t//var_dump($this->respuesta); exit;\n $this->ejecutarConsulta();\n //var_dump($this->respuesta); exit;\n //Devuelve la respuesta\n return $this->respuesta;\n\n }", "public function listadoPedidos(){\n $pedido=new Pedido();\n\n //Conseguimos todos los usuarios\n $allPedido=$pedido->getAll();\n print_r(json_encode($allPedido));\n //echo $allClientes\n }", "function crearFactura($partidas, $cliente){\n\n\t}", "public function CarregaClientes() {\n\t\t$clientes = new Model_Wpr_Clientes_ClientesIntegracao ();\n\t\t\n\t\treturn $clientes->carregaClientes ();\n\t}", "function cosultarItem2($id) {\n global $textos, $sql;\n\n if (!isset($id) || (isset($id) && !$sql->existeItem('facturas_venta', 'id', $id))) {\n $respuesta = array();\n $respuesta['error'] = true;\n $respuesta['mensaje'] = $textos->id('NO_HA_SELECCIONADO_ITEM');\n\n Servidor::enviarJSON($respuesta);\n return NULL;\n }\n\n $objeto = new FacturaVenta($id);\n $respuesta = array();\n\n $codigo .= HTML::campoOculto('id', $id);\n\n $codigo1 = HTML::parrafo($textos->id('CLIENTE') . ': ' . HTML::frase($objeto->cliente, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo1 .= HTML::parrafo($textos->id('NIT') . ': ' . HTML::frase($objeto->idCliente, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo1 .= HTML::parrafo($textos->id('FECHA_FACTURA') . ': ' . HTML::frase($objeto->fechaFactura, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo1 .= HTML::parrafo($textos->id('USUARIO_QUE_FACTURA') . ': ' . HTML::frase($objeto->usuario, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo1 .= HTML::parrafo($textos->id('MODO_PAGO') . ': ' . HTML::frase($textos->id('MODO_PAGO' . $objeto->modoPago), 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo1 .= HTML::parrafo('', 'negrilla margenSuperior');\n\n if ($objeto->modoPago == '2') {\n $codigo2 = HTML::parrafo($textos->id('FECHA_VENCIMIENTO') . ': ' . HTML::frase($objeto->fechaVtoFactura, 'sinNegrilla'), 'negrilla margenSuperior');\n }\n \n $codigo2 .= HTML::parrafo($textos->id('SEDE') . ': ' . HTML::frase($objeto->sede, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo2 .= HTML::parrafo($textos->id('VALOR_FLETE') . ': ' . HTML::frase(Recursos::formatearNumero($objeto->valorFlete, '$'), 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo2 .= HTML::parrafo($textos->id('OBSERVACIONES') . ': ' . HTML::frase($objeto->observaciones, 'sinNegrilla'), 'negrilla margenSuperior');\n\n $datosTabla = array(\n HTML::frase($textos->id('PLU'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('ARTICULO'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('CANTIDAD'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('DESCUENTO'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('PRECIO'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('SUBTOTAL'), 'negrilla margenIzquierda')\n );\n\n $subtotalFactura = 0;\n\n $listaArticulos = array();\n foreach ($objeto->listaArticulos as $article) {\n unset($article->id);\n unset($article->idFactura);\n \n if (strlen($article->articulo) > 60) {\n $article->articulo = substr($article->articulo, 0, 60) . '.';\n }\n \n if ($article->descuento == 0 || $article->descuento == '0') {\n $article->subtotal = $article->cantidad * $article->precio;\n \n } else {\n $article->subtotal = ($article->cantidad * $article->precio) - ( ( ($article->cantidad * $article->precio) * $article->descuento) / 100 );\n \n }\n \n $article->descuento = Recursos::formatearNumero($article->descuento, '%', '0');\n \n $article->precio = Recursos::formatearNumero($article->precio, '$');\n \n $subtotalFactura += $article->subtotal;\n\n $article->subtotal = Recursos::formatearNumero($article->subtotal, '$');\n\n $listaArticulos[] = $article;\n }\n\n $subtotalFactura += $objeto->valorFlete;\n $impuestoIva = ($subtotalFactura * $objeto->iva) / 100;\n\n $subtotalFactura += $impuestoIva;\n\n $idTabla = 'tablaListaArticulosConsulta';\n $clasesColumnas = array('', '', '', '', '');\n $clasesFilas = array('centrado', 'centrado', 'centrado', 'centrado', 'centrado', 'centrado');\n $opciones = array('cellpadding' => '5', 'cellspacing' => '5', 'border' => '2');\n $clase = 'tablaListaArticulosConsulta';\n \n $contenedorListaArticles = HTML::tabla($datosTabla, $listaArticulos, $clase, $idTabla, $clasesColumnas, $clasesFilas, $opciones);\n\n\n $codigo4 = HTML::parrafo($textos->id('IVA') . HTML::frase($objeto->iva . '% ', 'sinNegrilla') . HTML::frase(Recursos::formatearNumero($impuestoIva, '$'), 'sinNegrilla margenIzquierdaDoble'), 'negrilla margenSuperior');\n $codigo4 .= HTML::parrafo($textos->id('DESCUENTOS') . ': ', 'negrilla margenSuperior letraVerde');\n\n $totalFactura = $subtotalFactura;\n\n if (!empty($objeto->concepto1) && !empty($objeto->descuento1)) {\n $pesosDcto1 = ($totalFactura * $objeto->descuento1) / 100;\n $totalFactura = $totalFactura - $pesosDcto1;\n $codigo4 .= HTML::parrafo($objeto->concepto1 . ': ' . HTML::frase($objeto->descuento1 . '%', 'sinNegrilla') . HTML::frase(Recursos::formatearNumero($pesosDcto1, '$'), 'sinNegrilla margenIzquierdaDoble'), 'negrilla margenSuperior');\n }\n\n if (!empty($objeto->concepto2) && !empty($objeto->descuento2)) {\n $pesosDcto2 = ($totalFactura * $objeto->descuento2) / 100;\n $totalFactura = $totalFactura - $pesosDcto2;\n $codigo4 .= HTML::parrafo($objeto->concepto2 . ': ' . HTML::frase($objeto->descuento2 . '%', 'sinNegrilla') . HTML::frase(Recursos::formatearNumero($pesosDcto2, '$'), 'sinNegrilla margenIzquierdaDoble'), 'negrilla margenSuperior');\n }\n\n if (!empty($objeto->fechaLimiteDcto1) && !empty($objeto->porcentajeDcto1)) {\n $pesosDctoExtra1 = ($totalFactura * $objeto->porcentajeDcto1) / 100;\n $codigo4 .= HTML::parrafo($textos->id('FECHA_LIMITE_PAGO_PARA_DESCUENTO') . ': ' . $objeto->fechaLimiteDcto1 . ' ' . $textos->id('PORCENTAJE_DESCUENTO') . ': ' . HTML::frase($objeto->porcentajeDcto1 . '%', 'sinNegrilla') . HTML::frase(Recursos::formatearNumero($pesosDctoExtra1, '$'), 'sinNegrilla margenIzquierdaDoble'), 'negrilla margenSuperior');\n }\n\n if (!empty($objeto->fechaLimiteDcto2) && !empty($objeto->porcentajeDcto2)) {\n $pesosDctoExtra2 = ($totalFactura * $objeto->porcentajeDcto2) / 100;\n $codigo4 .= HTML::parrafo($textos->id('FECHA_LIMITE_PAGO_PARA_DESCUENTO') . ': ' . $objeto->fechaLimiteDcto2 . ' ' . $textos->id('PORCENTAJE_DESCUENTO') . ': ' . HTML::frase($objeto->porcentajeDcto2 . '%', 'sinNegrilla') . HTML::frase(Recursos::formatearNumero($pesosDctoExtra2, '$'), 'sinNegrilla margenIzquierdaDoble'), 'negrilla margenSuperior');\n }\n\n $codigo5 = HTML::parrafo($textos->id('SUBTOTAL') . ': ' . HTML::frase(Recursos::formatearNumero($subtotalFactura, '$'), 'sinNegrilla titulo'), 'negrilla margenSuperior');\n $codigo5 .= HTML::parrafo('', 'negrilla margenSuperior');\n $codigo5 .= HTML::parrafo('', 'negrilla margenSuperior');\n $codigo5 .= HTML::parrafo($textos->id('TOTAL') . HTML::frase(Recursos::formatearNumero($totalFactura, '$'), 'sinNegrilla letraAzul grande'), 'negrilla margenSuperior titulo');\n $codigo5 .= HTML::parrafo($objeto->facturaDigital, 'negrilla margenSuperior');\n\n\n $contenedor1 = HTML::contenedor($codigo1, 'contenedorIzquierdo');\n $contenedor2 = HTML::contenedor($codigo2, 'contenedorDerecho');\n $contenedor3 = HTML::contenedor($contenedorListaArticles, 'contenedorListadoArticulos');\n $contenedor4 = HTML::contenedor($codigo4, 'contenedorIzquierdo');\n $contenedor5 = HTML::contenedor($codigo5, 'contenedorDerecho');\n\n $codigo .= $contenedor1 . $contenedor2 . $contenedor3 . $contenedor4 . $contenedor5;\n\n $respuesta['generar'] = true;\n $respuesta['codigo'] = $codigo;\n $respuesta['titulo'] = HTML::parrafo($textos->id('CONSULTAR_ITEM'), 'letraBlanca negrilla subtitulo');\n $respuesta['destino'] = '#cuadroDialogo';\n $respuesta['ancho'] = 800;\n $respuesta['alto'] = 600;\n\n Servidor::enviarJSON($respuesta);\n \n}", "function RellenarIndice()\r\n {\r\n $this->AddPage();\r\n\r\n $this->Imprimir('2. Revisión y Análisis de las siguientes interrupciones:', 20, 10);\r\n\r\n $cont_causa500 = 1;\r\n $cont_imp = 1;\r\n $cont_pro = 1;\r\n\r\n foreach ($this->eventos as $evento)\r\n {\r\n if (Doctrine_Core::getTable('SAF_EVENTO_CONVOCATORIA')->getEventoConvocatoria($evento, $this->convocatoria)->getStatus() == 'analizado')\r\n {\r\n $this->ImprimirSubtituloIndice($evento, $cont_causa500, $cont_imp, $cont_pro);\r\n\r\n $fecha_evento = strftime(\"%A, %d/%m/%Y\", strtotime($evento->getFHoraIni()));\r\n $text = \"RI. \" . $evento->getCEventoD() . \" - Circuito \" . $evento->getCircuito() . \". \" . $fecha_evento . '. MVAmin: ' . $evento->getMvaMin();\r\n $this->Imprimir($text, 40, 10);\r\n }\r\n }\r\n }", "private function new_articulo()\n {\n $this->template = FALSE;\n \n $art0 = new articulo();\n $art0->referencia = $_POST['referencia'];\n if( $art0->exists() )\n {\n $this->results[] = $art0->get($_POST['referencia']);\n }\n else\n {\n $art0->descripcion = $_POST['descripcion'];\n $art0->codfamilia = $_POST['codfamilia'];\n $art0->set_impuesto($_POST['codimpuesto']);\n \n if( $art0->save() )\n {\n $this->results[] = $art0;\n }\n }\n \n header('Content-Type: application/json');\n echo json_encode($this->results);\n }", "public function mostrarClienteDocumentos($clienteid)\n {\n $clienteSocio = clientes::select('clientes.estado as clientesEstado', 's.id as socioId', \n 'clientes.id as clienteId',\n \"u.email as userEmail\", \"p.tipoDocumentoIdentidad_id as personatipoDocumentoIdentidad_id\",\n \"p.numeroidentificacion as personaNumeroIdentificacion\",\n \"tdi.nombre as tipoDocumentoIdentidad\",\n 'p.nombre as personaNombre', 'clientes.imagen as personaImagen')\n ->join('sectores as sct', 'sct.id', '=', 'clientes.sector_id')\n ->join('socios as s', 's.id', '=', 'sct.socio_id')\n\n ->join('users as u', 'u.id', '=', 'clientes.correo_id')\n ->join('personas as p', 'p.id', '=', 'u.persona_id')\n ->join('tiposDocumentosIdentidad as tdi', 'tdi.id', '=', 'p.tipoDocumentoIdentidad_id')\n ->where('clientes.id', '=', $clienteid)\n ->first();\n \n $tipos = tiposMonedas::select('id','nombre')\n ->where('estado', '=', 1)\n ->get();\n\n $tiposDocumentos = tiposDocumentos::select('id','nombre')\n ->where('estado', '=', 1)\n ->get();\n\n\n $documentosCliente = documentos::select('documentos.id as id','td.nombre as tipo', \n 'td.id as idTipoDocumento','documentos.numero as numero',\n 'documentos.fechaemision as fechaEmision',\n 'documentos.fechavencimiento as fechavencimiento',\n 'documentos.importe as importe', 'documentos.saldo as saldo',\n 'tm.id as idTipoMoneda',\n 'tm.nombre as moneda')\n ->join('tiposDocumentos as td','td.id', '=', 'documentos.tipoDocumento_id' )\n ->join('tiposMonedas as tm','tm.id', '=', 'documentos.tipoMoneda_id' )\n ->where('cliente_id', '=', $clienteid)\n ->get();\n\n if (sizeof($documentosCliente) > 0){\n return json_encode(array(\"code\" => true,\"tipos\"=>$tipos , \"tiposDocumentos\"=>$tiposDocumentos, \"result\"=>$documentosCliente, \"cliente\"=>$clienteSocio , \"load\"=>true ));\n }else{\n return json_encode(array(\"code\" => false, \"tipos\"=>$tipos, \"tiposDocumentos\"=>$tiposDocumentos, \"cliente\"=>$clienteSocio, \"load\"=>true));\n }\n \n // return json_encode(array(\"code\" => true, \"cliente\"=>$clienteSocio , \"load\"=>true ));\n \n\n }", "public function actionSincronizarCliente()\n\t{\n\t\t$usuario = $this->validateUsuario();\n\t\t\n\t\t$condition = ['ativo' => ProjetoCanvas::ATIVO, 'id_usuario' => $usuario->id];\n\t\t$projetosCanvas = ProjetoCanvas::findAll($condition);\n\t\t\n\t\t$projetosCanvasArr = [];\n\t\t\n\t\tif(count($projetosCanvas)) {\n\t\t\tforeach($projetosCanvas as $projetoCanvas) {\n\t\t\t\t$projetosCanvasArr[] = [\n\t\t\t\t\t\t'id' => $projetoCanvas->id,\n\t\t\t\t\t\t'nome' => $projetoCanvas->nome,\n\t\t\t\t\t\t'descricao' => $projetoCanvas->descricao,\n\t\t\t\t\t\t'itens' => $projetoCanvas->getItens()\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $projetosCanvasArr;\n\t}", "public function getArticulo()\n {\n return $this->articulo;\n }", "public function listaClientes(){\n\n $respuesta = Datos::mdlListaClientes(\"clientes\");\n $cont =0;\n\n foreach ($respuesta as $row => $item){\n \t$cont ++;\n\n\n echo '<tr>\n <td>'.$cont.'</td>\n <td>'.$item[\"nombre\"].'</td>\n <td>'.$item[\"razonSocial\"].'</td>\n <td>'.$item[\"rfc\"].'</td>\n <td>'.$item[\"direccion\"].'</td>\n <td>'.$item[\"ubicacion\"].'</td>\n <td>'.$item[\"telefono\"].'</td>\n <td>'.$item[\"celular\"].'</td>\n <td>'.$item[\"contacto\"].'</td>\n <td>'.$item[\"lineaCredito\"].'</td>\n <td><a href=\"updtCliente.php?idEditar='.$item[\"idCliente\"].'\"><button class=\"btn btn-warning\">Editar</button></a></td>\n <td><a href=\"listaClientes.php?idBorrar='.$item[\"idCliente\"].'\" ><button class=\"btn btn-danger\">Borrar</button></a></td>\n </tr>';\n }\n\n }", "function caricaCliente(&$form) {\r\n global $gTables;\r\n $_POST['num_rigo'] = 0;\r\n $form['traspo'] =($form['clfoco']>100000000)?0:$form['traspo']; // azzero il trasporto e per ricalcolarlo solo se non è un cliente anonimo\r\n $anagrafica = new Anagrafica();\r\n $cliente = $anagrafica->getPartner($form['clfoco']);\r\n $form['indspe'] =($cliente)?$cliente['indspe'] . \" - \" . $cliente['capspe'] . \" \" . $cliente['citspe'] . \" \" . $cliente['prospe']:'';\r\n $rs_testate = gaz_dbi_dyn_query(\"*\", $gTables['tesbro'], \"clfoco = '\" . $form['clfoco'] . \"' AND tipdoc LIKE 'VO_' AND status NOT LIKE 'EV%' \", \"datemi ASC\");\r\n while ($testate = gaz_dbi_fetch_array($rs_testate)) {\r\n $id_des = $anagrafica->getPartner($testate['id_des']);\r\n $form['traspo'] += $testate['traspo'];\r\n $form['speban'] = $testate['speban'];\r\n $form['expense_vat'] = $testate['expense_vat'];\r\n $form['stamp'] = $testate['stamp'];\r\n $form['round_stamp'] = $testate['round_stamp'];\r\n $form['virtual_taxstamp'] = $testate['virtual_taxstamp'];\r\n $form['vettor'] = $testate['vettor'];\r\n $form['imball'] = $testate['imball'];\r\n $form['portos'] = $testate['portos'];\r\n $form['spediz'] = $testate['spediz'];\r\n $form['pagame'] = $testate['pagame'];\r\n $form['caumag'] = $testate['caumag'];\r\n $form['destin'] = $testate['destin'];\r\n $form['id_des'] = $testate['id_des'];\r\n $form['search']['id_des'] =($id_des)?substr($id_des['ragso1'], 0, 10):'';\r\n $form['id_des_same_company'] = $testate['id_des_same_company'];\r\n $form['id_agente'] = $testate['id_agente'];\r\n $form['banapp'] = $testate['banapp'];\r\n $form['sconto'] = $testate['sconto'];\r\n $form['tipdoc'] = $testate['tipdoc'];\r\n $ctrl_testate = $testate['id_tes'];\r\n $rs_righi = gaz_dbi_dyn_query(\"*\", $gTables['rigbro'], \"id_tes = \" . $testate['id_tes'], \"id_rig asc\");\r\n while ($rigo = gaz_dbi_fetch_array($rs_righi)) {\r\n $articolo = gaz_dbi_get_row($gTables['artico'], \"codice\", $rigo['codart']);\r\n $form['righi'][$_POST['num_rigo']]['id_rig'] = $rigo['id_rig'];\r\n $form['righi'][$_POST['num_rigo']]['tiprig'] = $rigo['tiprig'];\r\n $form['righi'][$_POST['num_rigo']]['id_tes'] = $rigo['id_tes'];\r\n $form['righi'][$_POST['num_rigo']]['tipdoc'] = $testate['tipdoc'];\r\n $form['righi'][$_POST['num_rigo']]['datemi'] = $testate['datemi'];\r\n $form['righi'][$_POST['num_rigo']]['numdoc'] = $testate['numdoc'];\r\n $form['righi'][$_POST['num_rigo']]['descri'] = $rigo['descri'];\r\n $form['righi'][$_POST['num_rigo']]['id_body_text'] = $rigo['id_body_text'];\r\n $form['righi'][$_POST['num_rigo']]['codart'] = $rigo['codart'];\r\n $form['righi'][$_POST['num_rigo']]['unimis'] = $rigo['unimis'];\r\n $form['righi'][$_POST['num_rigo']]['prelis'] = $rigo['prelis'];\r\n $form['righi'][$_POST['num_rigo']]['provvigione'] = $rigo['provvigione'];\r\n $form['righi'][$_POST['num_rigo']]['ritenuta'] = $rigo['ritenuta'];\r\n $form['righi'][$_POST['num_rigo']]['sconto'] = $rigo['sconto'];\r\n $form['righi'][$_POST['num_rigo']]['quanti'] = $rigo['quanti'];\r\n\t\t\t$form['righi'][$_POST['num_rigo']]['lot_or_serial'] = $articolo['lot_or_serial'];\r\n\t\t\t$form['righi'][$_POST['num_rigo']]['cod_operazione'] = 11;\r\n\t\t\t$form['righi'][$_POST['num_rigo']]['SIAN'] = $articolo['SIAN'];\r\n\t\t\t$form['righi'][$_POST['num_rigo']]['recip_stocc'] = \"\";\r\n\t\t\tif ($articolo['SIAN']>0){\r\n\t\t\t\t$camp_artico = gaz_dbi_get_row($gTables['camp_artico'], \"codice\", $rigo['codart']);\r\n\t\t\t\t$form['righi'][$_POST['num_rigo']]['confezione'] = $camp_artico['confezione'];\r\n\t\t\t} else {\r\n\t\t\t\t$form['righi'][$_POST['num_rigo']]['confezione'] = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\r\n if (!isset($form['righi'][$_POST['num_rigo']]['evadibile'])) {\r\n $totale_evadibile = $rigo['quanti'];\r\n $rs_evasi = gaz_dbi_dyn_query(\"*\", $gTables['rigdoc'], \"id_order=\" . $rigo['id_tes'] . \" AND codart='\" . $rigo['codart'] . \"'\", \"id_rig asc\");\r\n while ($rg_evasi = gaz_dbi_fetch_array($rs_evasi)) {\r\n $totale_evadibile -= $rg_evasi['quanti'];\r\n }\r\n if ($totale_evadibile == 0) {\r\n $form['righi'][$_POST['num_rigo']]['checkval'] = false;\r\n }\r\n\t\t\t\t$upd_mm = new magazzForm;\r\n\t\t\t\t// Antonio Germani - controllo la giacenza in magazzino e gli ordini già ricevuti\r\n\t\t\t\t$mv = $upd_mm->getStockValue(false, $rigo['codart']);\r\n\t\t\t\t$magval = array_pop($mv);\r\n $magval=(is_numeric($magval))?['q_g'=>0,'v_g'=>0]:$magval;\r\n\t\t\t\t$form['righi'][$_POST['num_rigo']]['giac'] = $magval['q_g'];\r\n\t\t\t\t$form['righi'][$_POST['num_rigo']]['ordin'] = $upd_mm->get_magazz_ordinati($rigo['codart'], \"VOR\");\r\n\t\t\t\t\r\n $form['righi'][$_POST['num_rigo']]['evaso_in_precedenza'] = $rigo['quanti'] - $totale_evadibile;\r\n $form['righi'][$_POST['num_rigo']]['evadibile'] = $totale_evadibile;\r\n }\r\n $form['righi'][$_POST['num_rigo']]['id_doc'] = $rigo['id_doc'];\r\n $form['righi'][$_POST['num_rigo']]['codvat'] = $rigo['codvat'];\r\n $form['righi'][$_POST['num_rigo']]['pervat'] = $rigo['pervat'];\r\n $form['righi'][$_POST['num_rigo']]['codric'] = $rigo['codric'];\r\n $_POST['num_rigo'] ++;\r\n }\r\n }\r\n}", "public function crear()\n {\n $json = file_get_contents('php://input');\n //convierto en un array asociativo de php\n $obj = json_decode($json);\n\n $listaArticulos = [];\n foreach ($obj as $key => $value) {\n $indice = $key;\n $valor = $value;\n $articulo = new Articulo();\n $articulo->id = $valor->id;\n $articulo->nombre = $valor->nombre;\n $listaArticulos[] = $articulo;\n //array_push($listaArticulos, $articulo);\n //$items[] = $item;\n }\n $modeloCargado = $this->model;\n //$articulo->id = $obj->id;\n //$articulo->nombre = $obj->nombre;\n //$articulos = $this->model->get();\n //$this->view->articulos = json_encode($articulos);\n //$listaObjetos = json_encode($listaArticulos);\n\n $respuesta = [\n \"datos\" => $listaArticulos,\n \"totalResultados\" => count($listaArticulos),\n ];\n $this->view->respuesta = json_encode($respuesta);\n\n $this->view->render('api260/articulos/crear');\n //var_dump($this);\n //var_dump($this->view);\n }", "public function primerCliente($id_usuario,$nombreE,$rfcE,$cpE,$correo1E,$observacionesE,$fijo,$logo){\r\n\t\t$sql = \"INSERT INTO tbl_clientesclientes (id_usuario,logo,nombreE,rfcE,cpE,correo1E,observacionesE,estatus,fijo)VALUES('$id_usuario','$logo','$nombreE','$rfcE','$cpE','$correo1E','$observacionesE','1','$fijo')\";\r\n return ejecutarConsulta($sql); \t\r\n\t}", "public function buscaPorId($id){\n \n \t\t\t/* Primeiro cria a query do MySQL */\n \t\t\t$id_query = \"SELECT * FROM atendimentocliente WHERE idChamada = \".$id;\n\n \t\t\t/* Envia a query para o banco de dados e verifica se funcionou */\n \t\t\t$result = mysqli_query($this->conexao, $id_query)\n \t\t\tor die(\"Erro ao listar produtos por ID: \" . mysql_error() );\n\n \t\t\t/* Cria variável de retorno e inicializa com NULL */\n \t\t\t$retorno = null;\n\n \t\t\t/* Se encontrou algo, pega todos os campos do resultado obtido */\n \t\t\tif( $row = mysqli_fetch_array($result, MYSQLI_ASSOC) ){\n \t\t\t\t//Cria nova instância da classe produto\n \t\t\t\t $retorno = new Atendimentocliente();\n \t\t\t\t//Preenche todos os campos do novo objeto\n\t\t\t\t $retorno->idChamada = $row[\"idChamada\"]; \n \t\t\t\t $retorno->atendeu = $row[\"atendeu\"];\n\t\t\t\t $retorno->refProduto = $row[\"refProduto\"];\n\t\t\t\t $retorno->motivoPlano = $row[\"motivoPlano\"];\n\t\t\t\t $retorno->dataVencimento = $row[\"dataVencimento\"];\n\t\t\t\t $retorno->debitoAutomatico = $row[\"debitoAutomatico\"];\n\t\t\t\t $retorno->debitoOfertado= $row[\"debitoOfertado\"];\n\t\t\t\t $retorno->observacao = $row[\"observacao\"];\n\t\t\t\t $retorno->dataChamada = $row[\"dataChamada\"];\n\t\t\t\t $retorno->idVendaServico= $row[\"idVendaServico\"];\n\t\t\t\t $retorno->notaAtendimento = $row[\"notaAtendimento\"];\n\t\t\t\t $retorno->FoiNaoConformidade= $row[\"FoiNaoConformidade\"];\n\t\t\t\t\n\t\t\t\t \n\n \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\treturn $retorno;\n\n\t\t }", "function opzioni_cliente($id_tipo_cliente=\"\", $id_cli=\"\"){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t$visualizza =\"<a href=\\\"cliente_show.php?id_cli=\".$id_cli.\"\\\"><img src=\\\"images/cliente_dati.gif\\\" title=\\\"Visualizza Dati Cliente\\\"/></a>\";\n\t$opzione =\"<a href=\\\"popup_immobili.php?id_cli=\".$id_cli.\"\\\"><img class=\\\"cliente_opzioni\\\" src=\\\"images/cliente_popup_immobili.gif\\\" title=\\\"Mostra Immobile/i del cliente\\\"/></a>\";\n\t$str=\"\";\n\n\tswitch ($id_tipo_cliente) {\n\t\t\n\t\tcase 1: // acquirente\n\t\t\t//$opzione =\"<a href=\\\"popup_richieste.php?id_cli=\".$id_cli.\"\\\"><img class=\\\"cliente_opzioni\\\" src=\\\"images/cliente_popup_richieste.gif\\\" title=\\\"Mostra Richiesta/e del cliente\\\"/></a>\";\n\t\t//\t$richieste = \"<a href=\\\"immobile_cerca.php?id_cli=\".$id_cli.\"\\\"><img class=\\\"cliente_opzioni\\\" src=\\\"images/cliente_richieste.gif\\\" title=\\\"Mostra Immobili Affini alle richieste del cliente\\\"/></a>\";\n\t\t\t$str.= $visualizza;\n\t\t//\t$str.= $richieste;\n\t\t//\t$str.=$opzione;\n\t\t\tbreak;\n\t\tcase 2: // venditore\n\t\t\t//$richieste = \"<a href=\\\"richieste_cerca.php?id_cli=\".$id_cli.\"\\\"><img class=\\\"cliente_opzioni\\\" src=\\\"images/cliente_vendo.gif\\\" title=\\\"Mostra Richieste Correlate all'immobile del cliente\\\"/></a>\";\n\t\t\t$str.= $visualizza;\n\t\t//\t$str.= $richieste;\n\t\t//\t$str.=$opzione;\n\t\t\tbreak;\n\t\tcase 3: // affittuario\n\t\t\t$richieste = \"<a href=\\\"affittuario_cerca.php?id_cli=\".$id_cli.\"\\\"><img class=\\\"cliente_opzioni\\\" src=\\\"images/cliente_affittuario.gif\\\" title=\\\"Mostra persone disposte ad acquistare l'immobile del cliente\\\"/></a>\";\n\t\t\t$str.= $visualizza;\n\t\t//\t$str.= $richieste;\n\t\t\t//$str.=$opzione;\n\t\t\tbreak;\n\t\tcase 4: // cerca affitto\n\t\t//\t$opzione =\"<a href=\\\"popup_affitti.php?id_cli=\".$id_cli.\"\\\"><img class=\\\"cliente_opzioni\\\" src=\\\"images/cliente_popup_affitti.gif\\\" title=\\\"Mostra Richieste di affitti del cliente\\\"/></a>\";\n\t\t//\t$richieste = \"<a href=\\\"affitti_cerca.php?id_cli=\".$id_cli.\"\\\"><img class=\\\"cliente_opzioni\\\" src=\\\"images/cliente_cerco_affitti.gif\\\" title=\\\"Mostra gli immobili in affitto adatti alle richieste del cliente\\\"/></a>\";\n\t\t\t$str.= $visualizza;\n\t\t//\t$str.= $richieste;\n\t\t//\t$str.=$opzione;\n\t\t\tbreak;\n\t\n\t\tdefault:\n\t\t\t$str.= $visualizza;\n\t\t\t\n\t\t\tbreak;\n\t}\n\treturn $str;\n}", "public function listarClientes(){\n $this->bd->getConeccion();\n $sql = \"SELECT * FROM CLIENTE\";\n $registros = $this->bd->executeQueryReturnData($sql); \n $this->bd->cerrarConeccion(); \n $clientes = array(); \n \n foreach ($registros as $cliente) {\n $cliente = new Cliente($cliente['id'],$cliente['dni'],$cliente['Nombre'],$cliente['Apellido'],$cliente['Correo'],$cliente['Telefono']);\n array_push($clientes, $cliente);\n }\n \n return $clientes; \n }", "public function compradoAction()\n {\n $cliente = $this->get('security.context')->getToken()->getUser();\n if (!$cliente) throw $this->createNotFoundException('No existe el cliente (Error 1013)');\n $texto = \"\"; $texto = $texto.\" Cliente: \".$cliente->getNombre().\" - \";\n //Cojo el Entity Manager, asi como los datos Request y Session.\n $em = $this->get('doctrine')->getEntityManager();\n $request = $this->getRequest();\n $session = $request->getSession();\n //Si no existe el carrito en la session salimos.\n if(!$session->has('carrito'))\n { \n throw $this->createNotFoundException('No existe el carrito (Error 1014)');\n }\n else{\n //Si existe el carrito en la session, si no tiene productos salimos y si si tiene productos \n //realizamos la compra (creamos un pedido en nuestro sistema y lo guardamos.)\n $carrito = $session->get('carrito'); //$session->get('carrito', $carrito);\n if(!$carrito->getProductos())\n {\n throw $this->createNotFoundException('Error el carrito esta vacio (Error 1015)');\n }\n else{\n //KK estas lineas van todas fuera.\n /*\n ////////////////////////////////////////\n //////////////////////////////////////\n // AQUI ESTARIAN TODAS LAS COMPROVACIONES ASI COMO HAY QUE \n // RECORDAR QUE VENDRA DE UN FORMULARIO, Y habra multitud de parametros mas.\n //////////////////////////////////////\n //////////////////////////////////////\n */\n //Recuperamos la lista del carrito y comprobamos que todos los productos existen,\n //no estan descatalogados y hay suficiente stock para cumplir con la demanda. \n $listaCarro = $carrito->getProductos();\n foreach($listaCarro as $item){\n $texto = $texto.\" producto: \".$item->getProducto()->getNombre().\" - \".$item->getCantidad();\n $producto = $em->find('PafpfcBundle:Producto' , $item->getProducto()->getId());\n $detalleError = 'El producto: '.$item->getProducto()->getId().' - '.$item->getProducto()->getNombre().' ';\n if (!$producto) throw $this->createNotFoundException($detalleError.' no existe (Error 1018)');\n if ($producto->getDescatalogado()) throw $this->createNotFoundException('El producto '.$producto->getId().' - '.$producto->getNombre().' esta descatalogado (Error 1019)');\n if ($producto->getStock() < $item->getCantidad()) throw $this->createNotFoundException('No hay suficientes elementos en stock para '.$detalleError.' (Error 1020)');\n }\n\n////////AQUI ESTARIA LA COMPRA DE PAYPAL.../////////////\n////////AQUI ESTARIA LA COMPRA DE PAYPAL.../////////////\n////////AQUI ESTARIA LA COMPRA DE PAYPAL.../////////////\n //Asi conseguimos la consistencia... si no se paga no se modifica la base de datos y no se generan pedidos. \n \n $pedido = new Pedido();\n $pedido->setDireccion('Direccion pruebas nuevas');\n $pedido->setCliente($cliente);\n $pedido->setPagado(true);\n $em->persist($pedido);\n $em->flush();\n \n $texto = $texto.\" Pedido: \".$pedido->getId().\" - \";\n foreach($listaCarro as $item){\n //Tengo que recuperar el producto original para tener la referencia correcta a la hora de hacer \n //el flush en el pedido o no dejara ya q el objeto producto q esta dentro de listacarro es una copia.\n $producto = $em->find('PafpfcBundle:Producto' , $item->getProducto()->getId());\n //Comprobaciones sobre el producto y el pedido. Existe, es valido y hay en stock.\n $detalleError = 'El producto: '.$item->getProducto()->getId().' - '.$item->getProducto()->getNombre().' ';\n if (!$producto) throw $this->createNotFoundException($detalleError.' no existe (Error 1021)');\n if ($producto->getDescatalogado()) throw $this->createNotFoundException('El producto '.$producto->getId().' - '.$producto->getNombre().' esta descatalogado (Error 1022)');\n if ($producto->getStock() < $item->getCantidad()) throw $this->createNotFoundException('No hay suficientes elementos en stock para '.$detalleError.' (Error 1023)');\n//Megamarron si aqui generamos errores en la compra AL CLIENTE YA SE LE HA COBRADO...\n//Asi que aunque esten las comprobaciones pertinentes... todas ellas han de haber sido hechas tambien \n//antes de mandar los datos a paypal. Para mantener una consistencia casi total ¿haciendo dos \n//compras con diferencia de microsegundos y usuarios diferentes podria darse un error por falta de stock?\n //Generar la linea del pedido con precio calculado, reducir el stock del producto y persistir los dos elementos.\n $lineaped = new LineaPedido($pedido, $producto, $item->getCantidad());\n $precioPagado = $producto->getPrecioActual() * $item->getCantidad();\n $lineaped->setPrecioPagado($precioPagado);\n $newStock = $producto->getStock() - $item->getCantidad();\n $producto->setStock($newStock);\n $em->persist($producto);\n $texto = $texto.\" ListaPedido - producto: \".$lineaped->getProducto()->getNombre().\" - \".$lineaped->getCantidad().\" - \";\n $em->persist($lineaped);\n }\n //Al hacer flush en este punto consigo que no se almacenen ni la linea del pedido ni la modificacion en el producto si se produjo algun error.\n $em->flush();\n $this->get('session')->setFlash('notice', $texto);\n $session->remove('carrito'); \n }\n }\n return $this->render('PafpfcBundle:Pedido:compracorrecta.html.twig'); \n }", "public function setArticulo($nombre, $codigo, $descripcion, $alto, $ancho, $largo, $diametro, $peso, $empaque, $categoria, $tipo) {\n\t\trequire_once 'phputils/mysqlConexion.php';\n\t\t/*$nombre = strtolower($nombre);\n\t\t$codigo = strtolower($codigo);\n\t\t$descripcion = strtolower($descripcion);*/\n\t\t\n\t\t$newArticulo = new Articulos;\n\t\t$newArticulo -> nombre = $nombre;\n\t\t$newArticulo -> codigo = $codigo;\n\t\t$newArticulo -> descripcion = $descripcion;\n\t\tif ($alto != null)\n\t\t\t$newArticulo -> alto = $alto;\n\t\tif ($ancho != null)\n\t\t\t$newArticulo -> ancho = $ancho;\n\t\tif ($largo != null)\n\t\t\t$newArticulo -> largo = $largo;\n\t\tif ($diametro != null)\n\t\t\t$newArticulo -> diametro = $diametro;\n\t\tif ($peso != null)\n\t\t\t$newArticulo -> peso = $peso;\n\t\tif ($empaque != null)\n\t\t\t$newArticulo -> empaque = $empaque;\n\t\t$today = time() - 18720; \n\t\t$mysqldate = date('Y-m-d h:i:s',$today);\n\t\t$newArticulo -> fechaingreso = $mysqldate;\n\t\t$newArticulo -> categoria = $categoria;\n\t\t$newArticulo -> tipo = $tipo;\n\n\t\ttry {\n\t\t\t$newArticulo -> save();\n\t\t\treturn $newArticulo -> id;\n\t\t} catch (Exception $e) {\n\t\t\treturn 'false';\n\t\t} \n\t\t\n\t}", "public function create($id) //pasamos el id del cliente\n {\n \n }", "public function TresorieClient() {\n \n $em = $this->getDoctrine()->getManager();\n $entityClient = $em->getRepository('RuffeCardUserGestionBundle:Client')->findClientNoPaiment();\n return $this->render ( \"RuffeCardTresorieBundle:Default:clientPaiement.html.twig\", array ('Client'=>$entityClient));\n \n }", "function preparatoriasBYInstitucionTiposAlojamientos_get(){\n $id=$this->get('id');\n $id2=$this->get('id2');\n if (count($this->get())>2) {\n $response = array(\n \"status\" => \"error\",\n \"status_code\" => 409,\n \"message\" => \"Demasiados datos enviados\",\n \"validations\" =>array(\n \"id\"=>\"Envia Id (get) para obtener un especifico articulo o vacio para obtener todos los articulos\"\n ),\n \"data\"=>null\n );\n }else{\n if ($id) {\n $data = $this->DAO->selectEntity('Vw_tipoAlojamiento',array('idInstitucion'=>$id),false);\n }\n else{\n $data = $this->DAO->selectEntity('Vw_tipoAlojamiento',null,false);\n }\n if ($data) {\n $response = array(\n \"status\" => \"success\",\n \"status_code\" => 201,\n \"message\" => \"Articulo Cargado correctamente\",\n \"validations\" =>null,\n \"data\"=>$data\n );\n }else{\n $response = array(\n \"status\" => \"error\",\n \"status_code\" => 409,\n \"message\" => \"No se recibio datos\",\n \"validations\" =>null,\n \"data\"=>null\n );\n }\n }\n $this->response($response,200);\n }", "public function ClientesPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from clientes where codcliente = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codcliente\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function cliente_get(){\n\t\t$cliente_id = $this->uri->segment(3);\n\n\t\t//validar el cliente id\n\t\tif (!isset($cliente_id)) {\n\t\t\t$respuesta = array(\n\t\t\t\t'err'=>TRUE,\n\t\t\t\t'mensaje'=>'Es necesario el id del cliente'\n\t\t\t);\n\n\t\t\t$this->response($respuesta, REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\n\n\t\t//lo paso al modelo\n\t\t$cliente = $this->Cliente_model->get_cliente($cliente_id);\n\n\t\t//cargo, valido y lo devuelto para que se muestre\n\t\tif(isset($cliente)){\n\t\t\t$respuesta=array(\n\t\t\t\t'err'=>FALSE,\n\t\t\t\t'mensaje'=>'Registro cargado correctamente',\n\t\t\t\t'cliente'=>$cliente\n\t\t\t);\n\n\t\t\t$this->response($respuesta);\n\t\t}else{\n\t\t\t$respuesta=array(\n\t\t\t\t'err'=>TRUE,\n\t\t\t\t'mensaje'=>'El registro con el id '.$cliente_id.', no exste',\n\t\t\t\t'cliente'=>null\n\t\t\t);\n\t\t\t$this->response($respuesta, REST_Controller::HTTP_NOT_FOUND);\n\t\t}\n\t}", "function buscar_recomendado_hotel($precio, $nombre, $id, $cat){\n\t\t$precio_inicial=$precio-50;\n\t\t$precio_final=$precio+50;\n\t\t$marcas=explode(\" \",$nombre);\n\t\t$sql=\"SELECT * FROM producto, imagen WHERE galeria_image=id_pro AND tabla_image='producto' AND id_pro!='$id' AND disponible_pro='1' AND categoria_pro!='10' AND nombre_image='portada' GROUP BY id_pro ORDER BY RAND()\";\n\t\t//echo $sql;\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=\"si\";\n\t\t\t\t//calculando el URL\n\t\t\t\tsetlocale(LC_ALL, 'es_ES');\n\t\t\t\t//$resultado['nombre_pro']=ucwords(strtolower($resultado['nombre_pro']));\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat' GROUP BY id_cat\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\t\n\t\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\t\n\t\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\t\tif($i<=12) $resultado['limite_pro'][]=$i; else break;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$resultado['detal_pro']=$this->mostrar_precio($resultado['detal_pro']);\n\t\t\t\t$this->listado[] = $resultado;\n\t\t }\n\t}", "public function CargarDatosProducto($producto_id)\n {\n $resultado = array();\n $arreglo_resultado = array();\n\n $entity = $this->getDoctrine()->getRepository('IcanBundle:Producto')\n ->find($producto_id);\n if ($entity != null) {\n\n $arreglo_resultado['nombre'] = $entity->getNombre();\n $arreglo_resultado['categoria'] = ($entity->getCategoria() != null) ? $entity->getCategoria()->getCategoriaId() : \"\";\n $arreglo_resultado['marca'] = ($entity->getMarca() != null) ? $entity->getMarca()->getMarcaId() : \"\";\n $arreglo_resultado['porciento'] = ($entity->getPorciento() != null) ? $entity->getPorciento()->getValor() : \"\";\n $arreglo_resultado['titulo'] = $entity->getTitulo();\n $arreglo_resultado['descripcion'] = $entity->getDescripcion();\n $arreglo_resultado['caracteristica'] = $entity->getCaracteristica();\n $arreglo_resultado['tags'] = $entity->getTags();\n $arreglo_resultado['stock'] = $entity->getStock();\n $arreglo_resultado['precio'] = $entity->getPrecio();\n $arreglo_resultado['precioEspecial'] = $entity->getPrecioEspecial();\n $arreglo_resultado['destacado'] = ($entity->getDestacado() == 1) ? true : false;\n $arreglo_resultado['estado'] = ($entity->getEstado() == 1) ? true : false;\n $arreglo_resultado['url'] = $entity->getUrl();\n $arreglo_resultado['ficha'] = $entity->getFicha();\n $arreglo_resultado['disponibilidadInmediata'] = ($entity->getDisponibilidadInmediata() == 1) ? true : false;\n $arreglo_resultado['formaPago'] = $entity->getFormaPago();\n $arreglo_resultado['terminoDespacho'] = $entity->getTerminoDespacho();\n\n $imagen = $entity->getImagen();\n\n $ruta = $this->ObtenerURL();\n $dir = 'uploads/productos/';\n $ruta = $ruta . $dir;\n\n $size = (is_file($dir . $imagen)) ? filesize($dir . $imagen) : 0;\n $arreglo_resultado['imagen'] = array($imagen, $size, $ruta);\n\n\n $fecha = $entity->getFechapublicacion();\n if ($fecha != \"\") {\n $fecha = $fecha->format('d/m/Y H:i');\n }\n $arreglo_resultado['fecha'] = $fecha;\n\n //Imagenes del producto\n $productoimagenes = $this->getDoctrine()->getRepository('IcanBundle:ProductoImagen')->ListarImagenes($producto_id);\n $imagenes = array();\n foreach ($productoimagenes as $productoimagen) {\n\n $imagen = $productoimagen->getImagen();\n $size = (is_file($dir . $imagen)) ? filesize($dir . $imagen) : 0;\n\n array_push($imagenes, array(\n 'imagen' => $imagen,\n 'size' => $size,\n 'ruta' => $ruta,\n 'valida' => true\n ));\n }\n $arreglo_resultado['imagenes'] = $imagenes;\n\n //Productos relacionados\n $relacionados = array();\n $productos = $this->getDoctrine()->getRepository('IcanBundle:ProductoRelacion')\n ->ListarRelacionados($producto_id);\n $posicion = 0;\n foreach ($productos as $key => $producto_relacion) {\n $producto = $producto_relacion->getProductoRelacion();\n if ($producto->getProductoId() != $producto_id) {\n array_push($relacionados, array(\n 'productorelacion_id' => $producto_relacion->getProductorelacionId(),\n 'producto_id' => $producto->getProductoId(),\n 'nombre' => $producto->getNombre(),\n \"categoria\" => ($producto->getCategoria() != null) ? $producto->getCategoria()->getNombre() : \"\",\n \"marca\" => ($producto->getMarca() != null) ? $producto->getMarca()->getNombre() : \"\",\n \"estado\" => ($producto->getEstado()) ? 1 : 0,\n \"imagen\" => $ruta . $producto->getImagen(),\n \"precio\" => number_format($producto->getPrecio(), 0, ',', '.'),\n \"fecha\" => $producto->getFechapublicacion() != \"\" ? $producto->getFechapublicacion()->format(\"d/m/Y H:i\") : \"\",\n \"views\" => $producto->getViews(),\n 'posicion' => $posicion\n ));\n $posicion++;\n }\n }\n $arreglo_resultado['relacionados'] = $relacionados;\n\n $resultado['success'] = true;\n $resultado['producto'] = $arreglo_resultado;\n }\n return $resultado;\n }", "public static function dodajArtikelVKosarico() {\n $id = $_SESSION[\"uporabnik_id\"];\n $uporabnik = UporabnikiDB::get($id);\n\n $id_artikla = filter_input(INPUT_POST, \"id\", FILTER_SANITIZE_SPECIAL_CHARS);\n $status = \"kosarica\";\n\n // ce narocilo ze obstaja mu samo povecamo kolicino \n // drugace narocilo ustvarimo\n $narocilo = NarocilaDB::getByUporabnikId($id, $status);\n\n if (!$narocilo) {\n\n $id_narocila = NarocilaDB::insert($id, $status);\n PodrobnostiNarocilaDB::insert($id_artikla, 1, $id_narocila);\n\n } else {\n\n $podrobnost_narocila = PodrobnostiNarocilaDB::getByNarociloAndArtikel($narocilo[\"id\"], $id_artikla);\n\n if (!$podrobnost_narocila) {\n PodrobnostiNarocilaDB::insert($id_artikla, 1, $narocilo[\"id\"]);\n } else {\n PodrobnostiNarocilaDB::edit($id_artikla, $podrobnost_narocila[\"kolicina\"] + 1, $narocilo[\"id\"]); \n } \n }\n\n echo ViewHelper::redirect(BASE_URL);\n\n }", "function buscar_recomendado($precio, $nombre, $id, $cat){\n\t\t$precio_inicial=$precio-50;\n\t\t$precio_final=$precio+50;\n\t\t$marcas=explode(\" \",$nombre);\n\t\t$sql=\"SELECT * FROM producto, imagen WHERE galeria_image=id_pro AND tabla_image='producto' AND id_pro!='$id' AND disponible_pro='1' AND categoria_pro!='10' AND nombre_image='portada' GROUP BY id_pro ORDER BY RAND() LIMIT 0,5\";\n\t\t//echo $sql;\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=\"si\";\n\t\t\t\t//calculando el URL\n\t\t\t\tsetlocale(LC_ALL, 'es_ES');\n\t\t\t\t//$resultado['nombre_pro']=ucwords(strtolower($resultado['nombre_pro']));\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat' GROUP BY id_cat\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\t\n\t\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\t\n\t\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\t\tif($i<=12) $resultado['limite_pro'][]=$i; else break;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$resultado['detal_pro']=$this->mostrar_precio($resultado['detal_pro']);\n\t\t\t\t$this->listado[] = $resultado;\n\t\t }\n\t}", "public function catalogo(){\n \n $inicio['recomendado'] = $this->carga_recomendado();\n $inicio['categorias'] = $this->carga_menu_categorias();\n $this->Plantilla(\"catalogo\", $inicio);\n \n }", "function mostrar_producto_img(){\n\t\tif (isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$sql=\"SELECT * FROM producto WHERE id_pro='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t$resultado = mysql_fetch_array($consulta);\n\t\t\t$id=$resultado['id_pro'];\n\t\t\t$sql2=\"SELECT directorio_image, nombre_image FROM imagen WHERE galeria_image='$id' AND tabla_image='producto'ORDER BY id_image\";\n\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\n\t\t\twhile ($resultado2 = mysql_fetch_array($consulta2)){\n\t\t\t\t$this->listado[]=$resultado2;\n\t\t\t}\n\t\t}\n\t}", "public function cliente()\n {\n return $this->belongsTo('App\\Models\\ClienteModel', 'id_cliente');\n }", "public function createAction(Request $request)\n {\n $ord = new Remitovolvo(); \n $ords = $request->request->get('remitovolvo', array()); \n $cliente=$ords['client']; \n $cont=0;\n $sumaNeto=0;\n if (isset($ords['consumos'])) {\n $consumos = $ords['consumos'];\n foreach($consumos as $consumo) { \n $id1 = $consumo[\"idRep\"]; \n $em1 = $this->getDoctrine()->getManager();\n $rep = $em1->getRepository('SistemaAdminBundle:Repvolvo')->find($id1);\n $rep->setCantidad($rep->getCantidad() - 1);\n $em1->persist($rep);\n $sumaNeto = $sumaNeto + $consumo['subtotal'];\n $str = $consumo['subtotal'];\n $fa = str_replace(\".\", \",\", $str);\n $consumo['subtotal'] = $fa;\n $cont = $cont + 1;\n $repuestos[$cont]=$rep;\n $repuestos[0]=$rep;\n }\n// var_dump($consumos[1]['subtotal']);die();\n for ($i = 0; $i <= $cont; $i++) {\n $consumos[$i] = new \\Sistema\\AdminBundle\\Entity\\Consumo();\n $consumos[$i]->setidRepvolvo($repuestos[$i]);\n $ord->addConsumos($consumos[$i]); \n }\n }\n \n $form = $this->createForm(new RemitovolvoType(), $ord); \n $form->bindRequest($request);\n \n if ($form->isValid()) {\n $em2 = $this->getDoctrine()->getManager();\n $cli = $em2->getRepository('SistemaAdminBundle:Cliente')->findOneByNombre($cliente);\n $ord->setCliente($cli);\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($ord);\n $em->flush();\n \n return $this->redirect($this->generateUrl('remitovolvo_show', array('id' => $ord->getId()))); \n }\n \n return array(\n 'form' => $form->createView()\n );\n }", "public function EntregarPedidos()\n\t{\n\t\tself::SetNames();\n\t\t\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" cocinero = ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $cocinero);\n\t\t$stmt->bindParam(2, $codventa);\n\t\t\n\t\t$cocinero = strip_tags(\"0\");\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$sala = strip_tags(base64_decode($_GET[\"nombresala\"]));\n\t\t$mesa = strip_tags(base64_decode($_GET[\"nombremesa\"]));\n\t\t$stmt->execute();\n\t\t\n echo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-check-square-o'></span> EL PEDIDO DE LA \".$sala.\" Y \".$mesa.\" FUE ENTREGADO EXITOSAMENTE </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\t\n }", "public function getArticulosEnRecetas($form_id){\n log_message('INFO','#TRAZA | #TRAZ-PROD-TRAZASOFT | Etapa | getArticulosEnRecetas() ');\n\t\t$data = $this->Etapas->getArticulosEnRecetas($form_id)->articulos->articulo;\n echo json_encode($data);\n \n }", "function cocinar_pedido() {\n\t\tglobal $bd;\n\t\tglobal $x_from;\n\t\tglobal $x_idpedido;\n\t\tglobal $x_idcliente;\n\t\t\n\t\t$x_array_pedido_header = $_POST['p_header'];\n \t$x_array_pedido_body = $_POST['p_body'];\n\t\t$x_array_subtotales=$_POST['p_subtotales'];\n\t\t\n\t\t$idc=$x_array_pedido_header['idclie'] == '' ? ($x_idcliente == '' ? 0 : $x_idcliente) : $x_array_pedido_header['idclie'];\n\t\t// $idc = cocinar_registro_cliente();\n\t\t// $x_array_pedido_footer = $_POST['p_footer'];\n\t\t// $x_array_tipo_pago = $_POST['p_tipo_pago'];\n\n\t\t //sacar de arraypedido || tipo de consumo || local || llevar ... solo llevar\n\t\t $count_arr=0;\n\t\t $count_items=0;\n\t\t $item_antes_solo_llevar=0;\n\t\t $solo_llevar=0;\n\t\t $tipo_consumo;\n\t\t $categoria;\n\t\t \n\t\t $sql_pedido_detalle='';\n\t\t $sql_sub_total='';\n\n\t\t $numpedido='';\n\t\t $correlativo_dia='';\n\t\t $viene_de_bodega=0;// para pedido_detalle\n\t\t $id_pedido;\n\n\t\t \t\t \n\t\t // cocina datos para pedidodetalle\n\t\t foreach ($x_array_pedido_body as $i_pedido) {\n\t\t\tif($i_pedido==null){continue;}\n\t\t\t// tipo de consumo\n\t\t\t//solo llevar\n\t\t\t$pos = strrpos(strtoupper($i_pedido['des']), \"LLEVAR\");\n\t\t\t\n\t\t\t\n\t\t\t//subitems // detalles\n\t\t\tforeach ($i_pedido as $subitem) {\n\t\t\t\tif(is_array($subitem)==false){continue;}\n\t\t\t\t$count_items++;\n\t\t\t\tif($pos!=false){$solo_llevar=1;$item_antes_solo_llevar=$count_items;}\n\t\t\t\t$tipo_consumo=$subitem['idtipo_consumo'];\n\t\t\t\t$categoria=$subitem['idcategoria'];\n\n\t\t\t\t$tabla_procede=$subitem['procede']; // tabla de donde se descuenta\n\n\t\t\t\t$viene_de_bodega=0;\n\t\t\t\tif($tabla_procede===0){$viene_de_bodega=$subitem['procede_index'];}\n\n\t\t\t\t//armar sql pedido_detalle con arrPedido\n\t\t\t\t$precio_total=$subitem['precio_print'];\n\t\t\t\tif($precio_total==\"\"){$precio_total=$subitem['precio_total'];}\n\n\t\t\t\t//concatena descripcion con indicaciones\n\t\t\t\t$indicaciones_p=\"\";\n\t\t\t\t$indicaciones_p=$subitem['indicaciones'];\n\t\t\t\tif($indicaciones_p!==\"\"){$indicaciones_p=\" (\".$indicaciones_p.\")\";$indicaciones_p=strtolower($indicaciones_p);}\n\t\t\t\t\n\t\t\t\t$sql_pedido_detalle=$sql_pedido_detalle.'(?,'.$tipo_consumo.','.$categoria.','.$subitem['iditem'].','.$subitem['iditem2'].',\"'.$subitem['idseccion'].'\",\"'.$subitem['cantidad'].'\",\"'.$subitem['cantidad'].'\",\"'.$subitem['precio'].'\",\"'.$precio_total.'\",\"'.$precio_total.'\",\"'.$subitem['des'].$indicaciones_p.'\",'.$viene_de_bodega.','.$tabla_procede.'),'; \n\n\t\t\t}\n\n\t\t\t$count_arr++;\n\t\t}\t\t\n\t\t\n\t\tif($count_items==0){return false;}//si esta vacio\n\n\t\tif($item_antes_solo_llevar>1){$solo_llevar=0;} // >1 NO solo es para llevar\n\n\t\t//armar sql pedido_subtotales con arrTotales\t\t\n\t\t// $importe_total=0; // la primera fila es subtotal o total si no hay adicionales\n\t\t// $importe_subtotal = $x_array_subtotales[0]['importe'];\n\t\t// for ($z=0; $z < count($x_array_subtotales); $z++) {\t\n\t\t// \t$importe_total = $x_array_subtotales[$z]['importe'];\t\t\n\t\t// \t$sql_sub_total=$sql_sub_total.'(?,\"'.$x_array_subtotales[$z]['descripcion'].'\",\"'.$x_array_subtotales[$z]['importe'].'\"),';\n\t\t// }\n\t\t\n\t\t// subtotales\t\t\n\t\t$sql_subtotales = '';\n\t\t$importe_total=0; // la primera fila es subtotal o total si no hay adicionales\n\t\t$importe_subtotal = $x_array_subtotales[0]['importe'];\n\t\tforeach ( $x_array_subtotales as $sub_total ) {\n\t\t\t$tachado = $sub_total['tachado'] === \"true\" ? 1 : 0; \n\t\t\t$importe_row = $tachado === 1 ? $sub_total['importe_tachado'] : $sub_total['importe'];\n\t\t\t$importe_total = $sub_total['importe'];\n\t\t\t$sql_subtotales = $sql_subtotales.\"(?,\".$_SESSION['ido'].\",\".$_SESSION['idsede'].\",'\".$sub_total['descripcion'].\"','\".$importe_row.\"',\".$tachado.\"),\";\n\t\t}\n\n //guarda primero pedido para obtener el idpedio\n\t\tif(!isset($_POST['estado_p'])){$estado_p=0;}else{$estado_p=$_POST['estado_p'];}//para el caso de venta rapida si ya pago no figura en control de pedidos\n\t\tif(!isset($_POST['idpedido'])){$id_pedido=0;}else{$id_pedido=$_POST['idpedido'];}//si se agrea en un pedido / para control de pedidos al agregar\t\t\n\n if($id_pedido==0){ // nuevo pedido\n\t\t\t//num pedido\n\t\t\t$sql=\"select count(idpedido) as d1 from pedido where idorg=\".$_SESSION['ido'].\" and idsede=\".$_SESSION['idsede'];\n\t\t\t$numpedido=$bd->xDevolverUnDato($sql);\n\t\t\t$numpedido++;\n\n\t\t\t//numcorrelativo segun fecha\n\t\t\t$sql=\"SELECT count(fecha) AS d1 FROM pedido WHERE (idorg=\".$_SESSION['ido'].\" and idsede=\".$_SESSION['idsede'].\") and STR_TO_DATE(fecha,'%d/%m/%Y')=curdate()\";\n\t\t\t$correlativo_dia=$bd->xDevolverUnDato($sql);\n\t\t\t$correlativo_dia++;\n\n\t\t\t// si es delivery y si trae datos adjuntos -- json-> direccion telefono forma pago\n\t\t\t$json_datos_delivery=array_key_exists('arrDatosDelivery', $x_array_pedido_header) ? $x_array_pedido_header['arrDatosDelivery'] : '';\n\t\t\t\n\n // guarda pedido\n $sql=\"insert into pedido (idorg, idsede, idcliente, fecha,hora,fecha_hora,nummesa,numpedido,correlativo_dia,referencia,total,total_r,solo_llevar,idtipo_consumo,idcategoria,reserva,idusuario,subtotales_tachados,estado,json_datos_delivery)\n\t\t\t\t\tvalues(\".$_SESSION['ido'].\",\".$_SESSION['idsede'].\",\".$idc.\",DATE_FORMAT(now(),'%d/%m/%Y'),DATE_FORMAT(now(),'%H:%i:%s'),now(),'\".$x_array_pedido_header['mesa'].\"','\".$numpedido.\"','\".$correlativo_dia.\"','\".$x_array_pedido_header['referencia'].\"','\".$importe_subtotal.\"','\".$importe_total.\"',\".$solo_llevar.\",\".$tipo_consumo.\",\".$x_array_pedido_header['idcategoria'].\",\".$x_array_pedido_header['reservar'].\",\".$_SESSION['idusuario'].\",'\". $x_array_pedido_header['subtotales_tachados'] .\"',\".$estado_p.\",'\".$json_datos_delivery.\"')\";\n $id_pedido=$bd->xConsulta_UltimoId($sql);\n \n\t\t}else{\n\t\t\t//actualiza monto\n\t\t\t$sql=\"update pedido set total=FORMAT(total+\".$xarr['ImporteTotal'].\",2), subtotales_tachados = '\".$x_array_pedido_header['subtotales_tachados'].\"' where idpedido=\".$id_pedido;\n\t\t\t$bd->xConsulta_NoReturn($sql);\n }\n\n //armar sql completos\n\t\t//remplazar ? por idpedido\n\t\t$sql_subtotales = str_replace(\"?\", $id_pedido, $sql_subtotales);\n\t\t$sql_pedido_detalle = str_replace(\"?\", $id_pedido, $sql_pedido_detalle);\n\n\t\t//saca el ultimo caracter ','\n\t\t$sql_subtotales=substr ($sql_subtotales, 0, -1);\n\t\t$sql_pedido_detalle=substr ($sql_pedido_detalle, 0, -1);\n\n\t\t//pedido_detalle\n\t\t$sql_pedido_detalle='insert into pedido_detalle (idpedido,idtipo_consumo,idcategoria,idcarta_lista,iditem,idseccion,cantidad,cantidad_r,punitario,ptotal,ptotal_r,descripcion,procede,procede_tabla) values '.$sql_pedido_detalle;\n\t\t//pedido_subtotales\n\t\t$sql_subtotales='insert into pedido_subtotales (idpedido,idorg,idsede,descripcion,importe, tachado) values '.$sql_subtotales;\n\t\t// echo $sql_pedido_detalle;\n\t\t//ejecutar\n //$sql_ejecuta=$sql_pedido_detalle.'; '.$sql_sub_total.';'; // guarda pedido detalle y pedido subtotal\n $bd->xConsulta_NoReturn($sql_pedido_detalle.';');\n\t\t$bd->xConsulta_NoReturn($sql_subtotales.';');\n\t\t\n\t\t// $x_array_pedido_header['id_pedido'] = $id_pedido; // si viene sin id pedido\n\t\t$x_idpedido = $id_pedido;\n\n\t\t// SI ES PAGO TOTAL\n\t\tif ( strrpos($x_from, \"b\") !== false ) { $x_from = str_replace('b','',$x_from); cocinar_pago_total(); }\n\n\t\t\n\t\t// $x_respuesta->idpedido = $id_pedido; \n\t\t// $x_respuesta->numpedido = $numpedido; \n\t\t// $x_respuesta->correlativo_dia = $correlativo_dia; \n\t\t\n\t\t$x_respuesta = json_encode(array('idpedido' => $id_pedido, 'numpedido' => $numpedido, 'correlativo_dia' => $correlativo_dia));\n\t\tprint $x_respuesta.'|';\n\t\t// $x_respuesta = ['idpedido' => $idpedido];\n\t\t// print $id_pedido.'|'.$numpedido.'|'.$correlativo_dia;\n\t\t\n\t}", "public function crear02()\n {\n $json = file_get_contents('php://input');\n //convierto en un array asociativo de php\n $obj = json_decode($json);\n\n $articulo = new Articulo();\n $articulo->codigo = $obj->codigo;\n $articulo->descripcion = $obj->descripcion;\n $articulo->precio = $obj->precio;\n $articulo->fecha = $obj->fecha;\n //array_push($listaArticulos, $articulo);\n //$items[] = $item;\n\n $modeloCargado = $this->model->crear($articulo);\n //$articulo->id = $obj->id;\n //$articulo->nombre = $obj->nombre;\n //$articulos = $this->model->get();\n //$this->view->articulos = json_encode($articulos);\n //$listaObjetos = json_encode($listaArticulos);\n\n $respuesta = [\n \"datos\" => \"hola\",\n \"totalResultados\" => 5,\n ];\n $this->view->respuesta = json_encode($respuesta);\n\n $this->view->render('api260/articulos/crear02');\n //var_dump($this);\n //var_dump($this->view);\n }", "public function obtener_colectivo();", "public function conteoPedidos($cliente_id)\n {\n //contar todos los pedidos en curso (Estado 1 2 3)\n $enCurso = \\App\\Pedido::\n where('usuario_id',$cliente_id)\n ->where('estado_pago','aprobado')\n ->where(function ($query) {\n $query\n ->where('estado',1)\n ->orWhere('estado',2)\n ->orWhere('estado',3);\n })\n ->count();\n\n //contar todos los pedidos en finalizados (Estado 4)\n $enFinalizados = \\App\\Pedido::\n where('usuario_id',$cliente_id)\n ->where('estado',4)\n ->count();\n\n return response()->json(['enCurso'=>$enCurso, 'enFinalizados'=>$enFinalizados], 200);\n \n }", "public function cadastrar($cliente){\r\n\t\tinclude(\"../config/conexao.php\");\r\n\t\t$sql = 'INSERT INTO cliente (cod, n_casa, rua, bairro, cidade, estado, pais, cep, data_nasc, nome, tel_celular, tel_fixo, email) VALUES (:cod, :n_casa, :rua, :bairro, :cidade, :estado, :pais, :cep, :data_nasc, :nome, :tel_celular, :tel_fixo, :email)';\r\n\t\t$consulta = $pdo->prepare($sql);\r\n\t\t$consulta->bindValue(':cod',$cliente->getCod()); \r\n\t\t$consulta->bindValue(':n_casa',$cliente->getN_casa()); \r\n\t\t$consulta->bindValue(':rua',$cliente->getRua()); \r\n\t\t$consulta->bindValue(':bairro',$cliente->getBairro()); \r\n\t\t$consulta->bindValue(':cidade',$cliente->getCidade()); \r\n\t\t$consulta->bindValue(':estado',$cliente->getEstado()); \r\n\t\t$consulta->bindValue(':pais',$cliente->getPais()); \r\n\t\t$consulta->bindValue(':cep',$cliente->getCep()); \r\n\t\t$consulta->bindValue(':data_nasc',$cliente->getData_nasc()); \r\n\t\t$consulta->bindValue(':nome',$cliente->getNome()); \r\n\t\t$consulta->bindValue(':tel_celular',$cliente->getTel_celular()); \r\n\t\t$consulta->bindValue(':tel_fixo',$cliente->getTel_fixo()); \r\n\t\t$consulta->bindValue(':email',$cliente->getEmail()); \r\n\t\tif($consulta->execute())\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "protected function CargarCliente($item_id){ \n $bus = Cliente::model()->findByPk($item_id);\n $res = array(\n 'EXISTE' => $bus ? true : false,\n 'ID' => $bus ? $bus->CLIENTE : '',\n 'NOMBRE' => $bus ? $bus->NOMBRE : '',\n );\n \n echo CJSON::encode($res);\n }", "private function mettiOffertaInMercato() {\n\n $offerte = new MOfferte;\n\n $nomeRisorsaOfferta = $_POST['nomeRisorsaOfferta'];\n $quantitaOfferta = $_POST['quantitaOfferta'];\n $nomeRisorsaCercata = $_POST['nomeRisorsaCercata'];\n $quantitaCercata = $_POST['quantitaCercata'];\n\n $offerte->create(array(\n 'idutente' => (int) UtenteWeb::status()->user->id,\n 'risorsaofferta' => $nomeRisorsaOfferta,\n 'quantitaofferta' => (int) $quantitaOfferta,\n 'risorsacercata' => $nomeRisorsaCercata,\n 'quantitacercata' => (int) $quantitaCercata,\n ));\n }", "public function TresorieEntreprise() {\n \n $em = $this->getDoctrine()->getManager();\n $entityEntreprise= $em->getRepository('RuffeCardUserGestionBundle:Entreprise')->findClientNoPaiment();\n return $this->render ( \"RuffeCardTresorieBundle:Default:entreprisePaiement.html.twig\", array ('Entreprise'=>$entityEntreprise));\n \n }", "public function agregar(CuentaCorriente $cuentaCorriente)\n {\n }", "function mostrar_producto(){\n\t\tif (isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$sql=\"SELECT * FROM producto WHERE id_pro='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t$resultado = mysql_fetch_array($consulta);\n\t\t\t$this->id=$id;\n\t\t\t$this->codigo=$resultado['codigo_pro'];\n\t\t\tsetlocale(LC_ALL, 'es_ES');\n\t\t\t//$this->nombre=ucwords(strtolower($resultado['nombre_pro']));\n\t\t\t$this->nombre=$resultado['nombre_pro'];\n\t\t\t$this->principal=$resultado['principal_pro'];\n\t\t\t$this->suiche=false;\n\t\t\t$this->ruta=\"\"; $this->categoria=\"\";\n\t\t\t$this->buscar_ruta_nodo($resultado['categoria_pro']);\n\t\t\tfor($i=count($this->ruta)-1;$i>=0;$i--){\n\t\t\t\t$this->categoria.=\" &raquo; \".$this->ruta[$i]['nombre_cat'];\n\t\t\t}\n\t\t\t\n\t\t\t$this->id_cat=$resultado['categoria_pro'];\n\t\t\t$this->prioridad=$resultado['prioridad_pro'];\n\t\t\t$this->vistas=$resultado['vistas_pro'];\n\t\t\t$this->hotel=$resultado['hotel_pro'];\n\t\t\t$this->detal=$this->convertir_moneda($resultado['detal_pro']);\n\t\t\t$this->mayor=$this->convertir_moneda($resultado['mayor_pro']);\n\t\t\t\n\t\t\t$this->cantidad=$resultado['limite_pro'];\n\t\t\t$this->fecha=$this->convertir_fecha($resultado['fecha_pro']);\n\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t$this->limite2=$temp=10;\n\t\t\t//echo \"Numero: \".$temp;\n\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\tif($i<=12) $this->limite[]=$i; else break;\n\t\t\t}\n\t\t\t$this->descripcion=$resultado['descripcion_pro'];\n\t\t\t$this->claves=$resultado['claves_pro'];\n\t\t\t$this->marca=$resultado['marca_pro'];\n\t\t\n\t\t} \n\t}", "public function cliente()\n {\n return $this->hasMany('App\\Cliente');\n }", "function draw_singolo_ordine($id_prodotto, $nome_prodotto, $prezzo, $foto, $quantita)\n {\n echo \"<div class='col-md-9 col-xs-12 text-center' style='background-color:#F9F9F9; padding:5px; margin-bottom:5px;'>\";\n echo \" <div class='col-md-3 col-xs-12'>\";\n echo \" <a href='product_img/$foto'><img class='img-thumbnail' src='product_img/$foto' height='150px' width='150px'></a>\";\n echo \" </div>\";\n echo \" <div class='col-md-6 col-xs-12'>\";\n echo \" <div class='col-xs-12'>\";\n echo \" <h3 class='text-primary'> $nome_prodotto </h3>\";\n echo \" </div>\";\n echo \" </div>\";\n echo \" <div class='col-md-3 col-xs-12'>\";\n echo \" <div class='col-xs-12'>\";\n echo \" <h4>Prezzo</h4>\";\n echo \" <h3 style='color:green;'>€$prezzo</h3>\";\n echo \" </div>\";\n echo \" <div class='col-md-12'>\";\n echo \" <h5>Quantità:$quantita</h5>\";\n echo \" </div>\";\n echo \" </div>\";\n echo \"</div>\";\n }", "public function listar()\n {\n $lin_pedidos_model = new Lineas_pedidos_Model();\n session_start();\n //Le pedimos al modelo todos los Piezas\n $lin_pedidos = $lin_pedidos_model->readAll();\n\n //Pasamos a la vista toda la información que se desea representar\n if (isset($_SESSION['cliente'])) {\n $usuario[\"cliente\"] = $_SESSION['cliente'];\n }\n $variables = array();\n $usuario[\"usuario\"] = $_SESSION[\"usuario\"];\n $variables['articulos'] = $lin_pedidos;\n\n //Finalmente presentamos nuestra plantilla\n $this->view->show(\"cabecera.php\");\n $this->view->show(\"plantilla_header.php\", $usuario);\n $this->view->show(RUTA_VISTAS . \"listar_header.php\");\n $this->view->show(RUTA_VISTAS . \"listar.php\", $variables);\n $this->view->show(\"plantilla_pie.php\");\n $this->view->show(\"pie.php\", $usuario);\n }", "public function show(Cliente $cliente)\n {\n //\n }", "public function show(Cliente $cliente)\n {\n //\n }", "public function show(Cliente $cliente)\n {\n //\n }", "public function show(Cliente $cliente)\n {\n //\n }", "function getContenedoresDeViaje($flete){\n\t\t\ttry{\n\t\t\t$flete = (int) $flete;\n\n\t\t\t\t$PDOmysql = consulta();\n\t\t\t\t$PDOmysql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n\t\t\t\t$sql = 'SELECT Contenedor_Viaje.Contenedor\n\t\t\t\t\t\t FROM Contenedor_Viaje\n\t\t\t\t\t\t WHERE \n\t\t\t\t\t\t Contenedor_Viaje.Flete_idFlete = :flete\n\t\t\t\t\t\t and Contenedor_Viaje.statusA = \"Activo\"';\n\n\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t $stmt->bindParam(':flete', $flete);\n\t $stmt->execute();\n\t $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n\t $this->flete = $flete;#Inicia la variable local flete, igual al flete que se señala-\n\t $Listacontenedores = array(); #Crea una lista para almacenar los contenedores.\n\t \n\t foreach ($rows as $fila) { #Itera entre la consulta de la base de datos, cada ciclo, es un nuevo Contenedor.\n\t \t$contenedor = new Contenedor; # Se inicializa un objeto de la clase contenedor.\n\n\t \t$contenedor->getContenedorDeViaje($fila['Contenedor'], $flete);\n\n\t \t$Listacontenedores[] = $contenedor;\n\t }\n\n\t $this->contenedores = $Listacontenedores; #Inicia la variable local a los contenedores que se buscaron.\n\n\n\t\t\t} catch(PDOException $e){\n\t\t\t\techo $e;\n\t\t\t}\n\t\t}", "function listar_producto_nuevo(){\n\t\t$sql=\"SELECT claves_pro, categoria_pro, id_pro, detal_pro, mayor_pro, directorio_image, nombre_image, marca_pro, nombre_pro, limite_pro, descripcion_pro FROM producto, imagen WHERE galeria_image=id_pro AND tabla_image='Producto' AND disponible_pro='1' GROUP BY id_pro ORDER BY RAND() LIMIT 0 , 10\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$aux=\"\";\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$resultado['detal_pro']=$this->mostrar_precio($this->convertir_moneda($resultado['detal_pro']));\n\t\t\t$resultado['mayor_pro']=$this->mostrar_precio($this->convertir_moneda($resultado['mayor_pro']));\n\t\t\t$resultado['descripcion_pro']=strip_tags($resultado['descripcion_pro']);\n\t\t\t\n\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\n\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\tif($i<=12) $resultado['limite_pro'][]=$i; else break;\n\t\t\t}\n\t\t\t\n\t\t\t\t$cat=$resultado['categoria_pro'];\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat'\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "function mostrarPrestamos($bdConexion,$hCodigo,$idlibro,$idusuario)\r\n{\r\n\t$sqlMostrar = \"SELECT \r\n l.imagen,\r\n l.idLibro,\r\n l.titulo,\r\n l.precioCosto,\r\n det.idLibro, \r\n det.cantidad,\r\n det.total\r\n FROM tbllibro l\r\n INNER JOIN tbldetpedido det\r\n ON l.idLibro=det.idLibro AND det.idPedido = $hCodigo AND det.eliminado = 0\r\n \";\t\t\t\r\nif($hCodigo >0){\r\n\t$rsMostrar= $bdConexion->ejecutarSql($sqlMostrar);\r\n\tprint '\t<tr >\r\n <th>Codigo Libro</th>\r\n\t\t\t\t<th >Imagen</th>\r\n\t\t\t\t<th>Titulo</th>\r\n\t\t\t\t<th >Precio</th>\r\n\t\t\t\t<th >Cantidad</th>\r\n\t\t\t\t<th>Total</th>\r\n\t\t\t\t<th>Acciones</th>\r\n\t\t\t</tr>';\r\n\t//Monstran detalle de registros\r\n\twhile($fila = mysqli_fetch_array($rsMostrar))\r\n\t{\r\n\t\t\t\tprint \"<tr>\r\n\t\t\t\t<td>\".$fila['idLibro'].\"</td>\r\n\t\t\t\t<td><img width='60' height='80'src=\".$fila['imagen'].\"></td>\r\n\t\t\t\t<td>\".$fila['titulo'].\"</td>\r\n\t\t\t\t<td>\".$fila['precioCosto'].\"</td>\r\n\t\t\t\t<td>\".$fila['cantidad'].\"</td>\r\n\t\t\t\t<td>\".$fila['total'].\"</td>\r\n <td>\r\n <a href='frmPedido.php?accion=remove&hCodigo=\".$hCodigo\r\n .\"&idLibro=\".$fila['idLibro'].\"' \r\n onclick='return eliminarItem();' class=' fa fa-minus-circle'></a>\r\n </td>\r\n\t\t\t </tr>\";\r\n\t}//Fin While\r\n\t\r\n}//Fin del metodo mostrar Prestamos de cliente\r\n}", "static public function ctrCrearVenta(){\n\n\t\t\n\t\tif(isset($_POST[\"nuevaVenta\"])){\n\n\t\t\t/*=============================================\n\t\t\tACTUALIZAR LAS COMPRAS DEL CLIENTE Y REDUCIR EL STOCK Y AUMENTAR LAS VENTAS DE LOS PRODUCTOS\n\t\t\t=============================================*/\n\n\t\t\t$listaProductos = json_decode($_POST[\"listaProductos\"], true);\n\t\t\t\n\n\t\t\t// $totalProductosComprados = array();\n\n\t\t\tforeach ($listaProductos as $key => $value) {\n\n\t\t\t\t// TRAER EL STOCK\n\t\t\t\t$tablaProductos = \"productos\";\n\n\t\t\t $item = \"id\";\n\t\t\t $valor = $value[\"id\"];\n\t\t\t $orden = \"id\";\n\n\t\t\t\t$stock = ModeloProductos::mdlMostrarProductos($tablaProductos, $item, $valor, $orden);\n\t\t\t\t\n\t\t\t\t// VER QUE TIPO DE STOCK TIENE\n\t\t\t\t$item = \"id\";\n\t\t\t $valor = $stock[\"id_categoria\"];\n\n\t\t\t $categorias = ControladorCategorias::ctrMostrarCategorias($item, $valor);\n\t\t\t echo '<pre>'; print_r($categorias); echo '</pre>';\n\n\t\t\t\t// SUMAR UNA VENTA\n\t\t\t $item1a = \"ventas\";\n\t\t\t\t$valor1a = $value[\"cantidad\"] + $stock[\"ventas\"];\n\n\t\t\t\t$nuevasVentas = ModeloProductos::mdlActualizarProducto($tablaProductos, $item1a, $valor1a, $valor);\n\t\t\t\t\n\t\t\t\tif($categorias[\"movimiento\"]==\"SI\"){\n\t\t\t\t\t// SUMAR STOCK\n\t\t\t\t $item1b = \"stock\";\n\t\t\t\t\t$valor1b = $stock[\"stock\"]-$value[\"cantidad\"];\n\n\t\t\t\t\t$nuevoStock = ModeloProductos::mdlActualizarProducto($tablaProductos, $item1b, $valor1b, $value[\"id\"]);\n\t\t\t\t\t\n\t\t\t\t} \n\n\t\t\t}\n\t\t\t\n\n\t\t\t$tablaClientes = \"clientes\";\n\n\t\t\t$item = \"id\";\n\t\t\t$valor = $_POST[\"seleccionarCliente\"];\n\n\t\t\t$traerCliente = ModeloClientes::mdlMostrarClientes($tablaClientes, $item, $valor);\n\t\t\t\n\n\t\t\t$item1a = \"compras\";\n\t\t\t$valor1a = $traerCliente[\"compras\"]+1;\n\n\t\t\t$comprasCliente = ModeloClientes::mdlActualizarCliente($tablaClientes, $item1a, $valor1a, $valor);\n\n\t\t\t$item1b = \"ultima_compra\";\n\n\t\t\t\n\t\t\t$fecha = date('Y-m-d');\n\t\t\t$hora = date('H:i:s');\n\t\t\t$valor1b = $fecha.' '.$hora;\n\n\t\t\t$fechaCliente = ModeloClientes::mdlActualizarCliente($tablaClientes, $item1b, $valor1b, $valor);\n\n\t\t\t/*=============================================\n\t\t\tFORMATEO LOS DATOS\n\t\t\t=============================================*/\t\n\n\t\t\t$fecha = explode(\"-\",$_POST[\"fecha\"]); //15-05-2018\n\t\t\t$fecha = $fecha[2].\"-\".$fecha[1].\"-\".$fecha[0];\n\n\t\t\tif ($_POST[\"listaMetodoPago\"]==\"CTA.CORRIENTE\"){\n\t\t\t\t\n\t\t\t\t$adeuda=$_POST[\"totalVenta\"];\n\n\t\t\t\t$fechapago=\"0000-00-00\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\t$adeuda=0;\n\n\t\t\t\t$fechapago = $fecha;\n\t\t\t}\n\n\t\t\t\n\n\t\t\t/*=============================================\n\t\t\tGUARDAR LA COMPRA\n\t\t\t=============================================*/\t\n\n\t\t\t$tabla = \"ventas\";\n\n\n\n\t\t\t$datos = array(\"id_vendedor\"=>$_POST[\"idVendedor\"],\n\t\t\t\t\t\t \"fecha\"=>$fecha,\n\t\t\t\t\t\t \"id_cliente\"=>$_POST[\"seleccionarCliente\"],\n\t\t\t\t\t\t \"codigo\"=>$_POST[\"nuevaVenta\"],\n\t\t\t\t\t\t \"nrofc\"=>$_POST[\"nrocomprobante\"],\n\t\t\t\t\t\t \"detalle\"=>strtoupper($_POST[\"busqueda\"]),\n\t\t\t\t\t\t \"productos\"=>$_POST[\"listaProductos\"],\n\t\t\t\t\t\t \"impuesto\"=>$_POST[\"nuevoPrecioImpuesto\"],\n\t\t\t\t\t\t \"neto\"=>$_POST[\"nuevoPrecioNeto\"],\n\t\t\t\t\t\t \"total\"=>$_POST[\"totalVenta\"],\n\t\t\t\t\t\t \"adeuda\"=>$adeuda,\n\t\t\t\t\t\t \"obs\"=>strtoupper($_POST[\"obs\"]),\n\t\t\t\t\t\t \"metodo_pago\"=>$_POST[\"listaMetodoPago\"],\n\t\t\t\t\t\t \"fechapago\"=>$fechapago);\n\n\t\t\t$respuesta = ModeloVentas::mdlIngresarVenta($tabla, $datos);\n\n\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t/*=============================================\n\t\t\t\tCOMPARA EL NUMERO DE COMPROBANTE\n\t\t\t\t=============================================*/\n\t\t\t\t $nrofc = intval($_POST[\"nrocomprobante\"]);\n\n\t\t\t\t //ULTIMO NUMERO DE COMPROBANTE\n\t\t\t\t $item = \"nombre\";\n\t\t\t\t $valor = \"REGISTRO\";\n\n\t\t\t\t $nroComprobante = ControladorVentas::ctrUltimoComprobante($item, $valor);\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\n\t\t\t\t if($nrofc==$nroComprobante[\"numero\"]){\n\n\t\t\t\t \t$tabla=\"nrocomprobante\";\n\n\t\t\t\t\t$nrofc=$nrofc+1;\n\n\t\t\t\t \t$datos = array(\"nombre\"=>$valor,\n\t\t\t\t\t\t \"numero\"=>$nrofc);\n\n\t\t\t\t \t\n\t\t\t\t \tModeloVentas::mdlAgregarNroComprobante($tabla, $datos);\n\t\t\t\t }\n\n\t\t\t\t \n\t\t\t\t $nroComprobante = substr($_POST[\"nuevaVenta\"],8);\n\n\t\t\t\t //ULTIMO NUMERO DE COMPROBANTE\n\t\t\t\t $item = \"nombre\";\n\t\t\t\t $valor = \"FC\";\n\n\t\t\t\t $registro = ControladorVentas::ctrUltimoComprobante($item, $valor);\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\n\t\t\t\t if($nroComprobante==$registro[\"numero\"]){\n\n\t\t\t\t \t$tabla=\"nrocomprobante\";\n\n\t\t\t\t\t$nroComprobante=$nroComprobante+1;\n\n\t\t\t\t \t$datos = array(\"nombre\"=>$valor,\n\t\t\t\t\t\t \"numero\"=>$nroComprobante);\n\n\t\t\t\t \t\n\t\t\t\t \tModeloVentas::mdlAgregarNroComprobante($tabla, $datos);\n\t\t\t\t }\n\n\n\n\n\t\t\t\techo'<script>\n\n\t\t\t\tlocalStorage.removeItem(\"rango\");\n\n\t\t\t\t\n\n\t\t\t\t\t\t\t\twindow.location = \"ventas\";\n\n\n\t\t\t\t</script>';\n\n\n\t\t\t}\n\n\t\t }\n\n\t}", "function setIdCliente($id_cliente)\r\n\t {\r\n\t\t $this->id_cliente = $id_cliente;\r\n\t }", "public function recalcula() {\n\n //Si el cliente no está sujeto a iva\n //pongo el iva a cero en las líneas para evitar que por cambio\n //de cliente se aplique indebidamente\n $cliente = new Clientes($this->IDCliente);\n if ($cliente->getIva()->getIDTipo() == '0') {\n $lineas = new FemitidasLineas();\n $lineas->queryUpdate(array(\"Iva\" => 0, \"Recargo\" => 0), \"`IDFactura`= '{$this->IDFactura}'\");\n unset($lineas);\n }\n //Si el cliente no está sujeto a recargo de equivalencia\n //lo pongo a cero en las líneas para evitar que por cambio\n //de cliente se aplique indebidamente\n elseif ($cliente->getRecargoEqu()->getIDTipo() == '0') {\n $lineas = new FemitidasLineas();\n $lineas->queryUpdate(array(\"Recargo\" => 0), \"`IDFactura`= '{$this->IDFactura}'\");\n unset($lineas);\n }\n unset($cliente);\n\n //SI TIENE DESCUENTO, CALCULO EL PORCENTAJE QUE SUPONE RESPECTO AL IMPORTE BRUTO\n //PARA REPERCUTUIRLO PORCENTUALMENTE A CADA BASE\n $pordcto = 0;\n if ($this->getDescuento() != 0)\n $pordcto = round(100 * ($this->getDescuento() / $this->getImporte()), 2);\n\n //Calcular los totales, desglosados por tipo de iva.\n $this->conecta();\n if (is_resource($this->_dbLink)) {\n $lineas = new FemitidasLineas();\n $tableLineas = \"{$lineas->getDataBaseName()}.{$lineas->getTableName()}\";\n $articulos = new Articulos();\n $tableArticulos = \"{$articulos->getDataBaseName()}.{$articulos->getTableName()}\";\n unset($lineas);\n unset($articulos);\n\n $query = \"select sum(Importe) as Bruto,sum(ImporteCosto) as Costo from {$tableLineas} where (IDFactura='\" . $this->getIDFactura() . \"')\";\n $this->_em->query($query);\n $rows = $this->_em->fetchResult();\n $bruto = $rows[0]['Bruto'];\n\n $query = \"select Iva,Recargo, sum(Importe) as Importe from {$tableLineas} where (IDFactura='\" . $this->getIDFactura() . \"') group by Iva,Recargo order by Iva\";\n $this->_em->query($query);\n $rows = $this->_em->fetchResult();\n $totbases = 0;\n $totiva = 0;\n $totrec = 0;\n $bases = array();\n\n foreach ($rows as $key => $row) {\n $importe = $row['Importe'] * (1 - $pordcto / 100);\n $cuotaiva = round($importe * $row['Iva'] / 100, 2);\n $cuotarecargo = round($importe * $row['Recargo'] / 100, 2);\n $totbases += $importe;\n $totiva += $cuotaiva;\n $totrec += $cuotarecargo;\n\n $bases[$key] = array(\n 'b' => $importe,\n 'i' => $row['Iva'],\n 'ci' => $cuotaiva,\n 'r' => $row['Recargo'],\n 'cr' => $cuotarecargo\n );\n }\n\n $subtotal = $totbases + $totiva + $totrec;\n\n // Calcular el recargo financiero según la forma de pago\n $formaPago = new FormasPago($this->IDFP);\n $recFinanciero = $formaPago->getRecargoFinanciero();\n $cuotaRecFinanciero = $subtotal * $recFinanciero / 100;\n unset($formaPago);\n\n $total = $subtotal + $cuotaRecFinanciero;\n\n //Calcular el peso, volumen y n. de bultos de los productos inventariables\n switch ($_SESSION['ver']) {\n case '0': //Estandar\n $columna = \"Unidades\";\n break;\n case '1': //Cristal\n $columna = \"MtsAl\";\n break;\n }\n $em = new EntityManager($this->getConectionName());\n $query = \"select sum(a.Peso*l.{$columna}) as Peso,\n sum(aVolumen*l.{$columna}) as Volumen,\n sum(Unidades) as Bultos \n from {$tableArticulos} as a,{$tableLineas} as l\n where (l.IDArticulo=a.IDArticulo)\n and (a.Inventario='1')\n and (l.IDFactura='{$this->IDFactura}')\";\n $em->query($query);\n $rows = $em->fetchResult();\n $em->desConecta();\n\n $this->setImporte($bruto);\n $this->setBaseImponible1($bases[0]['b']);\n $this->setIva1($bases[0]['i']);\n $this->setCuotaIva1($bases[0]['ci']);\n $this->setRecargo1($bases[0]['r']);\n $this->setCuotaRecargo1($bases[0]['cr']);\n $this->setBaseImponible2($bases[1]['b']);\n $this->setIva2($bases[1]['i']);\n $this->setCuotaIva2($bases[1]['ci']);\n $this->setRecargo2($bases[1]['r']);\n $this->setCuotaRecargo2($bases[1]['cr']);\n $this->setBaseImponible3($bases[2]['b']);\n $this->setIva3($bases[2]['i']);\n $this->setCuotaIva3($bases[2]['ci']);\n $this->setRecargo3($bases[2]['r']);\n $this->setCuotaRecargo3($bases[2]['cr']);\n $this->setTotalBases($totbases);\n $this->setTotalIva($totiva);\n $this->setTotalRecargo($totrec);\n $this->setRecargoFinanciero($recFinanciero);\n $this->setCuotaRecargoFinanciero($cuotaRecFinanciero);\n $this->setTotal($total);\n $this->setPeso($rows[0]['Peso']);\n $this->setVolumen($rows[0]['Volumen']);\n $this->setBultos($rows[0]['Bultos']);\n\n $this->save();\n }\n }", "public static function recupereTudo() {\n include_once 'conexao.php';\n $sql = \"SELECT * FROM INSTITUICAO\";\n $query = mysql_query($sql);\n while ($sql = mysql_fetch_array($query)) {\n $id = $sql[\"id\"];\n $nome = $sql[\"nome\"];\n echo \"<a href=nome.php?id=$id>$nome</a>\";\n }\n }", "public function mostraElencoProvvedimenti($pagina) {\r\n \r\n $pagina->setJsFile(\"\");\r\n $operatore = $_SESSION[\"op\"];\r\n $ruolo = $operatore->getFunzione();\r\n $pagina->setHeaderFile(\"./view/header.php\"); \r\n OperatoreController::setruolo($pagina);\r\n $pagina->setMsg('');\r\n \r\n if (isset($_REQUEST['id'])) {\r\n $id = $_REQUEST['id'];\r\n $nuovoProvvedimento = ProvvedimentoFactory::getProvvedimento($id);\r\n $pagina->setTitle(\"Modifica operatore\");\r\n $pagina->setContentFile(\"./view/operatore/nuovoProvvedimento.php\");\r\n $update = true;\r\n } else {\r\n $pagina->setJsFile(\"./js/provvedimenti.js\");\r\n $pagina->setTitle(\"Elenco provvedimenti Unici\");\r\n $pagina->setContentFile(\"./view/operatore/elencoProvvedimenti.php\"); \r\n }\r\n include \"./view/masterPage.php\";\r\n }", "function redirecionaClienteParaDepartamentoTecnologia($cliente)\n{\n\n # montando URL\n $url =\n \"index.php/por/chat/startchat/(leaveamessage)/true?prefill%5Busername%5D={$cliente['razao_social']}&value_items_admin[0]={$cliente['duvida']}&value_items_admin[1]={$cliente['nome_usuario']}&value_items_admin[2]={$cliente['conta_contrato']}&value_items_admin[3]={$cliente['razao_social']}&value_items_admin[4]={$cliente['cnpj']}&value_items_admin[5]=0&nome_departamento=Tecnologia&codigo_ticket=0&novo_erp={$cliente['novo_erp']}&prefill%5Bphone%5D=2&value_items_admin[6]={$cliente['telefone']}&value_items_admin[7]=0\";\n\n # redirecionando cliente para o colaborador no chat teste\n echo json_encode(['url' => 'http://192.168.0.47:9999/' . $url], JSON_UNESCAPED_UNICODE);\n\n # redirecionando cliente para o colaborador no chat produção\n #echo json_encode(['url' => 'https://chat.avancoinfo.net/' . $url], JSON_UNESCAPED_UNICODE);\n\n exit;\n}", "public function carregarDadosAnunciante($idCliente) {\n $sql = new Sql($this->_dbAdapter);\n $select = $sql->select();\n $select->from(array('a' => 'tb_anunciante'))\n ->join(array('b' => 'tb_cliente'), 'a.ID_CLIENTE = b.ID_CLIENTE')\n ->join(array('c' => 'tb_cidade'), 'a.ID_CIDADE = c.ID_CIDADE')\n ->where(array(\n 'a.ID_CLIENTE' => (int) $idCliente\n ))->order('a.ID_ANUNCIANTE ASC');\n $statement = $sql->prepareStatementForSqlObject($select);\n $stmt = $statement->execute();\n $array = array();\n foreach ($stmt as $banner) {\n $array['idAnunciante'] = $banner['ID_ANUNCIANTE'];\n $array['stAnunciante'] = $banner['ST_ANUNCIANTE'];\n $array['noArtistico'] = $banner['NO_ARTISTICO'];\n $array['nuTelefone'] = $banner['NU_TELEFONE'];\n $array['sgUf'] = $banner['SG_UF'];\n $array['noCidade'] = $banner['NO_CIDADE'];\n }\n return $array;\n }", "function preparatoria_get(){\n $id=$this->get('id');\n $id2=$this->get('id2');\n if (count($this->get())>2) {\n $response = array(\n \"status\" => \"error\",\n \"status_code\" => 409,\n \"message\" => \"Demasiados datos enviados\",\n \"validations\" =>array(\n \"id\"=>\"Envia Id (get) para obtener un especifico articulo o vacio para obtener todos los articulos\"\n ),\n \"data\"=>null\n );\n }else{\n if ($id) {\n $data = $this->DAO->selectEntity('Vw_Prep',array('idTipoAlojamientoInstitucion'=>$id,'idTipoEstudioInstituccion'=>$id2),true);\n }\n else{\n $data = $this->DAO->selectEntity('Vw_Prep',null,false);\n }\n if ($data) {\n $response = array(\n \"status\" => \"success\",\n \"status_code\" => 201,\n \"message\" => \"Articulo Cargado correctamente\",\n \"validations\" =>null,\n \"data\"=>$data\n );\n }else{\n $response = array(\n \"status\" => \"error\",\n \"status_code\" => 409,\n \"message\" => \"No se recibio datos\",\n \"validations\" =>null,\n \"data\"=>null\n );\n }\n }\n $this->response($response,200);\n }", "function upImagenAction(){\n\t\t\n\t\t$request = $this->get('request');\n\t\t\n\t\t$estetica=$request->request->get('id');\n\t\t$img=$request->request->get('img');\n\t\t\t\t\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t$hcEstetica = $em->getRepository('HcBundle:Hc')->find($estetica);\n\t\t\n\t\t\t\t\n\t\tif($hcEstetica){\t\t\n\t\t\t$ruta = $this->container->getParameter('dlaser.directorio.imagenes');\n\t\t\t\n\t\t\tif ($img) {\n\t\t\t\t\n\t\t\t\t$imgData = base64_decode(substr($img,22));\n\t\t\t\t\n\t\t\t\t$file = $ruta.'grafico_'.$estetica.'.png';\n\t\t\t\t\n\t\t\t\tif (file_exists($file)) { unlink($file); }\n\t\t\t\t$fp = fopen($file, 'w');\n\t\t\t\tfwrite($fp, $imgData);\n\t\t\t\tfclose($fp);\n\t\t\t\t\n\t\t\t\t$response=array(\"responseCode\"=>200, \"msg\"=>\"La operación ha sido exitosa.\");\n\t\t\t}\n\t\t}else{\n\t\t\t$response=array(\"responseCode\"=>400, \"msg\"=>\"Ha ocurrido un error al crear la imagen.\");\n\t\t}\n\t\t\n\t\t$return=json_encode($response);\n\t\treturn new Response($return,200,array('Content-Type'=>'application/json'));\n\t}", "function entrada_por_traspaso(){\n\t\t$e= new Entrada();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cproveedores_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}", "public function articulos($id_compras_orden=false){\r\n\t\t$table \t\t\t\t= '';\r\n\t\t$accion \t\t\t= $this->tab['articulos'];\r\n\t\t$uso_interno\t\t= (!$id_compras_orden)?false:true;\r\n\t\t$id_compras_orden \t= (!$id_compras_orden)?$this->ajax_post('id_compras_orden'):$id_compras_orden;\r\n\t\t$detalle \t\t\t= $this->ordenes_model->get_orden_unico($id_compras_orden);\r\n\r\n\t\t$data_sql = array('id_compras_orden'=>$id_compras_orden);\r\n\t\t$data_listado=$this->db_model->db_get_data_orden_listado_registrado_unificado($data_sql);\r\n\t\t$moneda = $this->session->userdata('moneda');\r\n\t\tif(count($data_listado)>0){\r\n\t\t\t\t$style_table='display:block';\r\n\t\t\t\t$html='';\r\n\t\t\tfor($i=0;count($data_listado)>$i;$i++){\r\n\t\t\t\t// Lineas\r\n\t\t\t\t$peso_unitario = (substr($data_listado[$i]['peso_unitario'], strpos($data_listado[$i]['peso_unitario'], \".\" ))=='.000')?number_format($data_listado[$i]['peso_unitario'],0):$data_listado[$i]['peso_unitario'];\r\n\t\t\t\t$presentacion_x_embalaje = (substr($data_listado[$i]['presentacion_x_embalaje'], strpos($data_listado[$i]['presentacion_x_embalaje'], \".\" ))=='.000')?number_format($data_listado[$i]['presentacion_x_embalaje'],0):$data_listado[$i]['presentacion_x_embalaje'];\r\n\t\t\t\t$embalaje = ($data_listado[$i]['embalaje'])?$data_listado[$i]['embalaje'].' CON ':'';\r\n\r\n\t\t\t\t//print_debug($data_listado);\r\n\t\t\t\t$Data['consecutivo'] \t\t\t\t =\t ($i+1);\r\n\t\t\t\t$Data['id_compras_articulo_precios'] =\t $data_listado[$i]['id_compras_articulo_precios'];\r\n\t\t\t\t$Data['id_compras_articulo_presentacion'] =\t $data_listado[$i]['id_compras_articulo_presentacion'];\r\n\t\t\t\t$Data['id_compras_orden_articulo'] =\t $data_listado[$i]['id_compras_orden_articulo'];\r\n\t\t\t\t$Data['id_compras_articulo'] \t\t =\t $data_listado[$i]['id_compras_articulo'];\r\n\t\t\t\t$Data['id_articulo_tipo'] \t\t \t =\t $data_listado[$i]['id_articulo_tipo'];\r\n\t\t\t\t$Data['id_compras_um'] \t\t\t \t =\t $data_listado[$i]['id_compras_um'];\r\n\t\t\t\t$Data['um_x_embalaje'] \t\t\t \t =\t $data_listado[$i]['um_x_embalaje'];\r\n\t\t\t\t$Data['um_x_presentacion'] \t\t \t =\t $data_listado[$i]['um_x_presentacion'];\r\n\t\t\t\t$Data['unidad_minima'] \t\t\t \t =\t $data_listado[$i]['unidad_minima'];\r\n\t\t\t\t$Data['cl_um']\t\t\t\t\t \t =\t $data_listado[$i]['cl_um'];\r\n\t\t\t\t$Data['nombre_comercial']\t\t\t =\t $data_listado[$i]['nombre_comercial'];\r\n\t\t\t\t$Data['articulo']\t\t\t\t\t =\t $data_listado[$i]['articulo'].' - '.$data_listado[$i]['presentacion_detalle'];\r\n\t\t\t\t$Data['peso_unitario'] \t\t\t \t =\t $peso_unitario;\r\n\t\t\t\t$Data['upc'] \t\t\t\t\t\t =\t 'SKU:'.$data_listado[$i]['sku'].' UPC:'.$data_listado[$i]['upc'];\r\n\t\t\t\t$Data['presentacion_x_embalaje'] \t =\t $embalaje.$presentacion_x_embalaje;\r\n\t\t\t\t$Data['presentacion'] \t\t\t\t =\t $data_listado[$i]['presentacion'];\r\n\t\t\t\t$Data['costo_sin_impuesto'] \t\t =\t $data_listado[$i]['costo_sin_impuesto'];\r\n\t\t\t\t$Data['moneda'] \t\t\t\t\t =\t $moneda;\r\n\t\t\t\t$Data['cantidad'] \t\t\t\t\t =\t $data_listado[$i]['cantidad'];\r\n\t\t\t\t$Data['costo_x_cantidad'] \t\t\t =\t $data_listado[$i]['costo_x_cantidad'];\r\n\t\t\t\t$Data['descuento'] \t\t\t\t \t =\t $data_listado[$i]['descuento'];\r\n\t\t\t\t$Data['subtotal'] \t\t\t\t\t =\t $data_listado[$i]['subtotal'];\r\n\t\t\t\t$Data['impuesto_porcentaje'] \t\t =\t $data_listado[$i]['impuesto_porcentaje'];\r\n\t\t\t\t$Data['valor_impuesto']\t\t\t \t =\t $data_listado[$i]['valor_impuesto'];\r\n\t\t\t\t$Data['total'] \t\t\t\t\t \t =\t $data_listado[$i]['total'];\r\n\t\t\t\t$Data['number_costo_sin_impuesto'] =\t number_format($data_listado[$i]['costo_sin_impuesto'],2);\r\n\t\t\t\t$Data['number_cantidad'] \t\t\t =\t number_format($data_listado[$i]['cantidad'],0);\r\n\t\t\t\t$Data['number_costo_x_cantidad'] \t =\t number_format($data_listado[$i]['costo_x_cantidad'],2);\r\n\t\t\t\t$Data['number_descuento'] \t\t\t =\t number_format($data_listado[$i]['descuento'],0);\r\n\t\t\t\t$Data['number_subtotal']\t\t\t =\t number_format($data_listado[$i]['subtotal'],2);\r\n\t\t\t\t$Data['number_impuesto_porcentaje'] =\t number_format($data_listado[$i]['impuesto_porcentaje'],0);\r\n\t\t\t\t$Data['number_valor_impuesto']\t\t =\t number_format($data_listado[$i]['valor_impuesto'],2);\r\n\t\t\t\t$Data['number_total']\t\t\t\t =\t number_format($data_listado[$i]['total'],2);\r\n\r\n\t\t\t\t$url_listado_tpl = $this->modulo.'/'.$this->seccion.'/'.$this->submodulo.'/'.'entradas_recepcion_listado';\r\n\t\t\t\t$html.=$this->load_view_unique($url_listado_tpl ,$Data, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$style_table='display:none';\r\n\t\t\t$html='';\r\n\t\t}\r\n\t\t$data='';\r\n\t\t$proveedores = $this->ordenes_model->db_get_proveedores($data,$detalle[0]['id_proveedor']);\r\n\t\t$sucursales\t = $this->sucursales_model->get_orden_unico_sucursal($detalle[0]['id_sucursal']);\r\n\t\t$forma_pago\t = $this->formas_de_pago_model->get_orden_unico_formapago($detalle[0]['id_forma_pago']);\r\n\t\t$creditos\t = $this->creditos_model->get_orden_unico_credito($detalle[0]['id_credito']);\r\n\t\t$orden_tipo\t = $this->ordenes_model->db_get_tipo_orden($detalle[0]['id_orden_tipo']);\r\n\t\t\r\n\t\t$fec=explode('-',$detalle[0]['entrega_fecha']);\r\n\t\t$entrega_fecha=$fec[2].'/'.$fec[1].'/'.$fec[0];\r\n\t\t$fec2=explode('-',$detalle[0]['orden_fecha']);\r\n\t\t$orden_fecha=$fec2[2].'/'.$fec2[1].'/'.$fec2[0];\r\n\t\t$tabData['id_compras_orden']\t\t = $id_compras_orden;\r\n\t\t$tabData['orden_num'] \t\t\t = $this->lang_item(\"orden_num\",false);\r\n $tabData['proveedor'] \t \t\t\t = $this->lang_item(\"proveedor\",false);\r\n\t\t$tabData['sucursal'] \t\t\t = $this->lang_item(\"sucursal\",false);\r\n $tabData['orden_fecha'] \t\t = $this->lang_item(\"orden_fecha\",false);\r\n\t\t$tabData['entrega_fecha'] = $this->lang_item(\"entrega_fecha\",false);\r\n $tabData['observaciones'] \t = $this->lang_item(\"observaciones\",false);\r\n $tabData['forma_pago'] \t\t\t = $this->lang_item(\"forma_pago\",false);\r\n\t\t$tabData['articulo'] \t\t\t \t = $this->lang_item(\"articulo\",false);\r\n\t\t$tabData['costo_unitario']\t \t\t = $this->lang_item(\"costo_unitario\",false);\r\n\t\t$tabData['cantidad'] \t\t\t \t = $this->lang_item(\"cantidad\",false);\r\n\t\t$tabData['costo_cantidad'] \t = $this->lang_item(\"costo_cantidad\",false);\r\n\t\t$tabData['descuento'] \t\t\t \t = $this->lang_item(\"descuento\",false);\r\n\t\t$tabData['subtotal'] \t\t\t \t = $this->lang_item(\"subtotal\",false);\r\n\t\t$tabData['imp'] \t\t\t \t\t = $this->lang_item(\"imp\",false);\r\n\t\t$tabData['valor_imp'] \t\t\t \t = $this->lang_item(\"valor_imp\",false);\r\n\t\t$tabData['total'] \t\t\t \t\t = $this->lang_item(\"total\",false);\r\n\t\t$tabData['accion'] \t\t\t\t = $this->lang_item(\"accion\",false);\r\n\t\t$tabData['impuesto'] \t\t\t\t = $this->lang_item(\"impuesto\",false);\r\n\t\t$tabData['a_pagar'] \t\t\t\t = $this->lang_item(\"a_pagar\",false);\r\n\t\t$tabData['cerrar_orden'] \t\t \t = $this->lang_item(\"cerrar_orden\",false);\r\n\t\t$tabData['cancelar_orden']\t\t\t = $this->lang_item(\"cancelar_orden\",false);\r\n\t\t$tabData['presentacion']\t\t\t = $this->lang_item(\"embalaje\",false);\r\n\t\t$tabData['consecutivo']\t\t\t\t = $this->lang_item(\"consecutivo\",false);\r\n\t\t$tabData['moneda']\t\t\t\t \t = $moneda;\r\n\t\t$tabData['aceptar_orden']\t\t\t = $this->lang_item(\"aceptar_orden\",false);\r\n\t\t$tabData['devolucion_orden']\t\t = $this->lang_item(\"devolucion_orden\",false);\r\n\t\t$tabData['no_factura']\t\t \t\t = $this->lang_item(\"no_factura\",false);\r\n\t\t$tabData['fecha_factura']\t\t \t = $this->lang_item(\"fecha_factura\",false);\r\n\t\t$tabData['#']\t\t \t \t\t\t = $this->lang_item(\"#\",false);\r\n\t\t$tabData['costo_unitario']\t\t \t = $this->lang_item(\"costo_unitario\",false);\r\n\t\t$tabData['costo_cantidad']\t\t \t = $this->lang_item(\"costo_cantidad\",false);\r\n\t\t$tabData['valor_imp']\t\t \t \t = $this->lang_item(\"valor_imp\",false);\r\n\t\t$tabData['aceptar']\t\t \t \t\t = $this->lang_item(\"aceptar\",false);\r\n\t\t$tabData['comentarios_entrada']\t\t = $this->lang_item(\"comentarios_entrada\",false);\r\n\t\t$tabData['recibir_enetrada']\t\t = $this->lang_item(\"recibir_enetrada\",false);\r\n\t\t$tabData['rechazar_entrada']\t\t = $this->lang_item(\"rechazar_entrada\",false);\r\n\t\t$tabData['fecha_caducidad']\t\t \t = $this->lang_item(\"fecha_caducidad\",false);\r\n\t\t$tabData['acciones']\t\t \t \t = $this->lang_item(\"acciones\",false);\r\n\t\t$tabData['lote']\t\t \t \t \t = $this->lang_item(\"lote\",false);\r\n\t\t\r\n\r\n\t\t//DATA\r\n\t\t$tabData['orden_num_value']\t \t\t = $detalle[0]['orden_num'];\r\n\t\t$tabData['estatus']\t \t\t \t\t = $detalle[0]['estatus'];\r\n\t\t$tabData['observaciones_value']\t \t = $detalle[0]['observaciones'];\r\n\t\t$tabData['fecha_registro']\t \t \t = $detalle[0]['timestamp'];\r\n\t\t$tabData['list_sucursales']\t\t\t = $sucursales[0]['sucursal'];\r\n\t\t$tabData['orden_fecha_value']\t \t = $orden_fecha;\r\n\t\t$tabData['entrega_fecha_value']\t = $entrega_fecha;\r\n\t\t$tabData['list_forma_pago']\t\t\t = $forma_pago[0]['forma_pago'];\r\n\t\t$tabData['table']\t\t\t\t\t = $html;\r\n\t\t$tabData['style_table']\t\t\t\t = $style_table;\r\n\r\n\t\t$uri_view = $this->path.$this->submodulo.'/'.$accion;\r\n\t\tif(!$uso_interno){\r\n\t\t\techo json_encode( $this->load_view_unique($uri_view ,$tabData, true));\r\n\t\t}else{\r\n\t\t\t$includes['css'][] = array('name' => 'style.default', 'dirname' => '');\r\n\t\t\t$includes['css'][] = array('name' => 'estilos-custom', 'dirname' => '');\r\n\t\t\treturn $this->load_view_unique($uri_view ,$tabData, true, $includes);\r\n\t\t}\r\n\t}", "function listar_producto_imagen2($localidad){\n\t\t$sql=\"SELECT * FROM producto, imagen WHERE categoria_pro='9' AND galeria_image=id_pro AND tabla_image='Producto' AND disponible_pro='1' AND \n\t\t\t(nombre_pro LIKE '%' '\".$localidad.\"' '%' OR \n\t descripcion_pro LIKE '%' '\".$localidad.\"' '%') \n\t\t\tGROUP BY id_pro ORDER BY RAND() ASC\";\n\t\t\n\t\t//echo $sql;\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\tsetlocale(LC_ALL, 'es_ES');\n\t\t\t//$resultado['nombre_pro']=ucwords(strtolower($resultado['nombre_pro']));\n\t\t\t$resultado['detal_pro']=$this->convertir_moneda($resultado['detal_pro']);\n\t\t\t$resultado['mayor_pro']=$this->convertir_moneda($resultado['mayor_pro']);\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat'\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t\n\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\n\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\tif($i<=12)\n\t\t\t\t\t$resultado['limite_pro'][]=$i;\n\t\t\t}\n\t\t\t$this->descripcion=$resultado['descripcion_pro'];\n\t\t\t$resultado['descripcion_pro']=strip_tags($resultado['descripcion_pro']);\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "public function contato()\n {\n return $this->belongsTo(ClienteContato::class);\n }", "public function cliente()\n\t{\n\t\treturn $this->belongsTo(Cliente::class);\n\t}", "public function dataProveedoresInicial ($id_prod, $id_prov) {\n\n //Busqueda de todos los paises donde quiere recibir el productor para filtrar los metodos de envio\n $paises_prod = DB::select(DB::raw(\"SELECT id_pais FROM rdj_productores_paises\n WHERE id_productor=? ORDER BY id_pais\"),[$id_prod]);\n\n $prov = []; //Variable donde se almacenan los datos a responder de la solicitud HTTP\n\n //Busqueda de información basica del proveedor\n $query = DB::select(\n DB::raw(\"SELECT pr.id AS idp, pr.nombre AS prov, pa.nombre AS pais FROM \n rdj_paises pa, rdj_proveedores pr WHERE pa.id=pr.id_pais AND pr.id=?\"),\n [$id_prov]);\n\n //Almacenamiento de la info basica en aux\n $prov[\"idp\"] = $query[0]->idp;\n $prov[\"prov\"] = $query[0]->prov;\n $prov[\"pais\"] = $query[0]->pais;\n \n //Busqueda de los metodos de pago del proveedor\n $query = DB::select(\n DB::raw(\"SELECT CASE WHEN pa.tipo='c' THEN 'Cuota única' WHEN pa.tipo='p'\n THEN 'Por cuotas' END AS tipo, pa.num_cuotas AS numc, pa.porcentaje AS porc,\n pa.meses AS meses, pa.id FROM rdj_metodos_pagos pa WHERE pa.id_proveedor=?\"),\n [$prov[\"idp\"]]);\n \n //Almacenamiento de arreglo de metodos de pagos del proveedor\n $prov[\"pagos\"] = $query;\n\n //Para los metodos de envio, creamos un arreglo ya que pueden ser varios\n $prov[\"envios\"] = [];\n foreach($paises_prod as $pais) { //Para cada pais del productor buscamos si hay metodo de envio\n\n $query = DB::select(\n DB::raw(\"SELECT e.duracion, e.precio, e.id AS id_envio, p.id AS id_pais, p.nombre AS pais,\n CASE WHEN e.tipo='t' THEN 'Terrestre' WHEN e.tipo='a' THEN 'Aéreo'\n WHEN e.tipo='m' THEN 'Marítimo' END AS tipo FROM rdj_paises p,\n rdj_metodos_envios e WHERE e.id_pais=? AND e.id_proveedor=?\n AND e.id_pais=p.id ORDER BY e.id_pais\"),[$pais->id_pais, $prov[\"idp\"]]);\n\n //Agregamos al arreglo si conseguimos un metodo de envio para el pais\n //como pueden haber varios metodos de envio con el mismo pais necesitamos\n //hacer otro foreach\n if($query != []) {\n foreach($query as $met) {\n $metodo = [];\n $metodo[\"detalles\"] = [];\n $metodo[\"id_envio\"] = $met->id_envio;\n $metodo[\"id_pais\"] = $met->id_pais;\n $metodo[\"duracion\"] = $met->duracion;\n $metodo[\"precio\"] = $met->precio;\n $metodo[\"pais\"] = $met->pais;\n $metodo[\"tipo\"] = $met->tipo;\n array_push($prov[\"envios\"],$metodo);\n }\n }\n }\n\n //Para los detalles o modificadores de los metodos de envios conseguidos\n for($i = 0; $i <= sizeof($prov[\"envios\"]) - 1; $i++) {\n //Busqueda de los detalles de un metodo de envio\n $query = DB::select(\n DB::raw(\"SELECT d.id, d.nombre AS det, d.mod_precio AS precio, d.mod_duracion AS duracion\n FROM rdj_detalles_metodos_envios d WHERE d.id_envio=? AND d.id_proveedor=?\n AND d.id_pais=?\"),[$prov[\"envios\"][$i][\"id_envio\"], $id_prov, $prov[\"envios\"][$i][\"id_pais\"]]\n );\n //Agregamos al arreglo si conseguimos un detalle de envio para el metodo\n //como pueden haber varios detalles de envio con el mismo metodo necesitamos\n //hacer otro foreach\n if($query != []) {\n foreach($query as $det) {\n $detalle = [];\n $detalle[\"id\"] = $det->id;\n $detalle[\"det\"] = $det->det;\n $detalle[\"precio\"] = $det->precio;\n $detalle[\"duracion\"] = $det->duracion;\n array_push($prov[\"envios\"][$i][\"detalles\"],$detalle);\n }\n } \n }\n\n /* Buscamos todas las esencias del proveedor y las guardamos */\n $prov[\"esencias\"] = $query = DB::select(\n DB::raw(\"SELECT e.cas_ing_esencia AS cas, e.nombre AS ing, CASE WHEN\n e.naturaleza='n' THEN 'natural' WHEN e.naturaleza='s' THEN 'sintetica' END\n AS tipo FROM rdj_ingredientes_esencias e WHERE e.id_proveedor=? \n ORDER BY e.cas_ing_esencia\"), \n [$id_prov]);\n \n /* Buscamos todos los otros ingredientes del proveedor y los guardamos */\n $prov[\"otros\"] = $query = DB::select(\n DB::raw(\"SELECT o.cas_otro_ing AS cas, o.nombre AS ing\n FROM rdj_otros_ingredientes o WHERE o.id_proveedor=? \n ORDER BY o.cas_otro_ing\"), \n [$id_prov]);\n\n /* Proceso que elimina ingredientes contratados exclusivamente de la lista de ingredientes disponibles */\n $ingsExclusivos = DB::select(DB::raw(\"SELECT dc.cas_ing_esencia AS cas_esen, dc.cas_otro_ing AS cas_otro \n FROM rdj_contratos c, rdj_detalles_contratos dc WHERE c.fecha_apertura=dc.fecha_apertura \n AND c.id_proveedor=dc.id_proveedor AND c.id_proveedor=? AND c.exclusivo=true AND c.cancelacion=false\"),[$id_prov]);\n\n $esenFiltradas = [];\n $otrosFiltrados = [];\n\n foreach($prov[\"esencias\"] as $esen) {\n $cond = false;\n foreach($ingsExclusivos as $ing) {\n if($ing->cas_esen != null && $esen->cas == $ing->cas_esen) \n $cond = true;\n }\n if($cond == false) array_push($esenFiltradas, $esen);\n }\n\n foreach($prov[\"otros\"] as $otro) {\n $cond = false;\n foreach($ingsExclusivos as $ing) {\n if($ing->cas_otro != null && $otro->cas == $ing->cas_otro) \n $cond = true;\n }\n if($cond == false) array_push($otrosFiltrados, $otro);\n }\n\n $prov[\"esencias\"] = $esenFiltradas;\n $prov[\"otros\"] = $otrosFiltrados;\n \n /* Buscamos las presentaciones de cada esencia y las guardamos */\n foreach($prov[\"esencias\"] as $esen) {\n $query = DB::select(\n DB::raw(\"SELECT p.id, p.volumen AS vol, p.precio\n FROM rdj_presents_ings_esencias p WHERE p.cas_ing_esencia=?\n ORDER BY p.id\"),\n [$esen->cas]);\n $esen->cas = Controller::stringifyCas($esen->cas);\n $esen->pres = $query;\n }\n \n /* Buscamos las presentaciones de cada otro ing y las guardamos */\n foreach($prov[\"otros\"] as $otro) {\n $query = DB::select(\n DB::raw(\"SELECT p.id, p.volumen AS vol, p.precio\n FROM rdj_present_otros_ings p WHERE p.cas_otro_ing=?\n ORDER BY p.id\"),\n [$otro->cas]);\n $otro->cas = Controller::stringifyCas($otro->cas);\n $otro->pres = $query;\n }\n\n \n //Devolvemos a la interfaz la data necesaria para continuar\n return response([$prov],200);\n }", "function setColeccion() {\n $this->query = \"SELECT * FROM PROFESOR\";\n $this->datos = BDConexionSistema::getInstancia()->query($this->query);\n\n for ($x = 0; $x < $this->datos->num_rows; $x++) {\n $this->addElemento($this->datos->fetch_object(\"Profesor\"));\n }\n }", "public function articulo()\n {\n return $this->hasMany('App\\articulo','id','id_articulo');\n }", "function buscar_recomendado2($localidad){\n\t\t$sql=\"SELECT * FROM producto, imagen WHERE galeria_image=id_pro AND tabla_image='producto' AND disponible_pro='1' AND categoria_pro!='10' AND \n\t\t\t(nombre_pro LIKE '%' '\".$localidad.\"' '%' OR \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\tdescripcion_pro LIKE '%' '\".$localidad.\"' '%') GROUP BY id_pro ORDER BY RAND() LIMIT 0,5\";\n\t\t//echo $sql;\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=\"si\";\n\t\t\t\t//calculando el URL\n\t\t\t\tsetlocale(LC_ALL, 'es_ES');\n\t\t\t\t//$resultado['nombre_pro']=ucwords(strtolower($resultado['nombre_pro']));\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat' GROUP BY id_cat\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\t\n\t\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\t\n\t\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\t\tif($i<=12) $resultado['limite_pro'][]=$i; else break;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$resultado['detal_pro']=$this->mostrar_precio($resultado['detal_pro']);\n\t\t\t\t$this->listado[] = $resultado;\n\t\t }\n\t}", "public function showOneOrder(Cliente $cliente, Pedido $pedido)\n {\n $domicilio = Domicilio::where('cliente_id', $cliente->id)->first();\n\n //Array de las cervezas correspondientes del pedido\n $cervezas = array(\n \"modelo\" => NULL,\n \"cantidad\" => NULL\n );\n\n //Se agrega en el arreglo el modelo de cerveza pedido, con su cantidad\n\n foreach($pedido->cervezas()->withTrashed()->get() as $cerveza)\n {\n $cervezas[\"modelo\"][] = Cerveza::withTrashed()->where('id', $cerveza->id)->first();\n $cervezas[\"cantidad\"][] = $cerveza->pivot->cantidad;\n }\n\n $size = count($cervezas['modelo']);\n\n return view('layouts_cliente.clientePedidoIndividual', compact('pedido', 'domicilio', 'cervezas', 'size'));\n }" ]
[ "0.6769", "0.59649086", "0.58116716", "0.5800471", "0.577389", "0.57515746", "0.5745015", "0.5744867", "0.5737675", "0.5699315", "0.56696576", "0.56408423", "0.56384176", "0.56308216", "0.56282836", "0.5620897", "0.5619113", "0.56161904", "0.5601222", "0.5597932", "0.55951416", "0.5594328", "0.55880624", "0.5585173", "0.5584716", "0.5584335", "0.5583176", "0.5582831", "0.5581837", "0.55779845", "0.55745435", "0.5574154", "0.5571907", "0.5560817", "0.55429465", "0.55417514", "0.5536169", "0.55306107", "0.55197954", "0.55152756", "0.55039006", "0.5503847", "0.5500794", "0.54910576", "0.5487775", "0.5483576", "0.5482822", "0.5461088", "0.54557395", "0.54547226", "0.5450991", "0.5443004", "0.5430086", "0.5426688", "0.54191434", "0.5419081", "0.5418533", "0.54141873", "0.54112905", "0.54097503", "0.5406737", "0.54060763", "0.5404984", "0.540053", "0.5400347", "0.5398208", "0.53912", "0.5379537", "0.53794426", "0.537885", "0.53738314", "0.5373667", "0.5371918", "0.53718996", "0.53649247", "0.5362765", "0.5362765", "0.5362765", "0.5362765", "0.53530806", "0.53464216", "0.5346252", "0.5344505", "0.53439766", "0.53418183", "0.5337089", "0.53345144", "0.5333143", "0.5327776", "0.5324101", "0.5321292", "0.5320209", "0.53176445", "0.53167546", "0.53123534", "0.5309477", "0.5306384", "0.5305623", "0.53003323", "0.5298933", "0.52967125" ]
0.0
-1
al darle enviar al pedido a bourne , inica el proceso de recorrer el pedido del carrito y dividirlo en pedidos de 19 lineas asignar el consecutivo de cada pedido he insertarlo en las tablas de encabezado y detalle de pedido luego de dibidirlo se empieza a generar el archivo in_pedid ya con todos los datos de la linea de este archivo
function AgregaRevisame() { try{ $nombre_archivo = 'Revisame/25.mbg'; $contenido="0"; fopen($nombre_archivo, 'a+'); //Asegurarse primero de que el archivo existe y puede escribirse sobre el. if (is_writable("Revisame/25.mbg")) { if (!$gestor = fopen($nombre_archivo, 'a')) { echo "No se puede abrir el archivo ($nombre_archivo)"; exit; } if (fwrite($gestor, $contenido."\n") === FALSE) { echo "No se puede escribir al archivo ($nombre_archivo)"; exit; } fclose($gestor); } else { echo "No se puede escribir sobre el archivo $nombre_archivo"; } } catch(Exception $e){ echo "Error :" & $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function importarDocentes($archivo=$this->archivo){\n //cargamos el archivo\n $lineas = file($archivo); \n //inicializamos variable a 0, esto nos ayudará a indicarle que no lea la primera línea\n $i=0; \n //Recorremos el bucle para leer línea por línea\n foreach ($lineas as $linea_num => $linea)\n { \n //abrimos bucle\n /*si es diferente a 0 significa que no se encuentra en la primera línea \n (con los títulos de las columnas) y por lo tanto puede leerla*/\n if($i != 0) \n { \n //abrimos condición, solo entrará en la condición a partir de la segunda pasada del bucle.\n /* La funcion explode nos ayuda a delimitar los campos, por lo tanto irá \n leyendo hasta que encuentre un ; */\n $docente = explode(\";\",$linea);\n //Almacenamos los docente que vamos leyendo en una variable\n $dni=trim($docente[0]);\n $apellidos=trim($docente[1]);\n $nombre = trim($docente[2]);\n $facultad =trim($docente[3]);\n $telefono = trim($docente[4]);\n $correo = trim($docente[5]);\n $categoria = trim($docente[6]);\n $regimen = trim($docente[7]);\n $cargo= trim($docente[8]); \n //guardamos en base de docente la línea leida\n mysql_query(\"INSERT INTO docente(nombre,edad,profesion) \n VALUES('$dni,'$apellidos','$nombre','$facultad','$telefono','$correo','$categoria','$regimen','$cargo')\"); \n //cerramos condición\n } \n /*Cuando pase la primera pasada se incrementará nuestro valor y a la siguiente pasada ya \n entraremos en la condición, de esta manera conseguimos que no lea la primera línea.*/\n $i++;\n //cerramos bucle\n }\n}", "function cocinar_pedido() {\n\t\tglobal $bd;\n\t\tglobal $x_from;\n\t\tglobal $x_idpedido;\n\t\tglobal $x_idcliente;\n\t\t\n\t\t$x_array_pedido_header = $_POST['p_header'];\n \t$x_array_pedido_body = $_POST['p_body'];\n\t\t$x_array_subtotales=$_POST['p_subtotales'];\n\t\t\n\t\t$idc=$x_array_pedido_header['idclie'] == '' ? ($x_idcliente == '' ? 0 : $x_idcliente) : $x_array_pedido_header['idclie'];\n\t\t// $idc = cocinar_registro_cliente();\n\t\t// $x_array_pedido_footer = $_POST['p_footer'];\n\t\t// $x_array_tipo_pago = $_POST['p_tipo_pago'];\n\n\t\t //sacar de arraypedido || tipo de consumo || local || llevar ... solo llevar\n\t\t $count_arr=0;\n\t\t $count_items=0;\n\t\t $item_antes_solo_llevar=0;\n\t\t $solo_llevar=0;\n\t\t $tipo_consumo;\n\t\t $categoria;\n\t\t \n\t\t $sql_pedido_detalle='';\n\t\t $sql_sub_total='';\n\n\t\t $numpedido='';\n\t\t $correlativo_dia='';\n\t\t $viene_de_bodega=0;// para pedido_detalle\n\t\t $id_pedido;\n\n\t\t \t\t \n\t\t // cocina datos para pedidodetalle\n\t\t foreach ($x_array_pedido_body as $i_pedido) {\n\t\t\tif($i_pedido==null){continue;}\n\t\t\t// tipo de consumo\n\t\t\t//solo llevar\n\t\t\t$pos = strrpos(strtoupper($i_pedido['des']), \"LLEVAR\");\n\t\t\t\n\t\t\t\n\t\t\t//subitems // detalles\n\t\t\tforeach ($i_pedido as $subitem) {\n\t\t\t\tif(is_array($subitem)==false){continue;}\n\t\t\t\t$count_items++;\n\t\t\t\tif($pos!=false){$solo_llevar=1;$item_antes_solo_llevar=$count_items;}\n\t\t\t\t$tipo_consumo=$subitem['idtipo_consumo'];\n\t\t\t\t$categoria=$subitem['idcategoria'];\n\n\t\t\t\t$tabla_procede=$subitem['procede']; // tabla de donde se descuenta\n\n\t\t\t\t$viene_de_bodega=0;\n\t\t\t\tif($tabla_procede===0){$viene_de_bodega=$subitem['procede_index'];}\n\n\t\t\t\t//armar sql pedido_detalle con arrPedido\n\t\t\t\t$precio_total=$subitem['precio_print'];\n\t\t\t\tif($precio_total==\"\"){$precio_total=$subitem['precio_total'];}\n\n\t\t\t\t//concatena descripcion con indicaciones\n\t\t\t\t$indicaciones_p=\"\";\n\t\t\t\t$indicaciones_p=$subitem['indicaciones'];\n\t\t\t\tif($indicaciones_p!==\"\"){$indicaciones_p=\" (\".$indicaciones_p.\")\";$indicaciones_p=strtolower($indicaciones_p);}\n\t\t\t\t\n\t\t\t\t$sql_pedido_detalle=$sql_pedido_detalle.'(?,'.$tipo_consumo.','.$categoria.','.$subitem['iditem'].','.$subitem['iditem2'].',\"'.$subitem['idseccion'].'\",\"'.$subitem['cantidad'].'\",\"'.$subitem['cantidad'].'\",\"'.$subitem['precio'].'\",\"'.$precio_total.'\",\"'.$precio_total.'\",\"'.$subitem['des'].$indicaciones_p.'\",'.$viene_de_bodega.','.$tabla_procede.'),'; \n\n\t\t\t}\n\n\t\t\t$count_arr++;\n\t\t}\t\t\n\t\t\n\t\tif($count_items==0){return false;}//si esta vacio\n\n\t\tif($item_antes_solo_llevar>1){$solo_llevar=0;} // >1 NO solo es para llevar\n\n\t\t//armar sql pedido_subtotales con arrTotales\t\t\n\t\t// $importe_total=0; // la primera fila es subtotal o total si no hay adicionales\n\t\t// $importe_subtotal = $x_array_subtotales[0]['importe'];\n\t\t// for ($z=0; $z < count($x_array_subtotales); $z++) {\t\n\t\t// \t$importe_total = $x_array_subtotales[$z]['importe'];\t\t\n\t\t// \t$sql_sub_total=$sql_sub_total.'(?,\"'.$x_array_subtotales[$z]['descripcion'].'\",\"'.$x_array_subtotales[$z]['importe'].'\"),';\n\t\t// }\n\t\t\n\t\t// subtotales\t\t\n\t\t$sql_subtotales = '';\n\t\t$importe_total=0; // la primera fila es subtotal o total si no hay adicionales\n\t\t$importe_subtotal = $x_array_subtotales[0]['importe'];\n\t\tforeach ( $x_array_subtotales as $sub_total ) {\n\t\t\t$tachado = $sub_total['tachado'] === \"true\" ? 1 : 0; \n\t\t\t$importe_row = $tachado === 1 ? $sub_total['importe_tachado'] : $sub_total['importe'];\n\t\t\t$importe_total = $sub_total['importe'];\n\t\t\t$sql_subtotales = $sql_subtotales.\"(?,\".$_SESSION['ido'].\",\".$_SESSION['idsede'].\",'\".$sub_total['descripcion'].\"','\".$importe_row.\"',\".$tachado.\"),\";\n\t\t}\n\n //guarda primero pedido para obtener el idpedio\n\t\tif(!isset($_POST['estado_p'])){$estado_p=0;}else{$estado_p=$_POST['estado_p'];}//para el caso de venta rapida si ya pago no figura en control de pedidos\n\t\tif(!isset($_POST['idpedido'])){$id_pedido=0;}else{$id_pedido=$_POST['idpedido'];}//si se agrea en un pedido / para control de pedidos al agregar\t\t\n\n if($id_pedido==0){ // nuevo pedido\n\t\t\t//num pedido\n\t\t\t$sql=\"select count(idpedido) as d1 from pedido where idorg=\".$_SESSION['ido'].\" and idsede=\".$_SESSION['idsede'];\n\t\t\t$numpedido=$bd->xDevolverUnDato($sql);\n\t\t\t$numpedido++;\n\n\t\t\t//numcorrelativo segun fecha\n\t\t\t$sql=\"SELECT count(fecha) AS d1 FROM pedido WHERE (idorg=\".$_SESSION['ido'].\" and idsede=\".$_SESSION['idsede'].\") and STR_TO_DATE(fecha,'%d/%m/%Y')=curdate()\";\n\t\t\t$correlativo_dia=$bd->xDevolverUnDato($sql);\n\t\t\t$correlativo_dia++;\n\n\t\t\t// si es delivery y si trae datos adjuntos -- json-> direccion telefono forma pago\n\t\t\t$json_datos_delivery=array_key_exists('arrDatosDelivery', $x_array_pedido_header) ? $x_array_pedido_header['arrDatosDelivery'] : '';\n\t\t\t\n\n // guarda pedido\n $sql=\"insert into pedido (idorg, idsede, idcliente, fecha,hora,fecha_hora,nummesa,numpedido,correlativo_dia,referencia,total,total_r,solo_llevar,idtipo_consumo,idcategoria,reserva,idusuario,subtotales_tachados,estado,json_datos_delivery)\n\t\t\t\t\tvalues(\".$_SESSION['ido'].\",\".$_SESSION['idsede'].\",\".$idc.\",DATE_FORMAT(now(),'%d/%m/%Y'),DATE_FORMAT(now(),'%H:%i:%s'),now(),'\".$x_array_pedido_header['mesa'].\"','\".$numpedido.\"','\".$correlativo_dia.\"','\".$x_array_pedido_header['referencia'].\"','\".$importe_subtotal.\"','\".$importe_total.\"',\".$solo_llevar.\",\".$tipo_consumo.\",\".$x_array_pedido_header['idcategoria'].\",\".$x_array_pedido_header['reservar'].\",\".$_SESSION['idusuario'].\",'\". $x_array_pedido_header['subtotales_tachados'] .\"',\".$estado_p.\",'\".$json_datos_delivery.\"')\";\n $id_pedido=$bd->xConsulta_UltimoId($sql);\n \n\t\t}else{\n\t\t\t//actualiza monto\n\t\t\t$sql=\"update pedido set total=FORMAT(total+\".$xarr['ImporteTotal'].\",2), subtotales_tachados = '\".$x_array_pedido_header['subtotales_tachados'].\"' where idpedido=\".$id_pedido;\n\t\t\t$bd->xConsulta_NoReturn($sql);\n }\n\n //armar sql completos\n\t\t//remplazar ? por idpedido\n\t\t$sql_subtotales = str_replace(\"?\", $id_pedido, $sql_subtotales);\n\t\t$sql_pedido_detalle = str_replace(\"?\", $id_pedido, $sql_pedido_detalle);\n\n\t\t//saca el ultimo caracter ','\n\t\t$sql_subtotales=substr ($sql_subtotales, 0, -1);\n\t\t$sql_pedido_detalle=substr ($sql_pedido_detalle, 0, -1);\n\n\t\t//pedido_detalle\n\t\t$sql_pedido_detalle='insert into pedido_detalle (idpedido,idtipo_consumo,idcategoria,idcarta_lista,iditem,idseccion,cantidad,cantidad_r,punitario,ptotal,ptotal_r,descripcion,procede,procede_tabla) values '.$sql_pedido_detalle;\n\t\t//pedido_subtotales\n\t\t$sql_subtotales='insert into pedido_subtotales (idpedido,idorg,idsede,descripcion,importe, tachado) values '.$sql_subtotales;\n\t\t// echo $sql_pedido_detalle;\n\t\t//ejecutar\n //$sql_ejecuta=$sql_pedido_detalle.'; '.$sql_sub_total.';'; // guarda pedido detalle y pedido subtotal\n $bd->xConsulta_NoReturn($sql_pedido_detalle.';');\n\t\t$bd->xConsulta_NoReturn($sql_subtotales.';');\n\t\t\n\t\t// $x_array_pedido_header['id_pedido'] = $id_pedido; // si viene sin id pedido\n\t\t$x_idpedido = $id_pedido;\n\n\t\t// SI ES PAGO TOTAL\n\t\tif ( strrpos($x_from, \"b\") !== false ) { $x_from = str_replace('b','',$x_from); cocinar_pago_total(); }\n\n\t\t\n\t\t// $x_respuesta->idpedido = $id_pedido; \n\t\t// $x_respuesta->numpedido = $numpedido; \n\t\t// $x_respuesta->correlativo_dia = $correlativo_dia; \n\t\t\n\t\t$x_respuesta = json_encode(array('idpedido' => $id_pedido, 'numpedido' => $numpedido, 'correlativo_dia' => $correlativo_dia));\n\t\tprint $x_respuesta.'|';\n\t\t// $x_respuesta = ['idpedido' => $idpedido];\n\t\t// print $id_pedido.'|'.$numpedido.'|'.$correlativo_dia;\n\t\t\n\t}", "function generarRecibo15_txt() {\n $ids = $_REQUEST['ids'];\n $id_pdeclaracion = $_REQUEST['id_pdeclaracion'];\n $id_etapa_pago = $_REQUEST['id_etapa_pago'];\n//---------------------------------------------------\n// Variables secundarios para generar Reporte en txt\n $master_est = null; //2;\n $master_cc = null; //2;\n\n if ($_REQUEST['todo'] == \"todo\") { // UTIL PARA EL BOTON Recibo Total\n $cubo_est = \"todo\";\n $cubo_cc = \"todo\";\n }\n\n $id_est = $_REQUEST['id_establecimientos'];\n $id_cc = $_REQUEST['cboCentroCosto'];\n\n if ($id_est) {\n $master_est = $id_est;\n } else if($id_est=='0') {\n $cubo_est = \"todo\";\n }\n\n if ($id_cc) {\n $master_cc = $id_cc;\n } else if($id_cc == '0'){\n $cubo_cc = \"todo\";\n }\n //\n $dao = new PlameDeclaracionDao();\n $data_pd = $dao->buscar_ID($id_pdeclaracion);\n $fecha = $data_pd['periodo'];\n\n //---\n $dao_ep = new EtapaPagoDao();\n $data_ep = $dao_ep->buscar_ID($id_etapa_pago);\n ;\n\n $_name_15 = \"error\";\n if ($data_ep['tipo'] == 1):\n $_name_15 = \"1RA QUINCENA\";\n elseif ($data_ep['tipo'] == 2):\n $_name_15 = \"2DA QUINCENA\";\n endif;\n\n\n $nombre_mes = getNameMonth(getFechaPatron($fecha, \"m\"));\n $anio = getFechaPatron($fecha, \"Y\");\n\n\n $file_name = '01.txt';//NAME_COMERCIAL . '-' . $_name_15 . '.txt';\n $file_name2 = '02.txt';//NAME_COMERCIAL . '-BOLETA QUINCENA.txt';\n $fpx = fopen($file_name2, 'w');\n $fp = fopen($file_name, 'w');\n \n //..........................................................................\n $FORMATO_0 = chr(27).'@'.chr(27).'C!';\n $FORMATO = chr(18).chr(27).\"P\";\n $BREAK = chr(13) . chr(10);\n //$BREAK = chr(14) . chr(10);\n //chr(27). chr(100). chr(0)\n $LINEA = str_repeat('-', 80);\n//..............................................................................\n// Inicio Exel\n//.............................................................................. \n fwrite($fp,$FORMATO); \n \n\n\n // paso 01 Listar ESTABLECIMIENTOS del Emplearo 'Empresa'\n $dao_est = new EstablecimientoDao();\n $est = array();\n $est = $dao_est->listar_Ids_Establecimientos(ID_EMPLEADOR);\n $pagina = 1;\n\n // paso 02 listar CENTROS DE COSTO del establecimento. \n if (is_array($est) && count($est) > 0) {\n //DAO\n $dao_cc = new EmpresaCentroCostoDao();\n $dao_pago = new PagoDao();\n $dao_estd = new EstablecimientoDireccionDao();\n\n // -------- Variables globales --------// \n $TOTAL = 0;\n $SUM_TOTAL_CC = array();\n $SUM_TOTAL_EST = array();\n\n\n\n for ($i = 0; $i < count($est); $i++) { // ESTABLECIMIENTO\n //echo \" i = $i establecimiento ID=\".$est[$i]['id_establecimiento'];\n //echo \"<br>\";\n //$SUM_TOTAL_EST[$i]['establecimiento'] = strtoupper(\"Establecimiento X ==\" . $est[$i]['id_establecimiento']);\n $bandera_1 = false;\n if ($est[$i]['id_establecimiento'] == $master_est) {\n $bandera_1 = true;\n } else if ($cubo_est == \"todo\") {\n $bandera_1 = true;\n }\n\n if ($bandera_1) {\n \n // if($bander_ecc){\n \n $SUM_TOTAL_EST[$i]['monto'] = 0;\n //Establecimiento direccion Reniec\n $data_est_direc = $dao_estd->buscarEstablecimientoDireccionReniec($est[$i]['id_establecimiento']/* $id_establecimiento */);\n\n $SUM_TOTAL_EST[$i]['establecimiento'] = $data_est_direc['ubigeo_distrito'];\n\n $ecc = array();\n $ecc = $dao_cc->listar_Ids_EmpresaCentroCosto($est[$i]['id_establecimiento']);\n // paso 03 listamos los trabajadores por Centro de costo \n\n for ($j = 0; $j < count($ecc); $j++) {\n\n $bandera_2 = false;\n if ($ecc[$j]['id_empresa_centro_costo'] == $master_cc) {\n $bandera_2 = true;\n } else if ($cubo_est == 'todo' || $cubo_cc == \"todo\") { // $cubo_est\n $bandera_2 = true;\n }\n \n if ($bandera_2) {\n //$contador_break = $contador_break + 1;\n // LISTA DE TRABAJADORES\n $data_tra = array();\n $data_tra = $dao_pago->listar_2($id_etapa_pago, $est[$i]['id_establecimiento'], $ecc[$j]['id_empresa_centro_costo']);\n\n if (count($data_tra)>0) {\n \n $SUM_TOTAL_CC[$i][$j]['establecimiento'] = $data_est_direc['ubigeo_distrito'];\n $SUM_TOTAL_CC[$i][$j]['centro_costo'] = strtoupper($ecc[$j]['descripcion']);\n $SUM_TOTAL_CC[$i][$j]['monto'] = 0;\n\n //fwrite($fp, $LINEA); \n fwrite($fp, NAME_EMPRESA); \n //$worksheet->write(($row + 1), ($col + 1), NAME_EMPRESA);\n //$data_pd['periodo'] $data_pd['fecha_modificacion']\n $descripcion1 = date(\"d/m/Y\");\n \n fwrite($fp, str_pad(\"FECHA : \", 56, \" \", STR_PAD_LEFT));\n fwrite($fp, str_pad($descripcion1, 11, \" \", STR_PAD_LEFT));\n fwrite($fp, $BREAK);\n\n fwrite($fp, str_pad(\"PAGINA :\", 69, \" \", STR_PAD_LEFT)); \n fwrite($fp, str_pad($pagina, 11, \" \", STR_PAD_LEFT));\n fwrite($fp, $BREAK);\n\n fwrite($fp, str_pad($_name_15/*\"1RA QUINCENA\"*/, 80, \" \", STR_PAD_BOTH));\n fwrite($fp, $BREAK);\n\n fwrite($fp, str_pad(\"PLANILLA DEL MES DE \" . strtoupper($nombre_mes) . \" DEL \" . $anio, 80, \" \", STR_PAD_BOTH));\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n\n fwrite($fp, \"LOCALIDAD : \" . $data_est_direc['ubigeo_distrito']);\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n\n fwrite($fp, \"CENTRO DE COSTO : \" . strtoupper($ecc[$j]['descripcion']));\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n //$worksheet->write($row, $col, \"##################################################\");\n \n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(\"N \", 4, \" \", STR_PAD_LEFT));\n fwrite($fp, str_pad(\"DNI\", 12, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"APELLIDOS Y NOMBRES\", 40, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"IMPORTE\", 9, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"FIRMA\", 15, \" \", STR_PAD_RIGHT));\n fwrite($fp, $BREAK);\n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n \n $pag = 0;\n $num_trabajador = 0;\n for ($k = 0; $k < count($data_tra); $k++) {\n $num_trabajador = $num_trabajador +1; \n if($num_trabajador>24):\n fwrite($fp,chr(12));\n $num_trabajador=0;\n endif;\n \n $data = array();\n $data = $data_tra[$k]; \n //$DIRECCION = $SUM_TOTAL_EST[$i]['establecimiento'];\n // Inicio de Boleta \n \n generarRecibo15_txt2($fpx, $data, $nombre_mes, $anio,$pag);\n $pag = $pag +1;\n\n \n // Final de Boleta\n $texto_3 = $data_tra[$k]['apellido_paterno'] . \" \" . $data_tra[$k]['apellido_materno'] . \" \" . $data_tra[$k]['nombres']; \n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(($k + 1) . \" \", 4, \" \", STR_PAD_LEFT));\n fwrite($fp, str_pad($data_tra[$k]['num_documento'], 12, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(limpiar_caracteres_especiales_plame($texto_3), 40, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad($data_tra[$k]['sueldo'], 9, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(\"_______________\", 15, \" \", STR_PAD_RIGHT));\n fwrite($fp, $BREAK);\n \n // por persona\n $SUM_TOTAL_CC[$i][$j]['monto'] = $SUM_TOTAL_CC[$i][$j]['monto'] + $data_tra[$k]['sueldo'];\n }\n\n\n $SUM_TOTAL_EST[$i]['monto'] = $SUM_TOTAL_EST[$i]['monto'] + $SUM_TOTAL_CC[$i][$j]['monto'];\n \n //--- LINE\n fwrite($fp, $BREAK);\n //fwrite($fp, $LINEA);\n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(\"TOTAL \" . $SUM_TOTAL_CC[$i][$j]['centro_costo'] . \" \" . $SUM_TOTAL_EST[$i]['establecimiento'], 56, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM_TOTAL_CC[$i][$j]['monto'], 2));\n fwrite($fp, $BREAK);\n fwrite($fp, $LINEA);\n fwrite($fp, $BREAK);\n\n fwrite($fp,chr(12));\n $pagina = $pagina + 1;\n //fwrite($fp, $BREAK . $BREAK . $BREAK . $BREAK);\n $TOTAL = $TOTAL + $SUM_TOTAL_CC[$i][$j]['monto'];\n //$row_a = $row_a + 5;\n }//End Trabajadores\n }//End Bandera.\n }//END FOR CCosto\n\n\n // CALCULO POR ESTABLECIMIENTOS\n /* $SUM = 0.00;\n for ($z = 0; $z < count($SUM_TOTAL_CC[$i]); $z++) {\n\n fwrite($fp, str_pad($SUM_TOTAL_CC[$i][$z]['centro_costo'], 59, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM_TOTAL_CC[$i][$z]['monto'], 2));\n fwrite($fp, $BREAK);\n\n\n $SUM = $SUM + $SUM_TOTAL_CC[$i][$z]['monto'];\n }\n fwrite($fp, str_pad(\"T O T A L G E N E R A L --->>>\", 59, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM, 2));\n */\n\n //fwrite($fp, $BREAK . $BREAK);\n \n }\n }//END FOR Est\n\n /*\n fwrite($fp, str_repeat('*', 85));\n fwrite($fp, $BREAK);\n fwrite($fp, \"CALCULO FINAL ESTABLECIMIENTOS \");\n fwrite($fp, $BREAK);\n\n //$worksheet->write(($row+4), ($col + 1), \".::RESUMEN DE PAGOS::.\");\n $SUM = 0;\n for ($z = 0; $z < count($SUM_TOTAL_EST); $z++) {\n\n fwrite($fp, str_pad($SUM_TOTAL_EST[$z]['establecimiento'], 59, \" \", STR_PAD_RIGHT));\n fwrite($fp, number_format($SUM_TOTAL_EST[$z]['monto'], 2));\n fwrite($fp, $BREAK);\n $SUM = $SUM + $SUM_TOTAL_EST[$z]['monto'];\n }\n */\n \n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n fwrite($fp, str_pad(\"T O T A L G E N E R A L --->>>\", 56, \" \", STR_PAD_RIGHT));\n fwrite($fp, str_pad(number_format_var($TOTAL), 15, ' ',STR_PAD_RIGHT));\n fwrite($fp, $BREAK);\n fwrite($fp, $BREAK);\n \n \n }//END IF\n//..............................................................................\n// Inicio Exel\n//..............................................................................\n //|---------------------------------------------------------------------------\n //| Calculos Finales\n //|\n //|---------------------------------------------------------------------------\n //\n //fwrite($fp, $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK);\n //fwrite($fp, $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK . $BREAK);\n\n\n fclose($fp);\n fclose($fpx);\n // $workbook->close();\n // .........................................................................\n // SEGUNDO ARCHIVO\n //..........................................................................\n\n\n\n\n\n\n\n\n\n\n $file = array();\n $file[] = $file_name;\n $file[] = ($file_name2);\n ////generarRecibo15_txt2($id_pdeclaracion, $id_etapa_pago);\n\n\n $zipfile = new zipfile();\n $carpeta = \"file-\" . date(\"d-m-Y\") . \"/\";\n $zipfile->add_dir($carpeta);\n\n for ($i = 0; $i < count($file); $i++) {\n $zipfile->add_file(implode(\"\", file($file[$i])), $carpeta . $file[$i]);\n //$zipfile->add_file( file_get_contents($file[$i]),$carpeta.$file[$i]);\n }\n\n header(\"Content-type: application/octet-stream\");\n header(\"Content-disposition: attachment; filename=zipfile.zip\");\n\n echo $zipfile->file();\n}", "function guardaoe(){\n\t\t$m = intval($_POST['totalitem']);\n\t\t$t = 0;\n\t\t// calcula el total de\n\t\tfor ( $i=0; $i < $m; $i++ ){\n\t\t\t$t += $_POST['cana_'.$i];\n\t\t}\n\t\tif ( $t <= 0 ) {\n\t\t\techo \"No hay pedido\";\n\t\t\treturn;\n\t\t}\n\n\t\t// Crea encabezado\n\t\t$numero = $this->datasis->fprox_numero('nprdo');\n\t\t$data['numero'] = $numero;\n\t\t$data['fecha'] = date('Y-m-d');\n\t\t$data['almacen'] = $_POST['almacen'];\n\t\t$data['status'] = 'A';\n\t\t$data['usuario'] = $this->secu->usuario();\n\t\t$data['estampa'] = date('Ymd');\n\t\t$data['hora'] = date('H:i:s');\n\n\t\t$data['instrucciones'] = $_POST['instrucciones'];\n\n\t\t$this->db->insert('prdo',$data);\n\n\t\t// Crea Detalle\n\t\t$ids = '';\n\t\tfor ( $i=0; $i < $m; $i++ ){\n\t\t\t$cana = $_POST['cana_'.$i];\n\t\t\tif ( $cana > 0 ){\n\t\t\t\t// Guarda\n\t\t\t\t$id = intval($_POST['idpfac_'.$i]);\n\t\t\t\t$mSQL = \"\n\t\t\t\tINSERT INTO itprdo (numero, pedido, codigo, descrip, cana, ordenado, idpfac )\n\t\t\t\tSELECT '${numero}' numero, a.numa pedido, a.codigoa codigo, a.desca descrip, a.cana, ${cana} ordenado, ${id} idpfac\n\t\t\t\tFROM itpfac a JOIN pfac b ON a.numa = b.numero\n\t\t\t\tWHERE a.id= ${id}\";\n\t\t\t\t$this->db->query($mSQL);\n\t\t\t}\n\t\t}\n\n\t\t// Crea totales\n\t\t$mSQL = \"\n\t\tINSERT INTO itprdop ( numero, codigo, descrip, ordenado, producido)\n\t\tSELECT '${numero}' numero, codigo, descrip, sum(ordenado) ordenado, 0 producido\n\t\tFROM itprdo\n\t\tWHERE numero = '${numero}'\n\t\tGROUP BY codigo\";\n\t\t$this->db->query($mSQL);\n\n\t}", "Function send_file($session_id,$dokument_id,$file) {\n if (!$dokument_id) return VratChybu($session_id,'send_file','Není zadán dokument_id');\n $stav=$GLOBALS[\"KONEKTOR\"][$software_id][\"STAV\"]+2; //stav+1 = pozaduje se k vyrizeni v ext. programu\n $q=new DB_POSTA;\n if ($dokument_id) $sql=\"SELECT * FROM posta WHERE id = '\".$dokument_id.\"'\";\n// $sql.=\" AND stav in (\".$stav.\")\";\n $q->query($sql);\n $pocet=$q->Num_Rows();\n if ($pocet<1) return VratChybu($session_id,'send_file','Nenalezen odpovídající dokument_id');\n $q->Next_Record();\n// if ($q->Record[\"STAV\"]<>$stav) return VratChybu($session_id,'send_files','Nemáte přístup k tomuto souboru (stav není 2)');\n\n $counter=0;\n $counter2=0;\n $uplobj=Upload(array('create_only_objects'=>true,'agenda'=>'POSTA','noshowheader'=>true));\n //if (is_array($files[soubor][0])) $soubory=$files[soubor];\n //else \n if ($file['item']['FILE_NAME']) $soubory['item'][0]=$file['item']; else $soubory['item'][0]=$file;\n //$soubory=$files[soubor];\n while (list($key,$val)=each($soubory['item']))\n {\n if (!$val[\"FILE_NAME\"]) return VratChybu($session_id,'send_file','Není zadán název souboru');\n $upload_records = $uplobj['table']->GetRecordsUploadForAgenda($q->Record[\"ID\"]);\n $tmp_soubor = $GLOBALS[CONFIG_POSTA][HLAVNI][tmp_adresar].$val[\"FILE_NAME\"]; \n $GLOBALS['DESCRIPTION'] = TxtEncodingFromSoap($val[FILE_DESC]);\n $GLOBALS['LAST_USER_ID'] = $GLOBALS[\"KONEKTOR\"][$software_id][\"LAST_USER_ID\"];\n\n while (list($key1,$val1)=each($upload_records))\n {\n if ($val[FILE_ID]==$val1[ID]) \n {\n $val[FILE_NAME]=$val1[NAME];\n $GLOBALS[\"ID\"]=$val1[ID];\n $GLOBALS[\"FILE_ID\"]=$val1[ID];\n $GLOBALS[\"UPL_FILE\"]=$val[FILE_NAME];\n $GLOBALS[\"LAST_DATE\"]=Date('Y-m-d');\n $GLOBALS[\"UPL_DIR\"]='.';\n $GLOBALS['archiv_file_system']=true;\n $tmp_soubor='/tmp/upload/'.$val[FILE_NAME];\n $GLOBALS['COSTIM']='archiv_a'; //archivuj puvodni\n $GLOBALS['show_typ']=2;\n $GLOBALS['EDIT_ID']=$val[FILE_ID];\n\n }\n }\n\n //$tmp_soubor=TxtEcondingFromSoap(FileSystemConvertFNToFS($tmp_soubor));\n if (is_file($tmp_soubor)) unlink($tmp_soubor);\n $data=base64_decode($val[\"FILE_DATA\"]);\n if (strlen($data)<1) return VratChybu($session_id,'send_file','Není k dispozici obsah souboru '.$val[\"FILE_NAME\"]);\n if (!$fp=fopen($tmp_soubor,'w')) return VratChybu($session_id,'send_file','Chyba pri ulozeni tmp souboru '.$tmp_soubor);\n fwrite($fp,$data);\n fclose($fp);\n \n if (JePodepsanyDokument($data, 0)) {\n $GLOBALS['DESCRIPTION'] = 'el. podepsano';\n }\n \n $tmp_soubor_2=TxtEncodingFromSoap($tmp_soubor);\n //$tmp_soubor_2=$tmp_soubor;\n //echo $tmp_soubor_2;\n $ret = $uplobj['table']->SaveFileToAgendaRecord($tmp_soubor_2, $dokument_id);\n if ($ret[err_msg]>0) return VratChybu($session_id,'send_file','Chyba pri ulozeni souboru '.$val[\"FILE_NAME\"].': '.$ret[err_msg]);\n //print_r($ret);\n $file_ident=$ret[file_id];\n $text='(SEND_FILE) - k dokumentu ('.$dokument_id.') byl vložen soubor '.$val[\"FILE_NAME\"].' - ID: ('.$file_ident.')';\n WriteLog($software_id,$text,$session_id);\n $file[$counter2][FILE_ID]=$file_ident;\n $file[$counter2][FILE_NAME]=$val[\"FILE_NAME\"];\n $file[$counter2][FILE_DESC]=TxtEncoding4Soap($GLOBALS['DESCRIPTION']);\n $file[$counter2][FILE_SIZE]=' ';\n $file[$counter2][BIND_TYPE]=' ';\n $file[$counter2][FILE_DATA]=' ';\n if (is_file($tmp_soubor)) unlink($tmp_soubor);\n\n $counter2++;\n \n }\n// print_r($file);\n $text='Operace proběhla v pořádku';\n $value = array('RESULT'=>'OK','DESCRIPTION'=>TxtEncoding4Soap($text));\n $vysledek = array(\n 'return'=>new soapval('Result', 'tns:Result', $value),\n 'soubory'=>new soapval('soubor', 'tns:soubory',$file),\n );\n return VratVysledek($vysledek);\n}", "public function guardarDatos(){\n $contadorPadre = 0;\n $contadorHijo = 0;\n $contadorNieto = 0;\n $contadorHijoVector = 0;\n $contadorPadreVector = 0;\n $contadorNietoVector = 0;\n $contadorProducto = 1;\n $encontradoNieto = FALSE;\n // Imagenes\n $vectorImagenesPadre = $this->getImagenesIndexCategorias();\n $this->queryMarcasPrincipales(1);$this->queryMarcasPrincipales(2);$this->queryMarcasPrincipales(3);\n // csv\n $output = fopen('categories_import.csv', 'w');\n $vectorCategorias = array();\n $vectorCategoriasLabel = $this->getVectorLabelCategorias();\n array_push($vectorCategorias,$vectorCategoriasLabel);\n foreach ($this->categoriaPrincipal as $padre){\n $vectorCsv = $this->guardarPadre($contadorPadre,$vectorImagenesPadre[$contadorPadre],$this->padreContent[$contadorPadre]);\n $imagenesHijos = $this->listadoHijosNietosImagenes($this->padreContent[$contadorPadre]);\n // csv\n array_push($vectorCategorias,$vectorCsv);\n if (isset($padre[\"hijos\"])) {\n foreach($padre[\"hijos\"] as $hijo){\n $vectorCsv = $this->guardarHijo($contadorPadre,$contadorHijo,$imagenesHijos[$contadorHijo],$this->hijoContent[$contadorHijoVector]);\n $imagenesNietos = $this->listadoHijosNietosImagenes($this->hijoContent[$contadorHijoVector]);\n // csv\n array_push($vectorCategorias,$vectorCsv);\n if (isset($hijo[\"nietos\"])) {\n foreach($hijo[\"nietos\"] as $nieto){\n $vectorCsv = $this->guardarNieto($contadorPadre,$contadorHijo,$contadorNieto,$this->nietoContent[$contadorNietoVector],$imagenesNietos[$contadorNieto]);\n $this->guardarProductoNieto($contadorPadre,$contadorHijo,$contadorNieto,$this->nietoContent[$contadorNietoVector],$contadorProducto);\n $contadorProducto += $this->categoriaPrincipal[$contadorPadre][\"hijos\"][$contadorHijo][\"nietos\"][$contadorNieto][\"numeroProductos\"];\n // csv\n array_push($vectorCategorias,$vectorCsv);\n $contadorNieto++;\n $contadorNietoVector++;\n }\n $contadorNieto = 0;\n }else{\n $this->guardarProductoHijo($contadorPadre,$contadorHijo,false,$this->hijoContent[$contadorHijoVector],$contadorProducto);\n $contadorProducto += $this->categoriaPrincipal[$contadorPadre][\"hijos\"][$contadorHijo][\"numeroProductos\"];\n }\n $contadorHijo++;\n $contadorHijoVector++;\n }\n $contadorHijo = 0;\n }\n $contadorPadre++;\n }\n foreach ($vectorCategorias as $campo) {\n fputcsv($output, $campo,';');\n }\n fclose($output);\n $this->writeCsvMarcas();\n }", "function insertardatos($c){\n $temp=\"\";\n //RUTA DEL FICHERO QUE CONTIENE LA CREACION DE TABLAS\n $ruta_fichero_sql = 'mysql_script/datos.sql';\n \n \n //CON EL COMANDO FILE,VOLCAMOS EL CONTENIDO DEL FICHERO EN OTRA VARIABLE\n $datos_fichero_sql = file($ruta_fichero_sql);\n //LEEMOS EL FICHERO CON UN BUCLE FOREACH\n foreach($datos_fichero_sql as $linea_a_ejecutar){\n //QUITAMOS LOS ESPACIOS DE ALANTE Y DETRÁS DE LA VARIABLE\n $linea_a_ejecutar = trim($linea_a_ejecutar); \n \n //GUARDAMOS EN LA VARIABLE TEMP EL BLOQUE DE SENTENCIAS QUE VAMOS A EJECUTAR EN MYSQL\n $temp .= $linea_a_ejecutar.\" \";\n //COMPROBAMOS CON UN CONDICIONAL QUE LA LINEA ACABA EN ;, Y SI ES ASI LA EJECUTAMOS\n if(substr($linea_a_ejecutar, -1, 1) == ';'){\n mysqli_query($c,$temp);\n \n //REINICIAMOS LA VARIABLE TEMPORAL\n $temp=\"\";\n \n }//FIN IF BUSCAR SENTENCIA ACABADA EN ;\n else{\n //echo\"MAL\".$temp.\"<br><br>\";\n }\n \n }//FIN FOREACH\n \n \n }", "public function processarArquivo() {\n\n /**\n * Cria uma instancia de DBLayoutReader referente ao arquivo a ser processado e o layout cadastrado\n */\n $this->oLayoutReader = new DBLayoutReader($this->iCodigoArquivo, $this->sNomeArquivo, true, false);\n\n $_SESSION[\"DB_usaAccount\"] = \"1\";\n\n /**\n * Remove da base todos os registros referentes a situação a ser processada. No caso, situacao 2 - BPC\n */\n $this->removerSituacao();\n $rsArquivo = fopen($this->sNomeArquivo, 'r');\n $iLinha = 0;\n\n /**\n * Percorre o arquivo para tratamento das linhas\n */\n while (!feof($rsArquivo)) {\n\n $iLinha++;\n $sLinha = fgets($rsArquivo);\n $oLinha = $this->oLayoutReader->processarLinha($sLinha, 0, true, false, false);\n\n if (!$oLinha) {\n continue;\n }\n\n /**\n * Salva a primeira linha do arquivo por se o cabeçalho do mesmo, adicionando no arquivo de não processados\n * Ou se o nome da pessoa ou data de nascimento estiverem vazias\n */\n if ($iLinha == 1 || empty($oLinha->nome_pessoa) || empty($oLinha->data_nascimento)) {\n\n $this->escreveArquivoRegistrosNaoProcessados($sLinha);\n continue;\n }\n\n $oDataNascimento = new DBDate($oLinha->data_nascimento);\n $dtNascimento = $oDataNascimento->convertTo(DBDate::DATA_EN);\n\n /**\n * Chama o método validar, responsavel por verificar se existe algum registro com os dados passados\n * Passamos o nome da pessoa da linha atual do arquivo, e a data de nascimento, já tratada, no formato do banco\n */\n $iCadastroUnico = $this->validar($oLinha->nome_pessoa, $dtNascimento);\n\n /**\n * Caso tenha sido retornado o sequencial do cidadao na validacao, chama o metodo insereSituacao para inserir o\n * registro para o cidadao com tipo de situacao 2\n */\n if ($iCadastroUnico != null) {\n $this->insereSituacao($iCadastroUnico);\n } else {\n\n $this->escreveArquivoRegistrosNaoProcessados($sLinha);\n $this->lTemNaoProcessado = true;\n }\n\n unset($oLinha);\n unset($oDataNascimento);\n }\n\n fclose($this->fArquivoLog);\n }", "function escribir_pedido($cliente) {\r\n\t$conn = mysql_connect(BD_HOST, BD_USERNAME, BD_PASSWORD);\r\n\tmysql_select_db(BD_DATABASE1);\r\n\t//busco la serie para pedidos de clientes\r\n\t$ssql = 'SELECT SPCCFG FROM F_CFG';\r\n\t$rs1 = mysql_query($ssql, $conn);\r\n\t$datos1 = mysql_fetch_array($rs1);\r\n\t//busco los pedidos por serie, cliente y estado \r\n\t$ssql = 'SELECT * FROM F_PCL WHERE CLIPCL=' . $cliente . ' AND TIPPCL=\\'' . $datos1['SPCCFG'] . '\\' AND ESTPCL=\\'0\\'';\r\n\tmysql_select_db(BD_DATABASE1);\r\n\t$rs = mysql_query($ssql, $conn);\r\n\techo (mysql_error());\r\n\tif (mysql_num_rows($rs) != 0) {\r\n\t\t$datos = mysql_fetch_array($rs);\r\n\t\t//cojo el detalle del pedido por orden de lineas\r\n\t\t$ssql = 'SELECT * FROM F_LPC WHERE CODLPC=' . $datos['CODPCL'] . ' AND TIPLPC=\\'' . $datos['TIPPCL'] . '\\' ORDER BY POSLPC ASC'; \r\n\t\t$rs1 = mysql_query($ssql, $conn);\r\n\t\tif (mysql_num_rows($rs1) != 0) {\r\n\t\t\t$total = 0;\r\n\t\t\t$colorcelda = COLOROSCUROCELDA;\r\n\t\t\twhile ($linea = mysql_fetch_array($rs1)) {\r\n\t\t\t\tif($colorcelda == COLORCLAROCELDA) {\r\n\t\t\t\t\t$colorcelda = COLOROSCUROCELDA;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$colorcelda = COLORCLAROCELDA;\r\n\t\t\t\t}\r\n\t\t\t\t//compruebo que el producto no tenga 0 en cantidad y si es así lo borro\r\n\t\t\t\techo('<tr bordercolor=\"#cccccc\" bgcolor=\"#ffffff\">');\r\n\t\t\t\techo('<td bgcolor=\"' . $colorcelda . '\">' . $linea['ARTLPC'] . '</td>');\r\n\t\t\t\techo('<td bgcolor=\"' . $colorcelda . '\">' . $linea['DESLPC'] . '</td>');\r\n\t\t\t\techo('<td align=\"right\" bgcolor=\"' . $colorcelda . '\">');\r\n\t\t\t\tprintf(\"%.2f\", $linea['PRELPC']);\r\n\t\t\t\techo('</td>');\r\n\t\t\t\techo('<td align=\"right\" nowrap bgcolor=\"' . $colorcelda . '\"><img src=\"plantillas/' . PLANTILLA . '/imagenes/menos.gif\" border=\"0\" style=\"cursor:pointer\" onclick=\"sumaresta2(\\'num' . $linea['POSLPC'] . '\\',\\'-\\');actualizar.submit();\" >&nbsp;<input value=\"');\r\n\t\t\t\techo(decimal($linea['CANLPC']));\r\n\t\t\t\techo('\" name=\"num' . $linea['POSLPC'] . '\" id=\"num' . $linea['POSLPC'] . '\" size=\"10\" maxlength=\"10\" type=\"text\" onfocus=\"this.blur()\" style=\"text-align:right;\">&nbsp;<img src=\"plantillas/' . PLANTILLA . '/imagenes/mas.gif\" border=\"0\" onclick=\"sumaresta2(\\'num' . $linea['POSLPC'] . '\\',\\'+\\');actualizar.submit();\" style=\"cursor:pointer\"></td>');\r\n\t\t\t\techo('<td align=\"right\" bgcolor=\"' . $colorcelda . '\">');\r\n\t\t\t\tprintf(\"%.2f\", $linea['DT1LPC']);\r\n\t\t\t\techo('%</td>');\r\n\t\t\t\techo('<td align=\"right\" bgcolor=\"' . $colorcelda . '\">');\r\n\t\t\t\t$total = number_format($total + ($linea['TOTLPC']), 2, '.', '');\r\n\t\t\t\tprintf(\"%.2f\", ($linea['TOTLPC']));\r\n\t\t\t\techo('</td>');\r\n\t\t\t\tif ($linea['IINLPC'] != 0) {\r\n\t\t\t\t\techo('<td align=\"center\" bgcolor=\"' . $colorcelda . '\">SI</td>');\r\n\t\t\t\t}else{\r\n\t\t\t\t\techo('<td align=\"center\" bgcolor=\"' . $colorcelda . '\">NO</td>');\r\n\t\t\t\t}\r\n\t\t\t\techo('<td align=\"center\" bgcolor=\"' . $colorcelda . '\"><img src=\"plantillas/' . PLANTILLA . '/imagenes/nor.gif\" border=\"0\" align=\"middle\" style=\"cursor:pointer\" onclick=\"borrarart(' . $linea['POSLPC'] . ')\" alt=\"Borrar art&iacute;culo\">&nbsp;</td>');\r\n\t\t\t\techo('</tr>');\r\n\t\t\t}\r\n\t\t\techo('<tr bordercolor=\"#999999\" align=\"right\" bgcolor=\"#cccccc\">');\r\n\t\t\techo('<td colspan=\"6\"><font color=\"#000000\" face=\"Verdana\" size=\"2\"><b>Total:</b></font></td>');\r\n\t\t\techo('<td colspan=\"2\"><font color=\"#000000\" face=\"Verdana\" size=\"2\"><b>');\r\n\t\t\tprintf(\"%.2f\", $total);\r\n\t\t\techo('</b></font></td>');\r\n\t\t\techo('</tr>');\r\n\t\t}else{\r\n\t\t\techo('<tr bordercolor=\"#cccccc\" align=\"center\" bgcolor=\"#ffffff\">');\r\n\t\t\techo('<td colspan=\"7\" align=\"center\">NO SE HAN ENCONTRADO ARTICULOS</td>');\r\n\t\t\techo('</tr>');\r\n\t\t\techo('<tr bordercolor=\"#999999\" align=\"center\" bgcolor=\"#cccccc\">');\r\n\t\t\techo('<td colspan=\"2\"><font color=\"#000000\" face=\"Verdana\" size=\"2\"><b>Total:</b></font></td>');\r\n\t\t\techo('<td></td><td>&nbsp;</td><td>&nbsp;</td>');\r\n\t\t\techo('<td><font color=\"#cccccc\">.</font></td>');\r\n\t\t\techo('<td><font color=\"#cccccc\">.</font></td>');\r\n\t\t\techo('<td><font color=\"#cccccc\">.</font></td>');\r\n\t\t\techo('</tr>');\r\n\t\t} \r\n\t}else{\r\n\t\techo('<tr bordercolor=\"#cccccc\" align=\"center\" bgcolor=\"#ffffff\">');\r\n\t\techo('<td height=\"30\" colspan=\"8\">NO SE HAN ENCONTRADO ARTICULOS EN EL PEDIDO</td></tr>');\r\n\t\techo('<tr bordercolor=\"#999999\" align=\"center\" bgcolor=\"#cccccc\">');\r\n\t\techo('<td colspan=\"8\"><font color=\"#000000\" face=\"Verdana\" size=\"2\"><b>&nbsp;</b></font></td>');\r\n\t\techo('</tr>');\r\n\t}\r\n}", "public function EntregarPedidos()\n\t{\n\t\tself::SetNames();\n\t\t\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" cocinero = ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $cocinero);\n\t\t$stmt->bindParam(2, $codventa);\n\t\t\n\t\t$cocinero = strip_tags(\"0\");\n\t\t$codventa = strip_tags(base64_decode($_GET[\"codventa\"]));\n\t\t$sala = strip_tags(base64_decode($_GET[\"nombresala\"]));\n\t\t$mesa = strip_tags(base64_decode($_GET[\"nombremesa\"]));\n\t\t$stmt->execute();\n\t\t\n echo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-check-square-o'></span> EL PEDIDO DE LA \".$sala.\" Y \".$mesa.\" FUE ENTREGADO EXITOSAMENTE </center>\";\n\t\techo \"</div>\"; \n\t\texit;\n\t\n }", "public function GenerarPedidoWeb($arregloPedido,$arregloPasajeros,$codigoTransaccion,$idPoliza,$cantidadPasajeros)\r\n\t{\r\n\t\ttry\r\n\t\t{\t$fechaRegistro=date(\"m/d/Y h:m:s\" );\r\n\t\t\t//CREAMOS EL PEDIDO\r\n\t\t\t//var_dump($arregloPedido);\r\n\t\t\t$recordSett = &$this->conexion->conectarse()->Execute(\" INSERT INTO PedidoWeb\r\n\t\t(Id, CodigoTransaccion, IdPoliza, FechaCreacion, FechaRespuesta, NombreTitularFactura, DocumentoTitularFactura, DireccionTitularFactura, \r\n\t\tTelefonoTitularFactura,EmailTitularFactura, TelefonoContacto, TelefonoMovilContacto, DireccionContacto, NombreContactoEmergencia, ApellidoContactoEmergencia, \r\n\t\tTelefonoContactoEmergencia, EmailContactoEmergencia,FechaInicio,FechaFin,Precio ,Region,TrmIata, Estado)\r\n\t\tVALUES ( '\".$arregloPedido[0].\"','\".$codigoTransaccion.\"','\".$idPoliza.\"','\".$fechaRegistro.\"','\".$fechaRegistro.\"','\".$arregloPedido[7].\"','\".$arregloPedido[8].\"','\".$arregloPedido[9].\"','\".$arregloPedido[10].\"','\".$arregloPedido[11].\"','\".$arregloPedido[5].\"','\".$arregloPedido[4].\"','\".$arregloPedido[6].\"','\".$arregloPedido[1].\"','\".$arregloPedido[2].\"','\".$arregloPedido[3].\"','\".$arregloPedido[12].\"','\".$arregloPedido[13].\"','\".$arregloPedido[14].\"','\".$arregloPedido[15].\"','\".$arregloPedido[16].\"','\".$this->fun->getTrmIata($idPoliza).\"',3) \");\t\r\n\t\t\t//CREAMOS LOS PASAJEROS DEL PEDIDO.\r\n\t\t\t//var_dump($arregloPasajeros);\r\n\t\t\t//echo \"Cantidad Inicial \".$cantidadPasajeros.\"<br>\";\r\n\t\t\t$guardaPasajeros=0;\r\n\t\t\t$i=0;\r\n\t\t\t\twhile($cantidadPasajeros!= $guardaPasajeros){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t$Nombre=$arregloPasajeros[$i++];\r\n\t\t\t\t$Apellido=$arregloPasajeros[$i++];\r\n\t\t\t\t$Documento=$arregloPasajeros[$i++];\r\n\t\t\t\t$Email=$arregloPasajeros[$i++];\r\n\t\t\t\t$FechaNacimiento=$arregloPasajeros[$i++];\t\t\t\t\r\n\t\t\t\t\t$Idpasajero=$this->fun->NewGuid();\r\n\t\t\t\t\t$recordSett = &$this->conexion->conectarse()->Execute(\"INSERT INTO PasajerosPedido\r\n\t\t\t\t\t\t (Id, IdPedido, Nombre, Apellido, Documento, Email, FechaNacimiento)\r\n\t\t\t\t\t\t VALUES('\".$Idpasajero.\"','\".$arregloPedido[0].\"','\".$Nombre.\"','\".$Apellido.\"','\".$Documento.\"','\".$Email.\"','\".$FechaNacimiento.\"')\");\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$guardaPasajeros++;\t\r\n\t\t\t\t\t//echo $guardaPasajeros .\"<br>\";\r\n\t\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\techo 'Caught exception: ', $e->getMessage(), \"\\n\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function importar_operaciones_requerimientos(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $com_id = $this->security->xss_clean($post['com_id']); /// com id\n $componente = $this->model_componente->get_componente_pi($com_id);\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']);\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']);\n $list_oregional=$this->model_objetivoregion->list_proyecto_oregional($fase[0]['proy_id']); /// Lista de Objetivos Regionales\n $tp = $this->security->xss_clean($post['tp']); /// tipo de migracion\n\n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n /*------------------- Migrando ---------------*/\n $lineas = file($archivotmp);\n $i=0;\n $nro=0;\n $guardado=0;\n $no_guardado=0;\n $nro_prod=count($this->model_producto->list_prod($com_id));\n if($nro_prod!=0){\n $ope_ult=$this->model_producto->ult_operacion($com_id);\n $nro_prod=$ope_ult[0]['prod_cod']+1;\n }\n else{\n $nro_prod=1;;\n }\n\n if($tp==1){ /// Actividades\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){\n $datos = explode(\";\",$linea);\n if(count($datos)==21){\n\n $cod_or = trim($datos[0]); // Codigo Objetivo Regional\n $cod_ope = $nro_prod; // Codigo Operacion\n $descripcion = utf8_encode(trim($datos[2])); //// descripcion Operacion\n $resultado = utf8_encode(trim($datos[3])); //// descripcion Resultado\n $unidad = utf8_encode(trim($datos[4])); //// Unidad\n $indicador = utf8_encode(trim($datos[5])); //// descripcion Indicador\n $lbase = utf8_encode(trim($datos[6])); //// Linea Base\n if(trim($datos[6])==''){\n $lbase = 0; //// Linea Base\n }\n\n $meta = utf8_encode(trim($datos[7])); //// Meta\n if(trim($datos[7])==''){\n $meta = 0; //// Meta\n }\n\n $var=8;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=(float)$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n }\n\n $mverificacion = utf8_encode(trim($datos[20])); //// Medio de verificacion\n\n $ae=0;\n $or_id=0;\n if(count($list_oregional)!=0){\n $get_acc=$this->model_objetivoregion->get_alineacion_proyecto_oregional($fase[0]['proy_id'],$cod_or);\n if(count($get_acc)!=0){\n $ae=$get_acc[0]['ae'];\n $or_id=$get_acc[0]['or_id'];\n }\n }\n\n /*--- INSERTAR DATOS OPERACIONES (ACTIVIDADES 2020) ---*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array(\n 'com_id' => $com_id,\n 'prod_producto' => strtoupper($descripcion),\n 'prod_resultado' => strtoupper($resultado),\n 'indi_id' => 1,\n 'prod_indicador' => strtoupper($indicador),\n 'prod_fuente_verificacion' => strtoupper($mverificacion), \n 'prod_linea_base' => $lbase,\n 'prod_meta' => $meta,\n 'prod_unidades' => $unidad,\n 'acc_id' => $ae,\n 'prod_ppto' => 1,\n 'fecha' => date(\"d/m/Y H:i:s\"),\n 'prod_cod'=>$cod_ope,\n 'or_id'=>$or_id,\n 'fun_id' => $this->fun_id,\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('_productos', $data_to_store);\n $prod_id=$this->db->insert_id(); \n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0){\n $this->model_producto->add_prod_gest($prod_id,$this->gestion,$p,$m[$p]);\n }\n }\n\n $producto=$this->model_producto->get_producto_id($prod_id);\n if(count($producto)!=0){\n $guardado++;\n }\n else{\n $no_guardado++;\n }\n\n $nro_prod++;\n }\n }\n $i++;\n }\n \n }\n else{ /// Requerimientos\n\n foreach ($lineas as $linea_num => $linea){\n if($i != 0){\n $datos = explode(\";\",$linea);\n //echo count($datos).'<br>';\n if(count($datos)==20){\n \n $prod_cod = (int)$datos[0]; //// Codigo Actividad\n $cod_partida = (int)$datos[1]; //// Codigo partida\n $par_id = $this->minsumos->get_partida_codigo($cod_partida); //// DATOS DE LA FASE ACTIVA\n\n $detalle = utf8_encode(trim($datos[2])); //// descripcion\n $unidad = utf8_encode(trim($datos[3])); //// Unidad\n $cantidad = (int)$datos[4]; //// Cantidad\n $unitario = $datos[5]; //// Costo Unitario\n \n $p_total=($cantidad*$unitario);\n $total = $datos[6]; //// Costo Total\n\n $var=7; $sum_temp=0;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n $sum_temp=$sum_temp+$m[$i];\n }\n\n $observacion = utf8_encode(trim($datos[19])); //// Observacion\n $verif_cod=$this->model_producto->verif_componente_operacion($com_id,$prod_cod);\n \n //echo count($verif_cod).'--'.count($par_id).'--'.$cod_partida.'--'.round($sum_temp,2).'=='.round($total,2);\n\n if(count($verif_cod)!=0 & count($par_id)!=0 & $cod_partida!=0 & round($sum_temp,2)==round($total,2)){ /// Verificando si existe Codigo de Actividad, par id, Codigo producto\n // if($verif_cod[0]['prod_ppto']==1){ /// guardando si tiene programado presupuesto en la operacion\n $guardado++;\n /*-------- INSERTAR DATOS REQUERIMIENTO ---------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'ins_codigo' => $this->session->userdata(\"name\").'/REQ/'.$this->gestion, /// Codigo Insumo\n 'ins_fecha_requerimiento' => date('d/m/Y'), /// Fecha de Requerimiento\n 'ins_detalle' => strtoupper($detalle), /// Insumo Detalle\n 'ins_cant_requerida' => round($cantidad,0), /// Cantidad Requerida\n 'ins_costo_unitario' => $unitario, /// Costo Unitario\n 'ins_costo_total' => $total, /// Costo Total\n 'ins_unidad_medida' => $unidad, /// Unidad de Medida\n 'ins_gestion' => $this->gestion, /// Insumo gestion\n 'par_id' => $par_id[0]['par_id'], /// Partidas\n 'ins_tipo' => 1, /// Ins Tipo\n 'ins_observacion' => strtoupper($observacion), /// Observacion\n 'fun_id' => $this->fun_id, /// Funcionario\n 'aper_id' => $proyecto[0]['aper_id'], /// aper id\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('insumos', $data_to_store); ///// Guardar en Tabla Insumos \n $ins_id=$this->db->insert_id();\n\n /*--------------------------------------------------------*/\n $data_to_store2 = array( ///// Tabla InsumoProducto\n 'prod_id' => $verif_cod[0]['prod_id'], /// prod id\n 'ins_id' => $ins_id, /// ins_id\n );\n $this->db->insert('_insumoproducto', $data_to_store2);\n /*----------------------------------------------------------*/\n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0 & is_numeric($unitario)){\n $data_to_store4 = array(\n 'ins_id' => $ins_id, /// Id Insumo\n 'mes_id' => $p, /// Mes \n 'ipm_fis' => $m[$p], /// Valor mes\n );\n $this->db->insert('temporalidad_prog_insumo', $data_to_store4);\n }\n }\n // }\n\n }\n \n\n } /// end dimension (22)\n } /// i!=0\n\n $i++;\n\n }\n\n /// --- ACTUALIZANDO MONEDA PARA CARGAR PRESUPUESTO\n $this->update_ptto_operaciones($com_id);\n } /// end else\n\n $this->session->set_flashdata('success','SE REGISTRARON '.$guardado.' REQUERIMIENTOS');\n redirect('admin/prog/list_prod/'.$com_id.'');\n }\n else{\n $this->session->set_flashdata('danger','SELECCIONE ARCHIVO ');\n redirect('admin/prog/list_prod/'.$com_id.'');\n }\n }\n else{\n echo \"Error !!\";\n }\n }", "public function subir_archivo($archivotmp){ \n $i=0;\n $nro=0;\n $lineas = file($archivotmp);\n \n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){ \n $datos = explode(\";\",$linea);\n if(count($datos)==7){\n $da=$datos[0]; /// Da\n $ue=$datos[1]; /// Ue\n $prog=$datos[2]; /// Aper Programa\n $proy=trim($datos[3]);\n if(strlen($proy)==2){\n $proy='00'.$proy; /// Aper Proyecto\n }\n $act=trim($datos[4]); /// Aper Actividad\n if(strlen($act)==2){\n $act='0'.$act;\n }\n\n //$act='0'.trim($datos[4]); /// Aper Actividad\n $cod_part=trim($datos[5]); /// Partida\n if(strlen($cod_part)==3){\n $cod_part=$cod_part.'00';\n }\n\n $importe=(float)$datos[6]; /// Monto\n if(strlen($prog)==2 & strlen($proy)==4 & strlen($act)==3 & $importe!=0 & is_numeric($cod_part)){\n $aper=$this->model_ptto_sigep->get_apertura($prog,$proy,$act);\n //$aper=$this->model_ptto_sigep->get_apertura($prog,$proy,$act);\n if(count($aper)!=0){\n $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }\n\n //$ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n /*------------------- Update Datos ----------------------*/\n $query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->session->userdata(\"fun_id\")\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep', $update_ptto);\n /*-------------------------------------------------------*/\n }\n else{\n /*-------------------- Guardando Datos ------------------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => $aper[0]['aper_id'],\n 'da' => $da,\n 'ue' => $ue,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->session->userdata(\"fun_id\"),\n );\n $this->db->insert('ptto_partidas_sigep', $data_to_store);\n $sp_id=$this->db->insert_id();\n /*-------------------------------------------------------*/ \n }\n $nro++;\n }\n else{\n $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }\n /*-------------------- Guardando Datos ------------------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => 0,\n 'da' => $da,\n 'ue' => $ue,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->session->userdata(\"fun_id\"),\n );\n $this->db->insert('ptto_partidas_sigep', $data_to_store);\n $sp_id=$this->db->insert_id();\n /*-------------------------------------------------------*/ \n }\n }\n elseif(strlen($prog)==2 & strlen($proy)==4 & strlen($act)==3 & $importe==0){\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n //echo \"UPDATES 0->VALOR : \".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*------------------- Update Datos ----------------------*/\n $query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->session->userdata(\"fun_id\")\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep', $update_ptto);\n /*-------------------------------------------------------*/\n }\n }\n }\n }\n\n $i++;\n }\n return $nro;\n }", "function importar_requerimientos_operaciones(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $proy_id = $post['proy_id']; /// proy id\n $pfec_id = $post['pfec_id']; /// pfec id\n $com_id = $post['com_id']; /// com id\n \n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); /// DATOS DEL PROYECTO\n $fase = $this->model_faseetapa->get_id_fase($proy_id); //// DATOS DE LA FASE ACTIVA\n\n $monto_asig=$this->model_ptto_sigep->suma_ptto_accion($proyecto[0]['aper_id'],1);\n $monto_prog=$this->model_ptto_sigep->suma_ptto_accion($proyecto[0]['aper_id'],2);\n $saldo=round(($monto_asig[0]['monto']-$monto_prog[0]['monto']),2);\n\n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n\n $lineas = file($archivotmp);\n if($this->suma_monto_total($lineas)<=$saldo){\n /*------------------- Migrando ---------------*/\n $lineas = file($archivotmp);\n $i=0;\n $nro=0;\n //Recorremos el bucle para leer línea por línea\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){\n $datos = explode(\";\",$linea);\n \n if(count($datos)==21){\n $cod_ope = (int)$datos[0]; //// Codigo Operacion\n $cod_partida = (int)$datos[1]; //// Codigo partida\n $verif_com_ope=$this->model_producto->verif_componente_operacion($com_id,$cod_ope);\n $par_id = $this->minsumos->get_partida_codigo($cod_partida); //// DATOS DE LA FASE ACTIVA\n\n $detalle = utf8_encode(trim($datos[3])); //// descripcion\n $unidad = utf8_encode(trim($datos[4])); //// Unidad\n $cantidad = (int)$datos[5]; //// Cantidad\n $unitario = (float)$datos[6]; //// Costo Unitario\n $total = (float)$datos[7]; //// Costo Total\n if(!is_numeric($unitario)){\n if($cantidad!=0){\n $unitario=round(($total/$cantidad),2); \n }\n }\n\n $var=8;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=(float)$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n }\n\n $observacion = utf8_encode(trim($datos[20])); //// Observacion\n\n if(count($verif_com_ope)==1 & count($par_id)!=0 & $cod_partida!=0){\n $nro++;\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'ins_codigo' => $this->session->userdata(\"name\").'/REQ/'.$this->gestion, /// Codigo Insumo\n 'ins_fecha_requerimiento' => date('d/m/Y'), /// Fecha de Requerimiento\n 'ins_detalle' => strtoupper($detalle), /// Insumo Detalle\n 'ins_cant_requerida' => round($cantidad,0), /// Cantidad Requerida\n 'ins_costo_unitario' => $unitario, /// Costo Unitario\n 'ins_costo_total' => $total, /// Costo Total\n 'ins_tipo' => 1, /// Ins Tipo\n 'ins_unidad_medida' => strtoupper($unidad), /// Insumo Unidad de Medida\n 'par_id' => $par_id[0]['par_id'], /// Partidas\n 'ins_observacion' => strtoupper($observacion), /// Observacion\n 'fecha_creacion' => date(\"d/m/Y H:i:s\"),\n 'fun_id' => $this->session->userdata(\"fun_id\"), /// Funcionario\n 'aper_id' => $proyecto[0]['aper_id'], /// aper id\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('insumos', $data_to_store); ///// Guardar en Tabla Insumos \n $ins_id=$this->db->insert_id();\n\n /*----------------------------------------------------------*/\n $data_to_store2 = array( ///// Tabla InsumoProducto\n 'prod_id' => $verif_com_ope[0]['prod_id'], /// act_id\n 'ins_id' => $ins_id, /// ins_id\n );\n $this->db->insert('_insumoproducto', $data_to_store2);\n /*----------------------------------------------------------*/\n $gestion_fase=$fase[0]['pfec_fecha_inicio'];\n\n /*---------------- Recorriendo Gestiones de la Fase -----------------------*/\n for ($g=$fase[0]['pfec_fecha_inicio']; $g <=$fase[0]['pfec_fecha_fin'] ; $g++){\n $data_to_store = array( \n 'ins_id' => $ins_id, /// Id Insumo\n 'g_id' => $g, /// Gestion\n 'insg_monto_prog' => $total, /// Monto programado\n );\n $this->db->insert('insumo_gestion', $data_to_store); ///// Guardar en Tabla Insumo Gestion\n $insg_id=$this->db->insert_id();\n\n $ptto_fase_gestion = $this->model_faseetapa->fase_gestion($fase[0]['id'],$g); //// DATOS DE LA FASE GESTION\n $fuentes=$this->model_faseetapa->fase_presupuesto_id($ptto_fase_gestion[0]['ptofecg_id']);\n\n if(count($fuentes)==1){\n /*------------------- Guardando Fuente Financiamiento ------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store3 = array( \n 'insg_id' => $insg_id, /// Id Insumo gestion\n 'ifin_monto' => $total, /// Monto programado\n 'ifin_gestion' => $g, /// Gestion\n 'ffofet_id' => $fuentes[0]['ffofet_id'], /// ffotet id\n 'ff_id' => $fuentes[0]['ff_id'], /// ff id\n 'of_id' => $fuentes[0]['of_id'], /// ff id\n 'nro_if' => 1, /// Nro if\n );\n $this->db->insert('insumo_financiamiento', $data_to_store3); ///// Guardar en Tabla Insumo Financiamiento\n $ifin_id=$this->db->insert_id();\n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0 & is_numeric($unitario)){\n $data_to_store4 = array( \n 'ifin_id' => $ifin_id, /// Id Insumo Financiamiento\n 'mes_id' => $p, /// Mes \n 'ipm_fis' => $m[$p], /// Valor mes\n );\n $this->db->insert('ifin_prog_mes', $data_to_store4); ///// Guardar en Tabla Insumo Financiamiento Programado Mes\n }\n }\n /*-----------------------------------------------------------*/ \n }\n }\n\n }\n\n }\n\n }\n $i++;\n }\n\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'');\n /*--------------------------------------------*/\n }\n else{\n $this->session->set_flashdata('danger','COSTO PROGRAMADO A SUBIR ES MAYOR AL SALDO POR PROGRAMAR. VERIFIQUE PLANTILLA A MIGRAR');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n }\n } \n elseif (empty($file_basename)) {\n $this->session->set_flashdata('danger','POR FAVOR SELECCIONE ARCHIVO CSV');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n } \n elseif ($filesize > 100000000) {\n $this->session->set_flashdata('danger','TAMAÑO DEL ARCHIVO');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n } \n else {\n $mensaje = \"SOLO SE PERMITEN ESTOS ARCHIVOS : \" . implode(', ', $allowed_file_types);\n $this->session->set_flashdata('danger',$mensaje);\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n }\n\n } else {\n show_404();\n }\n }", "public function insertaPedido($pedido) {\n $codPedido = $pedido->getId();\n $mesa = $pedido->getMesa();\n $estado = $pedido->getEstado();\n $fecha = $pedido->getFecha();\n $elementos = $pedido->getElementos();\n\n /* Imprimir Datos */\n// echo \"- Pedido: \".$codPedido.\"<br>\";\n// echo \"- Mesa: \".$mesa.\"<br>\";\n// echo \"- Estado: \".$estado.\"<br>\";\n// echo \"- Fecha: \".$fecha.\"<br>\";\n// echo \"- Numero de elementos: \".count($elementos).\"<br><br>\";\n\n /* Insercion de los datos del pedido */\n $sql1 = \"INSERT INTO pedido VALUES($codPedido,$mesa,$estado,$fecha)\";\n $result1 = $this->bd->query($sql1);\n\n /* Para cada pedido, inserto los datos de sus elementos */\n for($i=0 ; $i<count($elementos); $i++) {\n /* Informacion del elemento del pedido */\n $codElem = $elementos[$i]->getId();\n $comentario = $elementos[$i]->getComentario();\n $estadoElem = $elementos[$i]->getEstado();\n $elemCarta = $elementos[$i]->getElemento();\n $codElemCarta = $elemCarta->getId();\n\n /* Imprimir Datos */\n// echo \"--- Elemento Pedido: \".$codElem.\"<br>\";\n// echo \"--- Comentario: \".$comentario.\"<br>\";\n// echo \"--- Estado: \".$estadoElem.\"<br>\";\n// echo \"--- Elemento Carta: \".$codElemCarta.\"<br><br>\";\n\n /* Insercion de los datos del elemento del pedido */\n $sql2 = \"INSERT INTO elementoPedido VALUES($codElem,$estadoElem,\\\"$comentario\\\")\";\n $result2 = $this->bd->query($sql2);\n $sql3 = \"INSERT INTO tieneElemento VALUES($codElem,$codPedido)\";\n $result3 = $this->bd->query($sql3);\n \n /* Insercion de los datos del elemento de la carta*/\n if(get_class($elemCarta) == \"ElementoPlato\") {\n $sql4 = \"INSERT INTO elementoColaCocina VALUES($codElem)\";\n $result4 = $this->bd->query($sql4);\n $sql5 = \"INSERT INTO asociaPlato VALUES($codElem,$codElemCarta)\";\n $result5 = $this->bd->query($sql5);\n }\n else if(get_class($elemCarta) == \"ElementoBebida\") {\n $sql4 = \"INSERT INTO elementoColaBar VALUES($codElem)\";\n $result4 = $this->bd->query($sql4);\n $sql5 = \"INSERT INTO asociaBebida VALUES($codElem,$codElemCarta)\";\n $result5 = $this->bd->query($sql5);\n }\n }\n }", "function DatosArchivosAdjPeritje($idPeritaje, $bloquearPeritaje){\n\ttry{\n\t\tglobal $conn; \n\t\t$contarAdjuntos = 0;\n\t\t\n\t\t$sql =\" SELECT PA_DESCRIPCION DESCRIPCION, \n\t\t\t\t\t\tTRIM(PA_PATHARCHIVO) PATHARCHIVO, \n\t\t\t\t\t\tPA_ID ID,\t\t\n\t\t\t\t\t\tPA_FECHAALTA FECHAALTA,\t\t\t\t\t\t\n\t\t\t\t\t\tLOWER(REPLACE (REPLACE (UPPER ( TRIM(PA_PATHARCHIVO)), UPPER ('\".STORAGE_DATA_RAIZ.\"\\LEGALES'), UPPER ('STORAGE_LEGALES')),'\\','/')) PATHARCHIVOFORMAT\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t FROM legales.lpa_periciaarchivoasociado\n\t\t\t\t WHERE pa_idpericias = :idPeritaje\n\t\t\t\t\t AND pa_fechabaja IS NULL \n\t\t\t\t\t ORDER BY PA_FECHAALTA ASC \";\n\t\t\t\t\t\t\t \n\t\t$params = array(\":idPeritaje\" => $idPeritaje );\n\t\t$stmt = DBExecSql($conn, $sql, $params);\n\t\t\t\t\t\t\n\t\t$resultado = \"<tr><td class='title_NegroFndAzul' >Archivos Adjuntos:</td></tr>\";\t\t\t\n\t\t$extensionesShowInBrowser = array(\"JPG\", \"JPEG\", \"PNG\", \"GIF\", \"BMP\", \"PDF\");\n\t\t$extensiones = $extensionesShowInBrowser;\n\t\t\n\t\twhile ($row = DBGetQuery($stmt)) {\t\t\t\t\t\n/*\n\t\t\t$patharchivo = TRIM($row[\"PATHARCHIVOFORMAT\"]);\t\t\n\t\t\t$patharchivo = str_replace('storage_legales','Storage_Legales',$patharchivo);\n\t\t\t$patharchivo = str_replace('pericias','PERICIAS',$patharchivo);\n*/\t\t\t\n\t\t\t$patharchivo = TRIM($row[\"PATHARCHIVO\"]);\t\t\n\t\t\t/*------------------------------------------------*/\n\t\t\t$pathArchivosLocal = TRIM($row[\"PATHARCHIVO\"]);\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$IDARCHIVO = TRIM($row[\"ID\"]);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$fExt = ExtToFile($pathArchivosLocal);\n\t\t\t$fExt = strtoupper($fExt);\n\t\t\t/*------------------------------------------------*/\n\t\t\t\n\t\t\t$resultado .= \"<tr>\n\t\t\t\t\t\t\t<td colspan='1' class='item_Blanco' style='padding-left:35px' >\n\t\t\t\t\t\t\t\t<b><font class='TextoTablaEJ' >\";\n\t\t\t\n\t\t\t$fileTitle = \"Fecha: \".$row[\"FECHAALTA\"];\n\t\t\t\n\t\t\t$fileEncode = \"/modules/usuarios_registrados/estudios_juridicos/Redirect.php?archivodescarga=\".base64_encode($IDARCHIVO).\"&pericia=d\";\n\t\t\t$resultado .= \"<a class='enlaces' href='\".trim($fileEncode).\"' title='\".$fileTitle.\"' > \".$row[\"DESCRIPCION\"].\" </a>\";\t\t\t\t \t\t\t\n\t\t\t\n\t/** PERITAJE **/\t\t\n/*\t\n\tif(in_array($fExt, $extensiones)){ \n\t\t$textreemp = ReemplazaDataStorage($pathArchivosLocal);\n\t\t$linkref = getFile($textreemp);\t\t\n\t\t//$resultado .= \"<p> \".$pathArchivosLocal; \n\t\t//$resultado .= \"<p> \".$textreemp; \n\t\t\n\t\t$resultado .= \"<a href='\".$linkref.\"' target='_blank' title='\".$fileTitle.\" + ' style='padding-right:5px' >\".$row[\"DESCRIPCION\"].\"</a> \";\n\t}\n\telse{\t\t\t\t\n\t\t//$resultado .= \"<p> \".$IDARCHIVO; \n\t\t$fileEncode = \"/modules/usuarios_registrados/estudios_juridicos/Redirect.php?archivodescarga=\".base64_encode($IDARCHIVO).\"&evento=d\";\n\t\t$resultado .= \"<a class='enlaces' href='\".trim($fileEncode).\"' title='\".$fileTitle.\"' > \".$row[\"DESCRIPCION\"].\" </a>\";\t\t\t\n\t}\n*/\t\n\t\t\t/*\n\t\t\tif(in_array($fExt, $extensiones)){ \n\t\t\t\t$resultado .= \"<a href='\".trim($patharchivo).\"' target='_blank' title='\".$fileTitle.\"' style='padding-right:5px'>\".Trim($row[\"DESCRIPCION\"]).\"</a> \";\n\t\t\t}else{\t\t\t\t\n\t\t\t\t$fileEncode = \"/modules/usuarios_registrados/estudios_juridicos/Redirect.php?archivodescarga=\".base64_encode($IDARCHIVO).\"&pericia=d\";\n\t\t\t\t$resultado .= \"<a class='enlaces' href='\".trim($fileEncode).\"' title='\".$fileTitle.\"' > \".$row[\"DESCRIPCION\"].\" </a>\";\t\t\t\t \t\t\t\n\t\t\t}\n\t\t\t*/\n\t\t\tif(!$bloquearPeritaje){\n\t\t\t\t$resultado .= \"\t<input class='btnElimTransp' id='btneliminar1' name='btneliminar' type='button' value='' \n\t\t\t\t\t\t\t\t\tonclick='ElimianarAdjuntosPericia(\".$idPeritaje.\",\".$row[\"ID\"].\")' >\t\";\n\t\t\t}\n\t\t\t\n\t\t\t$resultado .= \" </font></b>\t\n\t\t\t\t\t\t\t</td></tr> \";\t\n\t\t\t\t\t\t\t\n\t\t\t$contarAdjuntos++;\n\t\t}\n\t\tif($contarAdjuntos > 0){\t\t\t\t\t\t\n\t\t\t$resultado .= \"<tr><td colspan='1' class='item_Blanco'><b><font class='TextoTablaEJ' ></font></b></td></tr>\";\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\t$resultado .= \"\t<tr><td colspan='1' class='item_Blanco' style='padding-left:35px'><b><font class='TextoTablaEJ' >No existen archivos adjuntos </font></b></td></tr>\n\t\t\t\t\t\t<tr><td colspan='1' class='item_Blanco'><b><font class='TextoTablaEJ' ></font></b></td></tr>\";\t\t\t\n\t\t}\n\t\t\n\t\treturn $resultado;\t\t\t\n\t\t\n\t}catch (Exception $e) {\n DBRollback($conn); \n\t\tErrorConeccionDatos($e->getMessage());\n\t\treturn false;\n } \t\t\t\t\t\t\n}", "public function importacionLinea($tipo) {\n //echo \"llego2\";\n $codLin = '02';\n $tipConsult = $tipo;\n $dtActFecha = date(\"Y-m\", strtotime(date()));//'2019-02';//\n //$dtAntFecha = date(\"Y-m\", strtotime(date()));//restarle 1 mes//'2019-01';//\n\t$dtAntFecha = date(\"Y-m\", strtotime('-1 month', strtotime(date())));//Se resta 1 mes.\n //Generar Manualmente\n //$dtActFecha ='2019-04';\n //$dtAntFecha ='2019-03';\n \n \n try {\n $obj_con = new cls_Base();\n $obj_var = new cls_Global();\n $con = $obj_con->conexionServidor();\n //$rawDataANT = array();\n $rawDataACT = array();\n \n $sql = \"SELECT A.COD_LIN, A.COD_TIP, A.COD_MAR, D.NOM_LIN, E.NOM_TIP, F.NOM_MAR,\"\n . \"SUM(A.P_PROME*B.EXI_TOT) AS COS_ACT, \";\n $sql .= \"IFNULL((SELECT X.COSTO_T FROM \" . $obj_con->BdServidor . \".IG0007 X \"\n . \" WHERE X.COD_LIN=A.COD_LIN AND X.COD_MAR=A.COD_MAR AND TIP_CON='$tipConsult' \"\n . \" AND ANO_MES='$dtAntFecha'),0) COS_ANT \"; \n $sql .= \" FROM \" . $obj_con->BdServidor . \".IG0020 A \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0022 B ON A.COD_ART=B.COD_ART \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0001 D ON A.COD_LIN=D.COD_LIN \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0002 E ON A.COD_TIP=E.COD_TIP \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0003 F ON A.COD_MAR=F.COD_MAR \";\n $sql .= \" WHERE B.EXI_TOT <> 0 \"; \n $sql .=($codLin!='')?\" AND A.COD_LIN='$codLin' \":\"\";\n $sql .=($tipConsult!='TD')?\" AND A.COD_TIP='$tipConsult' \":\"\";\n $sql .=\" GROUP BY A.COD_LIN,A.COD_MAR ORDER BY COD_LIN,COD_MAR \";\n $sentencia = $con->query($sql);\n if ($sentencia->num_rows > 0) {\n while ($fila = $sentencia->fetch_assoc()) {//Array Asociativo\n $rawDataACT[] = $fila;\n }\n }\n //cls_Global::putMessageLogFile($sql);\n for ($i = 0; $i < sizeof($rawDataACT); $i++) {\n \n $sql=\"INSERT INTO \" . $obj_con->BdServidor . \".IG0007 \n (COD_LIN,COD_TIP,COD_MAR,NOM_MAR,COST_ANT,COST_ACT,COSTO_T,FEC_SIS,TIP_CON,ANO_MES)VALUES \n ('\" . $rawDataACT[$i]['COD_LIN'] . \"',\n '\" . $rawDataACT[$i]['COD_TIP'] . \"',\n '\" . $rawDataACT[$i]['COD_MAR'] . \"',\n '\" . $rawDataACT[$i]['NOM_MAR'] . \"',\n '\" . $rawDataACT[$i]['COS_ANT'] . \"',\n '\" . $rawDataACT[$i]['COS_ACT'] . \"',\n '\" . $rawDataACT[$i]['COS_ACT'] . \"',\n '\" . $dtActFecha . \"-01',\n '\" . $tipConsult . \"',\n '\" . $dtActFecha . \"')\";\n //cls_Global::putMessageLogFile($rawDataACT[$i]['COS_ACT']);\n //cls_Global::putMessageLogFile($sql);\n $command = $con->prepare($sql); \n $command->execute();\n \n \n } \n\n $con->commit();\n $con->close();\n return true;\n } catch (Exception $e) { // se arroja una excepción si una consulta falla\n //return VSexception::messageSystem('NO_OK', $e->getMessage(), 41, null, null);\n $con->rollback();\n $con->close();\n throw $e;\n return false;\n }\n }", "function insertar_recibidos_mov($id_mov)\r\n {\r\n global $db,$_ses_user;\r\n\r\n $ok=1;\r\n\r\n $db->StartTrans();\r\n\r\n $items=get_items_mov($id_mov);\r\n\r\n for($i=0;$i<$items['cantidad'];$i++)\r\n {\r\n $cantidad=$_POST[\"cant_recib_$i\"];\r\n if($cantidad>0)\r\n {\r\n $desc_recib=$_POST[\"desc_recib_$i\"];\r\n $id_prod_esp=$items[$i][\"id_prod_esp\"];\r\n $id_detalle_mov=$items[$i]['id_detalle_movimiento'];\r\n //vemos si ya se recibieo alguno de este producto. Si es asi, se actualiza\r\n //es entrada en recibidos_mov, sino, se inserta una nueva entrada\r\n $query=\"select id_recibidos_mov from recibidos_mov\r\n where id_detalle_movimiento=$id_detalle_mov and ent_rec=1\";\r\n $res=sql($query) or fin_pagina();\r\n if($res->fields['id_recibidos_mov'])\r\n {\r\n $query=\"update recibidos_mov set cantidad=cantidad+$cantidad , observaciones='$desc_recib' where id_recibidos_mov=\".$res->fields['id_recibidos_mov'].\" and ent_rec=1\";\r\n $tipo_log=\"actualización\";\r\n $id_recibidos_mov=$res->fields['id_recibidos_mov'];\r\n }\r\n else\r\n {\r\n $query=\"select nextval('recibidos_mov_id_recibidos_mov_seq') as id\";\r\n $id=$db->Execute($query) or die($db->ErrorMsg().\"<br>Error al traer la seucencia de recibidos_mov\");\r\n $id_recibidos_mov=$id->fields['id'];\r\n $query=\"insert into recibidos_mov(id_recibidos_mov,cantidad,observaciones,id_detalle_movimiento,ent_rec)\r\n values($id_recibidos_mov,$cantidad,'$desc_recib',$id_detalle_mov,1)\";\r\n $tipo_log=\"inserción\";\r\n }\r\n sql($query) or fin_pagina();\r\n\r\n $fecha_hoy=date(\"Y-m-d H:i:s\",mktime());\r\n $query=\"insert into log_recibidos_mov(fecha,usuario,tipo,id_recibidos_mov,cantidad_recibida)\r\n values('$fecha_hoy','\".$_ses_user['name'].\"','$tipo_log',$id_recibidos_mov,$cantidad)\";\r\n sql($query) or fin_pagina();\r\n }\r\n }\r\n if (!$db->CompleteTrans()) $ok=0;\r\n\r\n return $ok;\r\n}", "function TablaPedidosProductos()\n {\n //Logo\n $this->Image(\"./assets/img/logo.png\" , 15 ,10, 55 , 17 , \"PNG\"); \n //Arial bold 15\n $this->SetFont('Courier','B',15);\n $this->Ln(30);\n\t\n\t$con = new Login();\n $con = $con->ConfiguracionPorId();\n\t\n\t$pe = new Login();\n $pe = $pe->PedidosPorId();\n\t\n################################################# BLOQUE N° 1 ###################################################\t\n\n //Bloque de membrete principal\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(10, 10, 190, 17, '1.5', '');\n\t\n\t//Bloque de membrete principal\n $this->SetFillColor(199);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(98, 12, 12, 12, '1.5', 'F');\n\t//Bloque de membrete principal\n $this->SetFillColor(199);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(98, 12, 12, 12, '1.5', '');\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',16);\n $this->SetXY(101, 14);\n $this->Cell(20, 5, 'P', 0 , 0);\n\t$this->SetFont('courier','B',8);\n $this->SetXY(98, 19);\n $this->Cell(20, 5, 'Pedido', 0 , 0);\n\t\n\t\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',11);\n $this->SetXY(135, 12);\n $this->Cell(20, 5, 'N° PEDIDO ', 0 , 0);\n\t$this->SetFont('courier','B',8);\n $this->SetXY(165, 12);\n $this->Cell(20, 5,utf8_decode($pe[0]['codpedido']), 0 , 0);\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',8);\n $this->SetXY(135, 16);\n $this->Cell(20, 5, 'FECHA PEDIDO ', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(165, 16);\n $this->Cell(20, 5,utf8_decode(date(\"d-m-Y h:i:s\",strtotime($pe[0]['fechapedido']))), 0 , 0);\n\t//Linea de membrete Nro 3\n\t$this->SetFont('courier','B',8);\n $this->SetXY(135, 20);\n $this->Cell(20, 5, 'FECHA EMISIÓN', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(165, 20);\n $this->Cell(20, 5,utf8_decode(date(\"d-m-Y h:i:s\")), 0 , 0);\n\t\n\t\n################################################# BLOQUE N° 2 ###################################################\t\n\n\t//Bloque de datos de empresa\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(10, 29, 190, 18, '1.5', '');\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',9);\n $this->SetXY(15, 30);\n $this->Cell(20, 5, 'DATOS DE LA EMPRESA ', 0 , 0);\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 34);\n $this->Cell(20, 5, 'RAZÓN SOCIAL :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(40, 34);\n $this->Cell(20, 5,utf8_decode($con[0]['nomempresa']), 0 , 0);\n\t//Linea de membrete Nro 3\n\t$this->SetFont('courier','B',7);\n $this->SetXY(147, 34);\n $this->Cell(90, 5, 'RIF :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(156, 34);\n $this->Cell(90, 5,utf8_decode($con[0]['rifempresa']), 0 , 0);\n\t//Linea de membrete Nro 4\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 38);\n $this->Cell(20, 5, 'DIRECCIÓN :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(32, 38);\n $this->Cell(20, 5,utf8_decode($con[0]['direcempresa']), 0 , 0);\n\t//Linea de membrete Nro 5\n\t$this->SetFont('courier','B',7);\n $this->SetXY(140, 38);\n $this->Cell(20, 5, 'TELÉFONO :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(156, 38);\n $this->Cell(20, 5,utf8_decode($con[0]['tlfempresa']), 0 , 0);\n\t//Linea de membrete Nro 6\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 42);\n $this->Cell(20, 5, 'GERENTE :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(30, 42);\n $this->Cell(20, 5,utf8_decode($con[0]['nomresponsable']), 0 , 0);\n\t//Linea de membrete Nro 7\n\t$this->SetFont('courier','B',7);\n $this->SetXY(94, 42);\n $this->Cell(20, 5, 'CÉDULA :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(108, 42);\n $this->Cell(20, 5,utf8_decode($con[0]['cedresponsable']), 0 , 0);\n\t//Linea de membrete Nro 8\n\t$this->SetFont('courier','B',7);\n $this->SetXY(130, 42);\n $this->Cell(20, 5, 'EMAIL :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(142, 42);\n $this->Cell(20, 5,utf8_decode($con[0]['correoresponsable']), 0 , 0);\n\t\n################################################# BLOQUE N° 3 ###################################################\t\n\n\t//Bloque de datos de empresa\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(10, 49, 190, 14, '1.5', '');\n\t//Linea de membrete Nro 1\n\t$this->SetFont('courier','B',9);\n $this->SetXY(15, 50);\n $this->Cell(20, 5, 'DATOS DEL PROVEEDOR ', 0 , 0);\n\t//Linea de membrete Nro 2\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 54);\n $this->Cell(20, 5, 'RAZÓN SOCIAL :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(36, 54);\n $this->Cell(20, 5,utf8_decode($pe[0]['nomproveedor']), 0 , 0);\n\t//Linea de membrete Nro 3\n\t$this->SetFont('courier','B',7);\n $this->SetXY(100, 54);\n $this->Cell(70, 5, 'RIF :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(108, 54);\n $this->Cell(75, 5,utf8_decode($pe[0]['ritproveedor']), 0 , 0);\n\t//Linea de membrete Nro 4\n\t$this->SetFont('courier','B',7);\n $this->SetXY(130, 54);\n $this->Cell(90, 5, 'EMAIL :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(142, 54);\n $this->Cell(90, 5,utf8_decode($pe[0]['emailproveedor']), 0 , 0);\n\t//Linea de membrete Nro 5\n\t$this->SetFont('courier','B',7);\n $this->SetXY(15, 58);\n $this->Cell(20, 5, 'DIRECCIÓN :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(33, 58);\n $this->Cell(20, 5,utf8_decode($pe[0]['direcproveedor']), 0 , 0);\n\t//Linea de membrete Nro 6\n\t$this->SetFont('courier','B',7);\n $this->SetXY(90, 58);\n $this->Cell(20, 5, 'TELÉFONO :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(108, 58);\n $this->Cell(20, 5,utf8_decode($pe[0]['tlfproveedor']), 0 , 0);\n\t//Linea de membrete Nro 6\n\t$this->SetFont('courier','B',7);\n $this->SetXY(130, 58);\n $this->Cell(20, 5, 'CONTACTO :', 0 , 0);\n\t$this->SetFont('courier','',7);\n $this->SetXY(150, 58);\n $this->Cell(20, 5,utf8_decode($pe[0]['contactoproveedor']), 0 , 0);\n\t\n\t$this->Ln(7);\n\t$this->SetFont('courier','B',10);\n\t$this->SetTextColor(3, 3, 3); // Establece el color del texto (en este caso es Negro)\n $this->SetFillColor(229, 229, 229); // establece el color del fondo de la celda (en este caso es GRIS\n\t$this->Cell(8,8,'N°',1,0,'C', True);\n\t$this->Cell(28,8,'CÓDIGO',1,0,'C', True);\n\t$this->Cell(97,8,'DESCRIPCIÓN DE PRODUCTO',1,0,'C', True);\n\t$this->Cell(35,8,'CATEGORIA',1,0,'C', True);\n\t$this->Cell(22,8,'CANTIDAD',1,1,'C', True);\n\t\n\t################################################# BLOQUE N° 4 DE DETALLES DE PRODUCTOS ###################################################\t\n\t//Bloque de datos de empresa\n $this->SetFillColor(192);\n $this->SetDrawColor(3,3,3);\n $this->SetLineWidth(.3);\n $this->RoundedRect(10, 75, 190, 180, '1.5', '');\n\t\n $this->Ln(3);\n $tra = new Login();\n $reg = $tra->VerDetallesPedidos();\n\t$a=1;\n for($i=0;$i<sizeof($reg);$i++){\n\t$this->SetFont('courier','',8); \n\t$this->SetTextColor(3,3,3); // Establece el color del texto (en este caso es negro)\n $this->Cell(8,4,$a++,0,0,'C');\n\t$this->CellFitSpace(28,4,utf8_decode($reg[$i][\"codproducto\"]),0,0,'C');\n $this->CellFitSpace(97,4,utf8_decode($reg[$i][\"producto\"]),0,0,'C');\n $this->CellFitSpace(35,4,utf8_decode($reg[$i][\"nomcategoria\"]),0,0,'C');\n\t$this->CellFitSpace(22,4,utf8_decode($reg[$i][\"cantpedido\"]),0,0,'C');\n $this->Ln();\n\t\n }\n \n $this->Ln(175); \n $this->SetFont('courier','B',9);\n $this->Cell(190,0,'ELABORADO POR: '.utf8_decode($_SESSION[\"nombres\"]).' RECIBIDO POR:___________________________','',1,'C');\n $this->Ln(4);\n }", "public function GenerarPedidoCrecer($refVenta)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$fechaConfirmacion=date(\"m/d/Y h:m:s\" );\r\n\t\t\t\r\n\t\t\t//ACTUALIZAMOS EL ESTADO DE PEDIDO WEB A CONFIRMADO Y AGREGAMOS LA FECHA DE CONFIRMACION\r\n\t\t\t//$recordSett = &$this->conexion->conectarse()->Execute(\"\tUPDATE PedidoWeb\r\n\t\t\t//SET FechaRespuesta ='\".$fechaConfirmacion.\"', Estado = 1\r\n\t\t\t//WHERE (CodigoTransaccion = '\".$refVenta.\"' AND Estado = 3)\");\t\r\n\t\t\t\r\n\t\t\t//CREAMOS EL PEDIDO EN CRECER\r\n\t\t\t//1.OBTENEMOS LA INFORMACION DEL PEDIDO DESDE LA TABLA TEMPORAL\r\n\t\t\t\r\n\t\t\t//Id--0\r\n\t\t\t//CodigoTransaccion--1\r\n\t\t\t//IdPoliza--2\r\n\t\t\t//FechaCreacion--3\r\n\t\t\t//FechaRespuesta--4\r\n\t\t\t//NombreTitularFactura--5\r\n\t\t\t//DocumentoTitularFactura--6\r\n\t\t\t//DireccionTitularFactura--7\r\n\t\t\t//TelefonoTitularFactura--8\r\n\t\t\t//EmailTitularFactura--9\r\n\t\t\t//TelefonoContacto--10\r\n\t\t\t//TelefonoMovilContacto--11\r\n\t\t\t//DireccionContacto--12\r\n\t\t\t//NombreContactoEmergencia--13\r\n\t\t\t//ApellidoContactoEmergencia--14\r\n\t\t\t//TelefonoContactoEmergencia--15\r\n\t\t\t//EmailContactoEmergencia--16\r\n\t\t\t//Estado--17\r\n\t\t\t//FechaInicio--18\r\n\t\t\t//FechaFin--19\r\n\t\t\t//Precio--20\r\n\t\t\t//Region--21\r\n\t\t\t//TrmIata--22\t\t\t\r\n\t\t\t\r\n\t\t\t$pedidoWeb = &$this->conexion->conectarse()->Execute(\"SELECT Id, CodigoTransaccion, IdPoliza, FechaCreacion, FechaRespuesta, NombreTitularFactura, DocumentoTitularFactura, DireccionTitularFactura, TelefonoTitularFactura, EmailTitularFactura, TelefonoContacto, TelefonoMovilContacto, DireccionContacto, \r\n\t\t\tNombreContactoEmergencia, ApellidoContactoEmergencia, TelefonoContactoEmergencia, EmailContactoEmergencia,\r\n\t\t\t Estado, FechaInicio, FechaFin, Precio, Region, TrmIata \r\n\t\t\t FROM dbo.PedidoWeb\t\tWHERE CodigoTransaccion= '\".$refVenta.\"'\");\t\t\r\n\r\n\t\t\t//2.VALIDAMOS EL CLIENTE SI NO EXISTE CREAMOS EL CLIENTE Y SU CONTACTO.\t\t\t\r\n\t\t\t$existeCliente = &$this->conexion->conectarse()->Execute(\"SELECT DISTINCT Identificacion,Id FROM dbo.Empresas\r\n\t\t\tWHERE Identificacion='\".$pedidoWeb->fields[6].\"' \");\t\r\n\t\t\t\r\n\t\t\t$IdCliente=\"\";\r\n\t\t\t//CREAMOS EL CLIENTE NUEVO \r\n\t\t\tif($existeCliente->fields[0]==\"\"){\r\n\t\t\t\t\r\n\t\t\t\techo \"Entramos a creacion\";\r\n\t\t\t\t\r\n\t\t\t\t$IdCliente=$this->fun->NewGuid();\r\n\t\t\t\t$IdContacto=$this->fun->NewGuid();\r\n\t\t\t\t$IdPedido=$this->fun->NewGuid();\r\n\t\t\t\t$IdProductoCotizacion=$this->fun->NewGuid();\r\n\t\t\t\t$IdFactura=$this->fun->NewGuid();\t\t\t\t\r\n\t\t\t\t$grupo=2;//ASESORES\r\n\t\t\t\t$prioridad=2;\r\n\t\t\t\t$seguimiento=\"Creado desde el portal web \". $fechaConfirmacion.\"\\n\";\r\n\t\t\t\t$moneda=2;//DOLARES\r\n\t\t\t\t$viaContacto=2;//WEB\r\n\t\t\t\t$formaPago=1;\r\n\t\t\t\t//CREAMOS LA EMPRESA\r\n\t\t\t\t$crearCliente = &$this->conexion->conectarse()->Execute( \"INSERT INTO Empresas\r\n (Id, TipoEmpresa, Identificacion, Dv, RazonSocial, Antiguedad, Telefono, Fax, Direccion, Mail, Url, Ciudad, Departamento, Pais, Aniversario, TieneAniversario, \r\n FechaIngreso, IdActividadEconomica, Movil, Observaciones, SeguimientoHistorico, Estado, IdAsesor, RepresentanteLegal, IdTipoMonedaImportacion, \r\n TipoNacionalidad, IdEmpleadoModif, Imagen)\r\n\t\t\t\t\t\tVALUES ('\".$IdCliente.\"','N/A','\".$pedidoWeb->fields[6].\"','N','\".$pedidoWeb->fields[5].\"','0',\r\n\t\t\t\t\t\t'\".$pedidoWeb->fields[8].\"','0','\".$pedidoWeb->fields[7].\"','\".$pedidoWeb->fields[9].\"','-',NULL,NULL,\r\n\t\t\t\t\t\tNULL,NULL,NULL,'\".$fechaConfirmacion.\"',\r\n\t\t\t\t\t\tNULL,'\".$pedidoWeb->fields[11].\"','Ninguna',\r\n\t\t\t\t\t\tNULL,'0',NULL,'Ninguno',\r\n\t\t\t\t\t\t'2','false',NULL,\r\n\t\t\t\t\t\tNULL)\");\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL CLIENTE\r\n\t\t\t\t$crearCliente = &$this->conexion->conectarse()->Execute( \"INSERT INTO Clientes\r\n (Id, Ingreso, Inicio, Fin, CodigoSwift, IdTipoCliente, IdActividadEconomica)\r\n\t\t\t\tVALUES ('\".$IdCliente.\"','\".$fechaConfirmacion.\"','\".$fechaConfirmacion.\"',NULL,'0',NULL,'0')\");\r\n\t\t\t\t\r\n\t\t\t\t//NOTIFICAMOS DE LA COMPRA AL TITLULAR DE LA FACTURA\r\n\t\t\t\t/////////$this->fun->SendMailConfirmacionPago($pedidoWeb->fields[9], $pedidoWeb->fields[5], $pedidoWeb->fields[6]);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL CONTACTO.\t\t\t\t\r\n\t\t\t\t$crearContacto= &$this->conexion->conectarse()->Execute(\"INSERT INTO Contactos(Id, Descripcion, Cargo, Direccion, Telefono, Extension, Celular, Fax, EmailEmpresa, EmailPersonal, Observacion, Cumpleanno, TieneCumpleanno, Estado)\r\n\t\t\t\tVALUES ('\".$IdContacto.\"','\".$pedidoWeb->fields[13].\" \".$pedidoWeb->fields[14].\"',NULL,NULL,'\".$pedidoWeb->fields[15].\"',NULL,NULL,NULL,'\".$pedidoWeb->fields[16].\"','\".$pedidoWeb->fields[16].\"',NULL,NULL,NULL,'true')\");\r\n\t\t\t\t\r\n\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\tVALUES ('\".$IdCliente.\"','\".$IdContacto.\"')\");\r\n\r\n\t\t\t\t//CREAMOS EL PEDIDO\r\n\t\t\t\t\r\n\t\t\t\t\t$crearPedido = &$this->conexion->conectarse()->Execute(\"INSERT INTO OrdenCompraCliente\r\n (Id, FechaElaboracion, IdCliente, IdPaisOrigen, IdSedeCliente, IdRegionDestino, IdContactoEmergencia, FechaSalida, FechaRegreso, CantidadPasajeros, IdContacto, \r\n Codigo, IdAutor, IdEmpleado, FechaModificacion, SubtotalSinDto, Subtotal, ValorIva, Total, Trm_dia, UtilidadSobreCosto, Estado, GrupoAsignado, Prioridad, \r\n Probabilidad, Observaciones, SeguimientoHistorico, FechaRecepcion, Moneda, FormaPago, TiempoEntrega, TiempoVigencia, Instalacion, \r\n IdEmpleadoModif, IdViadeContacto)\r\n\t\t\t\t\t\t\tVALUES ('\".$IdPedido.\"','\".$fechaConfirmacion.\"','\".$IdCliente.\"','1',\r\n\t\t\t\t\t\t\t'00000000-0000-0000-0000-000000000000','\".$pedidoWeb->fields[21].\"',\r\n\t\t\t\t\t\t\t'\".$IdContacto.\"','\".$pedidoWeb->fields[18].\"','\".$pedidoWeb->fields[19].\"','0','\".$IdContacto.\"','',\r\n\t\t\t\t\t\t\t'7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','\".$fechaConfirmacion.\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"','0','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[22].\"',\r\n\t\t\t\t\t\t\t'true','1','\".$grupo.\"','\".$prioridad.\"','100',NULL,'\".$seguimiento.\"',\r\n\t\t\t\t\t\t\t'\".$fechaConfirmacion.\"','\".$moneda.\"','\".$formaPago.\"',NULL,NULL,'false','00000000-0000-0000-0000-000000000000','\".$viaContacto.\"')\");\r\n\t\t\t\t\t//CREAMOS EL PRODUCTO COTIZACION.\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\t// OBTENEMOS LA CANTIDAD DE PASAJEROS.\t\t\t\t\t\t\r\n\t\t\t\t\t\t$cantidadPasajeros = &$this->conexion->conectarse()->Execute(\"SELECT COUNT(*) AS Expr1\r\n\t\t\t\t\t\tFROM PasajerosPedido\r\n\t\t\t\t\t\tWHERE (IdPedido = '\".$pedidoWeb->fields[0].\"')\");\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$productoCotizacion = &$this->conexion->conectarse()->Execute(\"INSERT INTO ProductosCotizacion\r\n (Id, IdProducto, IdReferencia, Cantidad, ValorVenta, SubtotalSinDescuento, ValorVentaCliente, IVA, AplicarIva, IdFormaEnvio, TipoTrasporte, UtilidadGlobal, Utilidad, \r\n UtilidadEnPorcentaje, UtilidadDespuesCosto, Arancel, ComicionProveedor, IdEmpleado, FechaModificacion, FechaElaboracion, Moneda, ComentarioAdicional, \r\n Descuento, Aumento)\r\n\t\t\t\t\t\t\tVALUES ('\".$IdProductoCotizacion.\"','\".$pedidoWeb->fields[2].\"','\".$IdPedido.\"','\".$cantidadPasajeros->fields[0].\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"',\r\n\t\t\t\t\t\t\t'0','true','0','0','0','0','true','false','0',\r\n\t\t\t\t\t\t\t'0','7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','\".$fechaConfirmacion.\"','\".$fechaConfirmacion.\"','4','','0','0')\");\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL PASAJERO PRODUCTO COTIZACION.\r\n\t\t\t\t\t\t//CONSULTAMOS LOS PASAJEROS ASOCIADOS AL PEDIDO\t\t\t\t\t\t\r\n\t\t\t\t\t\t$pedidoPasajero = &$this->conexion->conectarse()->Execute(\"SELECT Id, IdPedido, Nombre, Apellido, Documento, Email, FechaNacimiento\r\n\t\t\t\t\t\t\tFROM PasajerosPedido \r\n\t\t\t\t\t\t\tWHERE (IdPedido = '\".$pedidoWeb->fields[0].\"')\");\t\t\r\n\t\t\t\t\t\tforeach($pedidoPasajero as $k => $row) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$idPasajero=\"\";\r\n\t\t\t\t\t\t\t$numeroPoliza=\"\";// ACA DEBO LLAMAR EL WEBSERVICE\r\n\t\t\t\t\t\t\t$idPasajeroProducto=$this->fun->NewGuid();\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$existePasajero = &$this->conexion->conectarse()->Execute(\"SELECT Id\r\n\t\t\t\t\t\t\t\tFROM Pasajero\r\n\t\t\t\t\t\t\t\tWHERE (Identificacion = '\". $row[4].\"')\");\t\t\t\t\t\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\t\t//NOTIFICAMOS A LOS PASAJEROS DE LA COMPRA\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t///////////$this->fun->SendMailConfirmacionPago($row[5], $row[2], $row[3]);\r\n\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($existePasajero->fields[0]==\"\"){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//CREAMOS PASAJERO\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$idPasajero=$this->fun->NewGuid();\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$existePasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\tINSERT INTO Pasajero\r\n \t\t(Id, Nombre, Apellido, Identificacion, FechaNacimiento, Telefono, Celular, Email, Estado, Direccion, Observaciones, SeguimientoHistorico)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$row[2].\"','\".$row[3].\"','\".$row[4].\"','\".$row[6].\"','\".$pedidoWeb->fields[10].\"','\".$pedidoWeb->fields[11].\"','\".$row[5].\"','true','\".$pedidoWeb->fields[12].\"','-','\".$seguimiento.\"')\");\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//ASOCIAMOS EL CONTACTO DE EMERGENCIA\r\n\t\t\t\t\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$IdContacto.\"')\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//ASOCIAMOS AL PASAJERO PRODUCTO COTIZACION\t\r\n\t\t\t\t\t\t\t\t$asociamospasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\t\tINSERT INTO PasajerosProductosCotizacion (Id, IdPasajero, IdProductoCotizacion, Poliza, Estado, Aumento, Descuento, ValorUnitario)\r\n\t\t\t\t\t\t\t\t\tVALUES ('\".$idPasajeroProducto.\"','\".$idPasajero.\"','\".$IdProductoCotizacion.\"','\".$numeroPoliza.\"','true','0','0','0')\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if($existePasajero->fields[0]!=\"\"){\r\n\t\t\t\t\t\t\t//\techo \"Entramos al caso cuando el pasajero ya existe\";\r\n\t\t\t\t\t\t\t\t$idPasajero=$existePasajero->fields[0];\t\t\r\n\t\t\t\t\t\t\t\t\t//ASOCIAMOS EL CONTACTO DE EMERGENCIA\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$IdContacto.\"')\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t//ASOCIAMOS AL PASAJERO PRODUCTO COTIZACION\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociamospasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\t\tINSERT INTO PasajerosProductosCotizacion (Id, IdPasajero, IdProductoCotizacion, Poliza, Estado, Aumento, Descuento, ValorUnitario)\r\n\t\t\t\t\t\t\t\t\tVALUES ('\".$idPasajeroProducto.\"','\".$idPasajero.\"','\".$IdProductoCotizacion.\"','\".$numeroPoliza.\"','true','0','0','0')\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS FACTURA.\t\t\t\t\r\n\t\t\t\t//CREAMOS FACTURA ORDEN COMPRA.\t\t\t\t\r\n\t\t\t\t//CREAMOS ALERTAS FACTURACION.\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t//EL CLIENTE YA EXISTE - ASOCIAMOS TODO EL PEDIDO\r\n\t\t\telse if($existeCliente->fields[0]!=\"\") {\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$IdCliente=$existeCliente->fields[1];\t\t\t\t\t\t\r\n\t\t\t\t$IdContacto=$this->fun->NewGuid();\r\n\t\t\t\t$IdPedido=$this->fun->NewGuid();\r\n\t\t\t\t$IdProductoCotizacion=$this->fun->NewGuid();\r\n\t\t\t\t$IdFactura=$this->fun->NewGuid();\t\t\t\t\r\n\t\t\t\t$grupo=2;//ASESORES\r\n\t\t\t\t$prioridad=2;\r\n\t\t\t\t$seguimiento=\"Creado desde el portal web \". $fechaConfirmacion.\"\\n\";\r\n\t\t\t\t$moneda=2;//DOLARES\r\n\t\t\t\t$viaContacto=2;//WEB\r\n\t\t\t\t$formaPago=1;\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL CONTACTO.\t\t\t\t\r\n\t\t\t\t$crearContacto= &$this->conexion->conectarse()->Execute(\"INSERT INTO Contactos(Id, Descripcion, Cargo, Direccion, Telefono, Extension, Celular, Fax, EmailEmpresa, EmailPersonal, Observacion, Cumpleanno, TieneCumpleanno, Estado)\r\n\t\t\t\tVALUES ('\".$IdContacto.\"','\".$pedidoWeb->fields[13].\" \".$pedidoWeb->fields[14].\"',NULL,NULL,'\".$pedidoWeb->fields[15].\"',NULL,NULL,NULL,'\".$pedidoWeb->fields[16].\"','\".$pedidoWeb->fields[16].\"',NULL,NULL,NULL,'true')\");\r\n\t\t\t\t\r\n\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\tVALUES ('\".$IdCliente.\"','\".$IdContacto.\"')\");\r\n\r\n\t\t\t\t//CREAMOS EL PEDIDO\r\n\t\t\t\t\r\n\t\t\t\t$crearPedido = &$this->conexion->conectarse()->Execute(\"INSERT INTO OrdenCompraCliente\r\n (Id, FechaElaboracion, IdCliente, IdPaisOrigen, IdSedeCliente, IdRegionDestino, IdContactoEmergencia, FechaSalida, FechaRegreso, CantidadPasajeros, IdContacto, \r\n Codigo, IdAutor, IdEmpleado, FechaModificacion, SubtotalSinDto, Subtotal, ValorIva, Total, Trm_dia, UtilidadSobreCosto, Estado, GrupoAsignado, Prioridad, \r\n Probabilidad, Observaciones, SeguimientoHistorico, FechaRecepcion, Moneda, FormaPago, TiempoEntrega, TiempoVigencia, Instalacion, \r\n IdEmpleadoModif, IdViadeContacto)\r\n\t\t\t\t\t\t\tVALUES ('\".$IdPedido.\"','\".$fechaConfirmacion.\"','\".$IdCliente.\"','1',\r\n\t\t\t\t\t\t\t'00000000-0000-0000-0000-000000000000','\".$pedidoWeb->fields[21].\"',\r\n\t\t\t\t\t\t\t'\".$IdContacto.\"','\".$pedidoWeb->fields[18].\"','\".$pedidoWeb->fields[19].\"','0','\".$IdContacto.\"','',\r\n\t\t\t\t\t\t\t'7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','\".$fechaConfirmacion.\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"','0','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[22].\"',\r\n\t\t\t\t\t\t\t'true','1','\".$grupo.\"','\".$prioridad.\"','100',NULL,'\".$seguimiento.\"',\r\n\t\t\t\t\t\t\t'\".$fechaConfirmacion.\"','\".$moneda.\"','\".$formaPago.\"',NULL,NULL,'false','00000000-0000-0000-0000-000000000000','\".$viaContacto.\"')\");\r\n\t\t\t\t //CREAMOS EL PRODUCTO COTIZACION.\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\t// OBTENEMOS LA CANTIDAD DE PASAJEROS.\t\t\t\t\t\t\r\n\t\t\t\t\t\t$cantidadPasajeros = &$this->conexion->conectarse()->Execute(\"SELECT COUNT(*) AS Expr1\r\n\t\t\t\t\t\tFROM PasajerosPedido\r\n\t\t\t\t\t\tWHERE (IdPedido = '\".$pedidoWeb->fields[0].\"')\");\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$productoCotizacion = &$this->conexion->conectarse()->Execute(\"INSERT INTO ProductosCotizacion\r\n (Id, IdProducto, IdReferencia, Cantidad, ValorVenta, SubtotalSinDescuento, ValorVentaCliente, IVA, AplicarIva, IdFormaEnvio, TipoTrasporte, UtilidadGlobal, Utilidad, \r\n UtilidadEnPorcentaje, UtilidadDespuesCosto, Arancel, ComicionProveedor, IdEmpleado, FechaModificacion, FechaElaboracion, Moneda, ComentarioAdicional, \r\n Descuento, Aumento)\r\n\t\t\t\t\t\t\tVALUES ('\".$IdProductoCotizacion.\"','\".$pedidoWeb->fields[2].\"','\".$IdPedido.\"','\".$cantidadPasajeros->fields[0].\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"',\r\n\t\t\t\t\t\t\t'0','true','0','0','0','0','true','false','0',\r\n\t\t\t\t\t\t\t'0','7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','\".$fechaConfirmacion.\"','\".$fechaConfirmacion.\"','4','','0','0')\");\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL PASAJERO PRODUCTO COTIZACION.\r\n\t\t\t\t\t\t//CONSULTAMOS LOS PASAJEROS ASOCIADOS AL PEDIDO\t\t\t\t\t\t\r\n\t\t\t\t\t\t$pedidoPasajero = &$this->conexion->conectarse()->Execute(\"SELECT Id, IdPedido, Nombre, Apellido, Documento, Email, FechaNacimiento\r\n\t\t\t\t\t\t\tFROM PasajerosPedido \r\n\t\t\t\t\t\t\tWHERE (IdPedido = '\".$pedidoWeb->fields[0].\"')\");\t\t\r\n\t\t\t\t\t\tforeach($pedidoPasajero as $k => $row) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$idPasajero=\"\";\r\n\t\t\t\t\t\t\t$numeroPoliza=\"\";// ACA DEBO LLAMAR EL WEBSERVICE\r\n\t\t\t\t\t\t\t$idPasajeroProducto=$this->fun->NewGuid();\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$existePasajero = &$this->conexion->conectarse()->Execute(\"SELECT Id\r\n\t\t\t\t\t\t\t\tFROM Pasajero\r\n\t\t\t\t\t\t\t\tWHERE (Identificacion = '\". $row[4].\"')\");\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t//NOTIFICAMOS A LOS PASAJEROS DE LA COMPRA\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t///////////\t$this->fun->SendMailConfirmacionPago($row[5], $row[2], $row[3]);\r\n\t\t\t\r\n\t\t\t\t\t\t\tif($existePasajero->fields[0]==\"\"){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//CREAMOS PASAJERO\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$idPasajero=$this->fun->NewGuid();\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$existePasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\tINSERT INTO Pasajero\r\n \t\t(Id, Nombre, Apellido, Identificacion, FechaNacimiento, Telefono, Celular, Email, Estado, Direccion, Observaciones, SeguimientoHistorico)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$row[2].\"','\".$row[3].\"','\".$row[4].\"','\".$row[6].\"','\".$pedidoWeb->fields[10].\"','\".$pedidoWeb->fields[11].\"','\".$row[5].\"','true','\".$pedidoWeb->fields[12].\"','-','\".$seguimiento.\"')\");\t\r\n\t\t\t\t\t\t\t\t//ASOCIAMOS EL CONTACTO DE EMERGENCIA\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$IdContacto.\"')\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//ASOCIAMOS AL PASAJERO PRODUCTO COTIZACION\t\r\n\t\t\t\t\t\t\t\t$asociamospasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\t\tINSERT INTO PasajerosProductosCotizacion (Id, IdPasajero, IdProductoCotizacion, Poliza, Estado, Aumento, Descuento, ValorUnitario)\r\n\t\t\t\t\t\t\t\t\tVALUES ('\".$idPasajeroProducto.\"','\".$idPasajero.\"','\".$IdProductoCotizacion.\"','\".$numeroPoliza.\"','true','0','0','0')\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if($existePasajero->fields[0]!=\"\"){\r\n\t\t\t\t\t\t\t//\techo \"Entramos al caso cuando el pasajero ya existe\";\r\n\t\t\t\t\t\t\t\t$idPasajero=$existePasajero->fields[0];\t\t\r\n\t\t\t\t\t\t\t\t\t//ASOCIAMOS EL CONTACTO DE EMERGENCIA\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$IdContacto.\"')\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t//ASOCIAMOS AL PASAJERO PRODUCTO COTIZACION\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociamospasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\t\tINSERT INTO PasajerosProductosCotizacion (Id, IdPasajero, IdProductoCotizacion, Poliza, Estado, Aumento, Descuento, ValorUnitario)\r\n\t\t\t\t\t\t\t\t\tVALUES ('\".$idPasajeroProducto.\"','\".$idPasajero.\"','\".$IdProductoCotizacion.\"','\".$numeroPoliza.\"','true','0','0','0')\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\techo 'Caught exception: ', $e->getMessage(), \"\\n\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function recuperarPedidos($usuarioId){\r\n\t\techo \"<br>Dentro de recuperarPedidos<br>\";\r\n\t\t\r\n\t\t//criar um array d epedidos\r\n\t\t$arrayPedidos = array();\r\n\t\t\r\n\t\t$sql = \"SELECT *, DATE_FORMAT(pedi_dataPedido,'%d/%m/%Y %H:%i') as data,\r\n\t\t\t\tDATE_FORMAT(pedi_dataEntraga,'%d/%m/%Y %H:%i') as dataEntrega\r\n\t\t\t\tFROM `tb_pedidos` WHERE usu_id = $usuarioId AND pedi_status <> 'C';\";\r\n\t\t\r\n\t\techo \"<br>\".$sql.\"<br>\";\r\n\t\t\r\n\t\t$conn = new Conexao();\r\n\t\t\r\n\t\t$mysqli = $conn->Conn();\r\n\t\t\t\r\n\t\tif($resultado = $mysqli->query($sql)){\r\n\t\t\t\t\r\n\t\t\twhile ($row = mysqli_fetch_array($resultado)) {\r\n\t\t\t\t//echo \"dentro \".$row['prod_id'].\" - \".$row['prod_nome'].\"<br>\";\r\n\t\t\t\t$pedidoDTO = new PedidoDTO();\r\n\t\t\r\n\t\t\t\t$pedidoDTO->setId($row['pedi_id']);\r\n\t\t\t\t$pedidoDTO->setSessao($row['pedi_sessao']);\r\n\t\t\t\t$pedidoDTO->setStatus($this->verificarStatus($row['pedi_status']));\r\n\t\t\t\t$pedidoDTO->setTroco($row['pedi_troco']);\r\n\t\t\t\t$pedidoDTO->setValorTotal($row['pedi_valorTotal']);\r\n\t\t\t\t$pedidoDTO->setDataPedido($row['data']);\r\n\t\t\t\t$pedidoDTO->setTaxa($row['pedi_taxa']);\r\n\t\t\t\tif($row['dataEntrega'] == null || $row['dataEntrega'] == \"\"){\r\n\t\t\t\t\t$pedidoDTO->setDataEntrega(\"\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$pedidoDTO->setDataEntrega($row['dataEntrega']);\r\n\t\t\t\t}\r\n\t\t\t\t$pedidoDTO->setFormaPagamento($row['pedi_formaPagamento']);\r\n\t\t\t\r\n\t\t\t\t$arrayPedidos[] = ($pedidoDTO);\r\n\t\t\t\t//echo \"id: $genero[0], Genero: $genero[1]<br>\";\r\n\t\t\t\t\t\r\n\t\t\t\t//echo \"Final\";\r\n\t\t\t\t//echo \"<br>$i<br>\";\r\n\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//buscar os produtos dos pedidos\r\n\t\t\tforeach($arrayPedidos as $pedido2DTO) {\r\n\t\t\t\t//echo \"<br> dentro\";\r\n\t\t\t\t//$pedido2DTO->getTaxa().\" taxa\".$pedido2DTO->getId().\"<br>\";\r\n\t\t\t\t$pedido2DTO->setArrayProdutos($this->produtosPedido($pedido2DTO->getId()));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//buscar cliente\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//buscar entregador\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tmysqli_free_result($resultado);\r\n\t\t}\r\n\t\t$conn->fecharConn();\r\n\t\t\r\n\t\treturn $arrayPedidos;\r\n\t\t\r\n\t\t\r\n\t}", "public function AgregaPedidos()\n{\n\n\tif(empty($_SESSION[\"CarritoVentas\"]))\n\t\t\t\t{\n\t\t\t\t\techo \"3\";\n\t\t\t\t\texit;\n\n\t\t\t\t} \n\n\t$ver = $_SESSION[\"CarritoVentas\"];\n\tfor($i=0;$i<count($ver);$i++){ \n\n\t\t$sql = \"select existencia from productos where codproducto = '\".$ver[$i]['txtCodigo'].\"'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$existenciadb = $row['existencia'];\n\n\t\tif($ver[$i]['cantidad'] > $existenciadb) {\n\n\t\t\techo \"4\";\n\t\t\texit; }\n\t\t}\n\n\t$ven = $_SESSION[\"CarritoVentas\"];\n\tfor($i=0;$i<count($ven);$i++){\n\n\t$sql = \"select existencia from productos where codproducto = '\".$ven[$i]['txtCodigo'].\"'\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\t$existenciadb = $row['existencia'];\n\n\n\t\t$sql = \"select * from detalleventas where codventa = ? and codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array( $_POST[\"codventa\"], $ven[$i]['txtCodigo'] ) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num>0)\n\t\t{\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $row;\n\t\t\t}\n\t\t\t$codproducto = $pae[0]['codproducto'];\n\t\t\t$cantven = $pae[0]['cantventa'];\n\t\t\t$import = $pae[0]['importe'];\n\t\t\t$import2 = $pae[0]['importe2'];\n\n\t\t\t$sql = \" update detalleventas set \"\n\t\t\t.\" cantventa = ?, \"\n\t\t\t.\" importe = ?, \"\n\t\t\t.\" importe2 = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codventa = '\".$_POST[\"codventa\"].\"' and codproducto = '\".$ven[$i]['txtCodigo'].\"';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $cantidad);\n\t\t\t$stmt->bindParam(2, $importe);\n\t\t\t$stmt->bindParam(3, $importe2);\n\n\t\t\t$cantidad = rount($ven[$i]['cantidad']+$cantven,2);\n\t\t\t$importe = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio2']+$import);\n\t\t\t$importe2 = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio']+$import2);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$existencia = rount($existenciadb-$ven[$i]['cantidad'],2);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" statusproducto = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"' and existencia = '0';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $statusproducto);\n\t\t\t$statusproducto = \"INACTIVO\";\n\t\t\t$stmt->execute();\n\n################## REGISTRAMOS LOS DATOS DE PRODUCTOS EN KARDEX #################\n\t\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $movimiento);\n\t\t\t$stmt->bindParam(5, $entradas);\n\t\t\t$stmt->bindParam(6, $salidas);\n\t\t\t$stmt->bindParam(7, $devolucion);\n\t\t\t$stmt->bindParam(8, $stockactual);\n\t\t\t$stmt->bindParam(9, $preciounit);\n\t\t\t$stmt->bindParam(10, $costototal);\n\t\t\t$stmt->bindParam(11, $documento);\n\t\t\t$stmt->bindParam(12, $fechakardex);\n\n\t\t\t$codventa = strip_tags($_POST[\"codventa\"]);\n\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t$codproducto = strip_tags($ven[$i]['txtCodigo']);\n\t\t\t$movimiento = strip_tags(\"SALIDAS\");\n\t\t\t$entradas = strip_tags(\"0\");\n\t\t\t$salidas = rount($ven[$i]['cantidad'],2);\n\t\t\t$devolucion = strip_tags(\"0\");\n\t\t\t$stockactual = rount($existenciadb-$ven[$i]['cantidad'],2); \n\t\t\t$preciounit = strip_tags($ven[$i]['precio2']);\n\t\t\t$costototal = strip_tags($ven[$i]['precio2'] * $ven[$i]['cantidad']);\n\t\t\t$documento = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t$fechakardex = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t$stmt->execute();\n\n\n############## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ###############\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array( $ven[$i]['txtCodigo'] ) );\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto IN ('\".$ven[$i]['txtCodigo'].\"')\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$racion = rount($cantracion*$cantidad,2);\n\t\t\t$cantidadracion = rount($cantingrediente-$racion,2);\n\t\t\t$stmt->execute();\n\n\n##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX #####################\n\t\t\t\t\t$query = \" insert into kardexingredientes values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t\t\t$stmt->bindParam(4, $codingrediente);\n\t\t\t\t\t$stmt->bindParam(5, $movimientoing);\n\t\t\t\t\t$stmt->bindParam(6, $entradasing);\n\t\t\t\t\t$stmt->bindParam(7, $salidasing);\n\t\t\t\t\t$stmt->bindParam(8, $stockactualing);\n\t\t\t\t\t$stmt->bindParam(9, $preciouniting);\n\t\t\t\t\t$stmt->bindParam(10, $costototaling);\n\t\t\t\t\t$stmt->bindParam(11, $documentoing);\n\t\t\t\t\t$stmt->bindParam(12, $fechakardexing);\n\n\t\t\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t\t\t$codproducto = strip_tags($codproducto);\n\t\t\t\t\t$codingrediente = strip_tags($codingrediente);\n\t\t\t\t\t$movimientoing = strip_tags(\"SALIDAS\");\n\n\t\t\t\t\t$entradasing = strip_tags(\"0\");\n\t\t\t\t\t$salidasing = rount($cantracion*$cantidad,2);\n\t\t\t\t\t$stockactualing = rount($cantingrediente-$racion,2);\n\t\t\t\t\t$preciouniting = strip_tags($costoingrediente);\n\t\t\t\t\t$costototaling = strip_tags($costoingrediente * $cantidad);\n\n\t\t\t\t\t$documentoing = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t\t\t$fechakardexing = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t\t\t$stmt->execute();\n\t##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX ###################\n\n\t\t }\n\n}\n############## FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ###########\t\n\n\n\t\t}\n\t\telse\n\t\t{\n\n\n\t\t\t$query = \" insert into detalleventas values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $producto);\n\t\t\t$stmt->bindParam(5, $codcategoria);\n\t\t\t$stmt->bindParam(6, $cantidad);\n\t\t\t$stmt->bindParam(7, $preciocompra);\n\t\t\t$stmt->bindParam(8, $precioventa);\n\t\t\t$stmt->bindParam(9, $ivaproducto);\n\t\t\t$stmt->bindParam(10, $importe);\n\t\t\t$stmt->bindParam(11, $importe2);\n\t\t\t$stmt->bindParam(12, $fechadetalleventa);\n\t\t\t$stmt->bindParam(13, $statusdetalle);\n\t\t\t$stmt->bindParam(14, $codigo);\n\n\t\t\t$codventa = strip_tags($_POST[\"codventa\"]);\n\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t$codproducto = strip_tags($ven[$i]['txtCodigo']);\n\t\t\t$producto = strip_tags($ven[$i]['descripcion']);\n\t\t\t$codcategoria = strip_tags($ven[$i]['tipo']);\n\t\t\t$cantidad = rount($ven[$i]['cantidad'],2);\n\t\t\t$preciocompra = strip_tags($ven[$i]['precio']);\n\t\t\t$precioventa = strip_tags($ven[$i]['precio2']);\n\t\t\t$ivaproducto = strip_tags($ven[$i]['ivaproducto']);\n\t\t\t$importe = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio2']);\n\t\t\t$importe2 = strip_tags($ven[$i]['cantidad'] * $ven[$i]['precio']);\n\t\t\t$fechadetalleventa = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t$statusdetalle = \"1\";\n\t\t\t$codigo = strip_tags($_SESSION['codigo']);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$existencia = rount($existenciadb-$ven[$i]['cantidad'],2);\n\t\t\t$stmt->execute();\n\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" statusproducto = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = '\".$ven[$i]['txtCodigo'].\"' and existencia = '0';\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $statusproducto);\n\t\t\t$statusproducto = \"INACTIVO\";\n\t\t\t$stmt->execute();\n\n##################### REGISTRAMOS LOS DATOS DE PRODUCTOS EN KARDEX ###################\n\t\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $movimiento);\n\t\t\t$stmt->bindParam(5, $entradas);\n\t\t\t$stmt->bindParam(6, $salidas);\n\t\t\t$stmt->bindParam(7, $devolucion);\n\t\t\t$stmt->bindParam(8, $stockactual);\n\t\t\t$stmt->bindParam(9, $preciounit);\n\t\t\t$stmt->bindParam(10, $costototal);\n\t\t\t$stmt->bindParam(11, $documento);\n\t\t\t$stmt->bindParam(12, $fechakardex);\n\n\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t$codproducto = strip_tags($ven[$i]['txtCodigo']);\n\t\t\t$movimiento = strip_tags(\"SALIDAS\");\n\t\t\t$entradas = strip_tags(\"0\");\n\t\t\t$salidas =rount($ven[$i]['cantidad'],2);\n\t\t\t$devolucion = strip_tags(\"0\");\n\t\t\t$stockactual = rount($existenciadb-$ven[$i]['cantidad'],2);\n\t\t\t$preciounit = strip_tags($ven[$i]['precio2']);\n\t\t\t$costototal = strip_tags($ven[$i]['precio2'] * $ven[$i]['cantidad']);\n\t\t\t$documento = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t$fechakardex = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t$stmt->execute();\t\n\n\n############### CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array( $ven[$i]['txtCodigo'] ) );\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto IN ('\".$ven[$i]['txtCodigo'].\"')\";\n\n\t $array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\n\t\t\t$codproducto = $row['codproducto'];\n\t\t\t$codingrediente = $row['codingrediente'];\n\t\t\t$cantracion = $row['cantracion'];\n\t\t\t$cantingrediente = $row['cantingrediente'];\n\t\t\t$costoingrediente = $row['costoingrediente'];\n\n\n\t\t\t$update = \" update ingredientes set \"\n\t\t\t.\" cantingrediente = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codingrediente = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($update);\n\t\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t\t$racion = rount($cantracion*$cantidad,2);\n\t\t\t$cantidadracion = rount($cantingrediente-$racion,2);\n\t\t\t$stmt->execute();\n\n\n##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX #####################\n$query = \" insert into kardexingredientes values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t\t\t$stmt->bindParam(1, $codventa);\n\t\t\t\t\t$stmt->bindParam(2, $codcliente);\n\t\t\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t\t\t$stmt->bindParam(4, $codingrediente);\n\t\t\t\t\t$stmt->bindParam(5, $movimientoing);\n\t\t\t\t\t$stmt->bindParam(6, $entradasing);\n\t\t\t\t\t$stmt->bindParam(7, $salidasing);\n\t\t\t\t\t$stmt->bindParam(8, $stockactualing);\n\t\t\t\t\t$stmt->bindParam(9, $preciouniting);\n\t\t\t\t\t$stmt->bindParam(10, $costototaling);\n\t\t\t\t\t$stmt->bindParam(11, $documentoing);\n\t\t\t\t\t$stmt->bindParam(12, $fechakardexing);\n\n\t\t\t\t\t$codcliente = strip_tags($_POST[\"cliente\"]);\n\t\t\t\t\t$codproducto = strip_tags($codproducto);\n\t\t\t\t\t$codingrediente = strip_tags($codingrediente);\n\t\t\t\t\t$movimientoing = strip_tags(\"SALIDAS\");\n\n\t\t\t\t\t$entradasing = strip_tags(\"0\");\n\t\t\t\t\t$salidasing = rount($cantracion*$cantidad,2);\n\t\t\t\t\t$stockactualing = rount($cantingrediente-$racion,2);\n\t\t\t\t\t$preciouniting = strip_tags($costoingrediente);\n\t\t\t\t\t$costototaling = strip_tags($costoingrediente * $cantidad);\n\n\t\t\t\t\t$documentoing = strip_tags(\"VENTA - FACTURA: \".$codventa);\n\t\t\t\t\t$fechakardexing = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t\t\t\t$stmt->execute();\n##################### REGISTRAMOS LOS DATOS DE INGREDIENTES EN KARDEX ###################\n\n\t\t }\n\n}\n############# FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS #############\t\n\n\t\t}\n\t}\n\n\t$sql4 = \"select * from ventas where codventa = ? \";\n\t$stmt = $this->dbh->prepare($sql4);\n\t$stmt->execute( array($_POST[\"codventa\"]) );\n\t$num = $stmt->rowCount();\n\n\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$paea[] = $row;\n\t\t}\n\t\t$subtotalivasive = $paea[0][\"subtotalivasive\"];\n\t\t$subtotalivanove = $paea[0][\"subtotalivanove\"];\n\t\t$iva = $paea[0][\"ivave\"]/100;\n\t\t$descuento = $paea[0][\"descuentove\"]/100;\n\t\t$totalivave = $paea[0][\"totalivave\"];\n\t\t$totaldescuentove = $paea[0][\"totaldescuentove\"];\n\n\n\t\t$sql3 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'SI'\";\n\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t$stmt->execute( array($_POST[\"codventa\"]));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$preciocompraiva = $p[0][\"preciocompra\"];\n\t\t$importeiva = $p[0][\"importe\"];\n\t\t$importe2iva = $p[0][\"importe2\"];\n\n\t\t$sql5 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'NO'\";\n\t\t$stmt = $this->dbh->prepare($sql5);\n\t\t$stmt->execute( array($_POST[\"codventa\"]));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $row;\n\t\t\t}\n\t\t\t$preciocompra = $row[\"preciocompra\"];\n\t\t\t$importe = $row[\"importe\"];\n\t\t\t$importe2 = $row[\"importe2\"];\t\t\n\n\t\t\t$sql = \" update ventas set \"\n\t\t\t.\" subtotalivasive = ?, \"\n\t\t\t.\" subtotalivanove = ?, \"\n\t\t\t.\" totalivave = ?, \"\n\t\t\t.\" totaldescuentove = ?, \"\n\t\t\t.\" totalpago= ?, \"\n\t\t\t.\" totalpago2= ?, \"\n\t\t\t.\" observaciones= ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codventa = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $subtotalivasive);\n\t\t\t$stmt->bindParam(2, $subtotalivanove);\n\t\t\t$stmt->bindParam(3, $totaliva);\n\t\t\t$stmt->bindParam(4, $totaldescuentove);\n\t\t\t$stmt->bindParam(5, $total);\n\t\t\t$stmt->bindParam(6, $total2);\n\t\t\t$stmt->bindParam(7, $observaciones);\n\t\t\t$stmt->bindParam(8, $codventa);\n\n\t\t\t$subtotalivasive= rount($importeiva,2);\n\t\t\t$subtotalivanove= rount($importe,2);\n\t\t\t$totaliva= rount($subtotalivasive*$iva,2);\n\t\t\t$tot= rount($subtotalivasive+$subtotalivanove+$totaliva,2);\n\t\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t\t$total= rount($tot-$totaldescuentove,2);\n\t\t\t$total2= rount($preciocompra,2);\nif (strip_tags(isset($_POST['observaciones']))) { $observaciones = strip_tags($_POST['observaciones']); } else { $observaciones =''; }\n\t\t\t$codventa = strip_tags($_POST[\"codventa\"]);\n\t\t\t$stmt->execute();\n\n###### AQUI DESTRUIMOS TODAS LAS VARIABLES DE SESSION QUE RECIBIMOS EN CARRITO DE VENTAS ######\n\t\t\tunset($_SESSION[\"CarritoVentas\"]);\n\n\necho \"<div class='alert alert-success'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<span class='fa fa-check-square-o'></span> LOS DETALLES FUERON AGREGADOS A LA \".$_POST[\"nombremesa\"].\", EXITOSAMENTE <a href='reportepdf?codventa=\".base64_encode($codventa).\"&tipo=\".base64_encode(\"TICKETCOMANDA\").\"' class='on-default' data-placement='left' data-toggle='tooltip' data-original-title='Imprimir Comanda' target='_black'><strong>IMPRIMIR COMANDA</strong></a>\";\necho \"</div>\";\n\necho \"<script>window.open('reportepdf?codventa=\".base64_encode($codventa).\"&tipo=\".base64_encode(\"TICKETCOMANDA\").\"', '_blank');</script>\";\nexit;\n\n\t\t}", "function mudar_posicao_arquivo($ordem, $evento_arquivo_id, $direcao, $evento_id=0){\r\n\t$sql = new BDConsulta;\r\n\tif($direcao && $evento_arquivo_id) {\r\n\t\t$novo_ui_ordem = $ordem;\r\n\t\t$sql->adTabela('evento_arquivos');\r\n\t\t$sql->adOnde('evento_arquivo_id != '.(int)$evento_arquivo_id);\r\n\t\t$sql->adOnde('evento_arquivo_evento_id = '.(int)$evento_id);\r\n\t\t$sql->adOrdem('evento_arquivo_ordem');\r\n\t\t$membros = $sql->Lista();\r\n\t\t$sql->limpar();\r\n\t\t\r\n\t\tif ($direcao == 'moverParaCima') {\r\n\t\t\t$outro_novo = $novo_ui_ordem;\r\n\t\t\t$novo_ui_ordem--;\r\n\t\t\t} \r\n\t\telseif ($direcao == 'moverParaBaixo') {\r\n\t\t\t$outro_novo = $novo_ui_ordem;\r\n\t\t\t$novo_ui_ordem++;\r\n\t\t\t} \r\n\t\telseif ($direcao == 'moverPrimeiro') {\r\n\t\t\t$outro_novo = $novo_ui_ordem;\r\n\t\t\t$novo_ui_ordem = 1;\r\n\t\t\t} \r\n\t\telseif ($direcao == 'moverUltimo') {\r\n\t\t\t$outro_novo = $novo_ui_ordem;\r\n\t\t\t$novo_ui_ordem = count($membros) + 1;\r\n\t\t\t}\r\n\t\tif ($novo_ui_ordem && ($novo_ui_ordem <= count($membros) + 1)) {\r\n\t\t\t$sql->adTabela('evento_arquivos');\r\n\t\t\t$sql->adAtualizar('evento_arquivo_ordem', $novo_ui_ordem);\r\n\t\t\t$sql->adOnde('evento_arquivo_id = '.(int)$evento_arquivo_id);\r\n\t\t\t$sql->exec();\r\n\t\t\t$sql->limpar();\r\n\t\t\t$idx = 1;\r\n\t\t\tforeach ($membros as $acao) {\r\n\t\t\t\tif ((int)$idx != (int)$novo_ui_ordem) {\r\n\t\t\t\t\t$sql->adTabela('evento_arquivos');\r\n\t\t\t\t\t$sql->adAtualizar('evento_arquivo_ordem', $idx);\r\n\t\t\t\t\t$sql->adOnde('evento_arquivo_id = '.(int)$acao['evento_arquivo_id']);\r\n\t\t\t\t\t$sql->exec();\r\n\t\t\t\t\t$sql->limpar();\r\n\t\t\t\t\t$idx++;\r\n\t\t\t\t\t} \r\n\t\t\t\telse {\r\n\t\t\t\t\t$sql->adTabela('evento_arquivos');\r\n\t\t\t\t\t$sql->adAtualizar('evento_arquivo_ordem', $idx + 1);\r\n\t\t\t\t\t$sql->adOnde('evento_arquivo_id = '.(int)$acao['evento_arquivo_id']);\r\n\t\t\t\t\t$sql->exec();\r\n\t\t\t\t\t$sql->limpar();\r\n\t\t\t\t\t$idx = $idx + 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t$saida=atualizar_arquivo($evento_id);\r\n\t$objResposta = new xajaxResponse();\r\n\t$objResposta->assign(\"combo_arquivo\",\"innerHTML\", utf8_encode($saida));\r\n\treturn $objResposta;\r\n\t}", "public function recorrerArchivoTXT(){\n $array = [];\n\n for ($row = $this->filaDesde; $row <= $this->filaHasta; ++ $row) {\n $item = new ExtractoBancarioItemVO();\n $registro = $this->FILE[$row];\n if($this->idTipoBanco['valor'] == 5){\n //pongo como separador la coma.\n $registro = preg_replace('/ +/', \",\", $registro);\n }\n\n $registro = explode (\",\" , $registro);\n\n if($this->idTipoBanco['valor'] == 5){\n //la posición 4 del vector es un error al hacer el parseo, no hay que considerarlo.\n //arreglo los valores del array para sacar un caracter inválido que viene del archivo.\n $invalido = $registro[1][0].$registro[1][1]; //en esta posición encuentro el caracter inválido.\n foreach ($registro as &$valor){\n $valor = str_replace($invalido, \"\", $valor);\n $valor = trim ($valor);\n }\n }\n\n for ($col = $this->columnaDesde; $col < $this->columnaHasta; ++ $col) {\n //si la columna leída nos interesa continúo.\n if(in_array($col, $this->columnas)){\n $val = $registro[$col];\n array_push($array, trim($val));\n }\n }\n\n $item->asignarValores($array, $this->idTipoBanco['valor']); //asigno los valores al objeto.\n $this->mensaje['valor'] .= $item->idTipoBancoConcepto['referencia']->result->getMessage();\n //si el status no es OK, incremento el contador de erróneos.\n if($item->idTipoBancoConcepto['referencia']->result->getStatus() != STATUS_OK)\n $this->cantidadRegistrosError['valor']++;\n $this->extractoBancarioItemArray[] = $item; //agrego el registro al array.\n\n $array = [];\n $this->cantidadRegistros['valor']++;\n }\n }", "function insertAtenciones(){\n\n\t$id_item=2; // proyecto : LEVEL\n\t$id_status=3;\n\t$id_nivel=1;\n\t$id_usuario=146; //larry portanova\n\t$id_user=203; //larry portanova\n\n\n\t//leer archivo\n\t$buffer=implode('',file('atenciones2/level.csv'));\n\n\t//parsear csv\n\t$atenciones=[];\n\n\t$lineas=explode(\"\\n\",$buffer);\n\n\t$campos=explode(\",\",$lineas[0]);\n\n\tforeach($lineas as $i => $linea){\n\n\t\tif($i==0) continue;\n\n\t\t$columnas=str_getcsv($linea);\n\n\t\tforeach($columnas as $j => $columna){\n\n\t\t\t$atenciones[$i][strtolower(trim($campos[$j]))]=$columna;\n\t\t}\n\n\t}\n\n\t// prin($atenciones);\n\n\t//inserts\n\n\t$fechaMonth=[\n\t'Ene'=>'01','Feb'=>'02','Mar'=>'03','Apr'=>'04','May'=>'05','Jun'=>'06','Jul'=>'07','Aug'=>'08','Set'=>'09','Oct'=>'10','Nov'=>'11','Dic'=>'12',\n\t'01'=>'01','02'=>'02','03'=>'03','04'=>'04','05'=>'05','06'=>'06','07'=>'07','08'=>'08','09'=>'09','10'=>'10','11'=>'11','12'=>'12',\n\t];\n\n\n\n\tforeach($atenciones as $i => &$atencion){\n\n\t\tif(trim($atencion['nombre'])=='') continue;\n\n\t\t//eliminamos vacio\n\t\tunset($atencion['']);\n\n\t\t//nombre completo\n\t\t$atencion['nombre_completo']=$atencion['nombre'];\n\n\t\t//nombre y apellidos\n\t\t$nom_partes=explode(\" \",$atencion['nombre']);\n\t\t$atencion['nombre']=$nom_partes[0];\n\t\tunset($nom_partes[0]);\n\t\t$atencion['apellidos']=trim(implode(\" \",$nom_partes));\n\n\t\t//fecha\n\t\t$atencion['fecha_original']=$atencion['fecha'];\n\t\t$fecha_partes=explode(\"-\",$atencion['fecha']);\n\t\t$atencion['fecha']=\"2015-\".$fechaMonth[$fecha_partes[1]].\"-\".str_pad($fecha_partes[0], 2, \"0\", STR_PAD_LEFT).\" 14:00:00\";\n\n\t\t$atencion['seguimiento']='Primer contacto';\n\t\t// prin($atencion['fecha']);\n\n\t\t// prin($atencion);\n\n\t\t// continue;\n\n\t\t//\n\t\t//cliente\n\t\t$clienteId=getIdOrCreate(\n\t\t\t\"clientes\",\n\t\t\t[\n\t\t\t\t\"nombre\" =>$atencion['nombre'],\n\t\t\t\t\"apellidos\" =>$atencion['apellidos'],\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"celular_claro\" =>$atencion['tel. cel.'],\n\t\t\t\t\"email\" =>$atencion['email'],\n\t\t\t\t\"telefono\" =>$atencion['fijo'],\n\n\t\t\t\t\"id_usuario\" =>$id_usuario,//\n\t\t\t\t\"user\" \t\t =>$id_user,//\n\n\t\t\t\t// \"tipo_cliente\" =>rand(1, 2),\n\t\t\t\t// \"genero\" \t\t=>rand(1, 2),\n\t\t\t\t// \"genero\" \t\t=>rand(1, 2),\n\t\t\t\t// \"email\" \t\t=>\"[email protected]\",\n\t\t\t]\n\t\t\t);\n\n\n\t\t//\t$pedido='[{\"type\":\"departamento\",\"price\":\"621000\",\"id\":\"12\"}]';\n\t\t//departamento\n\t\t$item_item=select_fila(\"id,pvlista\",\"productos_items_items\",\"where numero=\".$atencion['departamento'].\" and id_item=\".$id_item);\n\n\t\t// $pedido='[{\"type\":\"departamento\",\"price\":\"'.$item_item['pvlista'].'\",\"id\":\"'.$item_item['id'].'\"}]';\n\n\t\t// $pedido='[{\"type\":\"departamento\",\"price\":\"'.$item_item['pvlista'].'\",\"id\":\"'.$item_item['id'].'\",\"name\":\"1 departamento'.$atencion['departamento'].'\",\"num\":\"'.$atencion['departamento'].'\",\"torre\":\"1\"}]';\n\n\t\t$canalId=getIdOrCreate(\n\t\t\t\"contacto_canales\",\n\t\t\t[\n\t\t\t\"nombre\" =>$atencion['medio'],\n\t\t\t]\n\t\t\t);\n\n\n\t\t// prin($atencion);\n\t\t//atencion\n\t\t$venta=insert(\n\t\t\t[\n\t\t\t\"fecha_creacion\" =>$atencion['fecha'],//\n\t\t\t\"fecha_creacion2\"=>$atencion['fecha'],//\n\t\t\t\"visibilidad\" =>'1',\n\t\t\t\"id_cliente\" =>$clienteId,\n\t\t\t\"id_status\" =>$id_status,//\n\t\t\t\"id_nivel\" =>$id_nivel,//\n\t\t\t\"id_canal\" =>$canalId,\n\t\t\t\"id_item\" =>$id_item,//\n\t\t\t\"id_usuario\" =>$id_usuario,//\n\t\t\t\"user\" \t\t =>$id_user,//\n\t\t\t\n\t\t\t// \"pedido\" =>$pedido,//\n\t\t\t// \"pvlista\" =>$item_item['pvlista'],//\n\t\t\t// \"pvpromocion\" =>$item_item['pvlista'],//\n\n\t\t\t// \"id_item_item\" =>$item_item['id'],//\n\n\t\t\t]\n\t\t\t,\"ventas_items\"\n\t\t\t);\n\n\t\tif(trim($atencion['seguimiento'])!='')\n\t\tinsert(\n\t\t\t[\n\t\t\t'fecha_creacion' =>$atencion['fecha'],\n\t\t\t// \"id_item\" =>$id_item,//\n\t\t\t'id_grupo' =>$venta['id'],\n\t\t\t// \"id_cliente\" =>$clienteId,\n\t\t\t'texto' =>$atencion['seguimiento'],\n\t\t\t]\n\t\t\t,'ventas_mensajes'\n\t\t\t,1\n\t\t\t);\n\n\t}\n\n\t// exit();\n\n\tprin(\"Inserciones DONE\");\n\n\t// prin($atenciones);\n\n\t// prin($celdas);\n\n\n\t// $matriz = str_getcsv($buffer,',','\"','\\\\',\"\\n\");\n\n\t// $matriz = str_getcsv($buffer); \n\n\t// prin($matriz);\n\n}", "public function insertarContenedores(){\n\t\t\t#try{\n\t\t\t\n\t\t\t\t$PDOmysql = consulta();\n\t\t\t\t$PDOmysql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n\t\t\t\t#Itera entre el array Contenedores, para insertarlo uno por uno.\n\t\t\t\tforeach ($this->contenedores as $contenedor) {\n\t\t\t\t\n\t\t\t\t\t#Se comprueba si el contenedor esta en la base de datos.\n\t\t\t\t\t$sql = 'select idContenedor from Contenedor where idContenedor = :contenedor';\n\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id());\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\t#La variable respuesta comprueba si existe o no el contendor.\n\t\t\t\t\t$respuesta = $stmt->rowCount() ? true : false;\n\t\t\t\t\t#Si respuesta es que no existe el contenedor aun en la base de datos.\n\t\t\t\t\tif(! $respuesta){\n\t\t\t\t\t\t#Inserta el contenedor.\n\t\t\t\t\t\t$sql = 'insert into Contenedor(idContenedor,Tipo) values(:contenedor, :tipo);';\n\t\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id()); #get_id() y get_tipo()\n\t\t\t\t\t\t$stmt->bindParam(':tipo', $contenedor->get_tipo());\t\t#son metodos de la clase contenedor.\n\t\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t}\n\n\t\t\t\t\t$sql = 'SELECT Flete_idFlete, Contenedor \n\t\t\t\t\t\t\tfrom Contenedor_Viaje \n\t\t\t\t\t\t\twhere \n\t\t\t\t\t\t\tFlete_idFlete = :flete\n\t\t\t\t\t\t\tand\n\t\t\t\t\t\t\tContenedor = :contenedor';\n\n\n\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id());\n\t\t\t\t\t$stmt->bindParam(':flete', $this->flete);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\t#La variable respuesta comprueba si existe o no el contendor.\n\t\t\t\t\t$respuesta = $stmt->rowCount() ? true : false;\n\n\t\t\t\t\tif(! $respuesta){\n\t\t\t\t\t\t#Incicializa el viaje para el flete, asignando contenedores al flete.\n\t\t\t\t\t\t$sql = 'insert into Contenedor_Viaje(WorkOrder,Booking,Flete_idFlete, Contenedor) values(:workorder, :booking, :flete, :contenedor);';\n\t\t\t\t\t\t$stmt = $PDOmysql->prepare($sql);\n\t\t\t\t\t\t$stmt->bindParam(':workorder', $contenedor->get_workorder());\n\t\t\t\t\t\t$stmt->bindParam(':booking', $contenedor->get_booking());\n\t\t\t\t\t\t$stmt->bindParam(':flete', $contenedor->get_flete());\n\t\t\t\t\t\t$stmt->bindParam(':contenedor', $contenedor->get_id());\n\t\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t\t\t\t//Cada contenedor tiene un objeto ListaSellos.\n\t\t\t\t\t\t\t\t#Se manda a llamar al objeto, y este llama a su metodo insertar, para\n\t\t\t\t\t\t\t\t#añadir los sellos a la base de datos.\n\t\t\t\t\t\t\t\t#Esto se puede ya que cada contenedor conoce el flete al que pertenece.\n\t\t\t\t\t}\n\n\t\t\t\t\telse{\n\t\t\t\t\t\t$update = new Update;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$camposUpdate = array(\"statusA\" => 'Activo');\n\t\t\t\t\t\t$camposWhereUpdate = array(\"Flete_idFlete\" => $this->flete, \"Contenedor\" => $contenedor );\n\n\t\t\t\t\t\t$update->prepareUpdate(\"Contenedor_Viaje\", $camposUpdate, $camposWhereUpdate);\n\t\t\t\t\t\t$update->createUpdate();\n\t\t\t\t\t}\n\n\t\t\t\t\t$listaSellos = $contenedor->get_sellos();\n\t\t\t\t\tif($listaSellos){\n\t\t\t\t\t\t$listaSellos->insertar_sellos();\n\t\t\t\t\t}\t\t\n\n\t\t\t\t}\n\t\t\t#}catch(Exception $e){\n\n\t\t\t#}\n\n\t\t}", "function gerar(){\r\n\t\tif(strlen($this->estabelecimento->getdircontabil()) == 0){\r\n\t\t\t$_SESSION[\"ERROR\"] = \"Informe o diret&oacute;rio de integra&ccedil;&atilde;o cont&aacute;bil para o estabelecimento.<br><a onclick=\\\"$.messageBox('close'); openProgram('Estabel','codestabelec=\".$this->estabelecimento->getcodestabelec().\"')\\\">Clique aqui</a> para abrir o cadastro de estabelecimento.\";\r\n\t\t\techo messagebox(\"error\", \"\", $_SESSION[\"ERROR\"]);\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\tif($this->gerar_financeiro){\r\n\t\t\t$query = \"SELECT codlancto, data, debito, credito, LPAD(valorliquido::text,17,'0') AS valorliquido, historicopadrao, complemento, ccdb, cccr, pagrec FROM \";\r\n\r\n\t\t\t$query .= \"( \";\r\n\t\t\t$query .= \"SELECT lancamento.codlancto, lpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"contaparceiro.contacontabil as debito, contabanco.contacontabil AS credito, \";\r\n\t\t\t$query .= \"lancamento.valorparcela AS valorliquido, historicopadrao.descricao AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, '' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR , lancamento.pagrec \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contaparceiro on (v_parceiro.codconta = contaparceiro.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao ON (contaparceiro.codhistorico = historicopadrao.codhistorico) \";\r\n\t\t\t$query .= \"WHERE EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' AND (SUBSTR(lancamento.serie,1,3) != 'TRF' OR lancamento.serie is null) \";\r\n\r\n\t\t\t$query .= \"union all \";\r\n\r\n\t\t\t$query .= \"SELECT codlancto AS codlancto, \tlpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"(SELECT contacontabil FROM planocontas WHERE codconta=(SELECT codconta FROM banco WHERE codbanco=(SELECT codbanco FROM lancamento AS lanc_aux WHERE lanc_aux.dtliquid=lancamento.dtliquid AND serie='TRF' AND lanc_aux.horalog=lancamento.horalog AND pagrec='R' limit 1))) AS debito, \";\r\n\t\t\t$query .= \"(CASE WHEN pagrec='P' THEN contabanco.contacontabil END) AS credito, \";\r\n\t\t\t$query .= \"lancamento.valorparcela AS valorliquido, \";\r\n\t\t\t$query .= \"historicopadrao.descricao AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, \";\r\n\t\t\t$query .= \"'' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR, \";\r\n\t\t\t$query .= \"'T' AS pagrec \";\r\n\t\t\t$query .= \"FROM lancamento INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contaparceiro on (v_parceiro.codconta = contaparceiro.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao ON (contaparceiro.codhistorico = historicopadrao.codhistorico) \";\r\n\t\t\t$query .= \"WHERE SUBSTR(lancamento.serie,1,3)='TRF' AND lancamento.pagrec = 'P' \";\r\n\t\t\t$query .= \" AND EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' \";\r\n\t\t\t$query .= \"GROUP BY 1,2,3,4,5,6,7,8 \";\r\n\r\n\t\t\t$query .= \"union all \";\r\n\r\n\t\t\t$query .= \"SELECT lancamento.codlancto, lpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"CASE WHEN lancamento.pagrec = 'P' THEN conta_p.contacontabil ELSE conta_r.contacontabil END as debito, contabanco.contacontabil AS credito, \";\r\n\t\t\t$query .= \"lancamento.valorjuros AS valorliquido, CASE WHEN lancamento.pagrec = 'P' THEN h_p.descricao ELSE h_r.descricao END AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, '' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR , lancamento.pagrec \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN paramplanodecontas ON (paramplanodecontas.codestabelec = lancamento.codestabelec) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_p on (paramplanodecontas.codconta_valorjuros_pag = conta_p.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_r on (paramplanodecontas.codconta_valorjuros_rec = conta_r.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_p ON (conta_p.codhistorico = h_p.codhistorico) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_r ON (conta_r.codhistorico = h_r.codhistorico) \";\r\n\t\t\t$query .= \"WHERE EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} AND lancamento.valorjuros > 0 \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' \";\r\n\r\n\t\t\t$query .= \"union all \";\r\n\r\n\t\t\t$query .= \"SELECT lancamento.codlancto, lpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"CASE WHEN lancamento.pagrec = 'P' THEN conta_p.contacontabil ELSE conta_r.contacontabil END as debito, contabanco.contacontabil AS credito, \";\r\n\t\t\t$query .= \"lancamento.valordescto AS valorliquido, CASE WHEN lancamento.pagrec = 'P' THEN h_p.descricao ELSE h_r.descricao END AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, '' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR , lancamento.pagrec \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN paramplanodecontas ON (paramplanodecontas.codestabelec = lancamento.codestabelec) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_p on (paramplanodecontas.codconta_valordescto_pag = conta_p.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_r on (paramplanodecontas.codconta_valordescto_rec = conta_r.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_p ON (conta_p.codhistorico = h_p.codhistorico) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_r ON (conta_r.codhistorico = h_r.codhistorico) \";\r\n\t\t\t$query .= \"WHERE EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} AND lancamento.valordescto > 0 \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' \";\r\n\r\n\t\t\t$query .= \"union all \";\r\n\r\n\t\t\t$query .= \"SELECT lancamento.codlancto, lpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"CASE WHEN lancamento.pagrec = 'P' THEN conta_p.contacontabil ELSE conta_r.contacontabil END as debito, contabanco.contacontabil AS credito, \";\r\n\t\t\t$query .= \"lancamento.valoracresc AS valorliquido, CASE WHEN lancamento.pagrec = 'P' THEN h_p.descricao ELSE h_r.descricao END AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, '' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR , lancamento.pagrec \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN paramplanodecontas ON (paramplanodecontas.codestabelec = lancamento.codestabelec) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_p on (paramplanodecontas.codconta_valordescto_pag = conta_p.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_r on (paramplanodecontas.codconta_valordescto_rec = conta_r.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_p ON (conta_p.codhistorico = h_p.codhistorico) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_r ON (conta_r.codhistorico = h_r.codhistorico) \";\r\n\t\t\t$query .= \"WHERE EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} AND lancamento.valoracresc > 0 \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' \";\r\n\t\t\t$query .= \")AS tmp ORDER BY tmp.data, tmp.complemento, tmp.historicopadrao ASC \";\r\n\r\n\t\t\t$res = $this->con->query($query);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\r\n\t\t\t$arr_linha_contimatic = array();\r\n\t\t\t$cont = 1;\r\n\t\t\tforeach($arr as $row){\r\n\r\n\t\t\t\t$linha = $this->valor_numerico($cont, 0, 7); //\r\n\t\t\t\t$linha .= $this->valor_texto($row[\"data\"], 5); //\r\n\r\n\t\t\t\tif($row[\"pagrec\"] == \"R\"){\r\n\t\t\t\t\t$linha .= $this->valor_numerico($row[\"credito\"], 0, 7);\r\n\t\t\t\t\t$linha .= $this->valor_numerico($row[\"debito\"], 0, 7);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$linha .= $this->valor_numerico($row[\"debito\"], 0, 7);\r\n\t\t\t\t\t$linha .= $this->valor_numerico($row[\"credito\"], 0, 7);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$linha .= $row[\"valorliquido\"]; //\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"historicopadrao\"],0,5);\r\n\t\t\t\t$linha .= $this->valor_texto(removespecial($row[\"complemento\"].\" Chave:\".$row[\"codlancto\"]), 200); //\r\n\t\t\t\tif($row[\"pagrec\"] == \"R\"){\r\n\t\t\t\t\t$linha .= $this->valor_texto($row[\"cccr\"], 42);\r\n\t\t\t\t\t$linha .= $this->valor_texto($row[\"ccdb\"], 42);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$linha .= $this->valor_texto($row[\"ccdb\"], 42);\r\n\t\t\t\t\t$linha .= $this->valor_texto($row[\"cccr\"], 42);\r\n\t\t\t\t}\r\n\t\t\t\t$cont++;\r\n\t\t\t\t$arr_linha_contimatic[] = $linha;\r\n\t\t\t}\r\n\r\n\t\t\tif(strlen($this->apelidocontimatic) > 0){\r\n\t\t\t\t$nomearq = $this->estabelecimento->getdircontabil().$this->apelidocontimatic.\".\".\"M\".substr($this->ano,-2);\r\n\t\t\t}else{\r\n\t\t\t\t$nomearq = $this->estabelecimento->getdircontabil().$this->estabelecimento->getnome().\"_financeiro_\".$this->mes.\".txt\";\r\n\t\t\t}\r\n\t\t\t$arquivo = fopen($nomearq, \"w\");\r\n\t\t\tforeach($arr_linha_contimatic as $linha){\r\n\t\t\t\tfwrite($arquivo, $linha.\"\\r\\n\");\r\n\t\t\t}\r\n\t\t\tfclose($arquivo);\r\n\t\t\techo messagebox(\"success\", \"\", \"Arquivo gerado com sucesso!\");\r\n\t\t\techo download($nomearq);\r\n\t\t}\r\n\r\n\t\t// Gera o planod e contas\r\n\t\tif($this->gerar_planodecontas){\r\n\t\t\t//******************************************************************\r\n\t\t\t//\t\t\t\t\t\tRegistro Plano de Contas\r\n\t\t\t//******************************************************************\r\n\t\t\t$where = array();\r\n\t\t\t$this->setprevreal(\"R\");\r\n\t\t\t$this->setstatus(\"L\");\r\n\r\n\t\t\t$query = \"SELECT lancamento.codlancto, lancamento.dtlancto, lancamento.valorliquido, \";\r\n\t\t\t$query .= \"(SELECT numconta FROM planocontas WHERE lancamento.codcontadeb = codconta AND tpconta IN ('D','A')) AS numcontadeb, \";\r\n\t\t\t$query .= \"(SELECT numconta FROM planocontas WHERE lancamento.codcontacred = codconta AND tpconta IN ('C','A')) AS numcontacred, \";\r\n\t\t\t$query .= \"lancamento.numnotafis, lancamento.serie, v_parceiro.nome as parceiro \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\tif(strlen($this->ano) > 0){\r\n\t\t\t\t$where[] = \"EXTRACT(YEAR FROM dtliquid) = '{$this->ano}'\";\r\n\t\t\t}\r\n\t\t\tif(strlen($this->mes) > 0){\r\n\t\t\t\t$where[] = \"EXTRACT(MONTH FROM dtliquid) ='\".$this->mes.\"'\";\r\n\t\t\t}\r\n\t\t\tif(strlen($this->codestabelec) > 0){\r\n\t\t\t\t$where[] = \"codestabelec = \".$this->codestabelec;\r\n\t\t\t}\r\n\t\t\tif(strlen($this->prevreal) > 0){\r\n\t\t\t\t$where[] = \"prevreal = '\".$this->prevreal.\"'\";\r\n\t\t\t}\r\n\t\t\tif(strlen($this->status) > 0){\r\n\t\t\t\t$where[] = \"status = '\".$this->status.\"'\";\r\n\t\t\t}\r\n\t\t\tif(sizeof($where) > 0){\r\n\t\t\t\t$query .= \"WHERE (lancamento.codcontacred > 0 OR lancamento.codcontadeb > 0) AND \".implode(\" AND \", $where).\" \";\r\n\t\t\t}\r\n\t\t\techo $query;\r\n\t\t\t$arr_linha_contimatic = array();\r\n\t\t\t$res = $this->con->query($query);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\r\n\t\t\tif(count($arr) == 0){\r\n\t\t\t\tdie(messagebox(\"error\", \"\", \"Nenhum lancamento encontrado.\"));\r\n\t\t\t}\r\n\r\n\t\t\tforeach($arr as $row){\r\n\t\t\t\t$linha = $this->valor_numerico($row[\"codlancto\"], 0, 7); // Codigo do lancamento\r\n\t\t\t\t$linha .= $this->valor_data_planodecontas($row[\"dtlancto\"]); // Data do lancamento\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"numcontadeb\"], 0, 7); // Codigo reduzido da conta a ser debitada\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"numcontacred\"], 0, 7); // Codigo reduzido da conta a ser creditada\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"valorliquido\"], 2, 17); // Valor\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"codcontacred\"], 0, 5); // Historico padrao\r\n\t\t\t\t$linha .= $this->valor_texto(\"{$row[\"numnotafis\"]} {$row[\"serie\"]} - {$row[\"parceiro\"]}\", 200); // Complemento\r\n\t\t\t\t$arr_linha_contimatic[] = $linha;\r\n\t\t\t}\r\n\r\n\t\t\t$nomearq = $this->estabelecimento->getdircontabil().$this->estabelecimento->getnome().$this->mes.\".txt\";\r\n\t\t\t$arquivo = fopen($nomearq, \"w\");\r\n\t\t\tforeach($arr_linha_contimatic as $linha){\r\n\t\t\t\tfwrite($arquivo, $linha.\"\\r\\n\");\r\n\t\t\t}\r\n\t\t\tfclose($arquivo);\r\n\t\t\techo download($nomearq);\r\n\t\t\t//******************************************************************\r\n\t\t}\r\n\r\n\t\t// Busca os mapas resumo\r\n\t\t$this->arr_maparesumo = array();\r\n\t\tif($this->gerar_cupomfiscal){\r\n\t\t\tsetprogress(0, \"Carregando mapas resumo\", TRUE);\r\n\t\t\t$res = $this->con->query(\"SELECT codmaparesumo FROM maparesumo WHERE codestabelec = \".$this->estabelecimento->getcodestabelec().\" AND EXTRACT(YEAR FROM dtmovto) = \".$this->ano.\" AND EXTRACT(MONTH FROM dtmovto) = \".$this->mes.\" ORDER BY dtmovto, caixa\");\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\t\t\t$arr_codmaparesumo = array();\r\n\t\t\tforeach($arr as $i => $row){\r\n\t\t\t\t$arr_codmaparesumo[] = $row[\"codmaparesumo\"];\r\n\t\t\t}\r\n\t\t\t$this->arr_maparesumo = object_array_key(objectbytable(\"maparesumo\", NULL, $this->con), $arr_codmaparesumo);\r\n\t\t}\r\n\r\n\t\t// Busca os impostos dos mapas resumo\r\n\t\t$this->arr_maparesumoimposto = array();\r\n\t\t$i = 1;\r\n\t\t$n = sizeof($this->arr_maparesumo);\r\n\t\tforeach($this->arr_maparesumo as $maparesumo){\r\n\t\t\tsetprogress(($i / $n * 100), \"Carregando impostos dos mapas resumo: \".$i.\" de \".$n);\r\n\t\t\t$query = \"SELECT tptribicms, aliqicms, SUM(totalliquido) AS totalliquido, SUM(totalicms) AS totalicms \";\r\n\t\t\t$query .= \"FROM maparesumoimposto \";\r\n\t\t\t$query .= \"WHERE codmaparesumo = \".$maparesumo->getcodmaparesumo().\" \";\r\n\t\t\t$query .= \"\tAND totalliquido > 0 \";\r\n\t\t\t$query .= \"GROUP BY tptribicms, aliqicms \";\r\n\t\t\t$query .= \"ORDER BY tptribicms, aliqicms \";\r\n\t\t\t$res = $this->con->query($query);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\t\t\tforeach($arr as $row){\r\n\t\t\t\t$maparesumoimposto = objectbytable(\"maparesumoimposto\", NULL, $this->con);\r\n\t\t\t\t$maparesumoimposto->setcodmaparesumo($maparesumo->getcodmaparesumo());\r\n\t\t\t\t$maparesumoimposto->settptribicms($row[\"tptribicms\"]);\r\n\t\t\t\t$maparesumoimposto->setaliqicms($row[\"aliqicms\"]);\r\n\t\t\t\t$maparesumoimposto->settotalliquido($row[\"totalliquido\"]);\r\n\t\t\t\t$maparesumoimposto->settotalicms($row[\"totalicms\"]);\r\n\t\t\t\t$this->arr_maparesumoimposto[$maparesumo->getcodmaparesumo()][] = $maparesumoimposto;\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\r\n\t\t// Busca operacoes de nota fiscal\r\n\t\t$this->arr_operacaonota = array();\r\n\t\tsetprogress(0, \"Buscando operacoes de nota fiscal\", TRUE);\r\n\t\t$operacaonota = objectbytable(\"operacaonota\", NULL, $this->con);\r\n\t\t$arr_operacaonota = object_array($operacaonota);\r\n\t\tforeach($arr_operacaonota as $operacaonota){\r\n\t\t\t$this->arr_operacaonota[$operacaonota->getoperacao()] = $operacaonota;\r\n\t\t}\r\n\r\n\t\t// Busca as notas fiscais\r\n\t\t$this->arr_notafiscal = array();\r\n\t\tif($this->gerar_notafiscal){\r\n\t\t\tsetprogress(0, \"Carregando notas fiscais\", TRUE);\r\n\t\t\t$res = $this->con->query(\"SELECT idnotafiscal FROM notafiscal WHERE codestabelec = \".$this->estabelecimento->getcodestabelec().\" AND EXTRACT(YEAR FROM dtentrega) = \".$this->ano.\" AND EXTRACT(MONTH FROM dtentrega) = \".$this->mes);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\t\t\t$arr_idnotafiscal = array();\r\n\t\t\tforeach($arr as $i => $row){\r\n\t\t\t\t$arr_idnotafiscal[] = $row[\"idnotafiscal\"];\r\n\t\t\t}\r\n\t\t\t$this->arr_notafiscal = object_array_key(objectbytable(\"notafiscal\", NULL, $this->con), $arr_idnotafiscal);\r\n\t\t}\r\n\r\n\t\t// Busca os impostos das notas fiscais\r\n\t\t$this->arr_notafiscalimposto = array();\r\n\t\t$i = 1;\r\n\t\t$n = sizeof($this->arr_notafiscal);\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\tsetprogress(($i / $n * 100), \"Carregando impostos das notas fiscais: \".$i.\" de \".$n);\r\n\t\t\t$this->arr_notafiscalimposto[$notafiscal->getidnotafiscal()] = array();\r\n\t\t\t$query = \"SELECT idnotafiscal, aliquota, SUM(base) AS base, SUM(valorimposto) AS valorimposto, SUM(reducao) AS reducao, SUM(isento) AS isento \";\r\n\t\t\t$query .= \"FROM notafiscalimposto \";\r\n\t\t\t$query .= \"WHERE idnotafiscal = \".$notafiscal->getidnotafiscal().\" \";\r\n\t\t\t$query .= \"\tAND tipoimposto LIKE 'ICMS%' \";\r\n\t\t\t$query .= \"\tAND tipoimposto != 'ICMS_F' \";\r\n\t\t\t$query .= \"GROUP BY idnotafiscal, aliquota \";\r\n\t\t\t$query .= \"ORDER BY aliquota \";\r\n\t\t\t$res = $this->con->query($query);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\t\t\tforeach($arr as $row){\r\n\t\t\t\t$notafiscalimposto = objectbytable(\"notafiscalimposto\", NULL, $this->con);\r\n\t\t\t\t$notafiscalimposto->setidnotafiscal($notafiscal->getidnotafiscal());\r\n\t\t\t\t$notafiscalimposto->settipoimposto(\"ICMS\");\r\n\t\t\t\t$notafiscalimposto->setaliquota($row[\"imposto\"]);\r\n\t\t\t\t$notafiscalimposto->setbase($row[\"base\"]);\r\n\t\t\t\t$notafiscalimposto->setvalorimposto($row[\"valorimposto\"]);\r\n\t\t\t\t$notafiscalimposto->setreducao($row[\"reducao\"]);\r\n\t\t\t\t$notafiscalimposto->setisento($row[\"isento\"]);\r\n\t\t\t\t$this->arr_notafiscalimposto[$notafiscal->getidnotafiscal()][] = $notafiscalimposto;\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\t\t// Busca os cliente\r\n\t\t$this->arr_cliente = array();\r\n\t\tsetprogress(0, \"Buscando clientes\", TRUE);\r\n\t\t$arr_codcliente = array();\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\t$operacaonota = $this->arr_operacaonota[$notafiscal->getoperacao()];\r\n\t\t\tif($operacaonota->getparceiro() == \"C\"){\r\n\t\t\t\t$arr_codcliente[] = $notafiscal->getcodparceiro();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$arr_codcliente = array_merge(array_unique($arr_codcliente));\r\n\t\tforeach($arr_codcliente as $i => $codcliente){\r\n\t\t\tsetprogress((($i + 1) / sizeof($arr_codcliente) * 100), \"Carregando clientes: \".($i + 1).\" de \".sizeof($arr_codcliente));\r\n\t\t\t$this->arr_cliente[$codcliente] = objectbytable(\"cliente\", $codcliente, $this->con);\r\n\t\t}\r\n\r\n\t\t// Busca os estabelecimentos\r\n\t\t$this->arr_estabelecimento = array();\r\n\t\tsetprogress(0, \"Buscando estabelecimentos\", TRUE);\r\n\t\t$arr_codestabelec = array();\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\t$operacaonota = $this->arr_operacaonota[$notafiscal->getoperacao()];\r\n\t\t\tif($operacaonota->getparceiro() == \"E\"){\r\n\t\t\t\t$arr_codestabelec[] = $notafiscal->getcodparceiro();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$arr_codestabelec = array_merge(array_unique($arr_codestabelec));\r\n\t\tforeach($arr_codestabelec as $i => $codestabelec){\r\n\t\t\tsetprogress((($i + 1) / sizeof($arr_codestabelec) * 100), \"Carregando estabelecimentos: \".($i + 1).\" de \".sizeof($arr_codestabelec));\r\n\t\t\t$this->arr_estabelecimento[$codestabelec] = objectbytable(\"estabelecimento\", $codestabelec, $this->con);\r\n\t\t}\r\n\r\n\t\t// Busca os fornecedores\r\n\t\t$this->arr_fornecedor = array();\r\n\t\tsetprogress(0, \"Buscando fornecedores\", TRUE);\r\n\t\t$arr_codfornec = array();\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\t$operacaonota = $this->arr_operacaonota[$notafiscal->getoperacao()];\r\n\t\t\tif($operacaonota->getparceiro() == \"F\"){\r\n\t\t\t\t$arr_codfornec[] = $notafiscal->getcodparceiro();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$arr_codfornec = array_merge(array_unique($arr_codfornec));\r\n\t\tforeach($arr_codfornec as $i => $codfornec){\r\n\t\t\tsetprogress((($i + 1) / sizeof($arr_codfornec) * 100), \"Carregando fornecedores: \".($i + 1).\" de \".sizeof($arr_codfornec));\r\n\t\t\t$this->arr_fornecedor[$codfornec] = objectbytable(\"fornecedor\", $codfornec, $this->con);\r\n\t\t}\r\n\r\n\t\t// Busca as cidades\r\n\t\t$this->arr_cidade = array();\r\n\t\tsetprogress(0, \"Buscando cidades\", TRUE);\r\n\t\t$arr_codcidade = array();\r\n\t\t$arr_codcidade[] = $this->estabelecimento->getcodcidade();\r\n\t\tforeach($this->arr_cliente as $cliente){\r\n\t\t\t$arr_codcidade[] = $cliente->getcodcidaderes();\r\n\t\t}\r\n\t\tforeach($this->arr_estabelecimento as $estabelecimento){\r\n\t\t\t$arr_codcidade[] = $estabelecimento->getcodcidade();\r\n\t\t}\r\n\t\tforeach($this->arr_fornecedor as $fornecedor){\r\n\t\t\t$arr_codcidade[] = $fornecedor->getcodcidade();\r\n\t\t}\r\n\t\t$arr_codcidade = array_merge(array_unique($arr_codcidade));\r\n\t\tforeach($arr_codcidade as $i => $codcidade){\r\n\t\t\tsetprogress((($i + 1) / sizeof($arr_codcidade) * 100), \"Carregando cidades: \".($i + 1).\" de \".sizeof($arr_codcidade));\r\n\t\t\t$this->arr_cidade[$codcidade] = objectbytable(\"cidade\", $codcidade, $this->con);\r\n\t\t}\r\n\r\n\t\tsetprogress(0, \"Gerando arquivo\", TRUE);\r\n\t\t$arr_registro = array();\r\n\t\tforeach($this->arr_maparesumo as $maparesumo){\r\n\t\t\t$arr_registro[] = $this->registro_r1($maparesumo, FALSE);\r\n\t\t\t$arr_registro[] = $this->registro_r1($maparesumo, TRUE);\r\n\t\t}\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\t$arr_registro[] = $this->registro_r1($notafiscal);\r\n\t\t}\r\n\r\n\t\t$arr_linha_e = array(); // Linhas para criar arquivo de entrada\r\n\t\t$arr_linha_s = array(); // Linhas para criar arquivo de saida\r\n\t\tforeach($arr_registro as $registro){\r\n\t\t\tif(!is_null($registro)){\r\n\t\t\t\t$linha = implode(\"|\", $registro);\r\n\t\t\t\tswitch($registro[\"02\"]){\r\n\t\t\t\t\tcase \"E\": $arr_linha_e[] = $linha;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"S\": $arr_linha_s[] = $linha;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->criar_arquivo($arr_linha_e, \"E\");\r\n\t\t$this->criar_arquivo($arr_linha_s, \"S\");\r\n\r\n\t\techo messagebox(\"success\", \"\", \"Arquivo gerado com sucesso!\");\r\n\t}", "public function genera_txt($param_final){\n\n\t\t$allrows = $param_final;\n\t\t\n\t\t$id_us = $this->session->userdata('session_id'); \n\n\t\t$archivo = fopen($_SERVER['DOCUMENT_ROOT'].'/reportes_villatours_v/referencias/archivos/archivos_egencia_lay_data_import_sp/udids_'.$id_us.'.txt', \"w+\");\n\t\t\n\t\t$header = ['Link_Key','BookingID','UdidNumber','UdidValue','UdidDefinitions'];\n\n\t\t$str_body = '';\n\t\tforeach ($header as $key => $value) {\n\t\t\t\n\t\t\t\t\t$str_body = $str_body . $value.\"\t\";\n\n\t\t\t\t}\n\n\n\t\tfwrite($archivo, $str_body);\n\t\t\t\n\n\t $nueva_plantilla = [];\n\n\t\tforeach ($allrows['rep'] as $key => $value) {\n\t\n\n\t\t\tarray_push($nueva_plantilla, $value);\n\t\t\t\n\n\t\t}\n\n\t\t\n\t foreach($nueva_plantilla as $key => $value) {\n\n\t \tfwrite($archivo,\"\\r\\n\");\n\t \t\n\t \t$str_body = '';\n\t \tforeach($value as $value2) {\n\n\t \t\t$str_body = $str_body . $value2.\"\t\";\n\n\t \t}\n\n\t \tfwrite($archivo, $str_body);\n\n\t\t}\n\n\t\t\n\n\t\tfclose($archivo);\n\n }", "function analiza_archivo_presupuesto_rf_lib($file)\n{\n $cliente=new cliente();\n if (!file_exists($file)){\n exit(\"File not found\");\n }\n $htmlContent=file_get_contents($file);\n $DOM=new DOMDocument();\n //echo $htmlContent;\n @$DOM->loadHTML($htmlContent);\n $Header = $DOM->getElementsByTagName('td');\n $Detail = $DOM->getElementsByTagName('td');\n foreach($Header as $NodeHeader)\n {\n $aDataTableHeaderHTML[]=trim($NodeHeader->textContent);\n //echo $aDataTableHeaderHTML;\n }\n print_r($aDataTableHeaderHTML);\n \n \n $fecha_presupuesto=substr($aDataTableHeaderHTML[5],23,10);\n $nombre_cliente=$aDataTableHeaderHTML[8];\n $dirección_cliente=$aDataTableHeaderHTML[10];\n $rpu=$aDataTableHeaderHTML[12];\n $telefono=$aDataTableHeaderHTML[14];\n $presupuesto=$aDataTableHeaderHTML[16];\n $marca_instalar=$aDataTableHeaderHTML[26];\n $modelo_instalar=$aDataTableHeaderHTML[27];\n $capacidad_instalar=$aDataTableHeaderHTML[28];\n $monto_financiar=$aDataTableHeaderHTML[29];\n $marca_retirar=$aDataTableHeaderHTML[37];\n $capacidad_retirar=$aDataTableHeaderHTML[38];\n $modelo_retirar=$aDataTableHeaderHTML[39];\n $antiguedad=$aDataTableHeaderHTML[40];\n $solicitud=$aDataTableHeaderHTML[42];\n $precio_sin_iva=$aDataTableHeaderHTML[46];\n $iva=ltrim($aDataTableHeaderHTML[49]);\n $bonificacion=$aDataTableHeaderHTML[61];\n $monto_financiar2=$aDataTableHeaderHTML[64];\n $excedente=$aDataTableHeaderHTML[58];\n $interes=$aDataTableHeaderHTML[67];\n $iva_interes=$aDataTableHeaderHTML[70];\n $financiado=$aDataTableHeaderHTML[73];\n $amortizacion=$aDataTableHeaderHTML[76];\n $num_pagos=substr($aDataTableHeaderHTML[74],0,2);\n $fecha_presupuesto=obtiene_fecha($fecha_presupuesto);\n $precio_sin_iva=substr($precio_sin_iva,1,9);\n $iva=substr($iva,17,8);\n $monto_financiar=substr($monto_financiar2,16,10);\n $excedente=substr($excedente,16,7);\n $interes=substr($interes,17,8);\n $iva_interes=substr($iva_interes,16,7);\n $financiado=substr($financiado,17,9);\n $amortizacion=substr($amortizacion,17,6);\n //echo $fecha_presupuesto.\"\\n\";\n //echo $nombre_cliente.\"\\n\";\n //echo $rpu.\"\\n\";\n //echo $presupuesto.\"\\n\";\n //echo $telefono.\"\\n\";\n //echo $marca_instalar.\"\\n\";\n //echo $modelo_instalar.\"\\n\";\n //echo $capacidad_instalar.\"\\n\";\n //echo $marca_retirar.\"\\n\";\n //echo $modelo_retirar.\"\\n\";\n //echo $capacidad_retirar.\"\\n\";\n //echo $solicitud.\"\\n\";\n //echo $precio_sin_iva.\"\\n\";\n //echo $iva.\"\\n\";\n //echo $monto_financiar.\"\\n\";\n //echo $excedente.\"\\n\";\n //echo $interes.\"\\n\";\n //echo $iva_interes.\"\\n\"; //23\n //echo $financiado.\"\\n\"; //26\n //echo $amortizacion.\"\\n\"; //23\n //echo $num_pagos.\"\\n\";\n $sp=\"RF\";\n $activo=1;\n $sql=\"INSERT INTO\n presupuestos (fecha,nombre,rpu,num_presupuesto,telefono,marca_ins,modelo_ins,capacidad_ins,\n marca_ret,modelo_ret,capacidad_ret,solicitud,instalacion,precio_sin_iva,iva_equipo,monto_financiar,\n excedente,interes,iva_interes,total_financiamiento,amortizacion,pagos,subprograma,activo)\n VALUES (\n '$fecha_presupuesto', '$nombre_cliente','$rpu','$presupuesto','$telefono','$marca_instalar',\n '$modelo_instalar','$capacidad_instalar','$marca_retirar','$modelo_retirar','$capacidad_retirar',\n '$solicitud','0','$precio_sin_iva','$iva','$monto_financiar','$excedente','$interes',\n '$iva_interes','$financiado','$amortizacion','$num_pagos','$sp','$activo'\n )\";\n $resp=$cliente->insertar($sql);\n if($resp)\n {\n echo \"Se guardo correctamente\";\n }\n else{\n echo \"No se pudo guardar\";\n }\necho $sql;\n\n\n\n\n}", "public function bajarArchivos()\n {\n $anio = date('Y');\n ////$mes = (int)date('m')-1;\n\n $mes = (int) date('m')-(int)\\Config::get('constants.constantes.mes_proceso');\n if($mes == 0){\n $anio = $anio - 1;\n $mes = 1;\n } \n\n ini_set('max_execution_time', 0);\n ini_set('memory_limit', '-1');\n ini_set('default_socket_timeout', 600);\n ini_set('upload_max_filesize ', '40M');\n ini_set('post_max_size ', '40M');\n \n $empresas = Empresa::all()->sortBy(\"codigo\");\n\n //Ver con tavo como seria la query para no traer TODOS\n\n $i=0;\n $msg=\"\";\n foreach ($empresas as $empresa) {\n //Veo si existe un procesamiento para el anio, mes, codigo\n //$existeProcesamientoArchivoFinalizado = ProcesamientoArchivo::where('anio','=',$anio)->where('mes','=',$mes)->where('codigo','=', $empresa->codigo)->where('estado','=', 'Finalizado')->count();\n $existeProcesamientoArchivoFinalizado = $this->procesamientoArchivoRepository->existeProcesamientoArchivoPorEstado($anio, $mes, $empresa->codigo, \"Fin bajada de archivo\");\n if($existeProcesamientoArchivoFinalizado == 0){\n //if($i<4 && $empresa->codigo!=\"YPF\"){\n if($i<6){\n $i++;\n $this->procesamientoArchivoRepository->crearProcesamientoArchivoEstado($anio, $mes, $empresa->codigo, \"Inicio bajada de archivo\", \"\", $empresa->id);\n\n $PozoService = new PozoService($anio, $empresa->codigo, $mes);\n \\Log::info('init descarga');\n $nombreArchivo = $anio.\"-\".$mes.\"-\".$empresa->codigo.\"-ddjj.xlsx\";\n\n $msg.=\"Codigo empresa bajado ==> \".$empresa->codigo;\n\n $excel = $PozoService->processPozos($nombreArchivo);\n \\Log::info('fin descarga');\n \n $this->procesamientoArchivoRepository->crearProcesamientoArchivoEstado($anio, $mes, $empresa->codigo, \"Fin bajada de archivo\", \"Pendiente\", $empresa->id);\n if($excel == \"\"){\n $msg.=\" ==> No existe excel para esta empresa en este mes.\";\n $this->procesamientoArchivoRepository->crearProcesamientoArchivoEstado($anio, $mes, $empresa->codigo, \"No hay DDJJ (sin Excel)\", \"\", $empresa->id); \n } \n $msg.=\"<br>\";\n }\n }\n } \n\n if($i==0)\n echo \"No quedan archivos por bajar este mes\";\n else\n echo \"Se bajaron \".$i.\" archivos. \".$msg.\" Aun quedan archivos por bajar\";\n }", "public function queryInsertEnd($dados){\n try{\n $ID = $dados['0'];\n $IDENTIFICADOR = $dados['1']; \n $CEP = preg_replace(\"/[^0-9]/\", \"\",$dados['2']);\n $LOGRADOURO = $dados['3'];\n $NUMERO = $dados['4'];\n $COMPLEMENTO = $dados['5'];\n $BAIRRO = $dados['6'];\n $CIDADE = $dados['7'];\n $ESTADO = $dados['8'];\n $PAIS = $dados['9'];\n $STATUS = $dados['10'];\n $SQL = \"INSERT INTO `endereco` (`id`, `identificador`, `cep`, `logradouro`, `numero`, `complemento`, `bairro`, `cidade`, `estado`, `pais`, `status`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\"; \n $sqlEndereco = $this->conecta->conectar()->prepare($SQL); \n $sqlEndereco->bindParam(1, $ID, PDO::PARAM_STR);\n $sqlEndereco->bindParam(2, $IDENTIFICADOR, PDO::PARAM_STR);\n $sqlEndereco->bindParam(3, $CEP, PDO::PARAM_STR);\n $sqlEndereco->bindParam(4, $LOGRADOURO, PDO::PARAM_STR);\n $sqlEndereco->bindParam(5, $NUMERO, PDO::PARAM_STR);\n $sqlEndereco->bindParam(6, $COMPLEMENTO, PDO::PARAM_STR);\n $sqlEndereco->bindParam(7, $BAIRRO, PDO::PARAM_STR);\n $sqlEndereco->bindParam(8, $CIDADE, PDO::PARAM_STR);\n $sqlEndereco->bindParam(9, $ESTADO, PDO::PARAM_STR);\n $sqlEndereco->bindParam(10, $PAIS, PDO::PARAM_STR);\n $sqlEndereco->bindParam(11, $STATUS, PDO::PARAM_STR);\n if($sqlEndereco->execute()){\n return \"ok\";\n }else{\n return print_r($sqlEndereco->errorInfo());\n }\n } catch (PDOException $ex) {\n return 'error '.$ex->getMessage();\n }\n }", "function insertar_productos($id,$id_dep,$id_dep_destino=0,$es_pedido_material=0,$id_licitacion=-1,$nrocaso=-1)\r\n{\r\nglobal $db,$_ses_user;\r\n\r\n$db->StartTrans();\r\n\r\n if($es_pedido_material)\r\n { $titulo_material=\"Pedido de Material\";\r\n //traemos el id del tipo de reserva\r\n $query=\"select id_tipo_reserva from tipo_reserva where nombre_tipo='Reserva Para Pedido de Material'\";\r\n $res=sql($query,\"<br>Error al traer el id de la reserva del pedido<br>\") or fin_pagina();\r\n $tipo_reserva=$res->fields[\"id_tipo_reserva\"];\r\n }\r\n else\r\n { $titulo_material=\"Movimiento de Material\";\r\n //traemos el id del tipo de reserva\r\n $query=\"select id_tipo_reserva from tipo_reserva where nombre_tipo='Reserva Para Movimiento de Material'\";\r\n $res=sql($query,\"<br>Error al traer el id de la reserva del pedido<br>\") or fin_pagina();\r\n $tipo_reserva=$res->fields[\"id_tipo_reserva\"];\r\n }\r\n\r\n //traemos las filas que estan en la BD\r\n $items_en_bd=get_items_mov($id);\r\n //traemos los items que estan en la tabla\r\n $items=get_items_mov();\r\n//print_r($items);\r\n$fecha=date(\"Y-m-d H:i:s\",mktime());\r\n$usuario=$_ses_user[\"name\"];\r\n\r\n //primero borramos los productos que se borraron en la tabla\r\n $a_borrar=\"\";\r\n $cantidades_acum=0;\r\n for($j=0;$j<$items_en_bd['cantidad'];$j++)\r\n {\r\n for($i=0;$i<$items['cantidad'];$i++)\r\n {\r\n //si el id es igual al de la bd,\r\n //entonces esta insertada de antes\r\n if($items[$i]['id_detalle_movimiento']==$items_en_bd[$j]['id_detalle_movimiento'])\r\n {//controlamos si las cantidad en la fila difiere de la que esta guardada.\r\n //si lo hace debemos actualizar la cantidad reservada\r\n if($items[$i]['id_prod_esp']!=\"\" && $items[$i]['cantidad']!=$items_en_bd[$j]['cantidad'])\r\n {\r\n \t //no se puede cambiar la cantidad de la fila\r\n \t die(\"Error: No se puede cambiar las cantidades de la fila.\");\r\n }//de if($items[$i]['id_producto']!=\"\" && $items[$i]['cantidad']!=$items_en_bd[$j]['cantidad'])\r\n \t break;\r\n }//de if($items[$i]['id_detalle_movimiento']==$items_en_bd[$j]['id_detalle_movimiento'])\r\n }//de for($i=0;$i<$items['cantidad'];$i++)\r\n\r\n //si $i==$items['cantidad'] significa que la fila se borro, y\r\n //hay que eliminarla de la BD\r\n if($i==$items['cantidad'])\r\n {\r\n \t $a_borrar.=$items_en_bd[$j]['id_detalle_movimiento'].\",\";\r\n $cantidades_acum+=$items_en_bd[$j]['cantidad'];\r\n $cantidades.=$items_en_bd[$j]['cantidad'].\",\";\r\n $id_prod_esp_a_borrar.=$items_en_bd[$j]['id_prod_esp'].\",\";\r\n\r\n }\r\n //si habia un producto y se borro, hay que eliminar la fila\r\n //(este caso extremo falla si no se agrega este if\r\n if($i==0 && $items['cantidad']==1 && $items[$i]['id_prod_esp']==\"\")\r\n {\r\n $a_borrar.=$items_en_bd[$j]['id_detalle_movimiento'].\",\";\r\n $cantidades_acum+=$items_en_bd[$j]['cantidad'];\r\n $cantidades.=$items_en_bd[$j]['cantidad'].\",\";\r\n $id_prod_esp_a_borrar.=$items_en_bd[$j]['id_prod_esp'].\",\";\r\n }\r\n\r\n }//de for($j=0;$j<$items_en_bd['cantidad'];$j++)\r\n\r\n //si hay filas de movimiento a borrar, eliminamos las reservas\r\n //y luego la fila del movimiento insertar_recibidos_mov\r\n\r\n /*\r\n echo \"<br>\";\r\n echo \"a borrar : *** \";\r\n print_r($a_borrar);\r\n echo \" **** \";\r\n */\r\n if($a_borrar!=\"\"){\r\n $a_borrar=substr($a_borrar,0,strlen($a_borrar)-1);\r\n $filas_borrar=split(\",\",$a_borrar);\r\n $cantidades=substr($cantidades,0,strlen($cantidades)-1);\r\n $cantidades_b=split(\",\",$cantidades);\r\n $tam=sizeof($filas_borrar);\r\n $array_id_prod_esp=split(\",\",$id_prod_esp_a_borrar);\r\n for($g=0;$g<$tam;$g++)\r\n cancelar_reserva($array_id_prod_esp[$g],$cantidades_b[$g],$id_dep,\"Se cancelo el $titulo_material Nº $id\",9,\"\",$filas_borrar[$g]);\r\n\r\n //luego borramos todas las filas que haya que borrar, del\r\n $query=\"delete from detalle_movimiento where id_detalle_movimiento in ($a_borrar)\";\r\n sql($query) or fin_pagina(\"<br>Error al borrar los productos del movimiento <br>$query\");\r\n }//de if($a_borrar!=\"\")\r\n else\r\n $filas_borrar=array();\r\n\r\n $tam_filas_borrar=sizeof($filas_borrar);\r\n //luego insertamos los productos nuevos\r\n for($i=0;$i<$items['cantidad'];$i++) {\r\n //si el id de detalle_movimiento es vacio, entonces hay que insertarlo\r\n if($items[$i]['id_detalle_movimiento']==\"\")\r\n {\r\n if($items[$i]['id_prod_esp']!=\"\")\r\n {\r\n $query=\"select nextval('detalle_movimiento_id_detalle_movimiento_seq') as id_detalle_movimiento\";\r\n $id_det=sql($query)or fin_pagina();\r\n \t $query=\"insert into detalle_movimiento(id_detalle_movimiento,id_movimiento_material,id_prod_esp,descripcion,cantidad,precio)\r\n values(\".$id_det->fields['id_detalle_movimiento'].\",$id,\".$items[$i]['id_prod_esp'].\",'\".$items[$i]['descripcion'].\"',\".$items[$i]['cantidad'].\",\".(($items[$i]['precio']!=\"\")?$items[$i]['precio']:0).\")\r\n \";\r\n \t sql($query) or fin_pagina(\"<br>Error al insertar el producto $i del movimiento <br>$query\");\r\n \t //si la cantidad ya reservada para la fila es vacia, ingresamos una nueva reserva por la cantidad de la fila\r\n \t if ($items[$i][\"cantidad_res\"]==\"\" || $items[$i][\"cantidad_res\"]==0)\r\n \t {\treservar_stock($items[$i]['id_prod_esp'],$items[$i]['cantidad'],$id_dep,\"Reserva de Productos para $titulo_material Nº $id\",6,$tipo_reserva,\"\",$id_det->fields['id_detalle_movimiento'], $id_licitacion);\r\n \t }\r\n\t\t\t\t\t\t //en cambio, si la cantidad reservada es mayor que cero, en caso de tener que reservar mas, desde el stock disponible\r\n\t\t\t\t\t\t //lo que se hace es agregar a la reserva ya hecha, los nuevos productos,\r\n\t\t\t\t\t\t //(PORQUE SOLO PUEDE HABER UN DETALLE RESERVA POR FILA DE PM O DE OC)\r\n\t\t\t\t\t\t //Ademas se corrigen en consecuencia las\r\n\t\t\t\t\t\t //cantidades disponibles y reservadas de ese producto en ese stock, si es necesario.\r\n else if ($items[$i][\"cantidad_res\"]>0){\r\n\t\t\t\t\t\t\tif ($nrocaso) {\r\n\r\n\t\t\t\t\t\t \t$consulta=\"select id_detalle_reserva,id_en_stock,cantidad_reservada\r\n\t\t\t\t\t\t\t\t\t from stock.en_stock\r\n\t\t\t\t\t\t\t\t\t join stock.detalle_reserva using (id_en_stock)\r\n\t\t\t\t\t\t\t\t\t where nrocaso='$nrocaso'\r\n\t\t\t\t\t\t\t\t\t and id_prod_esp=\".$items[$i]['id_prod_esp'].\"\r\n\t\t\t\t\t\t\t\t\t and id_deposito=2 and id_detalle_movimiento isnull\r\n\t\t\t\t\t\t\t\t\t order by cantidad_reservada ASC\";\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t \telse{\r\n\t\t\t\t\t\t \t$consulta=\"select id_detalle_reserva,id_en_stock,cantidad_reservada\r\n\t\t\t\t\t\t\t\t\tfrom stock.en_stock\r\n\t\t\t\t\t\t\t\t\t\tjoin stock.detalle_reserva using (id_en_stock)\r\n\t\t\t\t\t\t\t\t\twhere id_licitacion= $id_licitacion\r\n\t\t\t\t\t\t\t\t\t\tand id_prod_esp=\".$items[$i]['id_prod_esp'].\"\r\n\t\t\t\t\t\t\t\t\t\tand id_deposito=2 and id_detalle_movimiento isnull\r\n\t\t\t\t\t\t\t\t\torder by cantidad_reservada ASC\r\n\t\t\t\t\t\t\t\t\";\r\n\t\t\t\t\t\t }\r\n\r\n\r\n\t\t\t\t\t\t\t$rta_consulta=sql($consulta, \"c311\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t//en la primera entrada viene la reserva de mayor cantidad, que es la que afectaremos mas abajo\r\n\t\t\t\t\t\t\t// por lo tanto la saltamos\r\n\t\t\t\t\t\t\t$cantidad_primer_reserva=$rta_consulta->fields[\"cantidad_reservada\"];\r\n\t\t\t\t\t\t\t$id_primer_reserva=$rta_consulta->fields[\"id_detalle_reserva\"];\r\n\t\t\t\t\t\t\t$rta_consulta->MoveNext();\r\n\t\t\t\t\t\t\t//luego acumulamos las demas cantidades de las reservas restantes, si es que hay\r\n\t\t\t\t\t\t\t$acum_otras_reservas=0;$index=0;\r\n\t\t\t\t\t\t\t//y creamos un arreglo con los id de detalle reserva que debemos descontar, y sus respectivas cantidades actuales\r\n\t\t\t\t\t\t\t$reservas_a_bajar=array();\r\n \t\t\t\t\t\t\twhile (!$rta_consulta->EOF)\r\n \t\t\t\t\t\t\t{\r\n \t\t\t\t\t\t\t $acum_otras_reservas+=$rta_consulta->fields[\"cantidad_reservada\"];\r\n \t\t\t\t\t\t\t $reservas_a_bajar[$index]=array();\r\n \t\t\t\t\t\t\t $reservas_a_bajar[$index][\"id\"]=$rta_consulta->fields[\"id_detalle_reserva\"];\r\n \t\t\t\t\t\t\t $reservas_a_bajar[$index][\"cantidad_reservada\"]=$rta_consulta->fields[\"cantidad_reservada\"];\r\n \t\t\t\t\t\t\t $index++;\r\n\r\n \t\t\t\t\t\t\t $rta_consulta->MoveNext();\r\n \t\t\t\t\t\t\t}//de while(!$rta_consulta->EOF)\r\n \t\t\t\t\t\t\t$rta_consulta->Move(0);\r\n\r\n\t\t\t\t\t\t\t $id_en_stock=$rta_consulta->fields[\"id_en_stock\"];\r\n\t\t\t\t\t\t\t\t//si la cantidad de la fila es mayor que la reservada, entonces se necesita reservar la diferencia\r\n\t\t\t\t\t\t\t\t//desde el stock disponible. Para eso aumentamos la cantidad de la reserva ya presente y movemos\r\n\t\t\t\t\t\t\t\t//las cantidades de la tabla en_stock, como corresponda\r\n\r\n\t\t\t\t\t\t\t\tif($items[$i]['cantidad']>$items[$i][\"cantidad_res\"]){\r\n\r\n\t\t\t\t\t\t\t\t\t$cantidad_aumentar=$items[$i]['cantidad']-$items[$i][\"cantidad_res\"];\r\n\t\t\t\t\t\t\t\t\t$nueva_reserva_pm=0;\r\n\t\t\t\t\t\t\t\t\t$sacar_de_stock_disp=1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//si la cantidad de la fila es menor que la reservada\r\n\t\t\t\t\t\t\t\telse if($items[$i]['cantidad']<$items[$i][\"cantidad_res\"]){\r\n\r\n\t\t\t\t\t\t\t\t\t$cantidad_aumentar=$items[$i]['cantidad'];\r\n\t\t\t\t\t\t\t\t\t//indicamos que solo se debe usar parte de la reserva del producto hecha desde OC, por lo que\r\n\t\t\t\t\t\t\t\t\t//solo se resta esa cantidad. Y ademas, se debe generar una nueva reserva para esos productos\r\n\t\t\t\t\t\t\t\t\t//que se van a usar para este PM\r\n\t\t\t\t\t\t\t\t\t$nueva_reserva_pm=1;\r\n\t\t\t\t\t\t\t\t\t$sacar_de_stock_disp=0;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$cantidad_aumentar=0;\r\n\t\t\t\t\t\t\t\t\t$nueva_reserva_pm=0;\r\n\t\t\t\t\t\t\t\t\t$sacar_de_stock_disp=0;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t//Si hay una sola reserva hecha y si la cantidad a usar para la fila del PM es menor que la reservada, significa que solo se usa una\r\n\t\t\t\t\t\t\t\t//parte de dicha reserva, entonces....\r\n\t\t\t\t\t\t\t\tif($acum_otras_reservas==0 && $nueva_reserva_pm)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t//Solo se descuenta de la reserva atada a la licitacion para ese producto, generada por la OC,\r\n\t\t\t\t\t\t\t\t\t//la cantidad que se va a utilizar.\r\n\t\t\t\t\t\t\t\t\t//Primero se descuenta de la cantidad reservada de la tabla en_stock\r\n\t\t\t\t\t\t\t\t\t$query=\"update stock.en_stock set cant_reservada=cant_reservada-$cantidad_aumentar\r\n\t\t\t\t\t\t\t\t\t\t where id_en_stock=$id_en_stock\";\r\n\t\t\t\t\t\t\t\t\tsql($query,\"<br>Error al actualizar cantidades del stock para reserva de productos<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t//luego se decrementa la cantidad de la reserva asociada a la licitacion de ese producto\r\n\t\t\t\t\t\t\t\t\t$consulta=\"update stock.detalle_reserva set cantidad_reservada=cantidad_reservada-$cantidad_aumentar\r\n\t\t\t\t\t\t\t\t\t where id_detalle_reserva=$id_primer_reserva\";\r\n\t\t\t\t\t\t\t\t\tsql($consulta, \"<br>c317: Error al actualizar la reserva para licitacion de la fila<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t$query=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Se utilizaron los productos reservados para OC o para Movimiento de material'\";\r\n\t\t\t\t\t\t\t\t\t$tipo_mov=sql($query,\"<br>Error al traer el tipo de movimiento<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\tif($tipo_mov->fields[\"id_tipo_movimiento\"]!=\"\")\r\n\t\t\t\t\t\t\t \t\t $id_tipo_movimiento=$tipo_mov->fields[\"id_tipo_movimiento\"];\r\n\t\t\t\t\t\t\t \t\telse\r\n\t\t\t\t\t\t\t \t\t die(\"Error Interno PM485: no se pudo determinar el tipo de movimiento de stock. Consulte a la División Software<br>\");\r\n\r\n\t\t\t\t\t\t\t\t\t//luego registramos el cambio en el log de movimientos de stock\r\n\t\t\t\t\t\t\t\t\t//(se utilizan esos productos de la reserva hecha por la OC)\r\n\t\t\t\t\t\t\t\t\t$campos=\" id_en_stock,id_tipo_movimiento,cantidad,fecha_mov,usuario_mov,comentario\";\r\n\t\t\t\t\t\t\t\t $values=\" $id_en_stock,$id_tipo_movimiento,$cantidad_aumentar,'$fecha','$usuario','Utilización de los productos para $titulo_material Nº $id'\";\r\n\t\t\t\t\t\t\t\t $sql=\"insert into log_movimientos_stock ($campos) values ($values)\";\r\n\t\t\t\t\t\t\t\t sql($sql,\"<br>Error al insetar en el log de movimientos de stock (insertar488)<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t//Y luego se genera una nueva reserva, para la fila del pedido de material actual, con esa cantidad,\r\n\t\t\t\t\t\t\t\t\t//que se desconto de la reserva hecha por la OC\r\n\t\t\t\t\t\t\t\t\treservar_stock($items[$i]['id_prod_esp'],$cantidad_aumentar,$id_dep,\"Reserva de Productos para $titulo_material\",6,$tipo_reserva,\"\",$id_det->fields['id_detalle_movimiento'], $id_licitacion);\r\n\r\n\t\t\t\t\t\t\t\t\t//como la funcion reservar_stock descuenta de la cantidad disponible\r\n\t\t\t\t\t\t\t\t\t//y agrega a la cantidad reservada del stock la cantidad pasada como parametro, es necesario volver\r\n\t\t\t\t\t\t\t\t\t//a incrementar la cantidad disponible para compensar,\r\n\t\t\t\t\t\t\t\t\t// debido a que los productos que ahora estan reservados para el PM antes lo estaban para la OC,\r\n\t\t\t\t\t\t\t\t\t// por lo que los productos ya fueron descontados de stock disponibles y agregados a la cantidad reservada\r\n\t\t\t\t\t\t\t\t\t//cuando se hizo la reserva desde la OC al recibir los productos\r\n\t\t\t\t\t\t\t\t\t$query=\"update stock.en_stock set cant_disp=cant_disp+$cantidad_aumentar\r\n\t\t\t\t\t\t\t\t\t where id_en_stock=$id_en_stock\r\n\t\t\t\t\t\t\t\t\t \";\r\n\t\t\t\t\t\t\t\t\tsql($query,\"<br>Error al compensar las cantidades del stock<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t}//de if($nueva_reserva_pm)\r\n\t\t\t\t\t\t\t\telse//no se hace una nueva reserva y el PM pasara a tener toda la reserva generada desde la OC\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t//si no hay nada que sacar del stock disponible entonces ponemos esa cantidad en cero\r\n \t\t\t\t\t\t\t\t if($sacar_de_stock_disp==0)\r\n\t\t\t\t\t\t\t\t\t $cantidad_aumentar=0;\r\n\r\n\t\t\t\t\t\t\t\t\t //agregamos a la reserva actual hecha para la licitacion, los productos disponibles necesarios para\r\n\t\t\t\t\t\t\t\t\t//completar la cantidad que requiere la fila de PM (si es necesario),\r\n\t\t\t\t\t\t\t\t\t// y le sacamos la relacion que tenia con la fila de OC\r\n\t\t\t\t\t\t\t\t\t$consulta=\"update stock.detalle_reserva set cantidad_reservada=cantidad_reservada+$cantidad_aumentar,\r\n\t\t\t\t\t\t\t\t\t id_detalle_movimiento=\".$id_det->fields['id_detalle_movimiento'].\",\r\n\t\t\t\t\t\t\t\t\t id_fila=null,id_tipo_reserva=$tipo_reserva\r\n\t\t\t\t\t\t\t\t\t where id_detalle_reserva=$id_primer_reserva\";\r\n\t\t\t\t\t\t\t\t\tsql($consulta, \"<br>c516: Error al actualizar la reserva de la fila<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t//luego actualizamos las cantidades disponibles y reservadas en stock, si la cantidad a aumentar es mayor que cero\r\n\t\t\t\t\t\t\t\t\tif($cantidad_aumentar>0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\t\t\t\t\t//restamos los productos que se reservan de la cantidad disponible y los sumamos a la cantidad\r\n\t\t\t\t\t\t\t\t\t\t//reservada\r\n\t\t\t\t\t\t\t\t\t\t$query=\"update stock.en_stock set cant_disp=cant_disp-$cantidad_aumentar,\r\n\t\t\t\t\t\t\t\t\t\t cant_reservada=cant_reservada+$cantidad_aumentar\r\n\t\t\t\t\t\t\t\t\t\t where id_en_stock=$id_en_stock\";\r\n\t\t\t\t\t\t\t\t\t\tsql($query,\"<br>Error al actualizar cantidades del stock para reserva de productos<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t\t$query=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Reserva de productos para OC o para Movimiento/Pedido de material'\";\r\n\t\t\t\t\t\t\t\t\t\t$tipo_mov=sql($query,\"<br>Error al traer el tipo de movimiento<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t\tif($tipo_mov->fields[\"id_tipo_movimiento\"]!=\"\")\r\n\t\t\t\t\t\t\t\t \t\t $id_tipo_movimiento=$tipo_mov->fields[\"id_tipo_movimiento\"];\r\n\t\t\t\t\t\t\t\t \t\telse\r\n\t\t\t\t\t\t\t\t \t\t die(\"Error Interno PM539: no se pudo determinar el tipo de movimiento de stock. Consulte a la División Software<br>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t//luego registramos el cambio en el log de movimientos de stock\r\n\t\t\t\t\t\t\t\t\t\t$campos=\" id_en_stock,id_tipo_movimiento,cantidad,fecha_mov,usuario_mov,comentario\";\r\n\t\t\t\t\t\t\t\t\t $values=\" $id_en_stock,$id_tipo_movimiento,$cantidad_aumentar,'$fecha','$usuario','Reserva de productos para Pedido de Material Nº $id'\";\r\n\t\t\t\t\t\t\t\t\t $sql=\"insert into log_movimientos_stock ($campos) values ($values)\";\r\n\t\t\t\t\t\t\t\t\t sql($sql,\"<br>Error al insetar en el log de movimientos de stock (insertar537)<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t}//de if($cantidad_aumentar>0)\r\n\r\n\t\t\t\t\t\t\t\t if($acum_otras_reservas)\r\n\t\t\t\t\t\t\t\t {//si habia mas de una reserva por el mismo producto provenientes de OC distintas, se eliminan, excepto la primera, todas\r\n\t\t\t\t\t\t\t\t\t//las reservas restantes que se utilizaron, de las que estan indicadas en $reservas_a_bajar, para que se mantenga\r\n\t\t\t\t\t\t\t\t\t//la idea de una unica reserva por detalle_movimiento\r\n\t\t\t\t\t\t\t\t\t//y se agrega el registro del movimiento en el log de movimientos de stock\r\n\t\t\t\t\t\t\t\t\t//(Se pone el movimiento de que se utilizaron esas reservas)\r\n\t\t\t\t\t\t\t\t\t//El procedimiento es sumar a la primer reserva la cantidad de las otras, necesaria para satisfacer la cantidad\r\n\t\t\t\t\t\t\t\t\t//que la fila del PM requiere. Lo que se use de las otras reservas se pondra como utilizado en el log del stock\r\n\t\t\t\t\t\t\t\t\t//y se descontara o eliminara de detalle_reserva. Lo que quede sin usarse, queda atado a la OC como estaba.\r\n\t\t\t\t\t\t\t\t\t//En caso de que se use una parte de una reserva y la otra no, se genera un nuevo log de stock parar la parte\r\n\t\t\t\t\t\t\t //que se utilizó de la OC, y se decuenta la cantidad usada, de la reserva afectada. Esto se explica mejor\r\n\t\t\t\t\t\t\t //durante la ejecucion del codigo que sigue:\r\n\r\n\t\t\t\t\t\t\t\t\t\t//la cantidad pedida por la fila\r\n\t\t\t\t\t\t\t\t\t\t$cantidad_pedida_para_fila=$items[$i]['cantidad'];\r\n\t\t\t\t\t\t\t\t\t\t//la cantidad acumulada para satisfacer la cantidad pedida por la fila\r\n\t\t\t\t\t\t\t\t\t\t//es hasta ahora la cantidad de la primer reserva\r\n\t\t\t\t\t\t\t\t\t\t$cantidad_acumulada_de_reservas=$cantidad_primer_reserva;\r\n\r\n\t\t\t\t\t\t\t\t\t\t//la cantidad que se saca de las restantes reservas, para agregarle a la primera\r\n\t\t\t\t\t\t\t\t\t\t$cantidad_total_a_sumar=0;\r\n\r\n //vamos acumulando el resto de las cantidades de las otras reservas, hasta que se acumule la cantidad pedida\r\n //por la fila, o hasta que se acaben las reservas disponibles\r\n\t\t\t\t\t\t\t\t\t\tfor($j=0;$j<sizeof($reservas_a_bajar);$j++ )\r\n {\r\n \t//si falta acumular para completar la cantidad requerida por la fila\r\n if($cantidad_acumulada_de_reservas<$cantidad_pedida_para_fila)\r\n {\r\n \t$cant_reserva_actual=$reservas_a_bajar[$j][\"cantidad_reservada\"];\r\n \t//utilizamos de la reserva actual, solo la cantidad necesaria que es:\r\n \t$cantidad_faltante=$cantidad_pedida_para_fila-$cantidad_acumulada_de_reservas;\r\n\r\n \tif($cant_reserva_actual<=$cantidad_faltante)\r\n \t{\r\n \t\t//si la cantidad para la reserva que estamos viendo es justo\r\n \t\t//lo que esta faltando, o no alcanza para cubrir todo lo que esta faltando\r\n \t\t//acumulamos toda esa reserva para la fila (es decir: se utilizan todos los productos de esa reserva)\r\n \t\t$cantidad_a_utilizar=$cant_reserva_actual;\r\n \t\t$cantidad_no_utilizada=0;\r\n \t}\r\n \telse if($cantidad_faltante>0)\r\n \t{\r\n \t\t//si en cambio, la cantidad faltante (que es mayor que cero) para cubrir lo requerido por la fila es\r\n \t\t//menor que la cantidad en la reserva que estamos viendo,\r\n \t\t//utilizamos de esa reserva solo la cantidad faltante, pero el resto la dejamos como estaba en la reserva\r\n \t\t$cantidad_a_utilizar=$cantidad_faltante;\r\n \t\t$cantidad_no_utilizada=$cant_reserva_actual-$cantidad_faltante;\r\n \t}\r\n \telse\r\n \t die(\"Error interno: la cantidad acumulada ($cantidad_acumulada_de_reservas) no es mayor o igual que la pedida por la fila($cantidad_pedida_para_fila)<br>\r\n \t \t Pero la cantidad faltante es igual a cero. Consulte a la División Software por este error. \");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t$cantidad_acumulada_de_reservas+=$cantidad_a_utilizar;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$reservas_a_bajar[$j][\"cantidad_utilizada\"]=$cantidad_a_utilizar;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$reservas_a_bajar[$j][\"cantidad_no_utilizada\"]=$cantidad_no_utilizada;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t$cantidad_total_a_sumar+=$cantidad_a_utilizar;\r\n }//de if($cantidad_acumulada_de_reservas<$cantidad_pedida_para_fila)\r\n else//si ya se acumulo todo lo que la fila pedia, la reserva queda como esta y lo indicamos en el arreglo\r\n {\r\n \t$reservas_a_bajar[$j][\"cantidad_utilizada\"]=0;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$reservas_a_bajar[$j][\"cantidad_no_utilizada\"]=$reservas_a_bajar[$j][\"cantidad_reservada\"];\r\n }//de if($cantidad_acumulada_de_reservas<$cantidad_pedida_para_fila)\r\n\r\n }//de for($j=0;$j<$reservas_a_bajar;$j++)\r\n\r\n //agregamos a la primer reserva, la cantidad que se utilizara de las demas reservas\r\n $query=\"update stock.detalle_reserva set cantidad_reservada=cantidad_reservada+$cantidad_total_a_sumar,\r\n id_detalle_movimiento=\".$id_det->fields['id_detalle_movimiento'].\",\r\n\t\t\t\t\t\t\t\t\t id_fila=null,id_tipo_reserva=$tipo_reserva\r\n\t\t\t\t\t\t\t\t\t where id_detalle_reserva=$id_primer_reserva\";\r\n\t\t\t\t\t\t\t\t\t sql($query, \"<br>c612: Error al actualizar la reserva de la fila con las otras reservas<br>\") or fin_pagina();\r\n\r\n //luego, por cada reserva afectada extra, descontamos las cantidades utilizadas\r\n for($j=0;$j<sizeof($reservas_a_bajar);$j++)\r\n {\r\n \t//si de esta reserva se utilizo algo de su cantidad debemos descontar esa cantidad\r\n \t//ya sea actualizando la cantidad de la reserva en cuestion, si aun queda una parte\r\n \t//sin utilizar; o eliminando ese detalle de reserva porque se utilizó completa\r\n \tif($reservas_a_bajar[$j][\"cantidad_utilizada\"]>0)\r\n \t{\r\n \t\t//si se utilizó toda la cantidad para esa reserva, simplemente se elimina la reserva,\r\n \t\t//debio a que ya quedó esa cantidad registrada como parte de la primer reserva con id: $id_primer_reserva\r\n \t\tif($reservas_a_bajar[$j][\"cantidad_reservada\"]==$reservas_a_bajar[$j][\"cantidad_utilizada\"])\r\n \t\t{\r\n \t\t\t$query=\"delete from stock.detalle_reserva where id_detalle_reserva=\".$reservas_a_bajar[$j][\"id\"];\r\n \t\t\tsql($query,\"<br>Error al eliminar la reserva con id \".$reservas_a_bajar[$j][\"id\"].\"<br>\") or fin_pagina();\r\n \t\t}//de if($reservas_a_bajar[$j][\"cantidad_reservada\"]==$reservas_a_bajar[$j][\"cantidad_utilizada\"])\r\n \t\telseif($reservas_a_bajar[$j][\"cantidad_utilizada\"]<$reservas_a_bajar[$j][\"cantidad_reservada\"])\r\n \t\t{\r\n \t\t\t//si la cantidad de la reserva a utilizar es menor que la reservada, entonces se resta de dicha reserva\r\n \t\t\t//la cantidad utilizada, y se registra en el log de stock que se utilizo esa cantidad\r\n \t\t\t$query=\"update stock.detalle_reserva set cantidad_reservada=cantidad_reservada-\".$reservas_a_bajar[$j][\"cantidad_utilizada\"].\" where id_detalle_reserva=\".$reservas_a_bajar[$j][\"id\"];\r\n \t\t\tsql($query,\"<br>Error al actualizar la cantidad del detalle de la reserva<br>\") or fin_pagina();\r\n\r\n \t\t\t//la cantidad utilizada entra a la primer reserva, por lo que solo es necesario registrar el log en\r\n \t\t\t//los movimientos de stock la utilizacion de $reservas_a_bajar[$j][\"cantidad_utilizada\"]\r\n \t\t\t//para la reserva $reservas_a_bajar[$j][\"id\"]\r\n\r\n \t\t\t$query=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Reserva de productos para OC o para Movimiento/Pedido de material'\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tipo_mov=sql($query,\"<br>Error al traer el tipo de movimiento<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($tipo_mov->fields[\"id_tipo_movimiento\"]!=\"\")\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t $id_tipo_movimiento=$tipo_mov->fields[\"id_tipo_movimiento\"];\r\n\t\t\t\t\t\t\t\t\t\t\t \t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t die(\"Error Interno PM654: no se pudo determinar el tipo de movimiento de stock. Consulte a la División Software<br>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t//generamos el log\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$campos=\" id_en_stock,id_tipo_movimiento,cantidad,fecha_mov,usuario_mov,comentario\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t $values=\" $id_en_stock,$id_tipo_movimiento,\".$reservas_a_bajar[$j][\"cantidad_utilizada\"].\",'$fecha','$usuario','Reserva de productos para Pedido de Material Nº $id'\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t $sql=\"insert into log_movimientos_stock ($campos) values ($values)\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t sql($sql,\"<br>Error al insetar en el log de movimientos de stock (insertar649)<br>\") or fin_pagina();\r\n\r\n\r\n\t\t\t //y generamos el correspondiente log indicando que se utilizaron productos reservados\r\n\t\t\t \t\t\t$query=\"select id_tipo_movimiento from stock.tipo_movimiento where nombre='Se utilizaron los productos reservados para OC o para Movimiento de material'\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tipo_mov=sql($query,\"<br>Error al traer el tipo de movimiento<br>\") or fin_pagina();\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($tipo_mov->fields[\"id_tipo_movimiento\"]!=\"\")\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t $id_tipo_movimiento=$tipo_mov->fields[\"id_tipo_movimiento\"];\r\n\t\t\t\t\t\t\t\t\t\t\t \t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t \t\t die(\"Error Interno PM700: no se pudo determinar el tipo de movimiento de stock. Consulte a la División Software<br>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$campos=\" id_en_stock,id_tipo_movimiento,cantidad,fecha_mov,usuario_mov,comentario\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t $values=\" $id_en_stock,$id_tipo_movimiento,\".$reservas_a_bajar[$j][\"cantidad_utilizada\"].\",'$fecha','$usuario','Utilización de los productos para $titulo_material Nº $id'\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t $sql=\"insert into log_movimientos_stock ($campos) values ($values)\";\r\n\t\t\t\t\t\t\t\t\t\t\t sql($sql,\"<br>Error al insetar en el log de movimientos de stock (insertar649)<br>\") or fin_pagina();\r\n\r\n \t\t}//de elseif($reservas_a_bajar[$j][\"cantidad_utilizada\"]<$reservas_a_bajar[$j][\"cantidad_reservada\"])\r\n \t\telse\r\n \t\t{\r\n \t\t\t//SI ENTRA POR ACA SIGNIFICA QUE LA CANTIDAD UTILIZADA ES MAYOR A LA RESERVADA PARA ESA RESERVA,\r\n \t\t\t//POR LO TANTO LA DECISION ANTERIOR AL ARMAR EL ARREGLO $reservas_a_bajar FUE INCORRECTA. ENTONCES\r\n \t\t\t//NO SE PUEDE CONTINUAR CON LA EJECUCION PORQUE ALGO ESTA MAL HECHO\r\n \t\t\tdie(\"Error interno: La cantidad que se decidio utilizar para la reserva con id \".$reservas_a_bajar[$j][\"id\"].\" es mayor a la que estaba reservada originalmente.<br>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCantidad a utilizar: \".$reservas_a_bajar[$j][\"cantidad_utilizada\"].\" - Cantidad reservada: \".$reservas_a_bajar[$j][\"cantidad_reservada\"].\"<br>\r\n \t\t\t No se puede continuar la ejecución. Contacte a la División Software\");\r\n \t\t}//del else\r\n\r\n \t}//de if($reservas_a_bajar[$j][\"cantidad_utilizada\"]>0)\r\n\r\n }//de for($j=0;$j<sizeof($reservas_a_bajar);$j++)\r\n\r\n\t\t\t\t\t\t\t\t\t}//if($acum_otras_reservas)\r\n\r\n\t\t\t\t\t\t\t\t}//del else de if($nueva_reserva_pm)\r\n///////////////////////////////\r\n\r\n\t\t\t\t\t\t }//de if ($items[$i][\"cantidad_res\"]>0)\r\n }//de if($items[$i]['id_producto'])\r\n }//de if($items[$i]['id_detalle_movimiento']==\"\")\r\n //sino, si la fila no fue borrada, la actualizamos\r\n elseif($tam_filas_borrar>0 && !in_array($items[$i]['id_detalle_movimiento'],$filas_borrar))\r\n {\r\n\r\n\t for($j=0;$j<$items_en_bd['cantidad'];$j++){\r\n\r\n\t if ($items_en_bd[$j][\"id_detalle_movimiento\"]==$items[$i][\"id_detalle_moviento\"])\r\n\t $cantidad_reservada_bd=$items_en_bd[$j][\"cantidad\"];\r\n\r\n\t }\r\n\r\n\t if ($cantidad_reservada_bd==$items[$i][\"cantidad\"])\r\n\t {\r\n\t //se modifico la cantidad y tendriamos que borrar los reservados\r\n\t //cancelar_reserva\r\n\t //reservar_stock\r\n\t }\r\n\r\n\t $query=\"update detalle_movimiento set descripcion='\".$items[$i]['descripcion'].\"',cantidad=\".$items[$i]['cantidad'].\",precio=\".(($items[$i]['precio']!=\"\")?$items[$i]['precio']:0).\"\r\n\t where id_detalle_movimiento=\".$items[$i]['id_detalle_movimiento'];\r\n\t sql($query) or fin_pagina(\"<br>Error al actualizar el producto $i del movimiento <br>$query\");\r\n\r\n\r\n }//de elseif($tam_filas_borrar>0 && !in_array($items[$i]['id_detalle_movimiento'],$filas_borrar))\r\n }//de for($i=0;$i<$items['cantidad'];$i++)\r\n\r\n $db->CompleteTrans();\r\n}", "public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }", "public function subir_archivo_aprobado($archivotmp){ \n $i=0;\n $nro=0;\n $lineas = file($archivotmp);\n \n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){ \n $datos = explode(\";\",$linea);\n if(count($datos)==7){\n $da=$datos[0]; /// Da\n $ue=$datos[1]; /// Ue\n $prog=$datos[2]; /// Aper Programa\n $proy=trim($datos[3]);\n if(strlen($proy)==2){\n $proy='00'.$proy; /// Aper Proyecto\n }\n $act=trim($datos[4]); /// Aper Actividad\n if(strlen($act)==2){\n $act='0'.$act;\n }\n\n //$act='0'.trim($datos[4]); /// Aper Actividad\n $cod_part=trim($datos[5]); /// Partida\n if(strlen($cod_part)==3){\n $cod_part=$cod_part.'00';\n }\n\n $importe=(float)$datos[6]; /// Monto\n\n\n /* $prog=$datos[0]; /// Aper Programa\n $proy=$datos[1]; /// Aper Proyecto\n $act=$datos[2]; /// Aper Actividad\n $cod_part=$datos[3]; /// Partida\n $importe=(float)$datos[4]; /// Monto*/\n if(strlen($prog)==2 & strlen($proy)==4 & strlen($act)==3 & $importe!=0 & is_numeric($cod_part)){\n $aper=$this->model_ptto_sigep->get_apertura($prog,$proy,$act);\n if(count($aper)!=0){\n $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }\n\n $ptto=$this->model_ptto_sigep->get_ptto_sigep_aprobado($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n /*------------------- Update Datos ----------------------*/\n $query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->fun_id\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep_aprobado', $update_ptto);\n /*-------------------------------------------------------*/\n $nro++;\n }\n else{\n /*-------------------- Guardando Datos ------------------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => $aper[0]['aper_id'],\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->fun_id,\n );\n $this->db->insert('ptto_partidas_sigep_aprobado', $data_to_store);\n $sp_id=$this->db->insert_id();\n /*-------------------------------------------------------*/\n }\n $nro++;\n }\n else{\n $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }\n /*-------------------- Guardando Datos ------------------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => 0,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->fun_id,\n );\n $this->db->insert('ptto_partidas_sigep_aprobado', $data_to_store);\n $sp_id=$this->db->insert_id();\n /*-------------------------------------------------------*/ \n $nro++;\n }\n }\n elseif(strlen($prog)==2 & strlen($proy)==4 & strlen($act)==3 & $importe==0){\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n //echo \"UPDATES 0->VALOR : \".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*------------------- Update Datos ----------------------*/\n $query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->fun_id\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep_aprobado', $update_ptto);\n /*-------------------------------------------------------*/\n $nro++;\n }\n }\n }\n }\n $i++;\n }\n return $nro;\n }", "static public function mdlIngresarTallerTerminado($datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO entallerjf (\n id_cabecera,\n articulo,\n cod_operacion,\n cantidad,\n usuario,\n total_precio,\n total_tiempo,\n codigo,\n trabajador,\n fecha_proceso,\n fecha_terminado,\n estado\n ) \n (SELECT \n :codigo,\n a.articulo,\n od.cod_operacion,\n :cantidad,\n :usuario,\n ((od.precio_doc) / 12) * :cantidad,\n ((od.tiempo_stand) / 60) * :cantidad,\n :editarBarra,\n :trabajador,\n :fecha_proceso,\n :fecha_terminado,\n 3 \n FROM\n articulojf a \n LEFT JOIN operaciones_detallejf od \n ON a.modelo = od.modelo \n WHERE articulo = :articulo AND cod_operacion= :operacion)\");\n\n $stmt->bindParam(\":articulo\", $datos[\"articulo\"], PDO::PARAM_STR);\n $stmt->bindParam(\":codigo\", $datos[\"codigo\"], PDO::PARAM_INT);\n $stmt->bindParam(\":cantidad\", $datos[\"cantidad\"], PDO::PARAM_INT);\n $stmt->bindParam(\":usuario\", $datos[\"usuario\"], PDO::PARAM_STR);\n $stmt->bindParam(\":editarBarra\", $datos[\"editarBarra\"], PDO::PARAM_STR);\n $stmt->bindParam(\":operacion\", $datos[\"operacion\"], PDO::PARAM_STR);\n $stmt->bindParam(\":trabajador\", $datos[\"trabajador\"], PDO::PARAM_STR);\n $stmt->bindParam(\":fecha_proceso\", $datos[\"fecha_proceso\"], PDO::PARAM_STR);\n $stmt->bindParam(\":fecha_terminado\", $datos[\"fecha_terminado\"], PDO::PARAM_STR);\n\t\t\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\n\t}", "private function importar_ordenes_rafam($ejercicio,$numero){\n // $stid = oci_parse($conn, $sql);\n // oci_execute($stid);\n \n // // echo \"<table border='1'>\\n\";\n // // while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {\n // // echo \"<tr>\\n\";\n // // foreach ($row as $key=>$item) {\n // // echo \" <td>\" . ($item !== null ? htmlentities($key.'-'.$item, ENT_QUOTES) : \"\") . \"</td>\\n\";\n // // }\n // // echo \"</tr>\\n\";\n // // }\n // // echo \"</table>\\n\";\n // die();\n // $conn = oci_connect('OWNER_RAFAM', 'OWNERDBA', \"(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.0.18)(PORT = 1521)))(CONNECT_DATA=(SID=HMABB)))\");\n \n // if (!$conn) {\n // $e = oci_error();\n // trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);\n // }\n $connection_rafam = \\Yii::$app->dbRafam;\n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n \n\n //Importo los Ordenes de Compra\n $sql= \"SELECT oc.NRO_OC,oc.EJERCICIO,TO_CHAR(oc.FECH_OC, 'YYYY-MM-DD') as FECHA_OC,\n oc.COD_PROV, oci.item_oc,oci.descripcion,oci.cantidad,oci.imp_unitario,\n pci.inciso, pci.par_prin, pci.par_parc, pci.clase, pci.tipo\n FROM orden_compra oc, oc_items oci, adjudicaciones a, ped_cotizaciones pc, ped_cotizaciones_items pci\n WHERE oc.ejercicio=oci.ejercicio AND oc.nro_oc=oci.nro_oc AND oc.uni_compra=2 AND oc.estado_oc<>'A' AND oci.uni_compra=2\n AND oc.ejercicio=a.ejercicio AND oc.nro_adjud=a.nro_adjudic AND a.deleg_solic=2 AND a.estado<>'A'\n AND pc.ejercicio=a.ejercicio AND a.nro_coti=pc.nro_coti AND pc.deleg_solic=2 AND pc.estado<>'A' AND pc.nro_llamado=a.nro_llamado\n AND pci.nro_llamado=pc.nro_llamado\n AND pci.ejercicio=pc.ejercicio AND pci.nro_coti=pc.nro_coti AND pci.item_real=oci.item_real \n AND oc.EJERCICIO=$ejercicio AND oc.NRO_OC=$numero\n ORDER BY oc.EJERCICIO,oc.NRO_OC,oci.item_oc\";\n\n $command = $connection_rafam->createCommand($sql);\n $orden = $command->queryAll();\n\n $oc_nro_actual='';\n foreach ($orden as $key => $row) {\n \n $oc_nro = $row['EJERCICIO'].str_pad( $row['NRO_OC'], 6, \"0\", STR_PAD_LEFT);\n $oc_proveed = $row['COD_PROV'];\n $oc_fecha = $row['FECHA_OC'];\n \n if ($oc_nro!=$oc_nro_actual){\n $orden_compra_existente = false;\n $orden_compra = OrdenCompra::findOne($oc_nro);\n if (!isset($orden_compra)){\n $oc_nro_actual = $oc_nro;\n $orden_compra = new OrdenCompra();\n $orden_compra->OC_NRO = $oc_nro;\n $orden_compra->OC_PROVEED = $oc_proveed;\n $this->verificar_proveedor($oc_proveed);\n $orden_compra->OC_FECHA = $oc_fecha;\n $orden_compra->OC_FINALIZADA = 0; \n if (!$orden_compra->save()){\n $mensaje = \"\"; \n foreach ($orden_compra->getFirstErrors() as $key => $value) {\n $mensaje .= \"$value \\\\n\\\\r\";\n }\n \n throw new ErrorException($mensaje);\n }\n \n }else{\n $orden_compra_existente = true;\n }\n }\n \n if (!$orden_compra_existente){\n $codigo_rafam_articulo = $row['INCISO'].'.'.$row['PAR_PRIN']\n .'.'.$row['PAR_PARC']\n .'.'.str_pad( $row['CLASE'], 5, \"0\", STR_PAD_LEFT)\n .'.'.str_pad( $row['TIPO'], 4, \"0\", STR_PAD_LEFT);\n\n $renglon = new OrdenCompra_renglones(); \n $renglon->EN_NROOC = $oc_nro;\n $renglon->EN_ITEM = $row['ITEM_OC'];\n $renglon->EN_CANT = $row['CANTIDAD'];\n $renglon->EN_COSTO = $row['IMP_UNITARIO'];\n $renglon->EN_CODRAFAM = $codigo_rafam_articulo;\n if (!$renglon->save()){\n $mensaje = \"\"; \n foreach ($renglon->getFirstErrors() as $key => $value) {\n $mensaje .= \"$value \\\\n\\\\r\";\n }\n \n throw new ErrorException($mensaje);\n }\n }\n }\n\n $transaction->commit();\n return true;\n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n }", "public static function generateTxt(){\n $archivo = fopen('documents/proveedores.txt','a');\n //------- Creamos el Encabepado --------\n fputs($archivo,\"codigo_del_proveedor\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"descripcion_del_proveedor\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"tipo_de_proveedor\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"rif\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"otra_descripcion\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"direccion\");\n fputs($archivo,\" ; \");\n fputs($archivo,\"telefono\");\n\n fputs($archivo,\"\\n\");\n\n //--------------------------------\n\n //----------- --------------------------\n $rows=Proveedores::find()->all();\n foreach($rows as $row)\n {\n fputs($archivo,$row->codigo);\n fputs($archivo,\";\");\n fputs($archivo,Proveedores::getSubString($row->razon,100));\n fputs($archivo,\";\");\n fputs($archivo,$row->tipo);\n fputs($archivo,\";\");\n fputs($archivo,$row->cedrif);\n fputs($archivo,\";\");\n fputs($archivo,'XXX');\n fputs($archivo,\";\");\n if (is_null($row->direccion)) fputs($archivo,'XXX'); else fputs($archivo,$row->direccion);\n fputs($archivo,\";\");\n if (($row->telefono==\"\")) fputs($archivo,'XXX'); else fputs($archivo,$row->telefono);\n fputs($archivo,\"\\n\");\n\n\n\n }\n fclose($archivo);\n\n\n }", "public function uploadNormaInsentivePanen($params = array()) {\n $sql = \"SELECT EXTRACT(YEAR FROM PERIOD_BUDGET) AS YEAR_PERIODE, PERIOD_BUDGET FROM TM_PERIOD WHERE STATUS = 'OPEN'\";\n $periode = $this->_db->fetchRow($sql);\n\n if ($_FILES['file']['size'] > 0) {\n //get the csv file\n $data = array();\n $file = $_FILES['file']['tmp_name'];\n $handle = fopen($file,\"r\");\n\n $total_rec = 0; $r = 0; \n $line_error = array(); $data_inserted = 0;\n $message = array(); $single_row_data = array();\n\n $uniq_code_file = $this->_global->genFileName();\n $filename = $uniq_code_file.'_'.$params['ba_code'].'_NORMA_INSENTIVE_PANEN';\n $this->_global->createSqlFile($filename, \"START : \".date(\"Y-m-d H:i:s\").\"\\n\"); //start create file\n\n do {\n if ($r>1) {\n $row = array(\n 'PERIOD_BUDGET' => 'TO_DATE(\\''.$this->_period.'\\',\\'DD-MM-RRRR\\')',\n 'BA_CODE' => addslashes($data[1]),\n 'PERCENTAGE_INCENTIVE_1' => addslashes($data[3]),\n 'INCENTIVE_1' => addslashes($data[4]),\n 'PERCENTAGE_INCENTIVE_2' => addslashes($data[5]),\n 'INCENTIVE_2' => addslashes($data[6]),\n 'PERCENTAGE_INCENTIVE_3' => addslashes($data[7]),\n 'INCENTIVE_3' => addslashes($data[8]),\n // 'FLAG_TEMP' => 'Y', // Flag temporary data\n 'INSERT_USER' => $this->_userName,\n 'INSERT_TIME' => 'SYSDATE',\n );\n\n $single_row_data = array_merge($row);\n\n $array_keys = array_keys($single_row_data);\n\n $ex = \"SELECT count(*) EXIST from TN_INSENTIVE_PANEN where PERIOD_BUDGET = TO_DATE('\".$this->_period.\"','DD-MM-RRRR') and BA_CODE = '\".addslashes($data[1]).\"'\";\n $exists = $this->_db->fetchRow($ex);\n\n if(intval($exists['EXIST']) != 0) {\n $exclude_key = array('PERIOD_BUDGET', 'BA_CODE', 'INSERT_USER', 'INSERT_TIME');\n foreach ($exclude_key as $key) {\n unset($row[$key]);\n }\n\n $sql = 'UPDATE TN_INSENTIVE_PANEN SET ';\n foreach ($row as $key => $value) {\n $sql .= \"$key = '$value', \";\n }\n $sql .= \"UPDATE_USER = '\".$this->_userName.\"', UPDATE_TIME = SYSDATE \";\n $sql .= \"WHERE BA_CODE = '\".addslashes($data[1]).\"' AND PERIOD_BUDGET = TO_DATE('\".$this->_period.\"','DD-MM-RRRR')\";\n\n } else {\n $sql = 'INSERT INTO TN_INSENTIVE_PANEN ('.implode(', ', $array_keys).') VALUES (';\n foreach($array_keys as $key) {\n if($key == 'INSERT_TIME' || $key == 'PERIOD_BUDGET') {\n $sql .= \"$single_row_data[$key], \";\n } else {\n $sql .= \"'$single_row_data[$key]', \";\n }\n }\n $sql = substr($sql, 0, -2).')';\n \n }\n\n try {\n $this->_db->query($sql);\n $this->_db->commit();\n $this->_global->createSqlFile($filename, \"$sql\".\";\\n\");\n $data_inserted++;\n } catch (Exception $e) {\n $line_error[] = 'Data error pada baris '.$r.', detail messagenya. '.$e->getMessage();\n }\n\n $total_rec++;\n }\n $r++;\n \n } while ($data = fgetcsv($handle,1000,\",\",\"'\"));\n $this->_global->createSqlFile($filename, \"COMMIT; \");\n $this->_global->createSqlFile($filename, date('Y-m-d H:i:s').\"\\n\");\n \n $message = array(\n 'data_count' => '<strong>Jumlah Data:</strong> '.$total_rec,\n 'data_inserted' => '<strong>Data Inserted:</strong> '.$data_inserted,\n 'data_failed' => '<strong>Data Failed:</strong> '.count($line_error),\n );\n if(count($line_error) > 0) {\n $message['error_message'] = '<strong>Error Message:</strong></p><p><ul><li>'. implode(\"</li><li>\", $line_error) .'</li>';\n }\n }\n return $message;\n }", "public function uploadNormaPanenPremiLangsir($params = array())\n {\n $data = array();\n $newdata_ba = array();\n $datachk = array();\n $total_rec = $ins_rec = $lastBaCode = $update_rec = 0;\n \n if ($_FILES[file][size] > 0) {\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************\n //1. ****************** Check BA dari CSV FILE\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n $arrba = array();\n do {\n if (($datachk[0])&&($total_rec > 1)) {\n array_push($arrba,$datachk[1]);\n }\n $total_rec++;\n } while($datachk = fgetcsv($handle,1000,\";\",\"'\"));\n $arrbadis = array_values(array_unique($arrba, SORT_REGULAR)); //variabel array list BA pada CSV\n \n //2. ****************** Baca Urutan Upload dari T_SEQ\n $sqlCurTask=\"SELECT SEQ_NUM FROM T_SEQ WHERE TABLE_NAME='TN_PANEN_PREMI_LANGSIR'\";\n $seqNum = $this->_db->fetchOne($sqlCurTask);\n $sqlSeq=\"SELECT * FROM T_SEQ WHERE SEQ_NUM < ($seqNum) ORDER BY SEQ_NUM, TASK_NAME\";\n $rows = $this->_db->fetchAll($sqlSeq);\n if (!empty($rows)) {\n foreach ($rows as $idx => $row) { \n $tablechk = $row['REMARKS'];\n //2.1 ****************** get BA CODE yang sudah dimasukan pada table di awal sequence\n $sqlba = \"SELECT DISTINCT BA_CODE FROM \".$row['TABLE_NAME'];\n $arrnormaba = array();\n $arrlockba = array();\n $rowsba = $this->_db->fetchAll($sqlba);\n foreach ($rowsba as $idxba => $rowba) {\n array_push($arrnormaba,$rowba['BA_CODE']); //variabel array list BA pada masing2 norma\n //2.2 ****************** get STATUS LOCK masing2 BA CODE di T_SEQ\n $sqlba1 = \"SELECT STATUS FROM T_SEQ_CHECK WHERE BA_CODE='\".$rowba['BA_CODE'].\"' AND TASK_NAME='\".$row['TABLE_NAME'].\"'\";\n \n $arrlockba[$rowba['BA_CODE']] = $this->_db->fetchOne($sqlba1);\n } \n $arrNotFound=array();\n for($x=0;$x<count($arrbadis);$x++){\n if(!in_array($arrbadis[$x],$arrnormaba)){ //check apakah data ba csv ada di data ba norma?\n $arrNotFound[]=$arrbadis[$x];\n }elseif($arrlockba[$arrbadis[$x]]==\"LOCKED\"){\n $arrNotFound[]=$arrbadis[$x];\n }\n }\n if($arrNotFound) break;\n }\n }\n $arrNotFound =array();\n if($arrNotFound){\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'ba_notfound' => implode(\",\",$arrNotFound),\n 'task_err' => $tablechk\n );\n return $return;\n }\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************//\n //get the csv file\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n \n $total_rec = 0;\n \n //loop through the csv file and insert into database\n do {\n if (($data[0])&&($total_rec > 1)) {\n \n if ($lastBaCode <> addslashes($data[0])){\n /*try {\n //remove data\n $sqlDelete = \"\n DELETE FROM TN_PANEN_PREMI_LANGSIR\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n \";\n //log file penghapusan data\n $this->_global->deleteDataLogFile($sqlDelete); \n $this->_db->query($sqlDelete);\n } catch (Exception $e) {\n }*/\n $newdata_ba[] = addslashes($data[0]);\n }\n \n //cek data\n $sql = \"\n SELECT COUNT(*)\n FROM TN_PANEN_PREMI_LANGSIR\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND VRA_CODE = TRIM('\".addslashes($data[1]).\"')\n \";\n $count = $this->_db->fetchOne($sql);\n if ($count == 0) {\n try {\n //insert data\n $sql = \"\n INSERT INTO TN_PANEN_PREMI_LANGSIR (PERIOD_BUDGET, \n BA_CODE,\n VRA_CODE, \n TON_TRIP, \n TRIP_HARI, \n HM_TRIP, \n INSERT_USER, \n INSERT_TIME)\n VALUES (\n TO_DATE('{$this->_period}','DD-MM-RRRR'),\n TRIM('\".addslashes($data[0]).\"'),\n TRIM('\".addslashes($data[1]).\"'),\n '\".addslashes($data[2]).\"',\n '\".addslashes($data[3]).\"',\n '\".addslashes($data[4]).\"',\n '{$this->_userName}',\n SYSDATE\n )\n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $ins_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA PANEN PREMI LANGSIR', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA PANEN PREMI LANGSIR', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n // cek apakah data non-aktif\n $sql = \"\n SELECT COUNT(*)\n FROM TN_PANEN_PREMI_LANGSIR\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND VRA_CODE = TRIM('\".addslashes($data[1]).\"')\n AND DELETE_USER IS NULL\n \";\n $count = $this->_db->fetchOne($sql);\n \n if ($count == 0) {\n // update data menjadi aktif jika sebelumnya telah dinon-aktifkan\n try {\n \n $sql = \"\n UPDATE TN_PANEN_PREMI_LANGSIR\n SET TON_TRIP = '\".addslashes($data[2]).\"',\n TRIP_HARI = '\".addslashes($data[3]).\"',\n HM_TRIP = '\".addslashes($data[4]).\"',\n UPDATE_USER = '{$this->_userName}',\n UPDATE_TIME = SYSDATE,\n DELETE_USER = NULL,\n DELETE_TIME = NULL\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND VRA_CODE = TRIM('\".addslashes($data[1]).\"')\n \n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $update_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA PANEN PREMI LANGSIR', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA PANEN PREMI LANGSIR', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n }\n }\n $lastBaCode = addslashes($data[0]);\n }\n $total_rec++;\n } while ($data = fgetcsv($handle,1000,\",\",\"'\"));\n //\n $return = array(\n 'status' => 'done',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }else{\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }\n // ********************************************** HITUNG SEMUA HASIL UPLOAD **********************************************\n // Sabrina / 2013-08-22\n \n if (!empty($newdata_ba)) {\n try {\n $auto_calc = new Application_Model_NormaPanenPremiLangsir();\n \n foreach ($newdata_ba as $idx => $ba_code) {\n $params['budgetperiod'] = date(\"Y\", strtotime($this->_period));\n $params['key_find'] = $ba_code;\n \n $records1 = $this->_db->fetchAll(\"{$auto_calc->getData($params)}\");\n \n foreach ($records1 as $idx1 => $record1) {\n $auto_calc->calculateData($record1);\n }\n }\n //log DB\n $this->_global->insertLog('UPDATE SUCCESS', 'NORMA PANEN PREMI LANGSIR', '', '');\n } catch (Exception $e) {\n //log DB\n $this->_global->insertLog('UPDATE FAILED', 'NORMA PANEN PREMI LANGSIR', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n \n //return value\n $result = false;\n } \n } \n // ********************************************** END OF HITUNG SEMUA HASIL UPLOAD **********************************************\n \n return $return;\n }", "function DetailBIPOT() {\r\n global $_lf;\r\n $bipotid = $_REQUEST['bipotid'];\r\n $bpt = GetFields('bipot', 'BIPOTID', $bipotid, '*');\r\n $prg = GetaField('program', 'ProgramID', $bpt['ProgramID'], 'Nama');\r\n $prd = GetaField('prodi', 'ProdiID', $bpt['ProdiID'], 'Nama');\r\n \r\n $nmf = HOME_FOLDER . DS . \"tmp/$_SESSION[_Login].bipot.dwoprn\";\r\n $f = fopen($nmf, 'w');\r\n $mxc = 114;\r\n $grs = str_pad('-', $mxc, '-').$_lf;\r\n $hdr = str_pad(\"Daftar Biaya & Potongan $bpt[TahunID]\", $mxc, ' ', STR_PAD_BOTH).$_lf.\r\n str_pad($bpt['Nama'], $mxc, ' ', STR_PAD_BOTH).$_lf.\r\n str_pad(\"Program: $prg, Prodi: $prd\", $mxc, ' ', STR_PAD_BOTH).$_lf.\r\n $grs . \"No. Prio \".\r\n str_pad(\"Nama\", 30).\r\n str_pad(\"Jumlah\", 12, ' ', STR_PAD_LEFT). ' '.\r\n str_pad(\"Penarikan\", 12).\r\n str_pad(\"Oto?\", 5).' '.\r\n str_pad(\"St.Awal\", 12).' '.\r\n str_pad(\"St.Mhsw\", 12).' '.\r\n str_pad(\"Grade\", 5).' '.\r\n $_lf . $grs;\r\n \r\n $s = \"select b2.*, bn.Nama, format(b2.Jumlah, 0) as JML,\r\n t.Nama as NMTRX, s.Nama as SAAT\r\n from bipot2 b2\r\n left outer join bipotnama bn on b2.BIPOTNamaID=bn.BIPOTNamaID\r\n left outer join saat s on b2.SaatID=s.SaatID\r\n left outer join trx t on b2.TrxID=t.TrxID\r\n where b2.BIPOTID='$bipotid' and KodeID='$_SESSION[KodeID]'\r\n order by b2.TrxID, b2.Prioritas, b2.GradeNilai\";\r\n $r = _query($s); $n = 0;\r\n fwrite($f, $hdr);\r\n while ($w = _fetch_array($r)) {\r\n $n++;\r\n $jml = number_format($w['Jumlah']);\r\n $sa = TRIM($w['StatusAwalID'], '.');\r\n $sa = str_replace('.', ',', $sa);\r\n $sm = TRIM($w['StatusMhswID'], '.');\r\n $sm = str_replace('.', ',', $sm);\r\n fwrite($f, str_pad($n, 4).\r\n str_pad($w['Prioritas'], 5).\r\n str_pad($w['Nama'], 30).\r\n str_pad($jml, 12, ' ', STR_PAD_LEFT). ' '.\r\n str_pad($w['SAAT'], 12).\r\n str_pad($w['Otomatis'], 5, ' ', STR_PAD_BOTH) . ' '.\r\n str_pad($sa, 12). ' '.\r\n str_pad($sm, 12). ' '.\r\n str_pad($w['GradeNilai'], 5, ' ', STR_PAD_BOTH).\r\n $_lf);\r\n }\r\n fwrite($f, $grs);\r\n fclose($f);\r\n TampilkanFileDWOPRN($nmf);\r\n}", "public function uploadNormaPanenPremiMandor($params = array())\n {\n $data = array();\n $total_rec = $ins_rec = $lastBaCode = $update_rec = 0;\n $datachk = array();\n if ($_FILES[file][size] > 0) {\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************\n //1. ****************** Check BA dari CSV FILE\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n $arrba = array();\n do {\n if (($datachk[0])&&($total_rec > 1)) {\n array_push($arrba,$datachk[1]);\n }\n $total_rec++;\n } while($datachk = fgetcsv($handle,1000,\";\",\"'\"));\n $arrbadis = array_values(array_unique($arrba, SORT_REGULAR)); //variabel array list BA pada CSV\n \n //2. ****************** Baca Urutan Upload dari T_SEQ\n $sqlCurTask=\"SELECT SEQ_NUM FROM T_SEQ WHERE TABLE_NAME='TN_PANEN_PREMI_MANDOR'\";\n $seqNum = $this->_db->fetchOne($sqlCurTask);\n $sqlSeq=\"SELECT * FROM T_SEQ WHERE SEQ_NUM < ($seqNum) ORDER BY SEQ_NUM, TASK_NAME\";\n $rows = $this->_db->fetchAll($sqlSeq);\n if (!empty($rows)) {\n foreach ($rows as $idx => $row) { \n $tablechk = $row['REMARKS'];\n //2.1 ****************** get BA CODE yang sudah dimasukan pada table di awal sequence\n $sqlba = \"SELECT DISTINCT BA_CODE FROM \".$row['TABLE_NAME'];\n $arrnormaba = array();\n $arrlockba = array();\n $rowsba = $this->_db->fetchAll($sqlba);\n foreach ($rowsba as $idxba => $rowba) {\n array_push($arrnormaba,$rowba['BA_CODE']); //variabel array list BA pada masing2 norma\n //2.2 ****************** get STATUS LOCK masing2 BA CODE di T_SEQ\n $sqlba1 = \"SELECT STATUS FROM T_SEQ_CHECK WHERE BA_CODE='\".$rowba['BA_CODE'].\"' AND TASK_NAME='\".$row['TABLE_NAME'].\"'\";\n \n $arrlockba[$rowba['BA_CODE']] = $this->_db->fetchOne($sqlba1);\n } \n $arrNotFound=array();\n for($x=0;$x<count($arrbadis);$x++){\n if(!in_array($arrbadis[$x],$arrnormaba)){ //check apakah data ba csv ada di data ba norma?\n $arrNotFound[]=$arrbadis[$x];\n }elseif($arrlockba[$arrbadis[$x]]==\"LOCKED\"){\n $arrNotFound[]=$arrbadis[$x];\n }\n }\n if($arrNotFound) break;\n }\n }\n $arrNotFound =array();\n if($arrNotFound){\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'ba_notfound' => implode(\",\",$arrNotFound),\n 'task_err' => $tablechk\n );\n return $return;\n }\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************//\n //get the csv file\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n \n $total_rec = 0;\n \n //loop through the csv file and insert into database\n do {\n if (($data[0])&&($total_rec > 1)) {\n /*\n if ($lastBaCode <> addslashes($data[0])){\n try {\n //remove data\n $sqlDelete = \"\n DELETE FROM TN_PANEN_PREMI_MANDOR\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n \";\n //log file penghapusan data\n $this->_global->deleteDataLogFile($sqlDelete); \n $this->_db->query($sqlDelete);\n } catch (Exception $e) {\n \n }\n }\n */\n //cek data\n $sql = \"\n SELECT COUNT(*) \n FROM TN_PANEN_PREMI_MANDOR\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND PREMI_MANDOR_CODE = '\".addslashes($data[1]).\"'\n \";\n $count = $this->_db->fetchOne($sql);\n if ($count == 0) {\n try {\n //insert data\n $sql = \"\n INSERT INTO TN_PANEN_PREMI_MANDOR (PERIOD_BUDGET, BA_CODE, PREMI_MANDOR_CODE, DESCRIPTION, MIN_YIELD, MAX_YIELD, MIN_OER, MAX_OER, VALUE, INSERT_USER, INSERT_TIME)\n VALUES (\n TO_DATE('{$this->_period}','DD-MM-RRRR'),\n TRIM('\".addslashes($data[0]).\"'),\n '\".addslashes($data[1]).\"',\n '\".addslashes($data[2]).\"',\n '\".addslashes($data[3]).\"',\n '\".addslashes($data[4]).\"',\n '\".addslashes($data[5]).\"',\n '\".addslashes($data[6]).\"',\n '\".addslashes($data[7]).\"',\n '{$this->_userName}',\n SYSDATE\n )\n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $ins_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA PANEN PREMI MANDOR', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA PANEN PREMI MANDOR', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n // cek apakah data non-aktif\n $sql = \"\n SELECT COUNT(*) \n FROM TN_PANEN_PREMI_MANDOR\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND PREMI_MANDOR_CODE = '\".addslashes($data[1]).\"'\n AND DELETE_USER IS NULL\n \";\n $count = $this->_db->fetchOne($sql);\n \n if ($count == 0) {\n // update data menjadi aktif jika sebelumnya telah dinon-aktifkan\n try {\n $sql = \"\n UPDATE TN_PANEN_PREMI_MANDOR\n SET DESCRIPTION = '\".addslashes($data[2]).\"',\n MIN_YIELD = '\".addslashes($data[3]).\"',\n MAX_YIELD = '\".addslashes($data[4]).\"',\n MIN_OER = '\".addslashes($data[5]).\"',\n MAX_OER = '\".addslashes($data[6]).\"',\n VALUE = '\".addslashes($data[7]).\"',\n UPDATE_USER = '{$this->_userName}',\n UPDATE_TIME = SYSDATE,\n DELETE_USER = NULL,\n DELETE_TIME = NULL\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND PREMI_MANDOR_CODE = '\".addslashes($data[1]).\"'\n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $update_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA PANEN PREMI MANDOR', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA PANEN PREMI MANDOR', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n }\n }\n $lastBaCode = addslashes($data[0]);\n }\n $total_rec++;\n } while ($data = fgetcsv($handle,1000,\",\",\"'\"));\n //\n $return = array(\n 'status' => 'done',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }else{\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }\n \n return $return;\n }", "function consultar_opedidos(){\n \n $query_RecordsetResumo = \"SELECT * FROM CAIXACUPOM \";\n $query_RecordsetResumo .= \" WHERE TIPOATENDIMENTO = 'DELIVERY' \";\n #$query_RecordsetResumo .= \" AND STATUS_GO4YOU != '4' \";\n $query_RecordsetResumo .= \" ORDER BY CAIXACUPOM_CONTROLE DESC\";\n $query_RecordsetResumo .= \" LIMIT 20\";\n $RecordsetResumo = mysql_query($query_RecordsetResumo, $con) or die(mysql_error());\n $row_RecordsetResumo = mysql_fetch_assoc($RecordsetResumo);\n $totalRows_RecordsetResumo = mysql_num_rows($RecordsetResumo);\n \n $tempo = $_SESSION['TEMPO_PREPARACAO'];\n $pedidos = array();\n $i = 0;\n if($totalRows_RecordsetResumo != 0 ){\n do {\n \n # Checa se percisa alterar o status\n if(dif_hora(acrescenta_min($row_RecordsetResumo['DATAHORA' ], $tempo)) == 2 && $row_RecordsetResumo['STATUS_GO4YOU'] == \"0\"){\n update_status($row_RecordsetResumo['CAIXACUPOM_CONTROLE'], 2);\n }\n \n # Condicao para gerar contador de Tempo\n $status = \" excedido \";\n if($row_RecordsetResumo['STATUS_GO4YOU'] == \"0\" && dif_hora(acrescenta_min($row_RecordsetResumo['DATAHORA' ], $tempo)) != 2){\n $status = dif_hora_draw(acrescenta_min($row_RecordsetResumo['DATAHORA'], $tempo), date('Y-m-d H:i:s'));\n }\n \n $pedidos[$i]['CAIXACUPOM_CONTROLE'] = $row_RecordsetResumo['CAIXACUPOM_CONTROLE' ];\n $pedidos[$i]['DATAHORA' ] = dataMySql2BR($row_RecordsetResumo['DATAHORA' ]);\n $pedidos[$i]['TEMPO_PREVISTO' ] = acrescenta_min($row_RecordsetResumo['DATAHORA' ], $tempo);\n $pedidos[$i]['STATUS_GO4YOU' ] = trata_texto(status($row_RecordsetResumo['STATUS_GO4YOU']));\n $pedidos[$i]['TEMPO' ] = $status;\n $pedidos[$i]['STATUS_BTN' ] = $row_RecordsetResumo['STATUS_GO4YOU'] < 4 ? \n '<input type=\"submit\" value=\"'.trata_texto(status($row_RecordsetResumo['STATUS_GO4YOU'] + 1)).'\" onClick=\"update_status('.$row_RecordsetResumo['CAIXACUPOM_CONTROLE'].', '.$row_RecordsetResumo['STATUS_GO4YOU'].')\" style=\"cursor: pointer;\" />' :\n '<input type=\"button\" value=\"Entregue\" disabled />' ;\n ++$i;\n } while ($row_RecordsetResumo = mysql_fetch_assoc($RecordsetResumo)); \n }\n \n return json_encode($pedidos);\n \n}", "function EnviarArquivo($arquivo, $dados = null, $dmdid)\n{\n global $db;\n\n if (!$arquivo || !$dmdid)\n return false;\n\n // obtém o arquivo\n #$arquivo = $_FILES['arquivo'];\n if (!is_uploaded_file($arquivo['tmp_name'])) {\n redirecionar($_REQUEST['modulo'], $_REQUEST['acao'], $parametros);\n }\n // BUG DO IE\n // O type do arquivo vem como image/pjpeg\n if ($arquivo[\"type\"] == 'image/pjpeg') {\n $arquivo[\"type\"] = 'image/jpeg';\n }\n //Insere o registro do arquivo na tabela public.arquivo\n $sql = \"INSERT INTO public.arquivo \t\n\t\t\t(\n\t\t\t\tarqnome,\n\t\t\t\tarqextensao,\n\t\t\t\tarqdescricao,\n\t\t\t\tarqtipo,\n\t\t\t\tarqtamanho,\n\t\t\t\tarqdata,\n\t\t\t\tarqhora,\n\t\t\t\tusucpf,\n\t\t\t\tsisid\n\t\t\t)VALUES(\n\t\t\t\t'\" . current(explode(\".\", $arquivo[\"name\"])) . \"',\n\t\t\t\t'\" . end(explode(\".\", $arquivo[\"name\"])) . \"',\n\t\t\t\t'\" . $dados[\"arqdescricao\"] . \"',\n\t\t\t\t'\" . $arquivo[\"type\"] . \"',\n\t\t\t\t'\" . $arquivo[\"size\"] . \"',\n\t\t\t\t'\" . date('Y-m-d') . \"',\n\t\t\t\t'\" . date('H:i:s') . \"',\n\t\t\t\t'\" . $_SESSION[\"usucpf\"] . \"',\n\t\t\t\t\" . $_SESSION[\"sisid\"] . \"\n\t\t\t) RETURNING arqid;\";\n $arqid = $db->pegaUm($sql);\n\n //Insere o registro na tabela demandas.anexos\n $sql = \"INSERT INTO demandas.anexos \n\t\t\t(\n\t\t\t\tdmdid,\n\t\t\t\tarqid,\n\t\t\t\tanxdtinclusao,\n\t\t\t\tanxstatus\n\t\t\t)VALUES(\n\t\t\t \" . $dmdid . \",\n\t\t\t\t\" . $arqid . \",\n\t\t\t\tnow(),\n\t\t\t\t'A'\n\t\t\t);\";\n $db->executar($sql);\n\n if (!is_dir('../../arquivos/demandas/' . floor($arqid / 1000))) {\n mkdir(APPRAIZ . '/arquivos/demandas/' . floor($arqid / 1000), 0777);\n }\n $caminho = APPRAIZ . 'arquivos/' . $_SESSION['sisdiretorio'] . '/' . floor($arqid / 1000) . '/' . $arqid;\n switch ($arquivo[\"type\"]) {\n case 'image/jpeg':\n ini_set(\"memory_limit\", \"128M\");\n list($width, $height) = getimagesize($arquivo['tmp_name']);\n $original_x = $width;\n $original_y = $height;\n // se a largura for maior que altura\n if ($original_x > $original_y) {\n $porcentagem = (100 * 640) / $original_x;\n } else {\n $porcentagem = (100 * 480) / $original_y;\n }\n $tamanho_x = $original_x * ($porcentagem / 100);\n $tamanho_y = $original_y * ($porcentagem / 100);\n $image_p = imagecreatetruecolor($tamanho_x, $tamanho_y);\n $image = imagecreatefromjpeg($arquivo['tmp_name']);\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $tamanho_x, $tamanho_y, $width, $height);\n imagejpeg($image_p, $caminho, 100);\n //Clean-up memory\n ImageDestroy($image_p);\n //Clean-up memory\n ImageDestroy($image);\n break;\n default:\n if (!move_uploaded_file($arquivo['tmp_name'], $caminho)) {\n $db->rollback();\n return false;\n }\n }\n\n\n $db->commit();\n return true;\n}", "public function save_linea(){\n $sql=\"select LAST_INSERT_ID() as 'pedido' \";\n\n $query = $this->db->query($sql);\n\n //convierte a un objeto\n //ahora le pasamos el dato de pedido\n $pedido_id=$query->fetch_object()->pedido;\n\n // va recorrer el carrito y va guardar cada elemento en la variable elemento como array\n foreach($_SESSION['carrito'] as $elemento){\n //aca e cada arrray guarda los valores a una variable que contenera los valores de los producto por comprar\n $producto =$elemento['producto'];\n\n $insert =\"insert into lineas_pedidos values(NULL,{$pedido_id},{$producto->id},{$elemento['unidades']})\";\n\n //ejecutamos el query para que guarde los elementos en la base de datos\n $save=$this->db->query($insert);\n \n // var_dump($producto);\n // var_dump($insert);\n // var_dump($save);\n // echo $this->db->error;\n // die();\n }\n $result = false; //este es el resultado por defecto\n //si el $save da true (en otras palabras no esta vacio y los datos se llenaron correctamente)\n if($save){\n $result=true;\n }\n return $result;\n\n }", "private static function archivo()\n {\n $balda = $_POST[\"idbalda_am\"];\n //iniciamos la conexion\n $con = mysqli_connect('localhost', 'root', '', 'bd_documentacion');\n if (! $con) {\n die('Error no se pudo conectar : '.mysqli_error($con));\n }\n mysqli_select_db($con, \"ajax_demo\");\n\n $sql = \"SELECT archivos.Tipo_Documento, archivos.id_Archivos, archivos.estado, trasferencia.Sede, trasferencia.Area,trasferencia.Consecutivo,trasferencia.idTrasferencia , trasferencia.archivo FROM archivos LEFT JOIN trasferencia ON archivos.Trasferencia = trasferencia.idTrasferencia WHERE archivos.balda_am_idbalda_am=\".$balda;\n $con->set_charset(\"utf8\");\n $result = mysqli_query($con, $sql);\n $table = \"\";\n\n $boton = '<button type=\"button\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#myModal\" data-balda=\"'.$balda.'\">Agregar Carpeta</button>';\n\n while ($row = mysqli_fetch_array($result)) {\n $class = \"\";\n if ($row[\"estado\"] == \"toda\") {\n $class = \"warning\";\n } else if ($row[\"estado\"] == \"unidad\") {\n $class = \"info\";\n }\n $table .= \"<tr class='\".$class.\"'>\n <td>\".$row[\"Tipo_Documento\"].\"</td>\n <td><a target='_blank' href='\".$row[\"archivo\"].\"'>\".$row[\"Sede\"].\"-\".$row[\"Area\"].\"-\".$row[\"Consecutivo\"].\"</a></td>\n <td> <button type=\\\"button\\\" onclick=\\\"ver('\".$row[\"Tipo_Documento\"].\"','\".$row[\"id_Archivos\"].\"')\\\" class=\\\"btn btn-primary btn-simple btn-xs hvr-bounce-in\\\">\n \n <span style=\\\"font-size: 15px\\\"><i class=\\\"icon-eye\\\"></i></span>\n \n </button> </td>\";\n $table .= \"</tr>\";\n }\n\n $arr = [$table, $boton];\n echo json_encode($arr);\n }", "function Inserir() {\n if($this->GetClienteCPF($this->getCli_cpf())>0):\n echo '<div class=\"alert alert-danger\" id=\"erro_mostra\">Este CPF já esta cadastrado ';\n Sistema::VoltarPagina();\n echo '</div>';\n exit();\n endif;\n \n //se for maior que zero significa que exite algum email igual----------------------\n if($this->GetClienteEmail($this->getCli_email())>0):\n echo '<div class=\"alert alert-danger\" id=\"erro_mostra\">Este Email já esta cadastrado ';\n Sistema::VoltarPagina();\n echo '</div>';\n exit();\n endif;\n //Caso passou na verificação os dados serão gravados no banco-------------------------\n $query = \"INSERT INTO \".$this->prefix.\"clientes (cli_nome,\n cli_sobrenome,\n cli_data_nasc,\n cli_rg,\n cli_cpf,\n cli_ddd,\n cli_fone,\n cli_celular,\n cli_endereco,\n cli_numero,\n cli_bairro,\n cli_cidade,\n cli_uf,\n cli_cep,\n cli_email,\n cli_data_cad,\n cli_hora_cad,\n cli_pass) VALUES (:cli_nome,\n :cli_sobrenome,\n :cli_data_nasc,\n :cli_rg,\n :cli_cpf,\n :cli_ddd,\n :cli_fone,\n :cli_celular,\n :cli_endereco,\n :cli_numero,\n :cli_bairro,\n :cli_cidade,\n :cli_uf,\n :cli_cep,\n :cli_email,\n :cli_data_cad,\n :cli_hora_cad,\n :cli_senha)\";\n \n $params = array(\n ':cli_nome'=> $this->getCli_nome(),\n ':cli_sobrenome'=> $this->getCli_sobrenome(),\n ':cli_data_nasc'=> $this->getCli_data_nasc(),\n ':cli_rg'=> $this->getCli_rg(),\n ':cli_cpf'=> $this->getCli_cpf(),\n ':cli_ddd'=> $this->getCli_ddd(),\n ':cli_fone'=> $this->getCli_fone(),\n ':cli_celular'=> $this->getCli_celular(),\n ':cli_endereco'=> $this->getCli_endereco(),\n ':cli_numero'=> $this->getCli_numero(),\n ':cli_bairro'=> $this->getCli_bairro(),\n ':cli_cidade'=> $this->getCli_cidade(),\n ':cli_uf'=> $this->getCli_uf(),\n ':cli_cep'=> $this->getCli_cep(),\n ':cli_email'=> $this->getCli_email(),\n ':cli_data_cad'=> $this->getCli_data_cad(),\n ':cli_hora_cad'=> $this->getCli_hora_cad(),\n ':cli_senha'=> $this->getCli_senha(),\n \n \n );\n //echo $query;\n $this->ExecuteSQL($query, $params);\n \n \n }", "function crearbd($c){\n $temp=\"\";\n //RUTA DEL FICHERO QUE CONTIENE LA CREACION DE TABLAS\n $ruta_fichero_sql = 'mysql_script/tablas.sql';\n \n \n //CON EL COMANDO FILE,VOLCAMOS EL CONTENIDO DEL FICHERO EN OTRA VARIABLE\n $datos_fichero_sql = file($ruta_fichero_sql);\n //LEEMOS EL FICHERO CON UN BUCLE FOREACH\n foreach($datos_fichero_sql as $linea_a_ejecutar){\n //QUITAMOS LOS ESPACIOS DE ALANTE Y DETRÁS DE LA VARIABLE\n $linea_a_ejecutar = trim($linea_a_ejecutar); \n \n //GUARDAMOS EN LA VARIABLE TEMP EL BLOQUE DE SENTENCIAS QUE VAMOS A EJECUTAR EN MYSQL\n $temp .= $linea_a_ejecutar.\" \";\n //COMPROBAMOS CON UN CONDICIONAL QUE LA LINEA ACABA EN ;, Y SI ES ASI LA EJECUTAMOS\n if(substr($linea_a_ejecutar, -1, 1) == ';'){\n mysqli_query($c,$temp);\n \n //REINICIAMOS LA VARIABLE TEMPORAL\n $temp=\"\";\n \n }//FIN IF BUSCAR SENTENCIA ACABADA EN ;\n else{\n //echo\"MAL\".$temp.\"<br><br>\";\n }\n \n }//FIN FOREACH\n \n \n }", "public static function ingresarFicha($ficha,$programa_formacion,$etapa,$trimestre,$jornada,$tipo){\n\n $fic=Conexion::conectar('localhost','proyecto','root','');\n\n $fich=$fic->prepare(\"SELECT * FROM ficha WHERE numero_ficha=:numero\");\n $fich->execute(array(':numero' => $ficha ));\n\n if ($row=$fich->fetch(PDO::FETCH_ASSOC)) {\n\n setcookie(\"ficha\",\"<div class=\\\"alert alert-danger\\\" role=\\\"alert\\\">\n La ficha ya se encuentra registrada.\n </div>\",time()+10,\"/\");\n header(\"Location: ../vistas/consultar.php?aprendices=fichas\");\n \n }else{\n\n switch ($etapa) {\n case 1:\n $fichaa=$fic->prepare(\"INSERT INTO ficha (id_ficha,numero_ficha,id_programa,id_jornada,id_trimestre,id_etapa,id_tipo_formacion) \n VALUES (NULL, :numero_ficha, :programa, :etapa, :trimestre, :jornada, :tipo)\");\n $fichaa->execute(array(':numero_ficha' => $ficha, \n ':programa' => $programa_formacion, \n ':etapa' => $etapa, \n ':trimestre' => $trimestre, \n ':jornada' => $jornada, \n ':tipo' => $tipo));\n echo $ficha.\" \".$programa_formacion.\" \".$etapa.\" \".$trimestre.\" \".$jornada.\" \".$tipo;\n break;\n\n case 2:\n $fichaa=$fic->prepare(\"INSERT INTO ficha (id_ficha,numero_ficha,id_programa,id_jornada,id_trimestre,id_etapa,id_tipo_formacion) \n VALUES (NULL, :numero_ficha, :programa, :etapa, NULL, NULL, NULL)\");\n $fichaa->execute(array(':numero_ficha' => $ficha, \n ':programa' => $programa_formacion, \n ':etapa' => $etapa));\n break;\n }\n\n setcookie(\"ficha\",\"<div class=\\\"alert alert-primary\\\" role=\\\"alert\\\">\n La ficha fue registrada correctamente.\n </div>\",time()+10,\"/\");\n header(\"Location: ../vistas/consultar.php?aprendices=fichas\");\n } \n }", "function Pedidos_Show() {\n // De sesion\n global $db;\n global $ruta_raiz;\n // Control de visualizaci�n\n global $sFileName;\n global $opcionMenu;\n global $pageAnt; // Pagina de la cual viene\n // Valores\n\n $sFileName = $_POST[\"sFileName\"];\n $opcionMenu = empty($_POST[\"opcionMenu\"]) ? $_GET[\"opcionMenu\"] : $_POST[\"opcionMenu\"];\n\n if(empty($opcionMenu)){\n $opcionMenu = 0;\n }\n // Valores\n $fechaFinal = $_POST[\"fechaFinal\"];\n $fechaInicial = $_POST[\"fechaInicial\"];\n\n $krd = $_SESSION[\"krd\"];\n $dependencia = $_SESSION[\"dependencia\"];\n $usua_doc = $_SESSION[\"usua_doc\"];\n $ps_PRES_ESTADO = strip($_POST[\"s_PRES_ESTADO\"]);\n $ps_RADI_NUME_RADI = strip(trim($_POST[\"s_RADI_NUME_RADI\"]));\n $ps_numeroExpediente = strip(trim($_POST[\"s_numeroExpediente\"]));\n $ps_USUA_LOGIN = strip($_POST['s_USUA_LOGIN']);;\n $ps_DEPE_NOMB = strip($_POST[\"s_DEPE_NOMB\"]);\n $ps_USUA_NOMB = strip($_POST[\"s_USUA_NOMB\"]);\n $ps_hora_limite = strip($_POST[\"s_hora_limite\"]);\n $ps_minuto_limite = strip($_POST[\"s_minuto_limite\"]);\n $ps_meridiano = strip($_POST[\"s_meridiano\"]);\n $ps_PRES_REQUERIMIENTO = strip($_POST[\"s_PRES_REQUERIMIENTO\"]);\n\n\n\n if (strlen($pageAnt) == 0) {\n include_once(\"$ruta_raiz/include/query/prestamo/builtSQL1.inc\");\n //se codiciona para que el prestamos filtre por distintos estados\n //del prestamos.\n // PRESTAMO_ESTADO 1 Solicitado\n // PRESTAMO_ESTADO 2 Prestado\n // PRESTAMO_ESTADO 3 Devuelto\n // PRESTAMO_ESTADO 4 Cancelado\n // PRESTAMO_ESTADO 5 Prestamo Indefinido\n // PRESTAMO_ESTADO 6 Devolver al Proveedor\n if($opcionMenu == 1 or $opcionMenu == 3){\n $sWhere .= \" AND P.PRES_ESTADO = 1 \";\n } elseif($opcionMenu == 2){\n $sWhere .= \" AND P.PRES_ESTADO = 2 \";\n }\n\n include_once(\"$ruta_raiz/include/query/prestamo/builtSQL2.inc\");\n include_once(\"$ruta_raiz/include/query/prestamo/builtSQL3.inc\");\n $iSort = strip(get_param(\"FormPedidos_Sorting\"));\n if (!$iSort)\n $iSort = 20;\n $iSorted = strip(get_param(\"FormPedidos_Sorted\"));\n $sDirection = strip(get_param(\"s_Direction\"));\n if ($iSorted != $iSort) {\n $sDirection = \" DESC \";\n } else {\n if (strcasecmp($sDirection, \" DESC \") == 0) {\n $sDirection = \" ASC \";\n } else {\n $sDirection = \" DESC \";\n }\n }\n $sOrder = \" order by \" . $iSort . $sDirection . \",PRESTAMO_ID limit 1000\";\n include_once \"inicializarRTA.inc\";\n\n $db->conn->SetFetchMode(ADODB_FETCH_ASSOC);\n $rs = $db->query($sSQL . $sOrder);\n $db->conn->SetFetchMode(ADODB_FETCH_NUM);\n // Process empty recordset\n if (!$rs || $rs->EOF) {\n ?>\n <p align=\"center\" class=\"titulosError2\">NO HAY REGISTROS SELECCIONADOS</p>\n <? return;\n }\n // Build parameters for order\n $form_params_search = \"s_RADI_NUME_RADI=\" . tourl($ps_RADI_NUME_RADI) . \"&s_USUA_LOGIN=\" . tourl($ps_USUA_LOGIN) .\n \"&s_DEPE_NOMB=\" . tourl($ps_DEPE_NOMB) . \"&s_USUA_NOMB=\" . tourl($ps_USUA_NOMB) . \"&s_PRES_REQUERIMIENTO=\" .\n tourl($ps_PRES_REQUERIMIENTO) . \"&s_PRES_ESTADO=\" . tourl($ps_PRES_ESTADO) . \"&fechaInicial=\" .\n tourl($fechaInicial) . \"&fechaFinal=\" . tourl($fechaFinal) . \"&s_hora_limite=\" . tourl($ps_hora_limite) .\n \"&s_minuto_limite=\" . tourl($ps_minuto_limite) . \"&s_meridiano=\" . tourl($ps_meridiano);\n\n\n/**/\n $form_params_page = \"&FormPedidos_Page=1&FormStarPage=1&FormSiguiente=0\";\n $form_params = $form_params_search . $form_params_page . \"&opcionMenu=\" . tourl($opcionMenu) . \"&krd=\" . tourl($krd) .\n \"&FormPedidos_Sorted=\" . tourl($iSort) . \"&s_Direction=\" . tourl($sDirection) . \"&FormPedidos_Sorting=\";\n\n // HTML column prestamo headers\n ?>\n <form method=\"post\" action=\"prestamo.php\" id=\"form1\" name=\"rta\">\n <input type=\"hidden\" value='<?= $krd ?>' name=\"krd\">\n <input type=\"hidden\" value=\" \" name=\"radicado\">\n <input type=\"hidden\" value=\"\" name=\"prestado\">\n <input type=\"hidden\" value=\"<?= $ps_numeroExpediente ?>\" name=\"ps_numeroExpediente\">\n <input type=\"hidden\" name=\"opcionMenu\" value=\"<?= $opcionMenu ?>\">\n <!-- orden de presentacion del resultado en el formulario de envio !-->\n <input type=\"hidden\" name=\"FormPedidos_Sorting\" value=\"<?= $iSort ?>\">\n <input type=\"hidden\" name=\"FormPedidos_Sorted\" value=\"<?= $iSorted ?>\">\n <input type=\"hidden\" name=\"s_Direction\" value=\"<?= $sDirection ?>\">\n <table class='table table-striped table-bordered table-hover dataTable no-footer smart-form'>\n <thead>\n <tr role=\"row\">\n <th colspan=\"<?= $numCol ?>\"><a name=\"Search\"><?= $tituloRespuesta[$opcionMenu] ?></a></th>\n </tr>\n </thead>\n <?PHP // Titulos de las columnas\n include_once \"inicializarTabla.inc\";\n\n //----------------------\n // Process page scroller\n //----------------------\n // Initialize records per page\n $iRecordsPerPage = 15;\n // Inicializa el valor de la pagina actual\n $iPage = intval(get_param(\"FormPedidos_Page\"));\n // Inicializa los registros a presentar seg�n la p�gina actual\n $iCounter = 0;\n $ant = \"\";\n if ($iPage > 1) {\n do {\n $new = $rs->fields[\"PRESTAMO_ID\"];\n if ($new != $ant) {\n $iCounter++;\n $ant = $new;\n }\n $rs->MoveNext();\n } while ($iCounter < ($iPage - 1) * $iRecordsPerPage && !$rs->EOF);\n }\n $iCounterIni = $iCounter;\n // Display grid based on recordset\n $y = 1; // Cantidad de registros presentados\n include_once \"getRtaSQLAntIn.inc\"; //Une en un solo campo los expedientes\n while ($rs && !$rs->EOF) {\n // Inicializa las variables con los resultados\n include \"getRtaSQL.inc\";\n\n // Fila de la tabla con los resultados\n include \"getRtaSQLAnt.inc\";\n\n /* */ if ($fldARCH != 'SI') {\n $encabARCH = session_name() . \"=\" . session_id() . \"&buscar_exp=\" . tourl($fldEXP) . \"&krd=$krd&tipo_archivo=&nomcarpeta=\";\n }\n\n $y++;\n include \"cuerpoTabla.inc\";\n $rs->MoveNext();\n }\n\n // Fila de la tabla con lso resultados\n $cantRegPorPagina = $y;\n $iCounter = $iCounter + $y;\n ?>\n <script>\n // Inicializa el arreglo con los radicados a procesar\n var cantRegPorPagina =<?=$cantRegPorPagina-1?>;\n // Marca todas las casillas si la del titulo es marcada\n function seleccionarRta() {\n if(document.rta.rta_.checked) {\n for(i=2;i<document.rta.elements.length;i++)\n document.rta.elements[i].checked=1;\n } else {\n for(i=2;i<document.rta.elements.length;i++)\n document.rta.elements[i].checked=0;\n }\n }\n\n // Valida y envia el formulario\n function enviar() {\n var cant = 0;\n var kk = 1;\n\n for (i = 1; i < document.rta.elements.length; i++) {\n if (document.rta.elements[i].type == \"checkbox\") {\n if (eval(document.rta.elements[i].checked) == true) {\n cant = 1;\n }\n kk++;\n }\n }\n if (cant == 0) {\n alert(\"Debe seleccionar al menos un radicado\");\n } else {\n document.rta.prestado.value = cantRegPorPagina;\n //alert (document.getElementById(\"use_paswor_dmd5\").html);\n document.rta.action = \"formEnvio.php\";\n document.rta.submit();\n }\n }\n\n // Regresa al menu de prestamos\n function regresar() {\n document.rta.opcionMenu.value = \"\";\n document.rta.action = \"menu_prestamo.php\";\n document.rta.submit();\n }\n </script>\n <?\n // Build parameters for page\n if (strcasecmp($sDirection, \" DESC \") == 0) {\n $sDirectionPages = \" ASC \";\n } else {\n $sDirectionPages = \" DESC \";\n }\n $form_params_page = $form_params_search . \"&opcionMenu=\" . tourl($opcionMenu) . \"&FormPedidos_Sorted=\" . tourl($iSort) .\n \"&s_Direction=\" . tourl($sDirectionPages) . \"&krd=\" . tourl($krd) . \"&FormPedidos_Sorting=\" . tourl($iSort);\n // Numero total de registros\n $ant = $antfldPRESTAMO_ID;\n while ($rs && !$rs->EOF) {\n $new = $rs->fields[\"PRESTAMO_ID\"]; //para el manejo de expedientes\n if ($new != $ant) {\n $ant = $new;\n $iCounter++;\n }\n $rs->MoveNext();\n }\n $iCounter--;\n // Inicializa paginas visualizables\n $iNumberOfPages = 10;\n // Inicializa cantidad de p�ginas\n $iHasPages = intval($iCounter / $iRecordsPerPage);\n if ($iCounter % $iRecordsPerPage != 0) {\n $iHasPages++;\n }\n // Determina la p�gina inicial del intervalo\n $iStartPages = 1;\n $FormSiguiente = get_param(\"FormSiguiente\"); //Indica si (1) el n�mero de p�ginas es mayor al visualizable\n if ($FormSiguiente == 0) {\n $iStartPages = get_param(\"FormStarPage\");\n } elseif ($FormSiguiente == -1) {\n $iStartPages = $iPage;\n } else {\n if ($iPage > $iNumberOfPages) {\n $iStartPages = $iPage - $iNumberOfPages + 1;\n }\n }\n // Genera las paginas visualizables\n $sPages = \"\";\n if ($iHasPages > $iNumberOfPages) {\n if ($iStartPages == 1) {\n $sPages .= \"|< << \";\n } else {\n $sPages .= \"<a href=\\\"$sFileName?$form_params_page&FormPedidos_Page=1&FormStarPage=1&FormSiguiente=0&\\\">\n <font class=\\\"ColumnFONT\\\" title=\\\"Ver la primera p&aacute;gina\\\">|<</font></a>&nbsp;\";\n $sPages .= \"&nbsp;<a href=\\\"$sFileName?$form_params_page&FormPedidos_Page=\" . tourl($iStartPages - 1) . \"&FormStarPage=\" .\n tourl($iStartPages - 1) . \"&FormSiguiente=-1&\\\"><font class=\\\"ColumnFONT\\\" title=\\\"Ver la p&aacute;gina \" .\n ($iStartPages - 1) . \"\\\"><<</font></a>&nbsp;&nbsp;&nbsp;\";\n }\n }\n for ($iPageCount = $iStartPages; $iPageCount < ($iStartPages + $iNumberOfPages); $iPageCount++) {\n if ($iPageCount <= $iHasPages) {\n $sPages .= \"<a href=\\\"$sFileName?$form_params_page&FormPedidos_Page=$iPageCount&FormStarPage=\" . tourl($iStartPages) . \"&FormSiguiente=0&\\\">\n <font class=\\\"ColumnFONT\\\" title=\\\"Ver la p&aacute;gina \" . $iPageCount . \"\\\">\" . $iPageCount . \"</font></a>&nbsp;\";\n } else {\n break;\n }\n }\n if ($iHasPages > $iNumberOfPages) {\n if ($iPageCount - 1 < $iHasPages) {\n $sPages .= \"...&nbsp;&nbsp;<a href=\\\"$sFileName?$form_params_page&FormPedidos_Page=$iPageCount&FormStarPage=\" . tourl($iStartPages) .\n \"&FormSiguiente=1&\\\"><font class=\\\"ColumnFONT\\\" title=\\\"Ver la p&aacute;gina \" . $iPageCount . \"\\\">>></font></a>&nbsp;&nbsp;\";\n $sPages .= \"&nbsp;<a href=\\\"$sFileName?$form_params_page&FormPedidos_Page=$iHasPages&FormStarPage=tourl($iStartPages)\n &FormSiguiente=1&\\\"><font class=\\\"ColumnFONT\\\" title=\\\"Ver la &uacute;ltima p&aacute;gina\\\">>|</font></a>\";\n } else {\n $sPages .= \" >> |\";\n }\n }\n ?>\n <tr class=\"titulos5\" align=\"center\">\n <td colspan=\"<?= ($numCol + 1); ?>\">\n <small>\n <center><br><?= $sPages ?> (P&aacute;gina <?= $iPage ?>/<?= $iHasPages ?>)</center>\n </small>\n </td>\n </tr>\n <?php if ($_POST['genearreporte']!=\"Generar\") { ?>\n\n <? if ($opcionMenu == 1) { ?>\n <tr align=\"center\">\n <td colspan=\"11\" align=\"center\">\n <input type=\"button\" class=\"btn btn-primary\" value=\"Prestar\" onclick=\"enviar();\">\n <input type=\"button\" class=\"btn btn-primary\" value=\"Cancelar\" title=\"Regresa al menú de préstamo y control de documentos\" onclick=\"javascript:regresar();\"></center>\n </td>\n </tr>\n </table>\n <?php } else { #SI el documento se va a devolver\n if ($opcionMenu == 2) { ?>\n <tr align=\"center\">\n <td colspan=\"11\" align=\"center\">\n <input type=\"button\" class=\"botones\" value=\"Devolver\" onclick=\"enviar();\">\n <input type=\"button\" class=\"botones\" value=\"Cancelar\" title=\"Regresa al menú de préstamo y control de documentos\" onclick=\"javascript:regresar();\"></center>\n </td>\n </tr>\n <?php } } } ?>\n <?php if ($_POST['genearreporte']==\"Generar\") { ?>\n <table align=\"center\" class=\"table table-bordered table-striped\"><tr>\n <td align=\"center\">\n <?\n $xsql = serialize ( $sSQL ); // SERIALIZO EL QUERY CON EL QUE SE QUIERE GENERAR EL REPORTE\n $_SESSION ['xheader'] = \"<center><b>$titulo</b></center><br><br>\"; // ENCABEZADO DEL REPORTE\n $_SESSION ['xsql'] = $xsql; // SUBO A SESION EL QUERY// CREO LOS LINKS PARA LOS REPORTES\n echo \"<a href='$ruta_raiz/adodb/adodb-xls.inc.php' target='_blank'><img src='$ruta_raiz/adodb/spreadsheet.png' width='40' heigth='40' border='0'></a>\";\n ?>\n </td>\n </tr>\n </table>\n <?php } ?>\n\n </form>\n <?\n } //fin if\n}", "public function exportTiendasToCsv(){\n $Fecha = date('d-m-Y');\n #$Hora = date('H:i:s');\n #$fechahora = \"(\".$Fecha.\"-\".$Hora.\")\";\n\n $consulta = $this->db->prepare(\"\n SELECT\n 'COD_TIENDA'\n ,'COD_BTK'\n ,'TIENDA_NAME'\n ,'DIRECCION'\n ,'COD_CLIENTE'\n ,'CLIENTE_NAME'\n ,'COD_REGION'\n ,'REGION_NAME'\n ,'COD_CIUDAD'\n ,'CIUDAD_NAME'\n ,'COD_COMUNA'\n ,'COMUNA_NAME'\n ,'COD_ZONA'\n ,'ZONA_NAME'\n ,'COD_TIPO'\n ,'TIPO_NAME'\n ,'COD_AGRUPACION'\n ,'AGRUPACION_NAME'\n ,'COD_ESTADO'\n ,'ESTADO_NAME'\n UNION ALL\n SELECT \n TI.COD_TIENDA,\n TI.COD_BTK,\n TI.NOM_TIENDA,\n IFNULL(TI.DIREC_TIENDA,'') AS DIRECCION,\n CL.COD_CLIENTE,\n CL.NOM_CLIENTE,\n IFNULL(RG.COD_REGION, '') AS COD_REGION,\n IFNULL(RG.NOM_REGION, '') AS NOM_REGION,\n IFNULL(CT.COD_CIUDAD, '') AS COD_CIUDAD,\n IFNULL(CT.NOM_CIUDAD, '') AS NOM_CIUDAD,\n IFNULL(CM.COD_COMUNA, '') AS COD_COMUNA,\n IFNULL(CM.NOM_COMUNA, '') AS NOM_COMUNA,\n IFNULL(ZN.COD_ZONA, '') AS COD_ZONA,\n IFNULL(ZN.NOM_ZONA, '') AS NOM_ZONA,\n IFNULL(TT.COD_TIPO, '') AS COD_TIPO,\n IFNULL(TT.NOM_TIPO, '') AS NOM_TIPO,\n IFNULL(AG.COD_AGRUPACION, '') AS COD_AGRUPACION,\n IFNULL(AG.NOM_AGRUPACION, '') AS NOM_AGRUPACION,\n IFNULL(ET.COD_ESTADO, '') AS COD_ESTADO,\n IFNULL(ET.NOM_ESTADO, '') AS NOM_ESTADO\n FROM T_TIENDA TI\n LEFT OUTER JOIN T_CLIENTE CL ON CL.COD_CLIENTE = TI.CLIENTE_COD_CLIENTE\n LEFT OUTER JOIN T_TIENDA_ESTADO ET ON ET.COD_ESTADO = TI.ESTADO_COD_ESTADO\n LEFT OUTER JOIN T_COMUNA CM ON (CM.COD_COMUNA = TI.COMUNA_COD_COMUNA)\n AND (CM.CIUDAD_COD_CIUDAD = TI.COMUNA_CIUDAD_COD_CIUDAD)\n AND (CM.CIUDAD_REGION_COD_REGION = TI.COMUNA_CIUDAD_REGION_COD_REGION)\n LEFT OUTER JOIN T_CIUDAD CT ON CT.COD_CIUDAD = CM.CIUDAD_COD_CIUDAD\n LEFT OUTER JOIN T_REGION RG ON RG.COD_REGION = CM.CIUDAD_REGION_COD_REGION\n LEFT OUTER JOIN T_TIENDA_ZONA ZN ON ZN.COD_ZONA = TI.ZONA_COD_ZONA\n LEFT OUTER JOIN T_TIPO_TIENDA TT ON TT.COD_TIPO = TI.TIPO_TIENDA_COD_TIPO\n LEFT OUTER JOIN T_AGRUPACION AG ON AG.COD_AGRUPACION = TI.AGRUPACION_COD_AGRUPACION \n WHERE TI.COD_TIENDA NOT LIKE '%N/A%'\n AND TI.COD_BTK NOT LIKE '%N/A%'\n INTO OUTFILE '\".$this->apache.$this->root.\"views/tmp/SOM_TIENDAS_\".$Fecha.\".csv'\n CHARACTER SET latin1\n FIELDS TERMINATED BY ';'\n LINES TERMINATED BY '\\n'\");\n \n //OPTIONALLY ENCLOSED BY '\\\"'\n \n $consulta->execute();\n\n // hold & go to be sure\n sleep(2);\n \n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"SOM_TIENDAS_'.$Fecha.'.csv\"');\n header('Cache-Control: max-age=0');\n \n readfile(''.$this->apache.$this->root.'views/tmp/SOM_TIENDAS_'.$Fecha.'.csv');\n unlink(''.$this->apache.$this->root.'views/tmp/SOM_TIENDAS_'.$Fecha.'.csv');\n \n// $error = $consulta->errorInfo();\n// echo $error[2];\n }", "public function uploadNormaPanenOerBjr($params = array())\n {\n $data = array();\n $newdata_ba = array();\n $total_rec = $ins_rec = $lastBaCode = $update_rec = 0;\n $datachk = array();\n $lastBjrMin = $lastBjrMax = \"\";\n \n if ($_FILES[file][size] > 0) {\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************\n //1. ****************** Check BA dari CSV FILE\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n $arrba = array();\n do {\n if (($datachk[0])&&($total_rec > 1)) {\n array_push($arrba,$datachk[1]);\n }\n $total_rec++;\n } while($datachk = fgetcsv($handle,1000,\";\",\"'\"));\n $arrbadis = array_values(array_unique($arrba, SORT_REGULAR)); //variabel array list BA pada CSV\n \n //2. ****************** Baca Urutan Upload dari T_SEQ\n $sqlCurTask=\"SELECT SEQ_NUM FROM T_SEQ WHERE TABLE_NAME='TN_PANEN_OER_BJR'\";\n $seqNum = $this->_db->fetchOne($sqlCurTask);\n $sqlSeq=\"SELECT * FROM T_SEQ WHERE SEQ_NUM < ($seqNum) ORDER BY SEQ_NUM, TASK_NAME\";\n $rows = $this->_db->fetchAll($sqlSeq);\n if (!empty($rows)) {\n foreach ($rows as $idx => $row) { \n $tablechk = $row['REMARKS'];\n //2.1 ****************** get BA CODE yang sudah dimasukan pada table di awal sequence\n $sqlba = \"SELECT DISTINCT BA_CODE FROM \".$row['TABLE_NAME'];\n $arrnormaba = array();\n $arrlockba = array();\n $rowsba = $this->_db->fetchAll($sqlba);\n foreach ($rowsba as $idxba => $rowba) {\n array_push($arrnormaba,$rowba['BA_CODE']); //variabel array list BA pada masing2 norma\n //2.2 ****************** get STATUS LOCK masing2 BA CODE di T_SEQ\n $sqlba1 = \"SELECT STATUS FROM T_SEQ_CHECK WHERE BA_CODE='\".$rowba['BA_CODE'].\"' AND TASK_NAME='\".$row['TABLE_NAME'].\"'\";\n \n $arrlockba[$rowba['BA_CODE']] = $this->_db->fetchOne($sqlba1);\n } \n $arrNotFound=array();\n for($x=0;$x<count($arrbadis);$x++){\n if(!in_array($arrbadis[$x],$arrnormaba)){ //check apakah data ba csv ada di data ba norma?\n $arrNotFound[]=$arrbadis[$x];\n }elseif($arrlockba[$arrbadis[$x]]==\"LOCKED\"){\n $arrNotFound[]=$arrbadis[$x];\n }\n }\n if($arrNotFound) break;\n }\n }\n $arrNotFound =array();\n if($arrNotFound){\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'ba_notfound' => implode(\",\",$arrNotFound),\n 'task_err' => $tablechk\n );\n return $return;\n }\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************//\n //get the csv file\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n \n $total_rec = 0;\n \n //loop through the csv file and insert into database\n do {\n if (($data[0])&&($total_rec > 1)) {\n \n if ($lastBaCode <> addslashes($data[0])){\n /*try {\n //remove data\n $sqlDelete = \"\n DELETE FROM TN_PANEN_OER_BJR\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n \";\n //log file penghapusan data\n $this->_global->deleteDataLogFile($sqlDelete); \n $this->_db->query($sqlDelete);\n } catch (Exception $e) { \n }*/\n $newdata_ba[] = addslashes($data[0]);\n }\n \n if (($lastBjrMin <> addslashes($data[1])) && ($lastBjrMax <> addslashes($data[2]))){\n $premi_panen = addslashes($data[5]);\n $bjr_budget = addslashes($data[6]);\n $janjang_basis_mandor = addslashes($data[7]);\n $janjang_basis_jumat = addslashes($data[8]);\n }\n \n //cek data\n $sql = \"\n SELECT COUNT(*) \n FROM TN_PANEN_OER_BJR\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND BJR_MIN = '\".addslashes($data[1]).\"'\n AND BJR_MAX = '\".addslashes($data[2]).\"'\n AND OER_MIN = '\".addslashes($data[3]).\"'\n AND OER_MAX = '\".addslashes($data[4]).\"'\n \";\n \n $count = $this->_db->fetchOne($sql);\n if ($count == 0) {\n try {\n \n //hitung data otomatis masuk ke tabel\n $query = \"\n SELECT var.VALUE ASUMSI_OVER_BASIS\n FROM TN_PANEN_VARIABLE var\n WHERE var.PANEN_CODE = 'ASUM_OVR_BASIS'\n AND to_char(var.PERIOD_BUDGET,'DD-MM-RRRR') = '\".$this->_period.\"'\n AND UPPER(var.BA_CODE) IN ('\".$data[0].\"')\";\n $execute = $this->_db->fetchOne($query);\n $execute_asumsi = ($execute) ? $execute : 0; \n \n $ASUMSI_OVER_BASIS = (float)str_replace(\",\", \"\", $execute_asumsi);\n $JANJANG_BASIS_MANDOR = (float)str_replace(\",\", \"\", $janjang_basis_mandor);\n \n $over_basis_janjang = $JANJANG_BASIS_MANDOR * ( $ASUMSI_OVER_BASIS / 100 );\n $janjang_operation = $JANJANG_BASIS_MANDOR + $over_basis_janjang;\n \n $OVER_BASIS_JANJANG = (float)str_replace(\",\", \"\", $over_basis_janjang);\n $PREMI_PANEN = (float)str_replace(\",\", \"\", $premi_panen);\n $JANJANG_OPERATION = (float)str_replace(\",\", \"\", $janjang_operation);\n $BJR_BUDGET = (float)str_replace(\",\", \"\", $bjr_budget);\n \n $nilai = ( $OVER_BASIS_JANJANG * $PREMI_PANEN ) / ( $JANJANG_OPERATION * $BJR_BUDGET );\n \n //insert data\n $sql = \"\n INSERT INTO TN_PANEN_OER_BJR (PERIOD_BUDGET, \n BA_CODE, \n BJR_MIN, \n BJR_MAX, \n OER_MIN, \n OER_MAX, \n PREMI_PANEN, \n BJR_BUDGET, \n JANJANG_BASIS_MANDOR, \n JANJANG_BASIS_MANDOR_JUMAT, \n INSERT_USER, \n INSERT_TIME)\n VALUES (\n TO_DATE('{$this->_period}','DD-MM-RRRR'),\n TRIM('\".addslashes($data[0]).\"'),\n '\".addslashes($data[1]).\"',\n '\".addslashes($data[2]).\"',\n '\".addslashes($data[3]).\"',\n '\".addslashes($data[4]).\"',\n '\".$premi_panen.\"',\n '\".$bjr_budget.\"',\n '\".$janjang_basis_mandor.\"',\n '\".$janjang_basis_jumat.\"',\n '{$this->_userName}',\n SYSDATE\n )\n \";\n \n $this->_db->query($sql);\n $this->_db->commit();\n $ins_rec++;\n \n //TAMBAHAN untuk otomatis generate panen supervisi : SABRINA 19/08/2014\n $gen_inherit[$ins_rec]['BA_CODE'] = addslashes($data[0]);\n $gen_inherit[$ins_rec]['BJR_MIN'] = addslashes($data[1]);\n $gen_inherit[$ins_rec]['BJR_MAX'] = addslashes($data[2]);\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA PANEN OER BJR', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA PANEN OER BJR', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n\n // cek apakah data non-aktif\n $sql = \"\n SELECT COUNT(*) \n FROM TN_PANEN_OER_BJR\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND BJR_MIN = '\".addslashes($data[1]).\"'\n AND BJR_MAX = '\".addslashes($data[2]).\"'\n AND OER_MIN = '\".addslashes($data[3]).\"'\n AND OER_MAX = '\".addslashes($data[4]).\"'\n AND DELETE_USER IS NULL\n \";\n $count = $this->_db->fetchOne($sql);\n\n if ($count == 0) {\n // update data menjadi aktif jika sebelumnya telah dinon-aktifkan\n try {\n \n $sql = \"\n UPDATE TN_PANEN_OER_BJR\n SET PREMI_PANEN = '\".$premi_panen.\"',\n BJR_BUDGET = '\".$bjr_budget.\"',\n JANJANG_BASIS_MANDOR = '\".$janjang_basis_mandor.\"',\n JANJANG_BASIS_MANDOR_JUMAT = '\".$janjang_basis_jumat.\"',\n UPDATE_USER = '{$this->_userName}',\n UPDATE_TIME = SYSDATE,\n DELETE_USER = NULL,\n DELETE_TIME = NULL\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND BJR_MIN = '\".addslashes($data[1]).\"'\n AND BJR_MAX = '\".addslashes($data[2]).\"'\n AND OER_MIN = '\".addslashes($data[3]).\"'\n AND OER_MAX = '\".addslashes($data[4]).\"'\n \";\n \n \n $this->_db->query($sql);\n $this->_db->commit();\n $update_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA PANEN OER BJR', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA PANEN OER BJR', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n }\n }\n $lastBaCode = addslashes($data[0]);\n $lastBjrMin = addslashes($data[1]);\n $lastBjrMax = addslashes($data[2]);\n }\n $total_rec++;\n } while ($data = fgetcsv($handle,1000,\",\",\"'\"));\n //\n $return = array(\n 'status' => 'done',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }else{\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }\n // ********************************************** HITUNG SEMUA HASIL UPLOAD **********************************************\n // Sabrina / 2013-08-28\n \n if (!empty($newdata_ba)) {\n try {\n $auto_calc = new Application_Model_NormaPanenOerBjr();\n \n foreach ($newdata_ba as $idx => $ba_code) {\n $params['budgetperiod'] = date(\"Y\", strtotime($this->_period));\n $params['key_find'] = $ba_code;\n \n $records1 = $this->_db->fetchAll(\"{$auto_calc->getData($params)}\");\n \n foreach ($records1 as $idx1 => $record1) {\n $auto_calc->calculateData($record1);\n }\n }\n \n //log DB\n $this->_global->insertLog('UPDATE SUCCESS', 'NORMA PANEN OER BJR', '', '');\n } catch (Exception $e) {\n //log DB\n $this->_global->insertLog('UPDATE FAILED', 'NORMA PANEN OER BJR', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n \n //return value\n $result = false;\n } \n } \n // ********************************************** END OF HITUNG SEMUA HASIL UPLOAD **********************************************\n \n //generate panen supervisi : SABRINA 19/08/2014\n // hidden on 2017-08-08\n // [email protected]\n // if (!empty($gen_inherit)) {\n // foreach ($gen_inherit as $idx => $row) {\n // $this->_generateData->genNormaPanenSupervisi($row); //menggantikan trigger yang ada di DB saat BPS I\n // }\n // }\n \n return $return;\n }", "public function uploadNormaHargaBorong($params = array())\n {\n $data = array();\n $datachk = array();\n $newdata_region = array();\n $total_rec = $ins_rec = $lastBaCode = $update_rec = 0;\n \n if ($_FILES[file][size] > 0) {\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************\n //1. ****************** Check BA dari CSV FILE\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n $arrba = array();\n do {\n if (($datachk[0])&&($total_rec > 1)) {\n array_push($arrba,$datachk[1]);\n }\n $total_rec++;\n } while($datachk = fgetcsv($handle,1000,\";\",\"'\"));\n $arrbadis = array_values(array_unique($arrba, SORT_REGULAR)); //variabel array list BA pada CSV\n \n //2. ****************** Baca Urutan Upload dari T_SEQ\n $sqlCurTask=\"SELECT SEQ_NUM FROM T_SEQ WHERE TABLE_NAME='TN_HARGA_BORONG'\";\n $seqNum = $this->_db->fetchOne($sqlCurTask);\n $sqlSeq=\"SELECT * FROM T_SEQ WHERE SEQ_NUM < ($seqNum) ORDER BY SEQ_NUM, TASK_NAME\";\n $rows = $this->_db->fetchAll($sqlSeq);\n if (!empty($rows)) {\n foreach ($rows as $idx => $row) { \n $tablechk = $row['REMARKS'];\n //2.1 ****************** get BA CODE yang sudah dimasukan pada table di awal sequence\n $sqlba = \"SELECT DISTINCT BA_CODE FROM \".$row['TABLE_NAME'];\n $arrnormaba = array();\n $arrlockba = array();\n $rowsba = $this->_db->fetchAll($sqlba);\n foreach ($rowsba as $idxba => $rowba) {\n array_push($arrnormaba,$rowba['BA_CODE']); //variabel array list BA pada masing2 norma\n //2.2 ****************** get STATUS LOCK masing2 BA CODE di T_SEQ\n $sqlba1 = \"SELECT STATUS FROM T_SEQ_CHECK WHERE BA_CODE='\".$rowba['BA_CODE'].\"' AND TASK_NAME='\".$row['TABLE_NAME'].\"'\";\n \n $arrlockba[$rowba['BA_CODE']] = $this->_db->fetchOne($sqlba1);\n } \n $arrNotFound=array();\n for($x=0;$x<count($arrbadis);$x++){\n if(!in_array($arrbadis[$x],$arrnormaba)){ //check apakah data ba csv ada di data ba norma?\n $arrNotFound[]=$arrbadis[$x];\n }elseif($arrlockba[$arrbadis[$x]]==\"LOCKED\"){\n $arrNotFound[]=$arrbadis[$x];\n }\n }\n if($arrNotFound) break;\n }\n }\n $arrNotFound =array();\n if($arrNotFound){\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'ba_notfound' => implode(\",\",$arrNotFound),\n 'task_err' => $tablechk\n );\n return $return;\n }\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************//\n //get the csv file\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n \n $total_rec = 0;\n \n //loop through the csv file and insert into database\n do {\n if (($data[0])&&($total_rec > 1)) {\n \n if ($lastBaCode <> addslashes($data[0])){\n /*\n try {\n //remove data\n $sqlDelete = \"\n DELETE FROM TN_HARGA_BORONG \n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n \";\n //log file penghapusan data\n $this->_global->deleteDataLogFile($sqlDelete); \n $this->_db->query($sqlDelete); \n } catch (Exception $e) {\n \n }*/\n //get region code\n $region_code = $this->_formula->get_RegionCode(addslashes($data[0]));\n \n $newdata_region[] = $region_code;\n } \n \n //cek data\n $sql = \"\n SELECT COUNT(*) \n FROM TN_HARGA_BORONG\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND ACTIVITY_CODE = TRIM('\".addslashes($data[1]).\"')\n AND ACTIVITY_CLASS = TRIM('\".addslashes($data[2]).\"')\n \";\n $count = $this->_db->fetchOne($sql);\n if ($count == 0) {\n try {\n //insert data\n $sql = \"\n INSERT INTO TN_HARGA_BORONG\n (PERIOD_BUDGET, REGION_CODE, BA_CODE, ACTIVITY_CODE, ACTIVITY_CLASS, SPESIFICATION, PRICE, INSERT_USER, INSERT_TIME, PRICE_SITE)\n VALUES (\n TO_DATE('{$this->_period}','DD-MM-RRRR'),\n '\".$region_code.\"',\n TRIM('\".addslashes($data[0]).\"'),\n TRIM('\".addslashes($data[1]).\"'),\n TRIM('\".addslashes($data[2]).\"'),\n '\".addslashes($data[3]).\"',\n REPLACE('\".addslashes($data[4]).\"', ',', ''),\n '{$this->_userName}',\n SYSDATE,\n REPLACE('\".addslashes($data[5]).\"', ',', '')\n )\n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $ins_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA HARGA BORONG', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA HARGA BORONG', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n // cek apakah data non-aktif\n $sql = \"\n SELECT COUNT(*) \n FROM TN_HARGA_BORONG\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"' )\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND ACTIVITY_CODE = TRIM('\".addslashes($data[1]).\"')\n AND ACTIVITY_CLASS = TRIM('\".addslashes($data[2]).\"')\n AND DELETE_USER IS NULL\n \";\n $count = $this->_db->fetchOne($sql);\n \n if ($count == 0) {\n // update data menjadi aktif jika sebelumnya telah dinon-aktifkan\n try {\n $sql = \"\n UPDATE TN_HARGA_BORONG\n SET PRICE = REPLACE('\".addslashes($data[4]).\"', ',', ''),\n PRICE_SITE = REPLACE('\".addslashes($data[5]).\"', ',', ''),\n SPESIFICATION = '\".addslashes($data[3]).\"',\n UPDATE_USER = '{$this->_userName}',\n UPDATE_TIME = SYSDATE,\n DELETE_USER = NULL,\n DELETE_TIME = NULL\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND ACTIVITY_CODE = TRIM('\".addslashes($data[1]).\"')\n AND ACTIVITY_CLASS = TRIM('\".addslashes($data[2]).\"')\n \";\n $this->_db->query($sql);\n $this->_db->commit(); \n $update_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA HARGA BORONG', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA HARGA BORONG', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n }\n }\n $lastBaCode = addslashes($data[0]);\n }\n $total_rec++;\n } while ($data = fgetcsv($handle,1000,\",\",\"'\"));\n //\n $return = array(\n 'status' => 'done',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }else{\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }\n \n // ********************************************** HITUNG SEMUA HASIL UPLOAD **********************************************\n // Sabrina / 2013-08-23\n \n if (!empty($newdata_region)) {\n try {\n $auto_calc = new Application_Model_NormaHargaBorong();\n \n foreach ($newdata_region as $idx => $region_code) {\n $auto_calc->calculateAllItem($region_code);\n }\n \n //log DB\n $this->_global->insertLog('UPDATE SUCCESS', 'NORMA HARGA BORONG', '', '');\n } catch (Exception $e) {\n //log DB\n $this->_global->insertLog('UPDATE FAILED', 'NORMA HARGA BORONG', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n \n //return value\n $result = false;\n } \n } \n // ********************************************** END OF HITUNG SEMUA HASIL UPLOAD **********************************************\n \n return $return;\n }", "public function agregar($idproveedor,$idusuario,$tipo_comprobante,\n $serie_comprobante,$num_comprobante,$fecha_hora,$impuesto,\n $total_compra,$idarticulo,$cantidad,$precio_compra,$precio_venta){\n $conectar = Conectar::conexion();\n $sql = \"insert into ingreso values(null,?,?,?,?,?,?,?,?,'Aceptado')\";\n $sql = $conectar->prepare($sql);\n $sql->bindValue(1,$_POST[\"idproveedor\"]);\n $sql->bindValue(2,$_SESSION[\"idusuario\"]);\n $sql->bindValue(3,$_POST[\"tipo_comprobante\"]);\n $sql->bindValue(4,$_POST[\"serie_comprobante\"]);\n $sql->bindValue(5,$_POST[\"num_comprobante\"]);\n $sql->bindValue(6,$_POST[\"fecha_hora\"]);\n $sql->bindValue(7,$_POST[\"impuesto\"]);\n $sql->bindValue(8,$_POST[\"total_compra\"]);\n $sql->execute();\n\n //$resultado = $sql->fetch();\n //return $resultado;\n\n $idingresonew = $conectar->lastInsertId();\n $num_elementos= 0;\n $sw=true;\n $id=$_POST[\"idarticulo\"];\n $cant=$_POST[\"cantidad\"];\n $prec=$_POST[\"precio_compra\"];\n $prev=$_POST[\"precio_venta\"];\n\n while ($num_elementos < count($_POST[\"idarticulo\"])) {\n\n $sql_detalle = \"insert into detalle_ingreso(idingreso,idarticulo,cantidad,precio_compra,precio_venta)\n values('$idingresonew','$id[$num_elementos]','$cant[$num_elementos]','$prec[$num_elementos]','$prev[$num_elementos]')\";\n $sql_detalle = $conectar->prepare($sql_detalle);\n $sql_detalle->execute() or $sw=false;\n $num_elementos = $num_elementos + 1;\n }\n return $sw;\n }", "function importar_archivo_sigepp(){\n if ($this->input->post()) {\n $post = $this->input->post();\n \n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n \n /*--------------------------------------------------------------*/\n $i=0;\n $nro=0;$nroo=0;\n $lineas = file($archivotmp);\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){ \n\n $datos = explode(\";\",$linea);\n //echo count($datos).\"<br>\";\n if(count($datos)==7){\n\n $da=$datos[0]; /// Da\n $ue=$datos[1]; /// Ue\n $prog=$datos[2]; /// Aper Programa\n $proy=trim($datos[3]);\n if(strlen($proy)==2){\n $proy='00'.$proy; /// Aper Proyecto\n }\n $act=trim($datos[4]); /// Aper Actividad\n if(strlen($act)==2){\n $act='0'.$act;\n }\n $cod_part=trim($datos[5]); /// Partida\n if(strlen($cod_part)==3){\n $cod_part=$cod_part.'00';\n }\n\n $importe=(float)$datos[6]; /// Monto\n\n // echo $this->gestion.\"<br>\";\n echo $prog.'- ('.strlen($prog).') -> '.$proy.' ('.strlen($proy).') -> '.$act.' ('.strlen(trim($act)).') ----'.$importe.'-- CODIGO PARTIDA '.is_numeric($cod_part).'<br>';\n if(strlen($prog)==2 & strlen($proy)==4 & strlen(trim($act))==3 & $importe!=0 & is_numeric($cod_part)){\n // echo \"INGRESA : \".$prog.'-'.$proy.'-'.$act.'..'.$importe.\"<br>\";\n $nroo++;\n // echo \"string<br>\";\n $aper=$this->model_ptto_sigep->get_apertura($prog,$proy,$act);\n if(count($aper)!=0){\n $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }\n\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n echo \"UPDATES : \".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*------------------- Update Datos ----------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->session->userdata(\"fun_id\")\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep', $update_ptto);*/\n /*-------------------------------------------------------*/\n }\n else{\n echo \"INSERTS : \".$nroo.\" -\".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*-------------------- Guardando Datos ------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => $aper[0]['aper_id'],\n 'da' => $da,\n 'ue' => $ue,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->session->userdata(\"fun_id\"),\n );\n $this->db->insert('ptto_partidas_sigep', $data_to_store);\n $sp_id=$this->db->insert_id();*/\n /*-------------------------------------------------------*/ \n }\n $nro++;\n }\n else{\n echo \"NO INGRESA : \".$prog.'-'.$proy.'-'.$act.'..'.$importe.\"<br>\";\n /* $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }*/\n /*-------------------- Guardando Datos ------------------*/\n /* $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => 0,\n 'da' => $da,\n 'ue' => $ue,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->session->userdata(\"fun_id\"),\n );\n $this->db->insert('ptto_partidas_sigep', $data_to_store);\n $sp_id=$this->db->insert_id();*/\n /*-------------------------------------------------------*/ \n }\n }\n elseif(strlen($prog)==2 & strlen($proy)==4 & strlen($act)==3 & $importe==0){\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n echo \"UPDATES 0->VALOR : \".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*------------------- Update Datos ----------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->session->userdata(\"fun_id\")\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep', $update_ptto);*/\n /*-------------------------------------------------------*/\n }\n }\n }\n }\n\n $i++;\n }\n\n /*--------------------------------------------------------------*/\n } \n elseif (empty($file_basename)) {\n echo \"<script>alert('SELECCIONE ARCHIVO .CSV')</script>\";\n } \n elseif ($filesize > 100000000) {\n //redirect('');\n } \n else {\n $mensaje = \"Sólo estos tipos de archivo se permiten para la carga: \" . implode(', ', $allowed_file_types);\n echo '<script>alert(\"' . $mensaje . '\")</script>';\n }\n\n } else {\n show_404();\n }\n }", "public function save_Linea()\n {\n //con un campo AUTO_INCREMENT, podemos obtener \n //el ID del último registro insertado / actualizado inmediatamente. \"\n\n\n $sql = \"SELECT LAST_INSERT_ID() AS 'pedido'\";\n $query = $this->db->query($sql);\n $pedidoId = $query->fetch_object()->pedido;\n\n\n $carritoData = $_SESSION['carrito'];\n\n foreach ($carritoData as $valor) {\n $item = $valor['producto'];\n\n $insert = \"INSERT INTO lineaspedidos VALUES (NULL,\n {$pedidoId},\n {$item->id},\n {$valor['unidades']})\";\n\n $producto = $this->db->query($insert);\n\n $result = false;\n }\n if ($producto) {\n $result = true;\n }\n return $result;\n }", "function crear_ruta_unidad($un_x,$r_x,$usu,$cli){\n\t\n global $db,$dbf,$fecha_con_formato,$nueva_ruta,$insertar_ruta_unidad;\n\t \n\n $data = Array(\n \t'DESCRIPTION' => utf8_decode(strtoupper($r_x)),\n 'COD_USER' => $usu,\n 'COD_CLIENT' => $cli,\n 'CREATE_DATE' => $fecha_con_formato\n \n );\n \n if($dbf-> insertDB($data,'SAVL_ROUTES',true) == true){\n echo \"se genero la ruta, ahora se asigna unidad a ruta siempre y cuando sea diferente de -1 en el cod_entity\";\n\t\t\t\t\n\t\t\t\t$ruta = \"SELECT ID_ROUTE FROM SAVL_ROUTES WHERE DESCRIPTION LIKE '%\".strtoupper($r_x).\"%'\";\n\t\t\t\t $query = $db->sqlQuery($ruta);\n\t\t\t\t $row = $db->sqlFetchArray($query);\n\t\t\t\t \t$count_x = $db->sqlEnumRows($query);\t \n\t\t\t\t\t\n\t\t\t\t\t \t\n\t\t\t\tif($un_x!=-1) {\n\t\t\t\t\t $data_3 = Array(\n\t\t\t\t\t\t\t\t\t 'ID_ROUTE' => $row['ID_ROUTE'],\n\t\t\t\t\t\t\t\t\t 'COD_ENTITY' => $un_x,\n\t\t\t\t\t\t\t\t\t 'COD_USER' => $usu,\n\t\t\t\t\t\t\t\t\t 'CREATE_DATE' => $fecha_con_formato\n\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t if($dbf-> insertDB($data_3,'SAVL_ROUTES_UNITS',true) == true){\n \t\t\t\t\t echo \"info de la ruta\".$row['ID_ROUTE'].'-'.$un_x.'-'.$usu.'-'.$fecha_con_formato.'<br />';\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t }else{\n \t\t\t\t echo \"fallo en ruta-unidad\";\t\n }\n\t\t\t\t\t\t\t \n\t\t\t }\t\t\t\t \t\t\t\n\t\t\t}\t\t\n\t\t\t\n\t\t\t\n\t $nueva_ruta = $row['ID_ROUTE'];\t\t\n $insertar_ruta_unidad = $insertar_ruta_unidad + 1;\n}", "function autorizar_entregar_pm($id_movimiento_material) {\r\n global $_ses_user,$db,$id_stock_rma;\r\n \r\n\r\n //$db->StartTrans();\r\n $sql=\"select id_deposito from general.depositos where nombre='RMA-Produccion-San Luis' \";\r\n $res = sql($sql) or fin_pagina();\r\n $id_stock_rma = $res->fields[\"id_deposito\"];\r\n \r\n $titulo_pagina = \"Movimiento de Material\";\r\n $fecha_hoy = date(\"Y-m-d H:i:s\",mktime());\r\n \r\n \r\n $sql = \"select deposito_origen,deposito_destino from movimiento_material \r\n where id_movimiento_material = $id_movimiento_material\";\r\n $res = sql($sql) or fin_pagina();\r\n \r\n $deposito_origen = $res->fields[\"deposito_origen\"];\r\n $deposito_destino = $res->fields[\"deposito_destino\"];\r\n \r\n $sql = \" select id_detalle_movimiento,cantidad,id_prod_esp from detalle_movimiento \r\n where id_movimiento_material = $id_movimiento_material\";\r\n $detalle_mov = sql($sql) or fin_pagina();\r\n \r\n for($i=0; $i < $detalle_mov->recordcount(); $i++){ \t \r\n \t $id_detalle_movimiento = $detalle_mov->fields[\"id_detalle_movimiento\"];\t\r\n \t $cantidad = $detalle_mov->fields[\"cantidad\"];\r\n \t $id_prod_esp = $detalle_mov->fields[\"id_prod_esp\"];\r\n $sql = \"select id_recibidos_mov,cantidad\r\n from recibidos_mov where id_detalle_movimiento=$id_detalle_movimiento \r\n and ent_rec=0\";\r\n $detalle_rec = sql($sql) or fin_pagina();\r\n $id_recibido_mov = $detalle_rec->fields[\"id_recibidos_mov\"];\r\n\r\n if($id_recibido_mov==\"\") {\r\n\t \t //insert\r\n\t\t $sql = \"select nextval('recibidos_mov_id_recibidos_mov_seq') as id_recibido_mov\";\r\n\t\t $res_1 = sql($sql) or fin_pagina();\r\n\t\t $id_recibido_mov = $res_1->fields[\"id_recibido_mov\"];\r\n\t\t $sql=\"insert into recibidos_mov(id_recibidos_mov,id_detalle_movimiento,cantidad,ent_rec)\r\n\t\t values($id_recibido_mov,$id_detalle_movimiento,$cantidad,0)\";\r\n }else {\r\n\t //update\r\n\t $sql=\"update recibidos_mov set cantidad=cantidad+$cantidad\r\n\t where id_recibidos_mov=$id_recibido_mov\";\r\n }//del else\r\n sql($sql) or fin_pagina();\r\n $sql =\"insert into log_recibidos_mov(id_recibidos_mov,usuario,fecha,cantidad_recibida,tipo)\r\n values($id_recibido_mov,'\".$_ses_user[\"name\"].\"','$fecha_hoy',$cantidad,'entrega')\";\r\n sql($sql) or fin_pagina();\r\n //eliminamos las reservas hechas para este movimiento\r\n $comentario_stock=\"Utilización de los productos reservados por el $titulo_pagina Nº $id_movimiento\";\r\n $id_tipo_movimiento=7;\r\n descontar_reserva($id_prod_esp,$cantidad,$deposito_origen,$comentario_stock,$id_tipo_movimiento,$id_fila=\"\",$id_detalle_movimiento);\r\n //ahora incremento el stock destino\r\n \r\n if($deposito_destino==$id_stock_rma) {\r\n\t $comentario_rma=\"Ingreso de productos a RMA mediante el $titulo_pagina Nº $id_movimiento\";\r\n $tipo_log=\"Creacion MM Nº $id_movimiento\";\r\n $cb_insertados=array();\r\n $rma_san_luis = 1;\r\n incrementar_stock_rma($id_prod_esp,$cantidad,\"\",$comentario_rma,\"\",$cb_insertados,\"\",1,\"\",\"\",\"\",\"null\",\"\",$nro_caso,\"\",$tipo_log,\"\",$id_movimiento_material,$rma_san_luis);\r\n //guardamos el id de proveedor elegido para RMA, en la fila del PM o MM (en la tabla detalle_movimiento)\r\n /*\r\n $query=\"update mov_material.detalle_movimiento set id_proveedor=$id_proveedor_rma where id_detalle_movimiento=$id_detalle_movimiento\";\r\n sql($query,\"<br>Error al actualizar el proveedor de RMA del producto<br>\") or fin_pagina();\r\n */\r\n }\r\n else { \r\n $comentario = \" Ingreso de Productos mediante PM N°: $id_movimiento_material\";\r\n agregar_stock($id_prod_esp,$cantidad,$deposito_destino,$comentario,13,\"disponible\");\r\n } \r\n \r\n $detalle_mov->movenext(); \r\n }//del for\r\n \r\n}", "public function procesarPagos(){ \n\t\trequire_once './core/SimpleXLSX.php';\n\t\t$dato=\"\";\n\t\t$fecha=\"\";\n\t\t$reg=0;\n\t\t$act=0;\n\t\t$count1=0;\n\t\t$aporte0=new Aporte($this->adapter);\n\t\t$porCruzar= $aporte0->contarCruceAportes();\n\t\tif (isset($porCruzar) && count($porCruzar)>=1)\n {\n\t\t\t\t foreach($porCruzar as $aporte)\n\t\t\t\t {\n\t\t\t\t\t $count1 = $aporte->aporteID;\n\t\t\t\t }\n\t\t\t }\n\t\t\n\t\tif ( $xlsx = SimpleXLSX::parse( './uploads/Datos.xlsx' ) ) {\n\t\t\t \n\t foreach ( $xlsx->rows() as $r => $row ) {\n\t\t\n\t\tif ($r > 0)\n\t\t{\n\t\t\tif ($row[5]!= 'Depósito')\n\t\t\t{\n\t\t\t\t$fecha = substr($row[3], 0, 19) ;\n\t\t\t\t$fecha = str_replace(\".\",\":\",$fecha);\n\t\t\t\t$fecha = substr_replace($fecha, \" \", 10, 1);\n\t\t\t\t\t//echo $fecha.':'.$row[5].'|||'.$fecha .'<br/>';\n\t\t\t\t\t\n\t\t\t\t$aporte=new Aporte($this->adapter);\n\t\t\t\t$aporte->setTransactionID($row[4]);\n\t\t\t\t$aporte->setBank($row[14]);\n\t\t\t\t$aporte->setRegisteredDate($fecha);\n\t\t\t\t$aporte->setValue($row[6]);\n\t\t\t\t$aporte->setAccount($row[13]);\n\t\t\t\t\n\t\t\t\t$save=$aporte->updateCruce(); // Manda a actualizar la moto en el modelo\n\t\t\t\tif ($save == TRUE)\n\t\t\t\t{\n\t\t\t\t\t$act = $act+1;\n\t\t\t\t}\n\t\t\t\t$reg = $reg+1;\t\n\t\t\t\t//$dato = \"UPDATE aporte set \\\"transactionId\\\"='\".$row[4].\"', \\\"bank\\\"='\".$row[14].\"', \\\"registeredDate\\\"='\".$fecha.\"', \\\"bankValidated\\\"='true' WHERE \\\"account\\\"='\".$row[13].\"' AND \\\"value\\\"='\".$row[6].\"' AND \\\"bankValidated\\\"='false' AND \\\"callCenterValidated\\\"='false' AND \\\"transactionId\\\"= '0';\";\n\t\t\t\t//echo strval($save) . '<br/>';\n\t\t\t\ttry{\n\t\t\t\t$payment=new Payment($this->adapter);\n\t\t\t\t$payment->setTransactionID($row[4]);\n\t\t\t\t$payment->setValue($row[6]);\n\t\t\t\t$payment->setCedula($row[10]);\n\t\t\t\t$payment->setBank($row[14]);\n\t\t\t\t$payment->setAccount($row[13]);\n\t\t\t\t$payment->setRegisteredDate($fecha);\n\t\t\t\t$payment->setIsMatched('false');\n\t\t\t\t$payment->setIsActive('true');\n\t\t\t\t$save=$payment->save();\n\t\t\t\t}\n\t\t\t\tcatch (Exception $e) {\n\t\t\t\t\t//echo 'Excepción capturada: ', $e->getMessage(), \"\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t}\n\t\t} else {\n\t\techo SimpleXLSX::parseError();\n\t\t}\n\t\t\t$count2=0;\n\t\t$aporte1=new Aporte($this->adapter);\n\t\t$porCruzar1= $aporte1->contarCruceAportes();\n\t\tif (isset($porCruzar1) && count($porCruzar1)>=1)\n {\n\t\t\t\t foreach($porCruzar1 as $aporte)\n\t\t\t\t {\n\t\t\t\t\t $count2 = $aporte->aporteID;\n\t\t\t\t }\n\t\t\t }\n\t\t$payment0=new Payment($this->adapter);\n\t $save=$payment0->updateMatch();\n\t\n\t\t$aporte1->phpAlert('Registros econtrados en excel: ' .$reg \n\t\t.'\\nRegistros procesados desde el excel: ' .$act\n\t\t.'\\nAportes pendientes por cruzar antes del cruce: ' .$count1\n\t\t.'\\nAportes pendientes de cruzar luego del cruce: ' .$count2\n\t\t.'\\nTOTAL CRUZADOS en esta carga: ' .($count1 - $count2),\n\t\t$this->baseUrl(\"BandejaCallcenters\", \"index\")); // Alerta y redirige\n //$this->redirect(\"BandejaBancos\", \"index\"); // COntrolador + Vista\n }", "public function inserirAtividade($id_atividade = '172', $s, $id_usuario, $id_pedido_item) {\n global $controle_id_empresa, $controle_id_usuario;\n $where = '';\n #verifica se a forma de pagamento é deposito e se não é do correio para enviar ao operacional ou ao financeiro\n $this->sql = \"SELECT (CASE WHEN(pi.valor_rec = 0) THEN ('0') ELSE ('1') END) as recebido,\n\t\t\t\t\t\t\tp.origem, p.forma_pagamento, \n\t\t\t\t\t\t\tpi.data_prazo, pi.id_pedido, pi.certidao_nome, pi.certidao_devedor, pi.id_servico, p.cpf, p.id_pacote,pi.id_status, \n\t\t\t\t\t\t\tpi.data_atividade, pi.dias, pi.id_usuario_op, pi.encerramento, pi.atendimento, pi.inicio, pi.operacional,\n\t\t\t\t\t\t\tpi.certidao_cidade, pi.certidao_estado, pi.id_empresa_atend\n\t\t\t\t\t\t\tfrom vsites_pedido_item as pi, vsites_pedido as p where pi.id_pedido_item=? and pi.id_pedido=p.id_pedido limit 1\";\n\n $this->values = array($id_pedido_item);\n \n $res = $this->fetch();\n\t\tif($controle_id_usuario == 1 OR $controle_id_usuario == 3720){\n\t\t\t\t#print_r($res);\t\n\t\t\t\t#echo $id_atividade;\n\t\t\t\t#exit;\n\t\t}\n if (($res[0]->recebido == '0' or $res[0]->recebido == '') and ($id_atividade == '137' or $id_atividade == '198') and $res[0]->origem != 'Correios' and $res[0]->forma_pagamento == 'Depósito') {\n $id_atividade = '153';\n }\n\n #verifica se vai criar data da agenda\n $data_agenda = date('Y-m-d');\n if (($s->status_dias <> '' and $s->status_dias != '0' or $s->status_hora <> '') and ($id_atividade != \"110\" && $id_atividade != \"217\")) {\n if ($s->status_dias == '')\n $s->status_dias = '0';\n $data_agenda = somar_dias_uteis($data_agenda, $s->status_dias);\n $where .= \",data_i='\" . $data_agenda . \"' ,status_hora='\" . $s->status_hora . \":00'\";\n } else {\n if ($s->status_dias == '0' and $id_atividade != \"110\" and $id_atividade != \"217\") {\n $where .= \",data_i=NOW(), status_hora='\" . $s->status_hora . \":00'\";\n } else {\n if ($id_atividade != \"110\" && $id_atividade != \"217\") {\n $where .= \",data_i='', status_hora='\" . $s->status_hora . \":00'\";\n }\n }\n }\n\n #seleciona o status da nova atividade e verifica se tem que voltar para o status anterior\n $ativ = $this->selecionaPorID($id_atividade);\n if ($ativ->id_status == 99) {\n $this->sql = \"SELECT a.id_status from vsites_pedido_status as s, vsites_atividades as a where s.id_pedido_item=? and a.id_atividade=s.id_atividade and a.id_status!='0' and a.id_status!='99' and a.id_status!='15' and a.id_status!='12' and a.id_status!='18' and a.id_status!='17' order by s.id_pedido_status DESC LIMIT 1\";\n $this->values = array($id_pedido_item);\n $res_ant = $this->fetch();\n $id_status = $res_ant[0]->id_status;\n } else {\n $id_status = $ativ->id_status;\n }\n\n #se estiver no pendente precisa somar os dias que ficaram parado\n if (($res[0]->id_status == '12' or $res[0]->id_status == '15') and $res[0]->inicio != '0000-00-00 00:00:00') {\n $dias_add = dias_uteis(invert($res[0]->data_atividade, '/', 'PHP'), date('d/m/Y'));\n $prazo_dias = $res[0]->dias + $dias_add;\n $data_prazo = somar_dias_uteis($res[0]->inicio, $prazo_dias);\n $where .= \", dias='\" . $prazo_dias . \"', data_prazo='\" . $data_prazo . \"'\";\n }\n\n #se for liberado para a franquia marca o dia da liberação para franquia\n\n if ($id_atividade == '205') {\n $where .= \", data_status=NOW()\";\n }\n \n #se for para cadastrado começa a contar o prazo\n if (($id_atividade == '137' or $id_atividade == '198' or $id_atividade == '180') and ($res[0]->inicio == '0000-00-00 00:00:00')) {\n #verifica CDT\n $pedidoDAO = new PedidoDAO();\n $id_empresa_dir = $pedidoDAO->listaCDT($res[0]->certidao_cidade, $res[0]->certidao_estado, $res[0]->id_pedido, $controle_id_empresa);\n if ($id_empresa_dir <> '') {\n $where .= \", id_empresa_dir='\" . $id_empresa_dir . \"'\";\n }\n\n $where .= \", inicio=NOW()\";\n #se for atividade Conferido aguardar 24 horas soma 1 dia no prazo\n if ($id_atividade == '198' and $res[0]->inicio == '0000-00-00 00:00:00') {\n $res[0]->dias++;\n $data_prazo = somar_dias_uteis(date('Y-m-d'), $res[0]->dias);\n $where .= \", dias='\" . $res[0]->dias . \"', data_prazo='\" . $data_prazo . \"'\";\n } else {\n $data_prazo = somar_dias_uteis(date('Y-m-d'), $res[0]->dias);\n $where .= \", data_prazo='\" . $data_prazo . \"'\";\n }\n }\n\n #se atividade = conciliação ou cadastrado, inicia o atendimento\n if (($ativ->id_status == '2' or $ativ->id_status == '3' or $id_atividade == '153') and $res[0]->atendimento == '0000-00-00 00:00:00') {\n $where .= \", atendimento=NOW()\";\n }\n\n #verifica se foi concluído operacional\n if (($id_atividade == '203') and ($res[0]->operacional == '0000-00-00' or $res[0]->operacional == '')) {\n $where .= \", operacional=NOW()\";\n }\n\n #verifica se foi concluído\n if ($id_atividade == '119' and ($res[0]->encerramento == '0000-00-00 00:00:00' or $res[0]->encerramento == '')) {\n $where .= \", encerramento=NOW()\";\n }\n\n #verifica se o pedido já foi direcionado caso não tenha sido direciona para o proprio usuário\n if ($id_atividade == '145' and $res[0]->id_usuario_op == '0') {\n $where .= \", id_usuario_op=\" . $id_usuario;\n }\n\n #se o pedido de imóveis e detran estiverem liberados libera para faturamento\n if (($ativ->id_status == '8' or $ativ->id_status == '10') and ($res[0]->id_servico == '170' or $res[0]->id_servico == '11' or $res[0]->id_servico == '16' or $res[0]->id_servico == '64' or $res[0]->id_servico == '169' or $res[0]->id_servico == '156' or $res[0]->id_servico == '117') and $res[0]->id_pacote == '1') {\n if ($res[0]->id_servico == '169' or $res[0]->id_servico == '156' or $res[0]->id_servico == '117') {\n #se o pedido de imóveis e detran estiverem liberados libera para faturamento\n $this->sql = \"update vsites_pedido_item as pi set pi.pacote_lib = '1' where pi.id_pedido_item=?\";\n $this->values = array($id_pedido_item);\n $this->exec();\n } else {\n //verifica se todos os pedidos foram liberados para faturamento\n $this->sql = \"SELECT COUNT(0) as total from vsites_pedido_item as pi, vsites_pedido as p where \n pi.id_empresa_atend=? and\n pi.id_status!='14' and pi.id_status!='8' and pi.id_status!='10' and \n (pi.id_servico='170' or pi.id_servico='11' or pi.id_servico='16' or pi.id_servico='64') and \n (pi.certidao_devedor = ? and pi.certidao_devedor <> '' or \n pi.certidao_nome = ? and pi.certidao_nome <> '' and pi.certidao_devedor='') and \n pi.id_pedido_item!=? and\n pi.id_pedido=p.id_pedido and \n p.id_pacote='1' and p.cpf=?\";\n $this->values = array($res[0]->id_empresa_atend, $res[0]->certidao_devedor, $res[0]->certidao_nome, $id_pedido_item, $res[0]->cpf);\n $num_pacote = $this->fetch();\n if ($num_pacote[0]->total == 0) {\n //seleciona todos os pedidos que foram liberados para faturamento dentro do pacote\n $this->sql = \"SELECT pi.id_pedido_item, pi.id_pedido, pi.ordem from vsites_pedido_item as pi, vsites_pedido as p where \n pi.id_empresa_atend=? and\n (pi.id_servico='170' or pi.id_servico='11' or pi.id_servico='16' or pi.id_servico='64') and \n pi.id_status!='14' and\n (pi.certidao_devedor =? and pi.certidao_devedor <> '' or \n pi.certidao_nome = ? and pi.certidao_nome <> '' and pi.certidao_devedor='') and \n pi.id_pedido=p.id_pedido and\n p.id_pacote='1' and p.cpf=?\";\n $this->values = array($res[0]->id_empresa_atend, $res[0]->certidao_devedor, $res[0]->certidao_nome, $res[0]->cpf);\n $num_pacote = $this->fetch();\n foreach ($num_pacote as $l) {\n $this->sql = \"update vsites_pedido_item as pi set pi.pacote_lib = '1' where pi.id_pedido_item=?\";\n $this->values = array($l->id_pedido_item);\n $this->exec();\n }\n }\n }\n }\n\n\n if (($id_status == '8' or $id_status == '10') and $res[0]->id_pacote == '2') {\n #se o pacote empresarial estao liberados entao libera para faturamento\n $this->sql = \"SELECT COUNT(0)as total from vsites_pedido_item as pi where pi.id_pedido=? and pi.id_status!='14' and pi.id_status!='8' and pi.id_status!='10' and pi.id_pedido_item!=?\";\n $this->values = array($res[0]->id_pedido, $id_pedido_item);\n $num_pacote = $this->fetch();\n if ($num_pacote[0]->total == 0) {\n $this->sql = \"update vsites_pedido_item set pacote_lib = '1' where id_pedido=? and id_status!='14'\";\n $this->values = array($res[0]->id_pedido);\n $this->exec();\n }\n }\n\n\n if ($id_atividade != 110 && $id_atividade != 217) {\n #se status = 0 nao muda o status, nem data da atividade\n if($controle_id_usuario == 1 OR $controle_id_usuario == 3720){\n\t\t\t\t#print_r($this);\t\n\t\t\t\t#echo $id_atividade;\n\t\t\t\t#exit;\n\t\t\t}\n if ($id_status == '' or $id_status == '0') {\n if ($id_atividade == 212) {\n $where .= \", atraso=NOW() \";\n }\n $this->sql = \"update vsites_pedido_item set id_atividade='\" . $id_atividade . \"' \" . $where . \" where id_pedido_item=?\";\n $this->values = array($id_pedido_item);\n $this->exec();\n } else {\n if ($id_atividade == 155 and $res[0]->id_status == 6 or $id_atividade != 155) {\n if ($id_atividade == 115) {\n $where .= \", des=1 \";\n }\n $this->sql = \"update vsites_pedido_item set data_atividade=NOW(), id_status=?, id_atividade=?,status_hora=? \" . $where . \" where id_pedido_item=?\";\n $this->values = array($id_status, $id_atividade, $s->status_hora . ':00', $id_pedido_item);\n $this->exec();\n }\n }\n }\n\n $data_i = date('Y-m-d H:i:s');\n $this->fields = array('id_atividade', 'status_obs', 'data_i', 'id_usuario',\n 'id_pedido_item', 'status_dias', 'status_hora');\n $this->values = array('id_atividade' => $id_atividade, 'status_obs' => $s->status_obs, 'data_i' => $data_i, 'id_usuario' => $id_usuario,\n 'id_pedido_item' => $id_pedido_item, 'status_dias' => $s->status_dias, 'status_hora' => $s->status_hora);\n $this->insert();\n return 1;\n }", "public function guardar(){\n \n $_vectorpost=$this->_vcapitulo;\n $_programadas=[1,3,4,5,6,7,8,2,11,15,26];\n \n if(!empty($this->_relaciones)){\n \n $_vpasspregunta=explode(\"%%\",$this->_relaciones);\n \n /*Iniciando Transaccion*/\n $_transaction = Yii::$app->db->beginTransaction();\n try {\n foreach($_vpasspregunta as $_clguardar){\n\n /*Aqui se debe ir la funcion segun el tipo de pregunta\n * la variable $_clguardar es un string que trae\n * name_input ::: id_pregunta ::: id_tpregunta ::: id_respuesta\n * cada funcion de guardar por tipo se denomina gr_tipo...\n */\n\n $_ldata=explode(\":::\",$_clguardar);\n\n //Recogiendo codigos SQL\n //Se envia a la funcion de acuerdo al tipo\n // @name_input \"0\"\n // @id_pregunta \n // @id_tpregunta\n // @id_respuesta ==========================//\n \n /*Asociando Respuesta*/\n $_nameq = 'rpta'.$_ldata[0];\n \n \n \n if(!empty($_ldata[2]) and in_array($_ldata[2], $_programadas) === TRUE and isset($_vectorpost['Detcapitulo'][$_nameq])){\n \n \n //Yii::trace(\"Llegan tipos de preguntas \".$_ldata[2].\" Para idpregunta \".$_ldata[1],\"DEBUG\");\n /*Recogiendo Id_respuesta si existe*/ \n $_idrespuesta=(!empty($_ldata[3]))? $_ldata[3]:'';\n $id_pregunta= $_ldata[1];\n $this->_idcapitulo = $_ldata[4];\n \n \n /*Armando Trama SQL segun el tipo de pregunta*/\n $_valor = $_vectorpost['Detcapitulo'][$_nameq];\n \n //Yii::trace(\"que respuestas llegan \".$_valor,\"DEBUG\");\n \n if(isset($this->_agrupadas[$id_pregunta])){\n \n /*1) Buscando si existe una respuesta asociada a la agrupacion*/\n $idrpta_2a = Yii::$app->db->createCommand(\n 'SELECT id_respuesta FROM fd_respuesta\n LEFT JOIN fd_pregunta ON fd_pregunta.id_pregunta = fd_respuesta.id_pregunta\n WHERE fd_pregunta.id_agrupacion= :agrupacion \n and fd_respuesta.id_conjunto_pregunta= :idconjprta \n and fd_respuesta.id_conjunto_respuesta= :idconjrpta\n and fd_respuesta.id_capitulo= :idcapitulo\n and fd_respuesta.id_formato = :idformato\n and fd_respuesta.id_version = :idversion ')\n ->bindValues([\n ':idconjrpta' => $this->_idconjrpta,\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion, \n ':agrupacion' =>$this->_agrupadas[$id_pregunta],\n ])->queryOne();\n \n $_idrespuesta = $idrpta_2a['id_respuesta'];\n \n /*2) Si existe respuesta asociada se envia como _idrespuesta*/\n \n $v_rpta= $this->{\"gr_tipo2a\"}($_idrespuesta,$_valor,$id_pregunta); //Preguntas tipo 2 agrupadas\n $_ldata[1]= $v_rpta[2];\n \n }else{\n \n //Averiguando si la pregunta es tipo multiple y si la respuesta es null si es asi \n //Salta a la siguiente pregunta\n if(!empty($this->multiples[$id_pregunta]) and empty($_valor)){\n continue;\n }else if(!empty($this->multiples[$id_pregunta]) and !is_null($_valor)){\n $_idrespuesta=''; \n } \n \n /*Si la pregunta es tipo 3 se averigua si la respuesta es tipo especifique*/\n $_otros=null;\n if($_ldata[2]=='3' and isset($_vectorpost['Detcapitulo']['otros_'.$_ldata[0]])){\n \n $_otros = $_vectorpost['Detcapitulo']['otros_'.$_ldata[0]];\n $v_rpta= $this->{\"gr_tipo\".$_ldata[2]}($_idrespuesta,$_valor,$_otros);\n \n }else{\n \n if($_ldata[2]==11 and isset($this->_tipo11[$_nameq])){\n $_valor=count($this->_tipo11[$_nameq]);\n $v_rpta= $this->{\"gr_tipo\".$_ldata[2]}($_idrespuesta,$_valor);\n }else if ($_ldata[2]!=11 and !isset($this->_tipo11[$_nameq])){\n $v_rpta= $this->{\"gr_tipo\".$_ldata[2]}($_idrespuesta,$_valor,$_otros,$id_pregunta);\n }else{\n continue;\n } \n }\n } \n \n /*Asignando valor == null*/\n $v_rpta[1]=(!isset($v_rpta[1]))? NULL:$v_rpta[1];\n \n \n /*Generado comando SQL*/\n if(!empty($v_rpta[0])){\n \n if(empty($this->_idjunta))$this->_idjunta=0;\n if(is_null($_otros)){ \n \n if (strpos($v_rpta[0], ';') !== false) {\n $sep_qu = explode(\";\", $v_rpta[0]);\n \n Yii::$app->db->createCommand($sep_qu[0])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ':idconjrpta' => $this->_idconjrpta,\n ':idpregunta' => $_ldata[1],\n ':idtpregunta' => $_ldata[2],\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion,\n ':idjunta' =>$this->_idjunta,\n ])->execute();\n \n Yii::$app->db->createCommand($sep_qu[1])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ])->execute();\n \n \n }\n else\n {\n Yii::$app->db->createCommand($v_rpta[0])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ':idconjrpta' => $this->_idconjrpta,\n ':idpregunta' => $_ldata[1],\n ':idtpregunta' => $_ldata[2],\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion,\n ':idjunta' =>$this->_idjunta,\n ])->execute();\n }\n \n \n }else{ \n Yii::$app->db->createCommand($v_rpta[0])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ':idconjrpta' => $this->_idconjrpta,\n ':idpregunta' => $_ldata[1],\n ':idtpregunta' => $_ldata[2],\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion,\n ':idjunta' =>$this->_idjunta,\n ':otros' =>$_otros, \n ])->execute();\n }\n\n /*Se averigua con que id quedo guardada la respuesta si es tipo 11 -> guarda en SOP SOPORTE*/\n if($_ldata[2]=='11' and !empty($this->_tipo11[$_nameq])){\n\n $id_rpta = Yii::$app->db->createCommand(\n 'SELECT id_respuesta FROM fd_respuesta '\n . 'WHERE id_pregunta = :_prta'\n . ' and fd_respuesta.id_conjunto_pregunta= :idconjprta \n and fd_respuesta.id_conjunto_respuesta= :idconjrpta\n and fd_respuesta.id_capitulo= :idcapitulo\n and fd_respuesta.id_formato = :idformato\n and fd_respuesta.id_version = :idversion' )\n ->bindValues([\n ':_prta' => $_ldata[1], \n ':idconjrpta' => $this->_idconjrpta,\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion, \n ])->queryOne();\n\n\n foreach($this->_tipo11[$_nameq] as $_cltp11){\n\n $_vctp11=explode(\":::\",$_cltp11);\n $_namefile = $_vctp11[0].\".\".$_vctp11[2];\n\n $_sqlSOP=\"INSERT INTO sop_soportes ([[ruta_soporte]],[[titulo_soporte]],[[tamanio_soportes]],[[id_respuesta]]) VALUES (:ruta, :titulo, :tamanio, :_idrpta)\";\n\n Yii::$app->db->createCommand($_sqlSOP)\n ->bindValues([\n ':ruta' => $_vctp11[1],\n ':titulo' => $_namefile,\n ':tamanio' => $_vctp11[3],\n ':_idrpta' => $id_rpta[\"id_respuesta\"],\n ])->execute();\n\n }\n \n }\n /*Fin guardando en SOP_SOPORTES para tipo 11*/\n \n } \n }\n\n }\n \n \n \n $_transaction->commit();\n \n }catch (\\Exception $e) {\n $_transaction->rollBack();\n throw $e;\n return FALSE;\n } catch (\\Throwable $e) {\n $_transaction->rollBack();\n throw $e;\n return FALSE;\n } \n \n }\n return TRUE;\n }", "public function uploadNormaAlatKerjaPanen($params = array())\n {\n $data = array();\n $newdata_ba = array();\n $datachk = array();\n $total_rec = $ins_rec = $lastBaCode = $update_rec = 0;\n \n if ($_FILES[file][size] > 0) {\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************\n //1. ****************** Check BA dari CSV FILE\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n $arrba = array();\n do {\n if (($datachk[0])&&($total_rec > 1)) {\n array_push($arrba,$datachk[1]);\n }\n $total_rec++;\n } while($datachk = fgetcsv($handle,1000,\";\",\"'\"));\n $arrbadis = array_values(array_unique($arrba, SORT_REGULAR)); //variabel array list BA pada CSV\n \n //2. ****************** Baca Urutan Upload dari T_SEQ\n $sqlCurTask=\"SELECT SEQ_NUM FROM T_SEQ WHERE TABLE_NAME='TN_ALAT_KERJA_PANEN'\";\n $seqNum = $this->_db->fetchOne($sqlCurTask);\n $sqlSeq=\"SELECT * FROM T_SEQ WHERE SEQ_NUM < ($seqNum) ORDER BY SEQ_NUM, TASK_NAME\";\n $rows = $this->_db->fetchAll($sqlSeq);\n if (!empty($rows)) {\n foreach ($rows as $idx => $row) { \n $tablechk = $row['REMARKS'];\n //2.1 ****************** get BA CODE yang sudah dimasukan pada table di awal sequence\n $sqlba = \"SELECT DISTINCT BA_CODE FROM \".$row['TABLE_NAME'];\n $arrnormaba = array();\n $arrlockba = array();\n $rowsba = $this->_db->fetchAll($sqlba);\n foreach ($rowsba as $idxba => $rowba) {\n array_push($arrnormaba,$rowba['BA_CODE']); //variabel array list BA pada masing2 norma\n //2.2 ****************** get STATUS LOCK masing2 BA CODE di T_SEQ\n $sqlba1 = \"SELECT STATUS FROM T_SEQ_CHECK WHERE BA_CODE='\".$rowba['BA_CODE'].\"' AND TASK_NAME='\".$row['TABLE_NAME'].\"'\";\n \n $arrlockba[$rowba['BA_CODE']] = $this->_db->fetchOne($sqlba1);\n } \n $arrNotFound=array();\n for($x=0;$x<count($arrbadis);$x++){\n if(!in_array($arrbadis[$x],$arrnormaba)){ //check apakah data ba csv ada di data ba norma?\n $arrNotFound[]=$arrbadis[$x];\n }elseif($arrlockba[$arrbadis[$x]]==\"LOCKED\"){\n $arrNotFound[]=$arrbadis[$x];\n }\n }\n if($arrNotFound) break;\n }\n }\n $arrNotFound =array();\n if($arrNotFound){\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'ba_notfound' => implode(\",\",$arrNotFound),\n 'task_err' => $tablechk\n );\n return $return;\n }\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************//\n //get the csv file\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n \n $total_rec = 0;\n \n //loop through the csv file and insert into database\n do {\n if (($data[0])&&($total_rec > 1)) {\n \n if ($lastBaCode <> addslashes($data[0])){\n /*try {\n //remove data\n $sqlDelete = \"\n DELETE FROM TN_ALAT_KERJA_PANEN\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n \";\n //log file penghapusan data\n $this->_global->deleteDataLogFile($sqlDelete); \n $this->_db->query($sqlDelete);\n } catch (Exception $e) {\n \n }*/\n $newdata_ba[] = addslashes($data[0]);\n }\n \n //get region code\n $region_code = $this->_formula->get_RegionCode($data[0]);\n \n //cek data\n $sql = \"\n SELECT COUNT(*) \n FROM TN_ALAT_KERJA_PANEN\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND MATERIAL_CODE = TRIM('\".addslashes($data[1]).\"')\n \";\n $count = $this->_db->fetchOne($sql);\n if ($count == 0) {\n try {\n //insert data\n $sql = \"\n INSERT INTO TN_ALAT_KERJA_PANEN\n (PERIOD_BUDGET, REGION_CODE, BA_CODE, MATERIAL_CODE, ROTASI, INSERT_USER, INSERT_TIME)\n VALUES (\n TO_DATE('{$this->_period}','DD-MM-RRRR'),\n '\".$region_code.\"',\n TRIM('\".addslashes($data[0]).\"'),\n TRIM('\".addslashes($data[1]).\"'),\n REPLACE('\".addslashes($data[2]).\"', ',', ''),\n '{$this->_userName}',\n SYSDATE\n )\n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $ins_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA ALAT KERJA PANEN', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA ALAT KERJA PANEN', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n // cek apakah data non-aktif\n $sql = \"\n SELECT COUNT(*) \n FROM TN_ALAT_KERJA_PANEN\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND MATERIAL_CODE = TRIM('\".addslashes($data[1]).\"')\n AND DELETE_USER IS NULL\n \";\n $count = $this->_db->fetchOne($sql);\n \n if ($count == 0) {\n // update data menjadi aktif jika sebelumnya telah dinon-aktifkan\n try {\n $sql = \"\n UPDATE TN_ALAT_KERJA_PANEN\n SET ROTASI = REPLACE('\".addslashes($data[2]).\"', ',', ''),\n UPDATE_USER = '{$this->_userName}',\n UPDATE_TIME = SYSDATE,\n DELETE_USER = NULL,\n DELETE_TIME = NULL\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND MATERIAL_CODE = TRIM('\".addslashes($data[1]).\"')\n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $update_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA ALAT KERJA PANEN', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA ALAT KERJA PANEN', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n }\n }\n $lastBaCode = addslashes($data[0]);\n }\n $total_rec++;\n } while ($data = fgetcsv($handle,1000,\",\",\"'\"));\n //\n $return = array(\n 'status' => 'done',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }else{\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }\n \n // ********************************************** HITUNG SEMUA HASIL UPLOAD **********************************************\n // Sabrina / 2013-08-22\n \n $auto_calc = new Application_Model_NormaAlatKerjaPanen();\n \n if (!empty($newdata_ba)) {\n try {\n foreach ($newdata_ba as $idx => $ba_code) {\n $params['budgetperiod'] = date(\"Y\", strtotime($this->_period));\n $params['key_find'] = $ba_code;\n \n $records1 = $this->_db->fetchAll(\"{$auto_calc->getData($params)}\");\n \n foreach ($records1 as $idx1 => $record1) {\n $auto_calc->calculateData($record1);\n }\n }\n //log DB\n $this->_global->insertLog('UPDATE SUCCESS', 'NORMA ALAT KERJA PANEN', '', '');\n } catch (Exception $e) {\n //log DB\n $this->_global->insertLog('UPDATE FAILED', 'NORMA ALAT KERJA PANEN', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n \n //return value\n $result = false;\n } \n }\n \n //update summary\n $auto_calc->updateSummaryNormaAlatKerjaPanen();\n // ********************************************** END OF HITUNG SEMUA HASIL UPLOAD **********************************************\n \n return $return;\n }", "function import_surat_keputusan_pemutih_penyalur() {\n//\t\tif (! $this->get_permission('fill_this')) return $this->intruder();\n\t\tglobal ${$GLOBALS['post_vars']}, ${$GLOBALS['files_vars']};\n\t\t$pk = array (\n\t\t\t'id_surat_keputusan_pemutih_penyalur' => TRUE\n\t\t);\n\t\t$label_arr = $this->surat_keputusan_pemutih_penyalur_label;\n\n\t\t$fd = fopen(${$GLOBALS['files_vars']}['userfile']['tmp_name'], \"r\");\n\t\twhile (! feof($fd)) {\n\t\t\t$buffer = fgets($fd, 4096);\n\t\t\t$piece = split(\",\", $buffer);\n\t\t\tif (empty($field_arr)) {\n\t\t\t\t$insert_key = \"\";\n\t\t\t\tfor ($i=0;$i<count($piece);$i++) {\n\t\t\t\t\t$buffer2 = trim(preg_replace(\"/^\\\"(.*)\\\"$/\", \"\\\\1\", $piece[$i]), \"\\xA0 \\t\\n\\r\\0\\x0B\");\n\t\t\t\t\t$field_arr[$i] = array_search($buffer2, $label_arr);\n\t\t\t\t\tif ($field_arr[$i]) {\n\t\t\t\t\t\tif ($insert_key) $insert_key .= ',';\n\t\t\t\t\t\t$insert_key .= $field_arr[$i];\n\t\t\t\t\t}\n\t\t\t\t\t$count_piece++;\n\t\t\t\t}\n\t\t\t\tif ($insert_key) $insert_key = \"(\".$insert_key.\")\";\n\t\t\t} else if (count($piece) == $count_piece) {\n\t\t\t\tfor ($i=0;$i<count($piece);$i++) {\n\t\t\t\n\n\t\t$buffer2 = trim(preg_replace(\"/^\\\"(.*)\\\"$/\", \"\\\\1\", $piece[$i]), \"\\xA0 \\t\\n\\r\\0\\x0B\");\n\t\t\t\t\tif ($field_arr[$i]) {\n\t\t\t\t\t\tif ($insert_extra) $insert_extra .= ',';\n\t\t\t\t\t\t$insert_extra .= '\\''.$buffer2.'\\'';\n\t\t\t\t\t\tif ($pk[$field_arr[$i]]) {\n\t\t\t\t\t\t\tif ($delete_extra) $delete_extra .= \" AND \";\n\t\t\t\t\t\t\t$delete_extra .= $field_arr[$i].'=\\''.$buffer2.'\\'';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($insert_extra) {\n\t\t\t\t\t$insert_extra = \"(\".$insert_extra.\")\";\n\t\t\t\t\tif ($insert_value) $insert_value .= \",\";\n\t\t\t\t\t$insert_value .= $insert_extra;\n\t\t\t\t\tunset($insert_extra);\n\t\t\t\t}\n\t\t\t\tif ($delete_extra) {\n\t\t\t\t\t$delete_extra = \"(\".$delete_extra.\")\";\n\t\t\t\t\tif ($delete_where) $delete_where .= \" OR \";\n\t\t\t\t\t$delete_where .= $delete_extra;\n\t\t\t\t\tunset($delete_extra);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfclose($fd);\n\t\tunlink(${$GLOBALS['files_vars']}['userfile']['tmp_name']);\n\n\t\tglobal $adodb;\n\t\tif ($delete_where) $delete_query = \"DELETE FROM surat_keputusan_pemutih_penyalur WHERE \".$delete_where.\" ;\";\n\t\t$adodb->Execute($delete_query);\n\n\t\tif ($insert_key && $insert_value) {\n\n\t\t\tsrand((double)microtime()*1000000);\n\t\t\t$output_file = '/tmp/'.md5(rand()).'.output.txt';\n\t\t\t$all_query = $insert_value;\n\n\t\t\t$all_query = str_replace(\"),\", \")\\n\", $all_query);\n\t\t\tif (strstr($GLOBALS['adodb_type'], 'mysql')) {\n\t\t\t\t$piece = explode(\"\\n\", $all_query);\n\t\t\t\tforeach ($piece as $key => $value) {\n\t\t\t\t\t$value = str_replace('(\\'', '', $value);\n\t\t\t\t\t$value = str_replace('\\',\\'', \"\\t\", $value);\n\t\t\t\t\t$value = str_replace('\\')', '', $value);\n\t\t\t\t\tif ($data_file) $data_file .= \"\\n\";\n\t\t\t\t\t$data_file .= $value;\n\t\t\t\t}\n\t\t\t\t$fl = fopen($output_file.'.mysql', 'w');\n\t\t\t\tfwrite($fl, $data_file);\n\t\t\t\tfclose($fl);\n\t\t\t\t$adodb->Execute('LOAD DATA INFILE \\''.$output_file.'.mysql'.'\\' INTO TABLE surat_keputusan_pemutih_penyalur '.$insert_key);\n\t\t\t\tunlink($output_file.'.mysql');\n\t\t\t} else if (strstr($GLOBALS['adodb_type'], 'postgres')) {\n\n\t\t\t $piece = explode(\"\\n\", $all_query);\n\t\t\t\tforeach ($piece as $key => $value) {\n\t\t\t\t\t$value = str_replace('(\\'', '', $value);\n\t\t\t\t\t$value = str_replace('\\',\\'', \"\\t\", $value);\n\t\t\t\t\t$value = str_replace('\\')', '', $value);\n\t\t\t\t\tif ($data_file) $data_file .= \"\\n\";\n\t\t\t\t\t$data_file .= $value;\n\t\t\t\t}\n\t\t\t\t$fl = fopen($output_file.'.pgsql', 'w');\n\t\t\t\tfwrite($fl, $data_file);\n\t\t\t\tfclose($fl);\n\t\t\t\t$adodb->Execute('COPY surat_keputusan_pemutih_penyalur '.$insert_key.' FROM \\''.$output_file.'.pgsql'.'\\'');\n\t\t\t\tunlink($output_file.'.pgsql');\n\t\t\t} else {\n\t\t\t\t$piece = explode(\"\\n\", $all_query);\n\t\t\t\tforeach ($piece as $key => $value) {\n\t\t\t\t\t$adodb->Execute('INSERT INTO surat_keputusan_pemutih_penyalur '.$insert_key.' VALUES '.$value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$_block = new block();\n\t\t$_block->set_config('title', ('Import Surat Keputusan Pemutihan Izin Penyalur Status'));\n\t\t$_block->set_config('width', 595);\n\t\tif (! $adodb->ErrorMsg()) {\n\t\t\t$_block->parse(array('+<font color=green><b>'.__('Successfull Import').'</b></font>'));\n\t\t\treturn $_block->get_str();\n\t\t}\n\t\t$GLOBALS['self_close_js'] = $GLOBALS['adodb']->ErrorMsg();\n\t\t$_block->parse(array('+<font color=red><b>'.__('Failed Import').'</b></font>'));\n\t\treturn $_block->get_str();\n\t}", "final private function insertNewEnfermedades($id) {\n # Si hay proveedores\n if(null != $this->enfermedades) {\n # Insertar de nuevo esas relaciones\n $enfermedad = $this->db->prepare(\"INSERT INTO nino_enfermedad_2 (id_nino,id_enfermedad,fechacontagio)\n VALUES ('$id',?,'23/02/2017');\");\n foreach($this->enfermedades as $id_enfermedad){\n $enfermedad->execute(array($id_enfermedad));\n }\n $enfermedad->closeCursor();\n } \n }", "public function uploadNormaPanenLoading($params = array())\n {\n $data = array();\n $newdata_ba = array();\n $datachk = array();\n $total_rec = $ins_rec = $lastBaCode = $update_rec = 0;\n \n if ($_FILES[file][size] > 0) {\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************\n //1. ****************** Check BA dari CSV FILE\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n $arrba = array();\n do {\n if (($datachk[0])&&($total_rec > 1)) {\n array_push($arrba,$datachk[1]);\n }\n $total_rec++;\n } while($datachk = fgetcsv($handle,1000,\";\",\"'\"));\n $arrbadis = array_values(array_unique($arrba, SORT_REGULAR)); //variabel array list BA pada CSV\n \n //2. ****************** Baca Urutan Upload dari T_SEQ\n $sqlCurTask=\"SELECT SEQ_NUM FROM T_SEQ WHERE TABLE_NAME='TN_PANEN_LOADING'\";\n $seqNum = $this->_db->fetchOne($sqlCurTask);\n $sqlSeq=\"SELECT * FROM T_SEQ WHERE SEQ_NUM < ($seqNum) ORDER BY SEQ_NUM, TASK_NAME\";\n $rows = $this->_db->fetchAll($sqlSeq);\n if (!empty($rows)) {\n foreach ($rows as $idx => $row) { \n $tablechk = $row['REMARKS'];\n //2.1 ****************** get BA CODE yang sudah dimasukan pada table di awal sequence\n $sqlba = \"SELECT DISTINCT BA_CODE FROM \".$row['TABLE_NAME'];\n $arrnormaba = array();\n $arrlockba = array();\n $rowsba = $this->_db->fetchAll($sqlba);\n foreach ($rowsba as $idxba => $rowba) {\n array_push($arrnormaba,$rowba['BA_CODE']); //variabel array list BA pada masing2 norma\n //2.2 ****************** get STATUS LOCK masing2 BA CODE di T_SEQ\n $sqlba1 = \"SELECT STATUS FROM T_SEQ_CHECK WHERE BA_CODE='\".$rowba['BA_CODE'].\"' AND TASK_NAME='\".$row['TABLE_NAME'].\"'\";\n \n $arrlockba[$rowba['BA_CODE']] = $this->_db->fetchOne($sqlba1);\n } \n $arrNotFound=array();\n for($x=0;$x<count($arrbadis);$x++){\n if(!in_array($arrbadis[$x],$arrnormaba)){ //check apakah data ba csv ada di data ba norma?\n $arrNotFound[]=$arrbadis[$x];\n }elseif($arrlockba[$arrbadis[$x]]==\"LOCKED\"){\n $arrNotFound[]=$arrbadis[$x];\n }\n }\n if($arrNotFound) break;\n }\n }\n $arrNotFound =array();\n if($arrNotFound){\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'ba_notfound' => implode(\",\",$arrNotFound),\n 'task_err' => $tablechk\n );\n return $return;\n }\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************//\n //get the csv file\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n \n $total_rec = 0;\n \n //loop through the csv file and insert into database\n do {\n if (($data[0])&&($total_rec > 1)) { \n if ($lastBaCode <> addslashes($data[0])){\n /*try {\n //remove data\n $sqlDelete = \"\n DELETE FROM TN_PANEN_LOADING\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n \";\n //log file penghapusan data\n $this->_global->deleteDataLogFile($sqlDelete); \n $this->_db->query($sqlDelete);\n } catch (Exception $e) {\n \n }*/\n $newdata_ba[] = addslashes($data[0]);\n }\n \n //cek data\n $sql = \"\n SELECT COUNT(*) \n FROM TN_PANEN_LOADING\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND JARAK_PKS_MIN = '\".addslashes($data[1]).\"'\n AND JARAK_PKS_MAX = '\".addslashes($data[2]).\"'\n \";\n $count = $this->_db->fetchOne($sql);\n \n if ($count == 0) {\n try {\n \n //insert data\n $sql = \"\n INSERT INTO TN_PANEN_LOADING (PERIOD_BUDGET, \n BA_CODE, \n JARAK_PKS_MIN, \n JARAK_PKS_MAX, \n TARGET_ANGKUT_TM_SUPIR, \n BASIS_TM_SUPIR, \n JUMLAH_TM, \n TARIF_TM, \n TARIF_SUPIR, \n INSERT_USER, \n INSERT_TIME)\n VALUES (\n TO_DATE('{$this->_period}','DD-MM-RRRR'),\n TRIM('\".addslashes($data[0]).\"'),\n '\".addslashes($data[1]).\"',\n '\".addslashes($data[2]).\"',\n '\".addslashes($data[3]).\"',\n '\".addslashes($data[4]).\"',\n '\".addslashes($data[5]).\"',\n '\".addslashes($data[6]).\"',\n '\".addslashes($data[7]).\"',\n '{$this->_userName}',\n SYSDATE\n )\n \";\n \n $this->_db->query($sql);\n $this->_db->commit();\n $ins_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA PANEN LOADING', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA PANEN LOADING', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n // cek apakah data non-aktif\n $sql = \"\n SELECT COUNT(*) \n FROM TN_PANEN_LOADING\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND JARAK_PKS_MIN = '\".addslashes($data[1]).\"'\n AND JARAK_PKS_MAX = '\".addslashes($data[2]).\"'\n AND DELETE_USER IS NULL\n \";\n $count = $this->_db->fetchOne($sql);\n \n if ($count == 0) {\n // update data menjadi aktif jika sebelumnya telah dinon-aktifkan\n try {\n \n $sql = \"\n UPDATE TN_PANEN_LOADING\n SET TARGET_ANGKUT_TM_SUPIR = '\".addslashes($data[3]).\"',\n BASIS_TM_SUPIR = '\".addslashes($data[4]).\"',\n JUMLAH_TM = '\".addslashes($data[5]).\"',\n TARIF_TM = '\".addslashes($data[6]).\"',\n TARIF_SUPIR = '\".addslashes($data[7]).\"',\n UPDATE_USER = '{$this->_userName}',\n UPDATE_TIME = SYSDATE,\n DELETE_USER = NULL,\n DELETE_TIME = NULL\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND JARAK_PKS_MIN = '\".addslashes($data[1]).\"'\n AND JARAK_PKS_MAX = '\".addslashes($data[2]).\"'\n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $update_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA PANEN LOADING', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA PANEN LOADING', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n }\n }\n $lastBaCode = addslashes($data[0]);\n }\n $total_rec++;\n } while ($data = fgetcsv($handle,1000,\",\",\"'\"));\n //\n $return = array(\n 'status' => 'done',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }else{\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }\n // ********************************************** HITUNG SEMUA HASIL UPLOAD **********************************************\n // Sabrina / 2013-08-22\n \n if (!empty($newdata_ba)) {\n try {\n $auto_calc = new Application_Model_NormaPanenLoading();\n \n foreach ($newdata_ba as $idx => $ba_code) {\n $params['budgetperiod'] = date(\"Y\", strtotime($this->_period));\n $params['key_find'] = $ba_code;\n \n $records1 = $this->_db->fetchAll(\"{$auto_calc->getData($params)}\");\n \n foreach ($records1 as $idx1 => $record1) {\n $auto_calc->calculateData($record1);\n }\n }\n //log DB\n $this->_global->insertLog('UPDATE SUCCESS', 'NORMA PANEN LOADING', '', '');\n } catch (Exception $e) {\n //log DB\n $this->_global->insertLog('UPDATE FAILED', 'NORMA PANEN LOADING', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n \n //return value\n $result = false;\n } \n } \n // ********************************************** END OF HITUNG SEMUA HASIL UPLOAD **********************************************\n \n return $return;\n }", "function Insert($datos)\n { \n\t\t// si el id_fichero es nulo, se busca el siguiente que le corresponde \n\t\tif(is_null($datos['id_fichero']))\n\t\t{\t\n\t\t\t// Se obtiene el último id insertado\n\t\t\t$sql_atribs = \"SELECT max(id_fichero) as ultimo_id FROM ficheros_inmuebles WHERE inmueble='\".$datos['inmueble'].\"'\";\n\t\t\t$atribs = $this->Execute($sql_atribs) or die($this->ErrorMsg());\n\t\t\t$num_atribs = $atribs->RecordCount();\n\t\t\t$atrib = $atribs->FetchRow();\n\t\t\n\t\t\tif(is_null($atrib['ultimo_id']))\n\t\t\t{\n\t\t\t\t$id_fichero=1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$id_fichero = $atrib['ultimo_id']+1;\n\t\t\t}\n\t\t}\n\t\t// Se inserta los valores de los datos\n\t\t$insertSQL = sprintf(\"INSERT INTO ficheros_inmuebles (id_fichero, inmueble, fichero, texto_fichero, tipo_fichero) VALUES (%s, %s, %s, %s, %s)\", \n\t\t\t\t GetSQLValueString($id_fichero, \"int\"),\n\t\t\t\t GetSQLValueString($datos['inmueble'], \"text\"),\n\t\t\t\t GetSQLValueString($datos['fichero'], \"text\"),\n\t\t\t\t GetSQLValueString($datos['texto_fichero'], \"text\"),\n\t\t\t\t GetSQLValueString($datos['tipo_fichero'], \"text\"));\n\t\treturn $this->Execute($insertSQL) or die($this->ErrorMsg());\n }", "public static function inserirProdutoCarrinho(){\n if(isset($_SESSION['user'])){\n //USUARIO LOGADO COM CARRINHO\n if(isset($_SESSION['user']['carrinhoId'])){\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $expPro = explode(';',self::$carrinho->produto_id);\n $expQuant = explode(';',self::$carrinho->quantidade);\n\n $expPro[] = self::$produto['produto_id'];\n $expQuant[] = self::$produto['quantidade'];\n\n $impPro = implode(';',$expPro);\n $impQuant = implode(';',$expQuant);\n\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $query = \"UPDATE carrinhos SET produto_id=:idp, quantidade=:qnt, idCliente=:idC WHERE id=:id\";\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,$impPro);\n $stmt->bindValue(2,$impQuant);\n $stmt->bindValue(3,$_SESSION['user']['id']);\n $stmt->bindValue(4,self::$carrinho->id);\n $stmt->execute();\n\n //USUARIO LOGADO SEM CARRINHO\n }else{\n $conn = \\App\\lib\\Database\\Conexao::connect();\n $query = \"INSERT INTO carrinhos(produto_id,quantidade,idCliente) VALUES (:prodId, :qnt, :idCliente)\";\n $stmt = $conn->prepare($query);\n $stmt->bindValue(1,self::$produto['produto_id']);\n $stmt->bindValue(2,self::$produto['quantidade']);\n $stmt->bindValue(3,$_SESSION['user']['id']);\n $stmt->execute();\n if($stmt->rowCount()){\n return true;\n }throw new \\Exception(\"Nao Foi Possivel adicionar produto ao carrinho\");\n }\n\n //USUARIO NAO LOGADO\n }else{\n //USUARIO NAO LOGADO COM CARRINHO\n if(isset($_SESSION['carrinho'])){\n $expPro = explode(';',$_SESSION['carrinho']['produto_id']);\n $expQuant = explode(';',$_SESSION['carrinho']['quantidade']);\n $expPro[] = self::$produto['produto_id'];\n $expQuant[] = self::$produto['quantidade'];\n $impPro = implode(';',$expPro);\n $impQuant = implode(';',$expQuant);\n $_SESSION['carrinho'] = array('produto_id'=>$impPro,'quantidade'=>$impQuant);\n return true;\n //USUARIO NAO LOGADO SEM CARRINHO\n }else{\n $_SESSION['carrinho'] = array('produto_id'=>self::$produto['produto_id'],'quantidade'=>self::$produto['quantidade']);\n return true;\n \n }\n \n }\n }", "public function executeGenerarfile(sfWebRequest $request)\n {\n\n // Variables\n $sqlUpdate='';\n\n // Redirige al inicio si no tiene acceso\n if (!$this->getUser()->getGuardUser()->getIsSuperAdmin())\n $this->redirect('ingreso');\n\n $archivo = Doctrine_Core::getTable('Actualizacionestrat')->find(array($request['id']));\n // $archivo = Doctrine_Core::getTable('Actualizaciones')->find(array(2));\n\n $arr = explode(\".\", $archivo->getImagefile(), 2);\n $first = $arr[0];\n\n $nombre_archivo_upd = sfConfig::get('app_pathfiles_folder').\"/../actualizacionestrat\".'/upd_'.$first.\".sql\";\n\n // DATOS conexion\n /*$dbhost = 'localhost';$dbname = 'circulo'; $dbuser = 'root'; $dbpass = 'root911';\n\n $pdo = new \\PDO('mysql:host=' . $dbhost . ';dbname=' . $dbname, $dbuser, $dbpass, array(\n \\PDO::MYSQL_ATTR_LOCAL_INFILE => true\n ));*/\n\n\n // PRIMER PASO : ACTUALIZACION DE REGISTROS\n\n // SI existe el archivo previamente, lo borro\n if (file_exists($nombre_archivo_upd)) unlink($nombre_archivo_upd);\n\n // CONSULTA por registros a ACTUALIZAR (ya existe el email en la tabla de Pacientes)\n //$datoss = $archivo = Doctrine_Core::getTable('Actualizaciones')->obtenerRegistrosAActualizar();\n\n $fp=fopen($nombre_archivo_upd,\"w+\");\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('nombre','nombre','T');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('abreviacion','abreviacion','T');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idgrupotratamiento','idgrupotratamiento','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idobrasocial','idobrasocial','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idplan','idplan','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idontologia','idontologia','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('garantia','garantia','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('importe','importe','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('coseguro','coseguro','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('importeos','importeos','N');\n fwrite($fp,$sqlUpdate);\n\n\n\n fclose ($fp);\n\n return true;\n\n }", "function create_fichaClinica( $dataPrincipal = array() )\n{\n\n global $db, $conf;\n\n $sqlNuevoUpdate = \"INSERT INTO tab_documentos_ficha_clinica(\";\n $sqlNuevoUpdate .= \" nombre_apellido\";\n $sqlNuevoUpdate .= \" , cedula_pasaporte\";\n $sqlNuevoUpdate .= \" , fecha_nacimiento\";\n $sqlNuevoUpdate .= \" , lugar_nacimiento\";\n $sqlNuevoUpdate .= \" , estado_civil\";\n $sqlNuevoUpdate .= \" , n_hijos\";\n $sqlNuevoUpdate .= \" , sexo\";\n $sqlNuevoUpdate .= \" , edad\";\n $sqlNuevoUpdate .= \" , ocupacion\";\n $sqlNuevoUpdate .= \" , direccion_domicilio\";\n $sqlNuevoUpdate .= \" , emergencia_call_a\";\n $sqlNuevoUpdate .= \" , emergencia_telefono\";\n $sqlNuevoUpdate .= \" , telefono_convencional\";\n $sqlNuevoUpdate .= \" , operadora\";\n $sqlNuevoUpdate .= \" , celular\";\n $sqlNuevoUpdate .= \" , email\";\n $sqlNuevoUpdate .= \" , twiter\";\n $sqlNuevoUpdate .= \" , lugar_trabajo\";\n $sqlNuevoUpdate .= \" , telefono_trabajo\";\n $sqlNuevoUpdate .= \" , posee_seguro\";\n $sqlNuevoUpdate .= \" , motivo_consulta\";\n $sqlNuevoUpdate .= \" , tiene_enfermedades\";\n $sqlNuevoUpdate .= \" , otras_enfermedades\";\n\n $sqlNuevoUpdate .= \" , esta_algun_tratamiento_medico\";\n $sqlNuevoUpdate .= \" , cual_tratamiento_medico\";\n\n $sqlNuevoUpdate .= \" , tiene_problema_hemorragico\";\n $sqlNuevoUpdate .= \" , cual_problema_hemorragico\";\n\n $sqlNuevoUpdate .= \" , alergico_medicamento\";\n $sqlNuevoUpdate .= \" , cual_alergico_medicamento\";\n\n $sqlNuevoUpdate .= \" , toma_medicamento\";\n $sqlNuevoUpdate .= \" , cual_toma_medicamento\";\n\n $sqlNuevoUpdate .= \" , esta_embarazada\";\n $sqlNuevoUpdate .= \" , cual_esta_embarazada\";\n\n $sqlNuevoUpdate .= \" , enfermedades_hereditarias\";\n $sqlNuevoUpdate .= \" , cual_enfermedades_hereditarias\";\n\n $sqlNuevoUpdate .= \" , que_toma_ult_24horass\";\n $sqlNuevoUpdate .= \" , resistente_medicamento\";\n $sqlNuevoUpdate .= \" , hemorragia_bucales\";\n $sqlNuevoUpdate .= \" , complicacion_masticar\";\n $sqlNuevoUpdate .= \" , habitos_consume\";\n\n $sqlNuevoUpdate .= \")\";\n $sqlNuevoUpdate .= \"VALUES(\";\n\n $sqlNuevoUpdate .= \" '$dataPrincipal->doc_nombre_apellido'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_cedula'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_fecha_nc'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_lugar_n'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_estado_civil'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_hijos_n'\";\n $sqlNuevoUpdate .= \", '\".json_encode($dataPrincipal->sexo).\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_edad'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_ocupacion'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_domicilio'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_emergencia_call_a'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_emergencia_telef'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_telef_convencional'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_operadora'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_celular'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_email'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_twiter'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_lugar_trabajo'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_telef_trabajo'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_q_seguro_posee'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_motivo_consulta'\";\n\n $sqlNuevoUpdate .= \", '\".json_encode($dataPrincipal->enfermedades).\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_otras_enferm'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->segui_tratamiento) .\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_tratmient_descrip'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->problemas_hemorragicos) .\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_descrip_hemorragicos'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->alergico_medicamento) .\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_descrip_alergia'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->toma_medicamento_frecuente) .\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_descrip_medicamento'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->embarazada) .\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_descrip_embarazada'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->enferm_hederitarias) .\"'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_descript_hederitaria'\";\n\n $sqlNuevoUpdate .= \", '$dataPrincipal->q_medicina_tomo_24h_ultima'\";\n $sqlNuevoUpdate .= \", '$dataPrincipal->doc_resistente_medicamento'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->hemorragias_bocales) .\"'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->complicaciones_masticar) .\"'\";\n\n $sqlNuevoUpdate .= \", '\". json_encode($dataPrincipal->abitos_consume) .\"'\";\n\n\n $sqlNuevoUpdate .= \")\";\n\n $rs = $db->query($sqlNuevoUpdate);\n\n if(!$rs){\n return 'Error no se pudo guardar el documento Ficha clinica';\n }else{\n return '';\n }\n\n}", "public function inserirDados()\n\t\t{\n\t\t\t$insertIdoso = \"INSERT INTO idoso(logradouro,\n\t\t\t\t\t\t\t\t\t\ttipo_logradouro,\n\t\t\t\t\t\t\t\t\t\tnumero,\n\t\t\t\t\t\t\t\t\t\tcomplemento,\n\t\t\t\t\t\t\t\t\t\tbaiiro,\n\t\t\t\t\t\t\t\t\t\tcidade,\n\t\t\t\t\t\t\t\t\t\tuf,\n\t\t\t\t\t\t\t\t\t\tusuario_id_usuario)\n\t\t\t\t\t\t\t\tVALUES(:logradouro,\n\t\t\t\t\t\t\t\t\t\t:tipo_logradouro,\n\t\t\t\t\t\t\t\t\t\t:numero,\n\t\t\t\t\t\t\t\t\t\t:complemento,\n\t\t\t\t\t\t\t\t\t\t:baiiro,\n\t\t\t\t\t\t\t\t\t\t:cidade,\n\t\t\t\t\t\t\t\t\t\t:uf,\n\t\t\t\t\t\t\t\t\t\t:usuario_id_usuario)\";\n\n\t\t\t$stmt->pdo->prepare($insertIdoso);\n\t\t\t$stmt->bindParam(':logradouro', $this->logradouro);\n\t\t\t$stmt->bindParam(':tipo_logradouro', $this->tipo_logradouro);\n\t\t\t$stmt->bindParam(':numero', $this->numero);\n\t\t\t$stmt->bindParam(':complemento', $this->complemento);\n\t\t\t$stmt->bindParam(':bairro', $this->baiiro);\n\t\t\t$stmt->bindParam(':cidade', $this->cidade);\n\t\t\t$stmt->bindParam(':uf', $this->uf);\n\t\t\t$stmt->bindParam(':usuario_id_usuario', $this->buscarTodosDados());\n\n\t\t\tif($stmt->execute()) {\n\t\t\t\theader(\"Location: localhost:8001/contato\");\n\t\t\t} else {\n\t\t\t\tdie('Erro ao cadastrar');\n\t\t\t}\n\t\t}", "private function datosHorizontal($productosDelUsuario)\n {\n $this->SetTextColor(0,0,0);\n $this->SetFont('Arial','B',16);\n $top_datos=105;\n $this->SetXY(35, $top_datos);\n $this->Cell(190, 10, utf8_decode(\"DATOS DE LA TIENDA\"), 0, 2, \"J\");\n $this->SetFont('Arial','',10);\n $this->MultiCell(190, //posición X\n 5, //posición Y\n utf8_decode(\n \"ID Vendedor: \".\"1.\".\"\\n\".\n \"Vendedor: \".\"Mr. X.\".\"\\n\".\n \"Dirección: \".\"Medrano 951.\".\"\\n\".\n \"Provincia: \".\"C.A.B.A.\".\"\\n\".\n \"Telefono: \".\"+54 9 11 4867-7511.\".\"\\n\".\n \"Código Postal: \".\"1437.\"),\n 0, // bordes 0 = no | 1 = si\n \"J\", // texto justificado \n false);\n\n\n // Datos del cliente\n $this->SetFont('Arial','B',16);\n $this->SetXY(120, $top_datos);\n $this->Cell(190, 10, utf8_decode(\"DATOS DEL CLIENTE\"), 0, 2, \"J\");\n $this->SetFont('Arial','',10);\n $this->MultiCell(\n 190, //posición X\n 5, //posicion Y\n utf8_decode(\n \"DNI: \".\"20.453.557\".\"\\n\".\n \"Nombre y Apellido: \".\"Chuck Norris.\".\"\\n\".\n \"Dirección: \".\"Rivadavia 5227.\".\"\\n\".\n \"Provincia: \".\"C.A.B.A.\".\"\\n\".\n \"Telefono: \".\"+54 9 11 4741-7219.\".\"\\n\".\n \"Código Postal: \".\"3714.\"),\n 0, // bordes 0 = no | 1 = si\n \"J\", // texto justificado\n false);\n\n //Salto de línea\n $this->Ln(2);\n\n\n //Creación de la tabla de los detalles de los productos productos\n $top_productos = 165;\n $this->SetFont('Arial','B',16);\n $this->SetXY(30, $top_productos);\n $this->Cell(40, 5, utf8_decode('UNIDAD'), 0, 1, 'C');\n $this->SetXY(75, $top_productos);\n $this->Cell(40, 5, utf8_decode('PRODUCTO'), 0, 1, 'C');\n $this->SetXY(115, $top_productos);\n $this->Cell(70, 5, utf8_decode('PRECIO X UNIDAD'), 0, 1, 'C'); \n \n \n $this->SetXY(25, 150);\n $this->SetTextColor(241,241,241);\n $this->Cell(70, 5, '____________________________________________________', 0, 1, 'L'); \n\n $this->SetTextColor(0,0,0);\n $y = 170; // variable para la posición top desde la cual se empezarán a agregar los datos\n\n $precioTotal = 0;\n foreach($productosDelUsuario as $productoX)\n {\n $nombreProducto = $productoX['nombre'];\n $precioProducto = $productoX['precio'];\n \n $this->SetFont('Arial','',10);\n \n $this->SetXY(40, $y);\n $this->Cell(20, 5, utf8_decode(\"1\"), 0, 1, 'C');\n $this->SetXY(80, $y);\n $this->Cell(30, 5, utf8_decode(\"$nombreProducto\"), 0, 1, 'C');\n $this->SetXY(135, $y);\n $this->Cell(30, 5, utf8_decode(\"$$precioProducto\"), 0, 1, 'C');\n\n // aumento del top 5 cm\n $y = $y + 5;\n\n $precioTotal += $precioProducto;\n }\n\n $this->SetFont('Arial','B',16);\n $this->SetXY(100, 215);\n $this->Cell(0, 10, utf8_decode(\"Gastos de envío: $\".\"XXXX\"), 0, 1, \"C\");\n $this->SetXY(100, 223);\n $this->Cell(0, 10, utf8_decode(\"PRECIO TOTAL: $$precioTotal\"), 0, 1, \"C\");\n\n $this->Image('img/pdf/footer.jpg' , 0, 242, 210 , 55,'JPG');\n }", "function ventas() {\n// $fecha_limite='2015-08-11';\n// $and_filtro = \" and fecha <='$fecha_limite'\";\n// $and_filtro = \" and cod_cliente in (275,28,586,805)\";\n // $adjudicados = FUNCIONES::lista_bd_sql(\"select * from temp_ventas where urbanizacion!='OKINAWA'\");\n\n $adjudicados = FUNCIONES::lista_bd_sql(\"select * from temp_ventas where 1 $and_filtro\");\n\n echo '-- ' . count($adjudicados) . '<br>';\n\n// return;\n\n $num = 0;\n\n $insert = \"insert into venta(\n\n ven_urb_id,ven_numero,ven_lot_id,ven_lot_ids,ven_int_id,ven_co_propietario,ven_fecha,ven_moneda,\n\n ven_res_id,ven_superficie,ven_metro,ven_valor,ven_decuento,ven_incremento,ven_monto,ven_res_anticipo,ven_monto_intercambio,ven_monto_efectivo,\n\n ven_estado,ven_usu_id,ven_tipo,ven_val_interes,ven_cuota_inicial,ven_tipo_plan,ven_plazo,ven_cuota,ven_rango,ven_frecuencia,\n\n ven_observacion,ven_codigo,ven_vdo_id,ven_comision,ven_concepto,ven_tipo_pago,ven_fecha_firma,ven_fecha_cre,ven_monto_pagar,\n\n ven_form,ven_costo,ven_costo_cub,ven_costo_pag,ven_promotor,ven_importado,\n\n ven_lug_id,ven_ubicacion,ven_suc_id,ven_ufecha_prog,ven_ufecha_pago,ven_ufecha_valor,\n\n ven_cuota_pag,ven_capital_pag,ven_capital_desc,ven_capital_inc,ven_usaldo,ven_sfecha_prog,ven_costo_up,ven_numero_cliente,ven_multinivel,ven_porc_comisiones\n\n ) values\";\n\n $sql_insert = $insert;\n\n $reg = 0;\n\n\n\n $num_ini = 1000000;\n\n\n\n $aurbs = array(\n 'LUJAN' => '2',\n 'BISITO' => '3',\n 'OKINAWA' => '13',\n 'LA QUINTA' => '11'\n );\n\n\n\n $lotes_vendidos = array();\n\n\n\n foreach ($adjudicados as $tven) {\n\n if ($num == 440) {\n\n// echo \"$sql_insert<br>\";\n\n FUNCIONES::bd_query($sql_insert);\n\n $sql_insert = $insert;\n\n $num = 0;\n }\n\n $int_codigo = \"NET-$tven->cod_cliente\";\n\n $interno = FUNCIONES::objeto_bd_sql(\"select * from interno where int_codigo='$int_codigo'\");\n\n $urb_id = $aurbs[$tven->urbanizacion];\n\n\n\n $sql_lote = \"select * from lote\n\n inner join manzano on (lot_man_id=man_id)\n\n where man_urb_id='$urb_id' and man_nro='$tven->mz' and lot_nro='$tven->lote';\n\n \";\n\n\n\n $lote = FUNCIONES::objeto_bd_sql($sql_lote);\n\n\n\n if (!$lote || $lote->lot_estado != 'Disponible') {\n\n $lot_estado = $lote->lot_estado;\n\n $_uv = FUNCIONES::objeto_bd_sql(\"select * from uv where uv_id='$lote->lot_uv_id'\");\n\n $_zona = FUNCIONES::objeto_bd_sql(\"select * from zona where zon_id='$lote->lot_zon_id'\");\n\n $lote_id = importar_lotes($urb_id, $_uv->uv_nombre, $_zona->zon_nombre, $tven->mz, \"NET-$tven->lote\", $lote->lot_superficie);\n\n $sql_lote = \"select * from lote\n\n inner join manzano on (lot_man_id=man_id)\n\n where lot_id='$lote_id';\n\n \";\n\n\n\n $lote = FUNCIONES::objeto_bd_sql($sql_lote);\n\n\n\n echo \"-- no existe lote o esta $lot_estado ;$urb_id-$tven->mz-$tven->lote ---> LOTE ID: $lote_id<br>\";\n }\n\n /*\n\n if(!$lote){\n\n echo \"-- NO EXISTE LOTE $tven->urbanizacion - $tven->mz - $tven->lote <br>\";\n\n }else{\n\n // echo \"-- EXISTE LOTE $tven->urbanizacion - $tven->mz - $tven->lote - $lote->lot_estado<br>\";\n\n if($lote->lot_estado=='Vendido'){\n\n echo \"$tven->cod_venta<br>\";\n\n }\n\n }\n\n */\n\n\n\n// continue;\n\n\n\n if ($lote && $lote->lot_estado == 'Disponible') {\n\n if ($num > 0) {\n\n $sql_insert.=',';\n }\n\n $int_codigo_vdo = \"NET-$tven->cod_vendedor\";\n\n $_vendedor = FUNCIONES::objeto_bd_sql(\"select * from interno where int_codigo='$int_codigo_vdo'\");\n\n $txt_promotor = \"$int_codigo_vdo | $_vendedor->int_nombre\";\n\n\n\n// if($tven->ven_vdo_id>0){\n// $txt_promotor= _db::atributo_sql(\"select concat(int_nombre,' ',int_apellido) as campo from interno,vendedor where vdo_int_id=int_id and vdo_id='$tven->ven_vdo_id'\");\n// }\n// if(!$interno){\n// echo \"-- NO EXISTE INTERNO <BR>\";\n// }\n// if(!$tres){\n// echo \"-- NO EXISTE TEMP_RESERVA *** '$tobj->PY' , '$tobj->Numero_Reserva' <BR>\"; \n// }\n// if(!$tpromotor){\n// echo \"-- NO EXISTE PROMOTOR<BR>\"; \n// }\n\n\n\n $res_anticipo = $tven->cuota_inicial * 1;\n\n\n\n $ven_monto = $tven->precio;\n\n $saldo_efectivo = $tven->saldo_financiar;\n\n $ven_metro = round($ven_monto / $tven->superficie, 2);\n\n $concepto = FUNCIONES::get_concepto($lote->lot_id);\n\n $ven_numero = \"NET-$tven->cod_cliente\";\n\n $ven_numero_cliente = \"NET-$tven->cod_cliente\";\n\n $fecha_cre = date('Y-m-d H:i:s');\n\n// $insert=\"insert into venta(\n// ven_urb_id,ven_numero,ven_lot_id,ven_lot_ids,ven_int_id,ven_co_propietario,ven_fecha,ven_moneda,\n// ven_res_id,ven_superficie,ven_metro,ven_valor,ven_decuento,ven_incremento,ven_monto,ven_res_anticipo,ven_monto_intercambio,ven_monto_efectivo,\n// ven_estado,ven_usu_id,ven_tipo,ven_val_interes,ven_cuota_inicial,ven_tipo_plan,ven_plazo,ven_cuota,ven_rango,ven_frecuencia,\n// ven_observacion,ven_codigo,ven_vdo_id,ven_comision,ven_concepto,ven_tipo_pago,ven_fecha_firma,ven_fecha_cre,ven_monto_pagar,\n// ven_form,ven_costo,ven_costo_cub,ven_costo_pag,ven_promotor,ven_importado,\n// ven_lug_id,ven_ubicacion,ven_suc_id,ven_ufecha_prog,ven_ufecha_pago,ven_ufecha_valor,\n// ven_cuota_pag,ven_capital_pag,ven_capital_desc,ven_capital_inc,ven_usaldo,ven_sfecha_prog,ven_costo_up\n// ) values\";\n\n $ven_fecha = get_fecha($tven->fecha_venta);\n\n $ven_moneda = 2;\n\n $urb = FUNCIONES::objeto_bd_sql(\"select * from urbanizacion where urb_id=$urb_id\");\n\n $costo_m2 = $urb->urb_val_costo;\n\n $costo = $tven->superficie * $costo_m2;\n\n $costo_cub = $res_anticipo;\n\n if ($res_anticipo > $costo) {\n\n $costo_cub = $costo;\n }\n\n $sql_insert.=\"(\n\n '$urb_id','$ven_numero','$lote->lot_id','','$interno->int_id','0','$ven_fecha','$ven_moneda',\n\n '0','$tven->superficie','$ven_metro','$ven_monto','0','0','$ven_monto','$res_anticipo',0,'$saldo_efectivo',\n\n 'Pendiente','admin','Credito','$tven->interes','0','plazo',0,0,1,'dia_mes',\n\n '','',0,0,'$concepto','Normal','0000-00-00','$fecha_cre',0,\n\n 7,'$costo','$costo_cub',0,'$txt_promotor',0,\n\n 1,'Bolivia,Santa Cruz,Santa Cruz de la Sierra',1,\n\n '0000-00-00','0000-00-00','0000-00-00',0,0,0,0,0,'0000-00-00',0,'$ven_numero_cliente','si','{$urb->urb_porc_comisiones}'\n\n )\";\n\n $num++;\n\n $reg++;\n\n $lotes_vendidos[] = $lote->lot_id;\n } else {\n\n\n\n echo \"-- no existe lote o esta $lote->lot_estado;$urb_id-$tven->mz-$tven->lote<br>\";\n }\n }\n\n\n\n if ($num > 0) {\n\n// echo \"$sql_insert<br>\";\n\n FUNCIONES::bd_query($sql_insert);\n }\n\n\n\n $sql_up_lotes = \"update lote set lot_estado='Vendido' where lot_id in (\" . implode(',', $lotes_vendidos) . \")\";\n\n echo $sql_up_lotes . ';<br>';\n\n// FUNCIONES::bd_query($sql_up_lotes);\n\n\n\n echo \"-- <BR>TOTAL REGISTRADOS $reg\";\n}", "function Cargar_comisiones($id, $filadesde, $buscar_producto){\r\n\r\n\t\t$conexion = $this ->Conexion;\r\n\t\t$Usuario = $this ->Usuario;\r\n\t\r\n\t\tif($buscar_producto != null){\r\n\t\t\t$CADENA_BUSCAR = \" WHERE ID = '\".$id.\"' AND PRODUCTO LIKE '%\".$buscar_producto.\"%' \";\r\n\t\t}else{\r\n\t\t\t$CADENA_BUSCAR = \" WHERE ID = '\".$id.\"'\";\r\n\t\t}\r\n\r\n\t\t$resultado =$conexion->query(\"SELECT DATE_FORMAT(fecha_desde, '%d-%m-%Y') AS fecha_desde, DATE_FORMAT(fecha_hasta, '%d-%m-%Y') AS fecha_hasta, producto, folleto, cuadro, paquete, comision_paquetes, comision_alojamientos, comision_transportes,\t\r\n\t\t\t\t\t\t\t\t\t comision_servicios FROM hit_minoristas_comisiones \".$CADENA_BUSCAR.\" ORDER BY fecha_desde, fecha_hasta, producto, folleto, cuadro, paquete\");\r\n\r\n\t\t/*if ($resultado == FALSE){\r\n\t\t\techo('Error en la consulta');\r\n\t\t\t$resultado->close();\r\n\t\t\t$conexion->close();\r\n\t\t\texit;\r\n\t\t}*/\r\n\r\n\t\t//Guardamos el resultado en una matriz con un numero fijo de registros\r\n\t\t//que controlaremos por una tabla de configuracion de pantallas de usuarios. ESPECIFICO: Solo el nombre del formulario en la query\r\n\t\t$numero_filas =$conexion->query(\"SELECT LINEAS_MODIFICACION FROM hit_usuarios_formularios WHERE FORMULARIO = 'MINORISTAS_COMISIONES' AND USUARIO = '\".$Usuario.\"'\");\r\n\t\t$Nfilas\t = $numero_filas->fetch_assoc();\t\t\t\t\t\t\t\t\t\t\t //------\r\n\r\n\t\t$minoristas_comisiones = array();\r\n\t\tfor ($num_fila = $filadesde-1; $num_fila <= $filadesde + $Nfilas['LINEAS_MODIFICACION']-2; $num_fila++) {\r\n\t\t\t$resultado->data_seek($num_fila);\r\n\t\t\t$fila = $resultado->fetch_assoc();\r\n\t\t\t//Esto es para dejar de cargar lineas en caso de que sea la ultima pagina de la consulta\r\n\t\t\tif($fila['fecha_desde'] == ''){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tarray_push($minoristas_comisiones,$fila);\r\n\t\t}\r\n\r\n\t\t//Liberar Memoria usada por la consulta\r\n\t\t$resultado->close();\r\n\t\t$numero_filas->close();\r\n\r\n\t\treturn $minoristas_comisiones;\t\t\t\t\t\t\t\t\t\t\t\r\n\t}", "public function inserirPartida(){\n $usuari = $_POST[\"usuari\"];\n $ingame = $_POST[\"ingame\"];\n $codiTorneig = $_POST[\"torneig\"];\n\n $sql = \"INSERT INTO partida(idTorneo,participant,ingame)\n VALUES('$codiTorneig','$usuari','$ingame')\";\n\n $this->db->query($sql);\n $num_files = $this->db->affected_rows();\n\n return $num_files;\n }", "function editar_pelicula($peliActual){\n // leemos todas las pelis, y las volcamos al fichero menos la pasada como argumento\n\n $lesPelis=readPelis();\n\n // obrim el fitxer de pelis per a escriptura. \n $f = fopen(filePeliculas, \"w\");\n\n foreach($lesPelis as $peli){\n\n // guardem la peli llegida o l'actual, si és el cas\n if ($peli[\"id\"]==$peliActual[\"id\"]){\n $p=$peliActual;\n }\n else{\n $p=$peli;\n }\n\n //convertim $peli (array asociatiu) en array\n\n $valors_peli=array();\n foreach($p as $k=>$v){\n array_push($valors_peli,$v);\n }\n\n //escrivim al fitxer\n fputcsv($f,$valors_peli,\",\");\n\n }\n\n fclose($f);\n \n \n\n}", "public function lerArquivoLog(){\n $ponteiro = fopen(\"C:\\\\temp\\\\teste2.txt\", \"r\");\n\n //Abre o aruqivo .txt\n while(!feof($ponteiro)) {\n $linha = fgets($ponteiro, 4096);\n //Imprime na tela o resultado\n $this->pulaLinha();\n }\n //Fecha o arquivo\n fclose($ponteiro);\n }", "function escreveArquivo($aux_nome, $aux_tel, $aux_cpf, $aux_rg){\n\n $pessoa = new Individuo();\n\n /**\n * Para evitar que o usuario fique recarregando a pagina\n */\n \n $pessoa->setNome($aux_nome);\n if($pessoa->getNome() == '' || $pessoa->getNome() == null){\n session_destroy();\n die(\"Falha\");\n }\n /**\n * Gravando os dados\n */\n $pessoa->setTelefone($aux_tel);\n $pessoa->setCPF($aux_cpf);\n $pessoa->setRg($aux_rg);\n\n $dados = fopen(\"/home/mateus/Arquivos/dados_individual.csv\", \"a+\") or die(\"Failed\"); \n $conteudo = '';\n $conteudo = fread($dados, 1);\n\n if($conteudo == ''){\n escreveCabecalho($dados);\n }\n \n fwrite($dados, $pessoa->getNome());\n fwrite($dados, \",\");\n fwrite($dados, $pessoa->getTelefone());\n fwrite($dados, \",\");\n fwrite($dados, $pessoa->getCPF());\n fwrite($dados, \",\");\n fwrite($dados, $pessoa->getRg());\n fwrite($dados, \"\\n\");\n\n\n fclose($dados);\n }", "public function uploadNormaPanenVariabel($params = array())\n {\n $data = array();\n $datachk = array();\n $total_rec = $ins_rec = $irec = $lastBaCode = $update_rec = 0;\n \n if ($_FILES[file][size] > 0) {\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************\n //1. ****************** Check BA dari CSV FILE\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n $arrba = array();\n do {\n if (($datachk[0])&&($total_rec > 1)) {\n array_push($arrba,$datachk[1]);\n }\n $total_rec++;\n } while($datachk = fgetcsv($handle,1000,\";\",\"'\"));\n $arrbadis = array_values(array_unique($arrba, SORT_REGULAR)); //variabel array list BA pada CSV\n \n //2. ****************** Baca Urutan Upload dari T_SEQ\n $sqlCurTask=\"SELECT SEQ_NUM FROM T_SEQ WHERE TABLE_NAME='TN_PANEN_VARIABLE'\";\n $seqNum = $this->_db->fetchOne($sqlCurTask);\n $sqlSeq=\"SELECT * FROM T_SEQ WHERE SEQ_NUM < ($seqNum) ORDER BY SEQ_NUM, TASK_NAME\";\n $rows = $this->_db->fetchAll($sqlSeq);\n if (!empty($rows)) {\n foreach ($rows as $idx => $row) { \n $tablechk = $row['REMARKS'];\n //2.1 ****************** get BA CODE yang sudah dimasukan pada table di awal sequence\n $sqlba = \"SELECT DISTINCT BA_CODE FROM \".$row['TABLE_NAME'];\n $arrnormaba = array();\n $arrlockba = array();\n $rowsba = $this->_db->fetchAll($sqlba);\n foreach ($rowsba as $idxba => $rowba) {\n array_push($arrnormaba,$rowba['BA_CODE']); //variabel array list BA pada masing2 norma\n //2.2 ****************** get STATUS LOCK masing2 BA CODE di T_SEQ\n $sqlba1 = \"SELECT STATUS FROM T_SEQ_CHECK WHERE BA_CODE='\".$rowba['BA_CODE'].\"' AND TASK_NAME='\".$row['TABLE_NAME'].\"'\";\n \n $arrlockba[$rowba['BA_CODE']] = $this->_db->fetchOne($sqlba1);\n } \n $arrNotFound=array();\n for($x=0;$x<count($arrbadis);$x++){\n if(!in_array($arrbadis[$x],$arrnormaba)){ //check apakah data ba csv ada di data ba norma?\n $arrNotFound[]=$arrbadis[$x];\n }elseif($arrlockba[$arrbadis[$x]]==\"LOCKED\"){\n $arrNotFound[]=$arrbadis[$x];\n }\n }\n if($arrNotFound) break;\n }\n }\n $arrNotFound =array();\n if($arrNotFound){\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'ba_notfound' => implode(\",\",$arrNotFound),\n 'task_err' => $tablechk\n );\n return $return;\n }\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************//\n //get the csv file\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n \n $total_rec = 0;\n \n //loop through the csv file and insert into database\n $curBa = $oldBa = \"\";\n do {\n if (($data[0])&&($total_rec > 1)) {\n /*\n if ($lastBaCode <> addslashes($data[0])){\n try {\n //remove data\n $sqlDelete = \"\n DELETE FROM TN_PANEN_VARIABLE\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n \";\n //log file penghapusan data\n $this->_global->deleteDataLogFile($sqlDelete); \n $this->_db->query($sqlDelete);\n } catch (Exception $e) {\n \n }\n }\n */\n \n //cek data\n $sql = \"\n SELECT COUNT(*) \n FROM TN_PANEN_VARIABLE\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND PANEN_CODE = '\".addslashes($data[1]).\"'\";\n $curBa = addslashes($data[0]); \n $count = $this->_db->fetchOne($sql);\n if ($count == 0) {\n try {\n //insert data\n $sql = \"\n INSERT INTO TN_PANEN_VARIABLE (PERIOD_BUDGET, BA_CODE, PANEN_CODE, DESCRIPTION, VALUE, INSERT_USER, INSERT_TIME)\n VALUES (\n TO_DATE('{$this->_period}','DD-MM-RRRR'),\n TRIM('\".addslashes($data[0]).\"'),\n '\".addslashes($data[1]).\"',\n '\".addslashes($data[2]).\"',\n '\".addslashes($data[3]).\"',\n '{$this->_userName}',\n SYSDATE\n )\n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $ins_rec++;\n $status = 0;\n //TAMBAHAN untuk otomatis generate panen supervisi : SABRINA 19/08/2014\n for($i = 1; $i <= $irec; $i++){\n if($curBa == $gen_inherit[$i]['BA_CODE']){\n $status = 1; $arr_ba = $i;\n }\n }\n if($status == 0){\n $irec++;\n $arr_inh = $irec;\n $gen_inherit[$arr_inh]['BA_CODE'] = addslashes($data[0]);\n }else if($status == 1){\n $arr_inh = $arr_ba; \n }\n if(addslashes($data[1])==\"TGT_KRANI_BUAH\"){\n $gen_inherit[$arr_inh]['TARGET'] = addslashes($data[3]);\n }\n if(addslashes($data[1])==\"BAS_KRANI_BUAH\"){\n $gen_inherit[$arr_inh]['BASIS'] = addslashes($data[3]);\n }\n if(addslashes($data[1])==\"TRF_OB_KRANI_BUAH\"){\n $gen_inherit[$arr_inh]['TARIF_BASIS'] = addslashes($data[3]);\n }\n if(addslashes($data[1])==\"ASUM_OVR_BASIS\"){\n $gen_inherit[$arr_inh]['SELISIH_OVER_BASIS'] = addslashes($data[3]);\n }\n if(addslashes($data[1])==\"OER_PANEN\"){\n $gen_inherit[$arr_inh]['OER'] = addslashes($data[3]);\n }\n \n /*TGT_KRANI_BUAH\n BAS_KRANI_BUAH\n TRF_OB_KRANI_BUAH\n ASUM_OVR_BASIS\n OER_PANEN\n */\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA PANEN VARIABEL', '', '');\n \n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA PANEN VARIABEL', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n // cek apakah data non-aktif\n $sql = \"\n SELECT COUNT(*) \n FROM TN_PANEN_VARIABLE\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND PANEN_CODE = '\".addslashes($data[1]).\"'\n AND DELETE_USER IS NULL\n \";\n $count = $this->_db->fetchOne($sql);\n \n if ($count == 0) {\n // update data menjadi aktif jika sebelumnya telah dinon-aktifkan\n try {\n $sql = \"\n UPDATE TN_PANEN_VARIABLE\n SET DESCRIPTION = '\".addslashes($data[2]).\"',\n VALUE = '\".addslashes($data[3]).\"',\n UPDATE_USER = '{$this->_userName}',\n UPDATE_TIME = SYSDATE,\n DELETE_USER = NULL,\n DELETE_TIME = NULL\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND PANEN_CODE = '\".addslashes($data[1]).\"'\n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $update_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA PANEN VARIABEL', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA PANEN VARIABEL', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n }\n \n if(addslashes($data[1])==\"OER_PANEN\"){\n // cek apakah data OER berbeda\n $sql = \"\n SELECT count(*) \n FROM TN_PANEN_VARIABLE\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND PANEN_CODE = 'OER_PANEN'\n AND VALUE = '\".addslashes($data[3]).\"'\n AND DELETE_USER IS NULL\n \";\n $count = $this->_db->fetchOne($sql);\n \n if ($count == 0) {\n // update data menjadi aktif jika sebelumnya telah dinon-aktifkan\n try {\n $sql = \"\n UPDATE TN_PANEN_VARIABLE\n SET VALUE = '\".addslashes($data[3]).\"',\n UPDATE_USER = '{$this->_userName}',\n UPDATE_TIME = SYSDATE,\n DELETE_USER = NULL,\n DELETE_TIME = NULL\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND PANEN_CODE = 'OER_PANEN'\n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $update_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA PANEN VARIABEL', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA PANEN VARIABEL', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n }\n }\n $status = 0;\n for($i = 1; $i <= $irec; $i++){\n if($curBa == $gen_inherit[$i]['BA_CODE']){\n $status = 1; $arr_ba = $i;\n }\n }\n if($status == 0){\n $irec++;\n $arr_inh = $irec;\n $gen_inherit[$arr_inh]['BA_CODE'] = addslashes($data[0]);\n }else if($status == 1){\n $arr_inh = $arr_ba; \n }\n if(addslashes($data[1])==\"TGT_KRANI_BUAH\"){\n $gen_inherit[$arr_inh]['TARGET'] = addslashes($data[3]);\n }\n if(addslashes($data[1])==\"BAS_KRANI_BUAH\"){\n $gen_inherit[$arr_inh]['BASIS'] = addslashes($data[3]);\n }\n if(addslashes($data[1])==\"TRF_OB_KRANI_BUAH\"){\n $gen_inherit[$arr_inh]['TARIF_BASIS'] = addslashes($data[3]);\n }\n if(addslashes($data[1])==\"ASUM_OVR_BASIS\"){\n $gen_inherit[$arr_inh]['SELISIH_OVER_BASIS'] = addslashes($data[3]);\n }\n if(addslashes($data[1])==\"OER_PANEN\"){\n $gen_inherit[$arr_inh]['OER'] = addslashes($data[3]);\n }\n \n \n }\n $lastBaCode = addslashes($data[0]);\n }\n $total_rec++;\n } while ($data = fgetcsv($handle,1000,\",\",\"'\")); \n //\n $return = array(\n 'status' => 'done',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }else{\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }\n //generate oer BA : NBU 04/05/2015\n if (!empty($gen_inherit)) { \n foreach ($gen_inherit as $idx => $row) {\n $this->_generateData->genMasterOerBa($row);\n }\n }\n //generate panen supervisi : SABRINA 19/08/2014\n if (!empty($gen_inherit)) { \n foreach ($gen_inherit as $idx => $row) {\n $this->_generateData->genNormaPanenKraniBuah($row); //menggantikan trigger yang ada di DB saat BPS I\n }\n }\n \n return $return;\n }", "public function cargarPadrino($padrino)\n {\n try{\n $daoPadrino= new model\\dao\\DaoPadrinoImpl();\n //$nombre,$apellido,$alia,$dni,$cuil,$email,$emailAlt,$telefono,$telefonoAlt,$contacto,$domicilio,$domicilioFact,$montoPactado,$fichaFisicaIngreso\n $padrinoConsulta = new PadrinoEntity($padrino->nombre, $padrino->apellido,\n null,$padrino->dni,\n null, null,null, null,null, null,\n null, null,null,null);\n\n if(count($daoPadrino->select($padrinoConsulta))>0){\n return -1;\n }\n\n $insertDatos = false;\n $daoDomicilio= new model\\dao\\DaoDomicilioImpl();\n \n $retDoc=$daoDomicilio->insert($padrino->getDomicilio());\n\n if($retDoc==\"OK\") {\n\n $doc=$daoDomicilio->select($padrino->getDomicilio());\n\n if(count($doc)>0){\n $padrino->domicilio=$doc[0];\n }\n $insertDatos=true;\n }else{\n $insertDatos=false;\n }\n\n if($insertDatos){\n\n $resPadrino=$daoPadrino->insert($padrino);\n\n if($resPadrino==\"OK\"){\n return 0;\n }else{\n echo $resPadrino;\n return 1;\n }\n }else{\n return 1;\n }\n\n }catch (Exception $e) {\n return 'Error: '.$e->getMessage(). \"\\n\";\n }\n }", "public function enviarMailDoc() {\n $obj_con = new cls_Base();\n $obj_var = new cls_Global();\n $objEmpData= new EMPRESA();\n $dataMail = new mailSystem();\n $rep = new REPORTES();\n //$con = $obj_con->conexionVsRAd();\n $objEmp=$objEmpData->buscarDataEmpresa(cls_Global::$emp_id,cls_Global::$est_id,cls_Global::$pemi_id);//recuperar info deL Contribuyente\n $con = $obj_con->conexionIntermedio();\n \n $dataMail->file_to_attachXML=$obj_var->rutaXML.'NC/';//Rutas FACTURAS\n $dataMail->file_to_attachPDF=$obj_var->rutaPDF;//Ructa de Documentos PDF\n try {\n $cabDoc = $this->buscarMailNcRAD($con,$obj_var,$obj_con);//Consulta Documentos para Enviar\n //Se procede a preparar con los correos para enviar.\n for ($i = 0; $i < sizeof($cabDoc); $i++) {\n //Retorna Informacion de Correos\n $rowUser=$obj_var->buscarCedRuc($cabDoc[$i]['CedRuc']);//Verifico si Existe la Cedula o Ruc\n if($rowUser['status'] == 'OK'){\n //Existe el Usuario y su Correo Listo para enviar\n $row=$rowUser['data'];\n $cabDoc[$i]['CorreoPer']=$row['CorreoPer'];\n $cabDoc[$i]['Clave']='';//No genera Clave\n }else{\n //No Existe y se crea uno nuevo\n $rowUser=$obj_var->insertarUsuarioPersona($obj_con,$cabDoc,'MG0031',$i);//Envia la Tabla de Dadtos de Person ERP\n $row=$rowUser['data'];\n $cabDoc[$i]['CorreoPer']=$row['CorreoPer'];\n $cabDoc[$i]['Clave']=$row['Clave'];//Clave Generada\n }\n }\n //Envia l iformacion de Correos que ya se completo\n for ($i = 0; $i < sizeof($cabDoc); $i++) {\n if(strlen($cabDoc[$i]['CorreoPer'])>0){ \n //if(1>0){ \n $mPDF1=$rep->crearBaseReport();\n //Envia Correo \n include('mensaje.php');\n $htmlMail=$mensaje;\n\n $dataMail->Subject='Ha Recibido un(a) Documento Nuevo(a)!!! ';\n $dataMail->fileXML='NOTA DE CREDITO-'.$cabDoc[$i][\"NumDocumento\"].'.xml';\n $dataMail->filePDF='NOTA DE CREDITO-'.$cabDoc[$i][\"NumDocumento\"].'.pdf';\n //CREAR PDF\n $mPDF1->SetTitle($dataMail->filePDF);\n $cabFact = $this->mostrarCabNc($con,$obj_con,$cabDoc[$i][\"Ids\"]);\n $detDoc = $this->mostrarDetNc($con,$obj_con,$cabDoc[$i][\"Ids\"]);\n $impDoc = $this->mostrarNcImp($con,$obj_con,$cabDoc[$i][\"Ids\"]);\n $adiDoc = $this->mostrarNcDataAdicional($con,$obj_con,$cabDoc[$i][\"Ids\"]);\n \n $usuData=array();\n //$usuData=$objEmpData->buscarDatoVendedor($cabFact[0][\"USU_ID\"]);//Correo del Usuario que Autoriza\n include('formatNc/ncPDF.php');\n \n //COMETAR EN CASO DE NO PRESENTAR ESTA INFO\n $mPDF1->SetWatermarkText('ESTA INFORMACIÓN ES UNA PRUEBA');\n $mPDF1->watermark_font= 'DejaVuSansCondensed';\n $mPDF1->watermarkTextAlpha = 0.5;\n $mPDF1->showWatermarkText=($cabDoc[$i][\"Ambiente\"]==1)?TRUE:FALSE; // 1=Pruebas y 2=Produccion\n //****************************************\n \n $mPDF1->WriteHTML($mensajePDF); //hacemos un render partial a una vista preparada, en este caso es la vista docPDF\n $mPDF1->Output($obj_var->rutaPDF.$dataMail->filePDF, 'F');//I en un naverdoad F=ENVIA A UN ARCHVIO\n\n $resulMail=$dataMail->enviarMail($htmlMail,$cabDoc,$obj_var,$usuData,$i);\n if($resulMail[\"status\"]=='OK'){\n $cabDoc[$i]['EstadoEnv']=6;//Correo Envia\n }else{\n $cabDoc[$i]['EstadoEnv']=7;//Correo No enviado\n }\n \n }else{\n //No envia Correo \n //Error COrreo no EXISTE\n $cabDoc[$i]['EstadoEnv']=7;//Correo No enviado\n }\n \n }\n $con->close();\n $obj_var->actualizaEnvioMailRAD($cabDoc,\"NC\");\n //echo \"ERP Actualizado\";\n return true;\n } catch (Exception $e) {\n //$trans->rollback();\n //$con->active = false;\n $con->rollback();\n $con->close();\n throw $e;\n return false;\n } \n }", "function generarProblemasCompetencia2($id_competencia){\n\n \n include(\"../modelo/cnx.php\");\n $cnx = pg_connect($entrada) or die (\"Error de conexion. \". pg_last_error());\n // session_start();\n $seleccionar=\"SELECT problema.id_problema, id_usuario, nombre_problema\n FROM problema, competencia_problema\n where competencia_problema.id_problema=problema.id_problema\n and competencia_problema.id_competencia=\".$id_competencia;\n \n $result = pg_query($seleccionar) or die('ERROR AL INSERTAR DATOS: ' . pg_last_error());\n $columnas = pg_numrows($result);\n $this->formu.='<table>';\n $this->formu.='<tr><td>Identificador</td>';\n $this->formu.='<td>Nombre</td></tr>';\n for($i=0;$i<=$columnas-1; $i++){\n $line = pg_fetch_array($result, null, PGSQL_ASSOC);\n $this->formu.='<tr> \n <td>'.$line['id_problema'].'</td> \n <td>'.$line['nombre_problema'].'</td>\n <td><a href=\"../archivo_comite/'.$line['id_problema'].'/'.$line['id_problema'].'.pdf\">Descargar Enunciado</a></td>\n </tr>';\n } \n $this->formu.='</table>';\n return $this->formu; \n\n }", "function insertarFicha($datos_joven, $datos_apoderado) {\n //log_message('error',print_r(3,true));\n //log_message('error',print_r($datos_joven,true));\n //log_message('error',print_r($datos_apoderado,true));\n $this->db->trans_start(); \n $sql= 'SELECT * FROM \"MDB_MODULOS\".\"MODULOS_INSDATOSJOVEN\"(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)';\n $result = $this->db->query($sql, $datos_joven);\n log_message('error',print_r($result->result()[0]->MODULOS_INSDATOSJOVEN,true));\n $data = explode('|',$result->result()[0]->MODULOS_INSDATOSJOVEN);\n\n if($data[2] != '0'){\n //log_message('error',print_r('abel hola',true));\n $this->db->trans_rollback();\n return array('error'=> EXIT_ERROR,'msj'=> 'El usuario tiene una ficha valida');\n }\n else if($data[0] == 'OK'){\n if($datos_apoderado != \"0\") {\n //log_message('error',print_r('abel hola2',true));\n $sql= 'SELECT * FROM \"MDB_MODULOS\".\"MODULOS_INSDATOSAPODERADO\"(?,?,?,?,?,?,?,?,?,?,?,?,?)';\n $result = $this->db->query($sql, $datos_apoderado);\n //log_message('error',print_r($result->result()[0]->MODULOS_INSDATOSAPODERADO,true));\n $data2 = explode('|',$result->result()[0]->MODULOS_INSDATOSAPODERADO);\n if($data2[0] == 'OK'){\n $this->db->trans_complete();\n return array('error'=> EXIT_SUCCESS,'codigo1'=>$data[1],'codigo2'=>$data2[1]);\n } else {\n $this->db->trans_rollback();\n return array('error'=> EXIT_ERROR);\n }\n } else {\n $this->db->trans_complete();\n return array('error'=> EXIT_SUCCESS,'codigo1'=>$data[1],'codigo2'=>\"0\");\n }\n } else {\n\n $this->db->trans_rollback();\n return array('error'=> EXIT_ERROR,'msj'=> 'Error');\n }\n }", "function enviar_presupuesto(){\n $this->asignar_ingreso3();\n $nombre_sede = $this->sede;\n $resultado = $this->datoSede($nombre_sede);\n $cuerpo =\"<img src='http://prevaler.diazcreativos.net.ve/imagenes/logo_admin.png' /><br /><br />\n\t\t<u>Datos de Entrada:</u><br />\";\n $cuerpo .=\"<br />\";\n $cuerpo .= \"<strong>Nombre: </strong>\".utf8_decode($this->nombre1).\"<br />\" ;\n $cuerpo .= \"<strong>Apellido: </strong>\".$this->apellido1.\"<br />\" ;\n $cuerpo .= \"<strong>RIF/Cédula: </strong>\".$this->cedula1.\"<br />\" ;\n $cuerpo .= \"<strong>Fecha de Nacimiento: </strong>\".$this->fecha1.\"<br />\";\n $cuerpo .= \"<strong>E-mail: </strong>\".$this->email.\"<br />\" ;\n $cuerpo .= \"<strong>Teléfono: </strong>\".$this->telefono.\"<br />\" ;\n $cuerpo .= \"<strong>Domicilio: </strong>\".$this->direccion1.\"<br />\" ;\n $cuerpo .= \"<strong>Empresa: </strong>\".$this->empresa.\"<br />\";\n $cuerpo .= \"<strong>Especialidad Médica: </strong>\".$this->especialidad.\"<br />\";\n $cuerpo .= \"<strong>Médico Elegido: </strong>\".$this->medico.\"<br />\";\n $cuerpo .= \"<strong>Diagnóstico: </strong>\".$this->diagnostico.\"<br />\";\n $cuerpo .= \"<strong>Procedimiento: </strong>\".$this->procedimiento.\"<br /><br />\";\n if ($this->seguro != null) {\n $cuerpo .= \"<strong>Presupuesto Con Póliza de Seguro </strong><br /><br />\";\n $cuerpo .= \"<strong>Titular de la Póliza: </strong>\".utf8_decode($this->nombre_pol).\"<br />\" ;\n $cuerpo .= \"<strong>Cédula del Titular de la Póliza: </strong>\".$this->cedula_pol.\"<br />\" ;\n $cuerpo .= \"<strong>Empresa Aseguradora: </strong>\".$this->seguro.\"<br />\" ;\n }else{\n $cuerpo .= \"<strong>Presupuesto Sin Póliza de Seguro </strong><br /><br />\";\n $cuerpo .= \"<strong>Datos de Facturación </strong><br /><br />\";\n $cuerpo .= \"<strong>Nombre: </strong>\".utf8_decode($this->nombre2).\"<br />\" ;\n $cuerpo .= \"<strong>Apellido: </strong>\".$this->apellido2.\"<br />\" ;\n $cuerpo .= \"<strong>RIF/Cédula: </strong>\".$this->cedula2.\"<br />\" ;\n $cuerpo .= \"<strong>Fecha de Nacimiento: </strong>\".$this->fecha2.\"<br />\";\n $cuerpo .= \"<strong>Dirección: </strong>\".$this->direccion2.\"<br />\" ;\n }\n\n $cuerpo .= \"<br />\";\n $cuerpo .= \"---- Fin ----\";\n $cuerpo .= \"<br />\";\n $subject= \"Solicitud de Presupuesto Web Prevaler\";\n $subject2= \"Solicitud de Presupuesto Web Prevaler\";\n\n switch ($resultado['id_sede']) {\n case '1':\n $correo_envio=\"[email protected]\";\n break;\n case '2':\n $correo_envio=\"[email protected]\";\n break;\n case '3':\n $correo_envio=\"[email protected]\";\n break;\n case '4':\n $correo_envio=\"[email protected]\";\n break;\n case '8':\n $correo_envio=\"[email protected]\";\n break;\n\n default:\n $correo_envio=\"[email protected]\";\n break;\n }\n\n $basemailfor=$resultado['email_sede'];\n //$basemailfor=$correo_envio;\n $basemailfrom = $this->email;\n $respuesta =\"<img src='http://prevaler.diazcreativos.net.ve/imagenes/logo_admin.png' /><br />\n\t\t<strong>Saludos Sr(a).: $this->nombre1 $this->apellido1</strong><br /><br />\n\t\tNosotros hemos recibido su Solicitud de Presupuesto, nuestro departamento de atención al cliente le responderá lo más pronto posible<br />\n\t\tGracias por contactar a Prevaler.<br />\n\t\tPrevaler<br /><br />\n\t\tTel&eacute;fonos: <br/>\n\t\t\".$resultado['telefono_sede'].\"<br />\n\t\tTwitter: <a href='https://twitter.com/Prevaler_VE'>@Prevaler_VE</a><br />\n\t\tInstagram: <a href='https://www.instagram.com/prevaler_ve/'>@prevaler_ve</a><br />\n\t\t\".$resultado['email_sede'].\"\n\t\t<br /><br />\n\t\tAtentamente,<br />\n\t\tClínica Prevaler.\";\n $this->mensaje=\"<strong>&iexcl;Excelente!</strong> Su Solicitud de Presupuesto ha sido enviado exitosamente.\";\n\n $mail = new PHPMailer();\n $mail->From = $basemailfrom;\n $mail->FromName = utf8_decode($subject);\n $mail->AddAddress($basemailfor, $this->nombre.\" \".$this->apellido);\n $mail->Subject = utf8_decode($subject);\n $mail->Body = $cuerpo;\n $mail->AltBody = $cuerpo;\n $mail->isHTML(true);\n $exito = $mail->Send();\n\n $mail2 = new PHPMailer();\n $mail2->From = $basemailfor;\n $mail2->FromName = utf8_decode($subject2);\n $mail2->AddAddress($basemailfrom, $this->nombre.\" \".$this->apellido);\n $mail2->Subject = utf8_decode($subject2);\n $mail2->Body = $respuesta;\n $mail2->AltBody = $respuesta;\n $mail2->isHTML(true);\n $exito = $mail2->Send();\n }", "function autorizar_producto_san_luis($id_mov){\r\n\r\nglobal $db;\t\r\n \r\n $db->starttrans();\r\n $fecha_hoy=date(\"Y-m-d H:i:s\",mktime());\r\n \r\n //traigo el deposito origen\r\n $sql = \"select deposito_origen,deposito_destino\r\n from movimiento_material where id_movimiento_material = $id_mov\"; \r\n $res = sql($sql) or fin_pagina();\r\n $id_deposito_origen = $res->fields[\"deposito_origen\"];\r\n $id_deposito_destino = $res->fields[\"deposito_destino\"];\r\n \t \r\n //traigo el detalle de los movimientos a liberar \t \r\n $sql=\"select * from detalle_movimiento where id_movimiento_material=$id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\r\n $comentario = \" Autorizacion de PM Producto San Luis nro: $id_mov\";\r\n $id_tipo_movimiento = 7;\r\n\r\n //por cada detalle voy liberando las reservas del pm autorizado \r\n for($i=0;$i<$res->recordcount();$i++) {\r\n \t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n $cantidad = $res->fields[\"cantidad\"];\r\n $id_detalle_movimiento = $res->fields[\"id_detalle_movimiento\"]; \r\n ///////////////////////////////////////\r\n $sql = \"select id_recibidos_mov,cantidad\r\n from recibidos_mov where id_detalle_movimiento=$id_detalle_movimiento \r\n and ent_rec=0\";\r\n $detalle_rec = sql($sql) or fin_pagina();\r\n $id_recibido_mov = $detalle_rec->fields[\"id_recibidos_mov\"];\r\n if($id_recibido_mov==\"\") {\r\n\t \t //insert\r\n\t\t $sql = \"select nextval('recibidos_mov_id_recibidos_mov_seq') as id_recibido_mov\";\r\n\t\t $res_1 = sql($sql) or fin_pagina();\r\n\t\t $id_recibido_mov = $res_1->fields[\"id_recibido_mov\"];\r\n\t\t $sql=\"insert into recibidos_mov(id_recibidos_mov,id_detalle_movimiento,cantidad,ent_rec)\r\n\t\t values($id_recibido_mov,$id_detalle_movimiento,$cantidad,0)\";\r\n }else {\r\n\t //update\r\n\t $sql=\"update recibidos_mov set cantidad=cantidad+$cantidad\r\n\t where id_recibidos_mov=$id_recibido_mov\";\r\n }//del else\r\n sql($sql) or fin_pagina();\r\n $sql =\"insert into log_recibidos_mov(id_recibidos_mov,usuario,fecha,cantidad_recibida,tipo)\r\n values($id_recibido_mov,'\".$_ses_user[\"name\"].\"','$fecha_hoy',$cantidad,'entrega')\";\r\n sql($sql) or fin_pagina();\r\n /////////////////////////////////////// \r\n descontar_reserva($id_prod_esp,$cantidad,$id_deposito_origen,$comentario,$id_tipo_movimiento,\"\",$id_detalle_movimiento,\"\");\r\n $res->movenext(); \r\n }//del for\r\n \t \r\n //Inserto la Mercaderia entrante en el stock BS AS \r\n $sql = \"select * from mercaderia_entrante where id_movimiento_material = $id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n $comentario = \"Producto San Luis perteneciente al PM nro: $id_mov\";\r\n for($i=0;$i<$res->recordcount();$i++){\r\n\t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n\t $cantidad = $res->fields[\"cantidad\"];\r\n\t $descripcion = $res->fields[\"descripcion\"]; \r\n\t //el id_tipo_movimiento le hardcodeo uno de la tabla stock.tipo_movimiento\r\n\t $id_tipo_movimiento='13';\r\n\t //el ingreso del producto es a \"disponible\" por lo tanto la funcion no toma en cuenta los parametros que siguen\r\n\t $a_stock='disponible';\r\n\t agregar_stock($id_prod_esp,$cantidad,$id_deposito_destino,$comentario,$id_tipo_movimiento,$a_stock,$id_tipo_reserva,\"\",$id_detalle_movimiento,$id_licitacion,$nro_caso);\r\n\t $res->movenext();\r\n }//del for\r\n $db->completetrans();\r\n\r\n }", "function extraerConversacion(){\n $fp = fopen(\"../conversacion/conversacion.txt\",\"rb\");\n $conversacion = new Conversacion(); \n $numeroLinea = 0;\n $listaConversaciones = array();\n while (!feof($fp)){\n $linea = fgets($fp);\n $linea = trim($linea);\n if($numeroLinea == 0){\n $conversacion->setId($linea);\n }\n else{\n if($linea != \"\"){\n $conversacion->agregarMensaje($linea);\n }\n }\n $numeroLinea++;\n //. strlen(trim($linea)), strlen logitud de la cadena, trim borra las cadenas vacias al principio y al final\n\n if($linea == \"\"){\n // echo \" aqui empieza una nueva conversacion <br>\"; \n //$listaConversaciones debo agregarle la $conversacion\n array_push($listaConversaciones,$conversacion);\n $conversacion = new Conversacion(); \n $numeroLinea = 0;\n }\n }\n array_push($listaConversaciones,$conversacion);\n return $listaConversaciones;\n\n fclose($fp);\n \n }", "function crea_ruta_punto($itm,$r){\n\t \n\n global $db,$dbf,$fecha_con_formato,$cp,$cpno, $existe_punto_detalle;\n $cuenta_puntos=0;\n\t$cuenta_puntos_no = 0;\n\t$otra_ban = 0;\n\t$bandera =0;\n \n\t\t\t\t$usuario = \"SELECT COD_OBJECT_MAP FROM SAVL_G_PRIN WHERE ITEM_NUMBER = '\".$itm.\"'\";\n\t\t\t $query_user = $db->sqlQuery($usuario);\n\t\t\t\t$row_user = $db->sqlFetchArray($query_user);\n\t\t\t\t$count_user = $db->sqlEnumRows($query_user);\t \t \n\t\t\t\t\t\t\t \n\t\t\t\t\tif($count_user > 0)\t{\t\t\n\t\t\t\t \n \t\t\t\t\t$punto = \"SELECT COD_OBJECT_MAP FROM SAVL_ROUTES_DETAIL WHERE COD_OBJECT_MAP =\".$row_user['COD_OBJECT_MAP'];\n \t\t\t $query_punto = $db->sqlQuery($punto);\n \t\t\t\t $count_punto = $db->sqlEnumRows($query_punto);\n\t\t\t\t \n \t\t\t\t if($count_punto>0){\n \t\t\t\t\t\t // $existe_punto = $existe_punto +1;\n \t\t\t\t echo \"ya existe el geopunto en routes_detail, se guardara este mismo geopunto con otra ruta...\";\n\t\t\t\t\t\t\t\t\t\t\t$otra_ban = 1;\n \t\t\t\t\t\t }\n\t\t\t\t \n \t\t\t\t //if($count_punto==0){\n \t\t\t\t\t\t\t $data_2 = Array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'ID_ROUTE' => $r,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'COD_OBJECT_MAP' => $row_user['COD_OBJECT_MAP'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'CREATE_DATE' => $fecha_con_formato\n\t\t\t\t\t\t\t\t\t\t\t\t );\n \t\t\t\tif($dbf-> insertDB($data_2,'SAVL_ROUTES_DETAIL',false) == true){\n \t\t\t\t\t\t\t\t\t $bandera = 1;\n \t\t\t\t\t\t\t\t\t echo 1;\t\t\n }\telse{\n echo 0;\t\n }\t\n \t\t\t // }else{\n \t\t\t\t\t //\t\t$bandera = 0;\n \t\t\t\t\t //}\n\t\t\t\t \n\t\t\t\t }\n\n\t\t\tif($bandera ==1){\n\t\t\t $cp = $cp +1;\n\t\t\t}else{\n\t\t\t $cpno = $cpno +1;\n\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t \n\t\t\tif($otra_ban ==1){\n\t\t\t $existe_punto_detalle = $existe_punto_detalle +1;\n\t\t\t} \n \n }", "public function transferencia($row){\n\n // Data de Saida\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Data Saída: \"), 'LTB', 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->data_saida), 'TBR', 0, '');\n // Origem\n $this->SetFont('Times','B',10);\n $this->Cell(20, 6, utf8_decode(\"Origem: \"), 'LTB', 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(40, 6, utf8_decode($row->origem_nome), 'TBR', 0, '');\n\n $this->Ln();\n\n // Data de Entrada\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Data Entrada: \"), 'LTB', 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->data_saida), 'TBR', 0, '');\n // Destino\n $this->SetFont('Times','B',10);\n $this->Cell(20, 6, utf8_decode(\"Destino: \"), 'LTB', 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(40, 6, utf8_decode($row->destino_nome), 'TBR', 0, '');\n\n $this->Ln(10);\n\n\n // Status\n $this->SetFont('Times','B',10);\n $this->Cell(20, 6, utf8_decode(\"Status: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(30, 6, utf8_decode($row->status_nome), 'TBR', 0, '');\n\n // Peso Total\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Peso Total: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->saida_peso_total), 'TBR', 0, '');\n\n // Permanencia\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Perm. Média: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->permanencia_media), 'TBR', 0, '');\n\n // Machos\n $this->Ln();\n $this->SetFont('Times','B',10);\n $this->Cell(20, 6, utf8_decode(\"Machos: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(30, 6, utf8_decode($row->machos), 'TBR', 0, '');\n\n // Peso Medio\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Peso Médio: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->saida_peso_medio), 'TBR', 0, '');\n\n // Ganho Dia Medio\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Ganho/Dia: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->ganho_medio_media), 'TBR', 0, '');\n\n // Femeas\n $this->Ln();\n $this->SetFont('Times','B',10);\n $this->Cell(20, 6, utf8_decode(\"Femeas:\"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(30, 6, utf8_decode($row->femeas), 'TBR', 0, '');\n\n // Ganho Total\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Ganho Total: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->ganho_total), 'TBR', 0, '');\n\n // Maior Peso \n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Maior Peso: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->saida_maior_peso), 'TBR', 0, '');\n\n // Total\n $this->Ln();\n $this->SetFont('Times','B',10);\n $this->Cell(20, 6, utf8_decode(\"Total:\"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(30, 6, utf8_decode($row->quantidade), 'TBR', 0, '');\n\n // Ganho Total Medio\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Ganho Médio: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->ganho_total_media), 'TBR', 0, '');\n \n // Menor Peso\n $this->SetFont('Times','B',10);\n $this->Cell(25, 6, utf8_decode(\"Menor Peso: \"), 1, 0, '');\n $this->SetFont('Times','',10);\n $this->Cell(25, 6, utf8_decode($row->saida_menor_peso), 'TBR', 0, '');\n\n $this->Ln(6);\n }", "public function insertar($idordencompra, $nrofactura, $idproveedor, $idpersonal, $idsucursal, $idformapago, $idtipodoc, $iddeposito, \n $fecha_hora, $obs, $monto_compra, $idmercaderia, $cantidad, $precio, $total_exenta, $total_iva5, $total_iva10, $liq_iva5, $liq_iva10, $cuota){\n\n $sql = \"INSERT INTO compras (idordencompra, nrofactura, idproveedor, idpersonal, idsucursal, idformapago, idtipodocumento, iddeposito, fecha, obs, monto, cuotas, estado) \n VALUES ('$idordencompra', '$nrofactura', '$idproveedor', '$idpersonal', '$idsucursal', '$idformapago', '$idtipodoc', '$iddeposito', '$fecha_hora', '$obs', '$monto_compra', '$cuota', '1')\";\n \n $idcompranew = ejecutarConsulta_retornarID($sql);\n\n $num_elementos=0;\n $sw=true;\n\n while($num_elementos < count($idmercaderia)){\n\n $sql_detalle = \"INSERT INTO compras_detalle (idcompra, idmercaderia, cantidad, precio) \n VALUES ('$idcompranew', '$idmercaderia[$num_elementos]', '$cantidad[$num_elementos]', '$precio[$num_elementos]')\";\n ejecutarConsulta($sql_detalle) or $sw = false;\n\n $num_elementos =$num_elementos + 1;\n }\n\n //aca realimazamos la insercion en la tabla libro compras\n\n $sql2 = \"INSERT INTO libro_compras (idcompra, idproveedor, fecha, montoexenta, montoiva5, montoiva10, grabiva5, grabiva10, montopagado) \n VALUES ('$idcompranew', '$idproveedor', '$fecha_hora', '$total_exenta', '$total_iva5', '$total_iva10', '$liq_iva5', '$liq_iva10', '$monto_compra')\";\n\n ejecutarConsulta($sql2);\n\n //aca realizamos la insercion en la tabla cuentas a pagar \n\n if($idformapago == 1){\n $formaPago = 'CONTADO';\n }else{\n $formaPago = 'CREDITO';\n }\n\n $monto_cuota = $monto_compra / $cuota;\n\n $fecha = strtotime($fecha_hora);\n $fecha = date('Y-m-d H:i:s', $fecha);\n $cont = 0;\n\n for ($i=1; $i <= $cuota ; $i++) { \n\n if($i >= 2){\n $cont = $cont + 1;\n $fecha = date(\"Y-m-d H:i:s\", strtotime($fecha_hora. \"+ {$cont} month\"));\n }\n\n if($cuota == 1){\n $concepto = \"Cuota Nro. \". $i .\"/\". $cuota .\" \". $formaPago;\n }else{\n $concepto = \"Cuota Nro. \". $i .\"/\". $cuota .\" \". $formaPago .\" \". $cuota .\" MESES\";\n }\n\n $sql3 = \"INSERT INTO cuentas_a_pagar (idcompra, idproveedor, nrofactura, idnotacredidebi, totalcuota, nrocuota, montocuota, fechavto, obs, estado) \n VALUES ('$idcompranew', '$idproveedor', '$nrofactura', '0', '$cuota', '$i', '$monto_cuota', '$fecha','$concepto', '1')\";\n\n ejecutarConsulta($sql3);\n\n }\n\n $sql4 = \"UPDATE orden_compras SET estado = '2' WHERE idordencompra = '$idordencompra'\";\n ejecutarConsulta($sql4);\n\n return $sw;\n\n }", "function enviar_mail_mov($datos)\r\n{\r\n\tglobal $db,$titulo_pagina;\r\n\t//ver el origen y destino\r\n\t$sql = \"select temp1.nombre as origen, temp1.id_deposito as id_origen,temp2.nombre as destino, temp2.id_deposito as id_destino from movimiento_material join depositos as temp1 on (temp1.id_deposito = deposito_origen) join depositos as temp2 on (temp2.id_deposito = deposito_destino) where id_movimiento_material = \".$datos['Id'];\r\n $result = $db->Execute($sql) or die($db->ErrorMsg().\"<br>Error Enviando mail\");\r\n\r\n $origen = $result->fields['origen'];\r\n\t$destino = $result->fields['destino'];\r\n $id_origen = $result->fields['id_origen'];\r\n $id_destino = $result->fields['id_destino'];\r\n\r\n\t//buscar el responsable del deposito origen\r\n\t$sql = \"select usuarios.mail from depositos join responsable_deposito using (id_deposito) join usuarios using (id_usuario) where id_deposito = \".$id_origen;\r\n\t$result = $db->Execute($sql) or die($db->ErrorMsg().\"<br>Error Enviando mail\");\r\n\t$responsable_origen = array();\r\n\twhile (!$result->EOF) {\r\n\t\t$responsable_origen[] = $result->fields['mail'];\r\n\t\t$result->MoveNext();\r\n\t}\r\n\r\n\t//buscar el responsable del deposito origen\r\n\t$sql = \"select usuarios.mail from depositos join responsable_deposito using (id_deposito) join usuarios using (id_usuario) where id_deposito = \".$id_destino;\r\n $result = $db->Execute($sql) or die($db->ErrorMsg().\"<br>Error Enviando mail\");\r\n\t$responsable_destino = array();\r\n\twhile (!$result->EOF) {\r\n\t\t$responsable_destino[] = $result->fields['mail'];\r\n\t\t$result->MoveNext();\r\n\t}\r\n\r\n\t//tengo que prepara el \"para\" para enviar el mail\r\n\t//el problema es que se pueden repetir los mail\r\n\t//armo un arreglo con los mail\r\n\t$mail_para = array ();\r\n //la variable \"$responsable_origen\" es arreglo por eso hago un merge para que me quede solo un arreglo\r\n $mail_para= array_merge($mail_para,$responsable_origen);\r\n //la variable \"$responsable_destino\" es arreglo por eso hago un merge para que me quede solo un arreglo\r\n $mail_para= array_merge($mail_para,$responsable_destino);\r\n //saco el tamaño del arreglo por que no se como me quedo despues de los merge\r\n $i=sizeof($mail_para);\r\n\t//$para = \"[email protected],\".join(\",\",$responsable_origen).\",\".join(\",\",$responsable_destino);\r\n\tif($origen==\"New Tree\" || $destino==\"New Tree\"){\r\n\t $mail_para[$i]=\"[email protected]\";\r\n\t $i++;\r\n\t $mail_para[$i]=\"[email protected]\";\r\n\t $i++;\r\n\t //$para.=\",[email protected],[email protected]\";\r\n\t}\r\n\t//agregar responsables\r\n\r\n\t$asunto = \"$titulo_pagina Nº: \".$datos['Id'];\r\n\t$contenido = \"$titulo_pagina Nº \".$datos['Id'].\".\\n\";\r\n\t$contenido.= \"Depósito de Origen: \".$origen.\".\\n\";\r\n\t$contenido.= \"Depósito de Destino: \".$destino.\".\\n\";\r\n\t$contenido.= \"Autorizado por \".$datos['Usuario'].\" el día \".fecha($datos[\"Fecha\"]).\".\\n\";\r\n\t$contenido.= \"\\nDetalle del movimiento: \\n\";\r\n\r\n\r\n\t//obtener el detalle del movimiento\r\n\t$sql = \"select cantidad,descripcion from detalle_movimiento where id_movimiento_material = \".$datos['Id'];\r\n $result = $db->Execute($sql) or die($db->ErrorMsg().\"<br>Error Enviando mail\");\r\n\r\n $contenido.= \"Cantidad | Descripción \\n\";\r\n $contenido.= \"--------------------------------------------------------------\\n\";\r\n\r\n while (!$result->EOF) {\r\n \t$contenido.=\" \".$result->fields['cantidad'].\" \".$result->fields['descripcion'].\"\\n\";\r\n \t$result->MoveNext();\r\n }\r\n\r\n\t//agrego datos si tiene logistica integrada\r\n\tif ($datos['id_logistica_integrada']!=''){\r\n\t\t//todo lo que sigue es para el para\r\n\r\n\t\t$mail_para[$i]=\"[email protected]\";\r\n\t\t$i++;\r\n\t\t$mail_para[$i]=\"[email protected]\";\r\n\t\t$i++;\r\n\t\t//$para = $para. \" [email protected]\";\r\n\t\t//$para = $para. \", [email protected]\";\r\n\t\t$sql = \"select * from\r\n\t\t\t\t (select (nombre|| ' ' ||apellido) as usuario, mail from sistema.usuarios)as lado_a\r\n\t\t\t\tjoin\r\n\t\t\t\t (select usuario from mov_material.log_movimiento where id_movimiento_material = \".$datos['Id'].\"\r\n\t\t\t\t group by usuario\r\n\t\t\t\t )as lado_b\r\n\t\t\t\tusing (usuario)\";\r\n \t$result_mail = $db->Execute($sql) or die($db->ErrorMsg().\"<br>Error Enviando mail (consulta trae mail a partir de log)\");\r\n\r\n \twhile (!$result_mail->EOF){\r\n \t\t//$para = $para. \", \" . $result_mail->fields['mail'];\r\n \t\t$mail_para[$i]=$result_mail->fields['mail'];\r\n \t\t$i++;\r\n \t\t$result_mail->MoveNext();\r\n \t}\r\n\r\n \t//saco el tamaño del arreglo para asegurarme que esta en la posicion correcta para seguir\r\n\t\t$i=sizeof($mail_para);\r\n\r\n \t//si esta asociado a una licitacion\r\n\t\tif ($datos['asociado_a']=='lic') {\r\n\t\t\t$sql = \"select mail as mail_patrocinador, mail_lider from (\r\n\t\t\t\t\tselect mail as mail_lider, patrocinador from\r\n\t\t\t\t\t(\r\n\t\t\t\t\tselect id_licitacion, lider, patrocinador from\r\n\t\t\t\t\t (select id_licitacion from mov_material.movimiento_material where id_movimiento_material = \".$datos['Id'].\") as a\r\n\t\t\t\t\tjoin\r\n\t\t\t\t\t licitaciones.licitacion\r\n\t\t\t\t\tusing (id_licitacion)\r\n\t\t\t\t\t)as b\r\n\t\t\t\t\tleft join sistema.usuarios\r\n\t\t\t\t\ton id_usuario = lider\r\n\t\t\t\t\t)as c\r\n\t\t\t\t\tleft join sistema.usuarios\r\n\t\t\t\t\ton id_usuario = patrocinador\";\r\n\t\t $result_mail = $db->Execute($sql) or die($db->ErrorMsg().\"<br>Error Enviando mail (consulta trae mail a partir de log)\");\r\n\t\t if ($result_mail->fields['mail_lider']!=''){\r\n\t\t \t$mail_para[$i]=$result_mail->fields['mail_lider'];\r\n\t\t\t\t$i++;\r\n\t\t \t//$para = $para. \", \".$result_mail->fields['mail_lider'];\r\n\t\t }\r\n\t\t if ($result_mail->fields['mail_patrocinador']!=''){\r\n\t\t \t$mail_para[$i]=$result_mail->fields['mail_patrocinador'];\r\n\t\t\t\t$i++;\r\n\t\t \t//$para = $para. \", \".$result_mail->fields['mail_patrocinador'];\r\n\t\t }\r\n\t\t}\r\n\r\n\t\t//si esta asociado a un caso\r\n\t\tif ($datos['asociado_a']=='caso'){\r\n\t\t\t$mail_para[$i]=\"[email protected]\";\r\n\t\t\t$i++;\r\n\t\t\t$mail_para[$i]=\"[email protected]\";\r\n\t\t\t$i++;\r\n\t\t\t//$para = $para. \", [email protected], [email protected] \";\r\n\t\t}\r\n\r\n\t\t//todo lo que sigue es para el contenido\r\n\t\t$sql = \"select * from mov_material.logistica_integrada where id_logistica_integrada = \". $datos['id_logistica_integrada'];\r\n\t\t$result = $db->Execute($sql) or die($db->ErrorMsg().\"<br>Error Enviando mail (consulta trae mail a partir de log)\");\r\n\t\t$contenido.=\"\\n\\n\\n\";\r\n\t\t$contenido.=\"----------------------- Logistica Integrada -------------------\\n\\n\";\r\n\t\t$contenido.=\"Dirección: \". $result->fields['direccion'] .\"\\n\";\r\n\t\t$contenido.=\"Fecha de envio: \". fecha ($result->fields['fecha_envio_logis']) .\"\\n\";\r\n\t\t$contenido.=\"Contacto: \". $result->fields['contacto'] .\"\\n\";\r\n\t\t$contenido.=\"Telefono: \". $result->fields['telefono'] .\"\\n\";\r\n\t\t$contenido.=\"Código Postal: \". $result->fields['cod_pos'] .\"\\n\\n\";\r\n\t\t$contenido.= \"--------------------------------------------------------------\\n\";\r\n\t}\r\n\t//fin de agrego datos si tiene logistica integrada\r\n\t//print_r ($mail_para);\r\n\t$para=elimina_repetidos($mail_para,0);\r\n\t//no envia el mail a juan manuel lo saco del string, en caso que se encuentre ultimo el mail\r\n\t$para=ereg_replace(\"[email protected]\",\"\",$para);\r\n\t//no envia el mail a juan manuel lo saco del string, en caso que se encuentre distinto del ultimo el mail\r\n\t$para=ereg_replace(\"[email protected],\",\"\",$para);\r\n/*\techo \"<br> los ok: \".$para;\r\n\tdie();*/\r\n\tenviar_mail($para, $asunto, $contenido,'','','',0);\r\n}", "function identificar_pago_cli_mercantil($acceso,$id_cuba,$abrev_cuba){\n\t$acceso2=conexion();\n\t\n\t\tsession_start();\n\t\t$ini_u = $_SESSION[\"ini_u\"]; \n\t\tif($ini_u==''){\n\t\t\t$ini_u =\"AA\";\n\t\t}\n\t$acceso->objeto->ejecutarSql(\"select *from pagodeposito where (id_pd ILIKE '$ini_u%') ORDER BY id_pd desc\"); \n\t$id_pd = $ini_u.verCoo($acceso,\"id_pd\");\n\t$login = $_SESSION[\"login\"]; \n\t$fecha= date(\"Y-m-d\");\n\t$hora= date(\"H:i:s\");\n\t\n\t$palabra_clave='DEPOSITO EN EFECTIVO';\n\t$palabra_clave1='DEPO-FACIL ELECTRONICO';\n\t//ECHO \" select * from vista_tablabancos where id_cuba='$id_cuba' and descrip_tb ilike 'REC. INT. CARGO CUENTA%'\";\n\t$acceso2->objeto->ejecutarSql(\" select * from vista_tablabancos where id_cuba='$id_cuba' and (descrip_tb ilike '$palabra_clave%' or descrip_tb ilike '$palabra_clave1%' )AND (Status_tb='REGISTRADO' or status_tb='NO RELACIONADO')order by id_tb \");\n\t\twhile($row=row($acceso2)){\n\t\t\t$abrev_cuba=trim($row[\"abrev_cuba\"]);\n\t\t\t$id_tb=trim($row[\"id_tb\"]);\n\t\t\t//echo \"<br>$abrev_cuba:\";\n\t\t\t$fecha_tb=trim($row[\"fecha_tb\"]);\n\t\t\t$referencia_tb=trim($row[\"referencia_tb\"]);\n\t\t\t$monto_tb=trim($row[\"monto_tb\"]);\n\t\t\t$descrip_tb=trim($row[\"descrip_tb\"]);\n\t\t\t$valor=explode($palabra_clave,$descrip_tb);\n\t\t\t$ini=substr($referencia_tb, 0, 3);\n\t\t\t$nro_contrato='00000000000000000000000000';\n\t\t\t//echo \"<br>:$referencia_tb:\";\n\t\t\t//if($ini=='000'){\n\t\t\t\t//$nro_contrato=\t$ano=substr($referencia_tb, 3, 8);\n\t\t\t\t$nro_contrato=\t$referencia_tb;\n\t\t\t\tif(strlen($nro_contrato)!=8 && strlen($nro_contrato)!=7){\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//\techo \"<br>nro_contrato:$nro_contrato:\";\n\t\t\t//}\n\t\t\t//echo \"<br>$referencia_tb: select * from contrato where nro_contrato ilike '%$nro_contrato%' \";\n\t\t\t$acceso->objeto->ejecutarSql(\" select * from contrato where nro_contrato ilike '%$nro_contrato%' \");\n\t\t\tif($row=row($acceso)){\n\t\t\t\t$id_contrato=trim($row[\"id_contrato\"]);\n\t\t\t\t$acceso->objeto->ejecutarSql(\"insert into pagodeposito(id_pd,id_contrato,fecha_reg,hora_reg,login_reg,fecha_dep,banco,numero_ref,status_pd,tipo_dt,monto_dep,obser_p,id_tb,fecha_conf,hora_conf,login_conf) values \n\t\t\t\t('$id_pd','$id_contrato','$fecha','$hora','$login','$fecha_tb','$id_cuba','$referencia_tb','CONFIRMADO','DEPOSITO','$monto_tb','$descrip_tb','$id_tb','$fecha','$hora','$login')\");\t\n\t\t\t\t$acceso->objeto->ejecutarSql(\"update tabla_bancos set status_tb='CONCILIADO' , tipo_tb='CLIENTES' where id_tb='$id_tb'\");\t\n\t\t\t\t$id_pd=$ini_u.verCoo_inc($acceso,$id_pd);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$acceso->objeto->ejecutarSql(\"update tabla_bancos set status_tb='NO RELACIONADO', tipo_tb='CLIENTES' where id_tb='$id_tb'\");\t\n\t\t\t}\n\t\t}\n\treturn $cad;\t\n}", "public function InsertPedidoDetalle( $id_orden , $id_sucursal , $productos ,$nota_interna ,$estado_pedido ){\n date_default_timezone_set('America/El_Salvador');\n $date = date(\"Y-m-d H:m:s\");\n\n $total = 0;\n $shipping = 0;\n $subtotal = 0;\n $contadorTabla =1;\n $precio_minimo=0;\n\n foreach ($productos as $value) {\n \n foreach ($value as $demo) {\n\n $nodo = $this->nodoByProducto( $id_sucursal , $demo->id_producto );\n\n if($demo->ck =='true'){\n \n if($demo->precio_minimo !=0){\n $total = $demo->precio_minimo * $demo->cnt;\n //$subtotal += $demo->precio_minimo * $demo->cnt;\n }else{\n $total = $demo->numerico1 * $demo->cnt;\n //$subtotal += $demo->numerico1 * $demo->cnt;\n }\n \n $precio_minimo = $demo->precio_minimo;\n }else{\n //$subtotal += $demo->numerico1 * $demo->cnt;\n $total = $demo->numerico1 * $demo->cnt;\n $precio_minimo = 0;\n } \n $original = $demo->numerico1 ;//* $demo->cnt;\n\n $data = array(\n 'id_pedido' => $id_orden, \n 'id_producto' => $demo->id_producto,\n 'id_nodo' => $nodo[0]->nodoID, \n 'producto_elaborado'=> 0,\n 'precio_grabado' => $total,\n 'precio_original' => $original,\n 'cantidad' => $demo->cnt,\n 'llevar' => 0,\n 'pedido_estado' => $estado_pedido,\n 'nota_interna' => $nota_interna,\n 'estado' => 2,\n ); \n $this->db->insert(self::sys_pedido_detalle,$data); \n } \n }\n return 1; \n \n }", "public function save_linea(){\n \n //$sql = \"SELECT LAST_INSERT_ID() as 'pedido' ;\";//Devuelve id del ultimo pedido\n $sql = \"SELECT * FROM pedidos ORDER BY id DESC LIMIT 1;\";\n $query = $this->db->query($sql);\n\n $pedido_id = $query->fetch_object()->id;\n\n $cast_pedido_id = (int)$pedido_id;\n \n //var_dump($cast_pedido_id);\n \n //Insertamos productos y cantidad de productos\n foreach($_SESSION['carrito'] as $indice =>$elemento){\n \n $producto = $elemento['producto'];\n $product_id = (int)$producto->id;\n \n $insert = \"INSERT INTO lineas_pedidos VALUES(null , $cast_pedido_id, $product_id, {$elemento['unidades']});\";\n $save = $this->db->query($insert);\n \n //Llamada al método updateStock, el cual le pasamos el id del producto y las unidades y va modificando el stock.\n $this->updateStock($producto->id, $elemento['unidades']);\n // echo $this->db->error;\n // die();\n } \n\n\n $result = false;\n if($save){\n $result = true;\n }\n return $result;\n }", "public function uploadPerencanaanProduksiPeriodeBerjalan($params = array())\n {\n $data = array();\n $datachk = array();\n $total_rec = $ins_rec = $lastBaCode = $update_rec = 0;\n \n if ($_FILES[file][size] > 0) {\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************\n //1. ****************** Check BA dari CSV FILE\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n $arrba = array();\n do {\n if (($datachk[0])&&($total_rec > 1)) {\n array_push($arrba,$datachk[1]);\n }\n $total_rec++;\n } while($datachk = fgetcsv($handle,1000,\";\",\"'\"));\n $arrbadis = array_values(array_unique($arrba, SORT_REGULAR)); //variabel array list BA pada CSV\n \n //2. ****************** Baca Urutan Upload dari T_SEQ\n $sqlCurTask=\"SELECT SEQ_NUM FROM T_SEQ WHERE TABLE_NAME='TR_PRODUKSI_PERIODE_BUDGET'\";\n $seqNum = $this->_db->fetchOne($sqlCurTask);\n $sqlSeq=\"SELECT * FROM T_SEQ WHERE SEQ_NUM < ($seqNum) ORDER BY SEQ_NUM, TASK_NAME\";\n $rows = $this->_db->fetchAll($sqlSeq);\n if (!empty($rows)) {\n foreach ($rows as $idx => $row) { \n $tablechk = $row['REMARKS'];\n //2.1 ****************** get BA CODE yang sudah dimasukan pada table di awal sequence\n $sqlba = \"SELECT DISTINCT BA_CODE FROM \".$row['TABLE_NAME'];\n $arrnormaba = array();\n $arrlockba = array();\n $rowsba = $this->_db->fetchAll($sqlba);\n foreach ($rowsba as $idxba => $rowba) {\n array_push($arrnormaba,$rowba['BA_CODE']); //variabel array list BA pada masing2 norma\n //2.2 ****************** get STATUS LOCK masing2 BA CODE di T_SEQ\n $sqlba1 = \"SELECT STATUS FROM T_SEQ_CHECK WHERE BA_CODE='\".$rowba['BA_CODE'].\"' AND TASK_NAME='\".$row['TABLE_NAME'].\"'\";\n \n $arrlockba[$rowba['BA_CODE']] = $this->_db->fetchOne($sqlba1);\n } \n $arrNotFound=array();\n for($x=0;$x<count($arrbadis);$x++){\n if(!in_array($arrbadis[$x],$arrnormaba)){ //check apakah data ba csv ada di data ba norma?\n $arrNotFound[]=$arrbadis[$x];\n }elseif($arrlockba[$arrbadis[$x]]==\"LOCKED\"){\n $arrNotFound[]=$arrbadis[$x];\n }\n }\n if($arrNotFound) break;\n }\n }\n $arrNotFound =array();\n if($arrNotFound){\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'ba_notfound' => implode(\",\",$arrNotFound),\n 'task_err' => $tablechk\n );\n return $return;\n }\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************//\n //get the csv file\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n \n $total_rec = 0;\n \n //loop through the csv file and insert into database\n do {\n if (($data[0])&&($total_rec > 1)) {\n /*\n if ($lastBaCode <> addslashes($data[1])){\n try {\n //remove data\n $sqlDelete = \"\n DELETE FROM TR_PRODUKSI_TAHUN_BERJALAN\n WHERE BA_CODE = TRIM('\".addslashes($data[1]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n \";\n //log file penghapusan data\n $this->_global->deleteDataLogFile($sqlDelete); \n $this->_db->query($sqlDelete);\n } catch (Exception $e) {\n }\n }\n */ \n $pisah = explode(',', $data[56]);\n $dist_sm1 = $pisah[0];\n $pisah = explode(',', $data[57]);\n $dist_sm2 = $pisah[0];\n $pisah = explode(',', $data[42]);\n $data42 = $pisah[0];\n \n $total_seb_ton = $dist_sm1 + $dist_sm2;\n \n if(($data[58] > 0 && $data[58] <> '') && $data[59] <> '' && $data42 <> '' && $data[44] <> '' && $data[45] <> '' && $data[46] <> '' && \n $data[47] <> '' && $data[48] <> '' && $data[49] <> '' && $data[50] <> '' && $data[51] <> '' && $data[52] <> '' && $data[53] <> '' && $data[54] <> '' &&\n $data[55] <> '' && $dist_sm1 <> '' && $dist_sm2 <> ''){\n if((int)$data42 == (int)$total_seb_ton){\n //cek block exists\n $sql = \"SELECT COUNT(*) FROM TM_HECTARE_STATEMENT \n WHERE BA_CODE = TRIM('\".addslashes($data[1]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND AFD_CODE = TRIM('\".addslashes($data[2]).\"')\n AND BLOCK_CODE = TRIM('\".addslashes($data[3]).\"')\n \";\n $count = $this->_db->fetchOne($sql);\n if($count <> 0){ \n //cek data\n $sql = \"\n SELECT COUNT(*)\n FROM TR_PRODUKSI_TAHUN_BERJALAN\n WHERE BA_CODE = TRIM('\".addslashes($data[1]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND AFD_CODE = TRIM('\".addslashes($data[2]).\"')\n AND BLOCK_CODE = TRIM('\".addslashes($data[3]).\"')\n \";\n \n $count = $this->_db->fetchOne($sql);\n //echo $sql;\n if ($count == 0) {\n try {\n //insert data\n $sql = \"\n INSERT INTO TR_PRODUKSI_TAHUN_BERJALAN (PERIOD_BUDGET, BA_CODE, AFD_CODE, BLOCK_CODE, HA_PANEN, POKOK_PRODUKTIF, SPH_PRODUKTIF, TON_AKTUAL, JANJANG_AKTUAL, BJR_AKTUAL, YPH_AKTUAL, TON_TAKSASI, JANJANG_TAKSASI, BJR_TAKSASI, YPH_TAKSASI, TON_ANTISIPASI, JANJANG_ANTISIPASI, BJR_ANTISIPASI, YPH_ANTISIPASI, TON_BUDGET, YPH_BUDGET, VAR_YPH, TRX_CODE, INSERT_USER, INSERT_TIME)\n VALUES (\n TO_DATE('{$this->_period}','DD-MM-RRRR'),\n TRIM('\".addslashes($data[1]).\"'),\n TRIM('\".addslashes($data[2]).\"'),\n TRIM('\".addslashes($data[3]).\"'),\n '\".addslashes($data[12]).\"',\n '\".addslashes($data[13]).\"',\n '\".addslashes($data[14]).\"',\n '\".addslashes($data[15]).\"',\n '\".addslashes($data[16]).\"',\n '\".addslashes($data[17]).\"',\n '\".addslashes($data[18]).\"',\n '\".addslashes($data[19]).\"',\n '\".addslashes($data[20]).\"',\n '\".addslashes($data[21]).\"',\n '\".addslashes($data[22]).\"',\n '\".addslashes($data[23]).\"',\n '\".addslashes($data[24]).\"',\n '\".addslashes($data[25]).\"',\n '\".addslashes($data[26]).\"',\n '\".addslashes($data[27]).\"',\n '\".addslashes($data[28]).\"',\n '\".addslashes($data[29]).\"',\n F_GEN_TRANSACTION_CODE(TO_DATE('{$this->_period}','DD-MM-RRRR'),TRIM('\".addslashes($data[1]).\"'),'PP'),\n '{$this->_userName}',\n SYSDATE\n )\n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $ins_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'PERENCANAAN PRODUKSI - PERIODE BERJALAN', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'PERENCANAAN PRODUKSI - PERIODE BERJALAN', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n // cek apakah data non-aktif\n $sql = \"\n SELECT COUNT(*)\n FROM TR_PRODUKSI_TAHUN_BERJALAN\n WHERE BA_CODE = TRIM('\".addslashes($data[1]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND AFD_CODE = TRIM('\".addslashes($data[2]).\"')\n AND BLOCK_CODE = TRIM('\".addslashes($data[3]).\"')\n AND DELETE_USER IS NULL\n \";\n \n $count = $this->_db->fetchOne($sql);\n if ($count == 0) {\n // update data menjadi aktif jika sebelumnya telah dinon-aktifkan\n try {\n $sql = \"\n UPDATE TR_PRODUKSI_TAHUN_BERJALAN\n SET HA_PANEN = '\".addslashes($data[12]).\"',\n POKOK_PRODUKTIF = '\".addslashes($data[13]).\"',\n SPH_PRODUKTIF = '\".addslashes($data[14]).\"',\n TON_AKTUAL = '\".addslashes($data[15]).\"',\n JANJANG_AKTUAL = '\".addslashes($data[16]).\"',\n BJR_AKTUAL = '\".addslashes($data[17]).\"',\n YPH_AKTUAL = '\".addslashes($data[18]).\"',\n TON_TAKSASI = '\".addslashes($data[19]).\"',\n JANJANG_TAKSASI = '\".addslashes($data[20]).\"',\n BJR_TAKSASI = '\".addslashes($data[21]).\"',\n YPH_TAKSASI = '\".addslashes($data[22]).\"',\n TON_ANTISIPASI = '\".addslashes($data[23]).\"',\n JANJANG_ANTISIPASI = '\".addslashes($data[24]).\"',\n BJR_ANTISIPASI = '\".addslashes($data[25]).\"',\n YPH_ANTISIPASI = '\".addslashes($data[26]).\"',\n TON_BUDGET = '\".addslashes($data[27]).\"',\n YPH_BUDGET = '\".addslashes($data[28]).\"',\n VAR_YPH = '\".addslashes($data[29]).\"',\n UPDATE_USER = '{$this->_userName}',\n UPDATE_TIME = SYSDATE,\n DELETE_USER = NULL,\n DELETE_TIME = NULL\n WHERE BA_CODE = TRIM('\".addslashes($data[1]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND AFD_CODE = TRIM('\".addslashes($data[2]).\"')\n AND BLOCK_CODE = TRIM('\".addslashes($data[3]).\"')\n \n \";\n \n \n $this->_db->query($sql);\n $this->_db->commit();\n $update_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'PERENCANAAN PRODUKSI - PERIODE BERJALAN', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'PERENCANAAN PRODUKSI - PERIODE BERJALAN', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n }\n }\n }else{\n $data_error2[] = $total_rec;\n $data_error[] = $total_rec;\n }\n }else{\n //echo $data[27] . \" == \" . $data[42] . \" == \" . $total_seb_ton;die();\n $data_error3[] = $total_rec;\n $data_error[] = $total_rec;\n }\n }else{\n $data_error1[] = $total_rec;\n $data_error[] = $total_rec;\n }\n $lastBaCode = addslashes($data[1]);\n }\n $total_rec++;\n } while ($data = fgetcsv($handle,1000,\",\",\"'\"));\n //die();\n $return = array(\n 'status' => 'done',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error,\n 'line_err' => $data_error1,\n 'empty_blck' => $data_error2,\n 'jml_eq' => $data_error3\n );\n }else{\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error,\n 'line_err' => $data_error1,\n 'empty_blck' => $data_error2,\n 'jml_eq' => $data_error3 \n );\n }\n \n return $return;\n }", "function insertarExportacioncontenedores($refexportaciones,$contenedor,$tara,$precinto) {\r\n$sql = \"insert into dbexportacioncontenedores(idexportacioncontenedor,refexportaciones,contenedor,tara,precinto)\r\nvalues ('',\".$refexportaciones.\",'\".($contenedor).\"',\".$tara.\",'\".($precinto).\"')\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}", "function addPedido($dni, $nombre, $apellido, $ubicacion, $telefono, $imagen, $claseVehiculo, $franjaHoraria)\n {\n\n //si está seteada, quiere decir que hay una imagen en la carpeta temporal de php.\n if (isset($imagen[\"fileTemp\"])) {\n move_uploaded_file($imagen[\"fileTemp\"], $imagen[\"filePath\"]);\n $imagen = $imagen[\"filePath\"];\n } else {\n $imagen = null;\n }\n\n $sentencia = $this->db->prepare(\"INSERT INTO pedido(usuario_asignado, nombre, apellido, ubicacion, telefono, foto, clase_vehiculo ,franja_horaria) VALUES(?,?,?,?,?,?,?,?)\");\n $sentencia->execute(array($dni, $nombre, $apellido, $ubicacion, $telefono, $imagen, $claseVehiculo, $franjaHoraria));\n }", "static public function mdlIngresarPacienteAseguradoExterno($tabla, $datos) {\n\n\t\t$pdo = Conexion::conectarBDFicha();\t\t\t\n\t\t$stmt = $pdo->prepare(\"INSERT INTO $tabla(cod_asegurado, cod_afiliado, cod_empleador, nombre_empleador, paterno, materno, nombre, sexo, nro_documento, fecha_nacimiento, edad, id_departamento_paciente, id_provincia_paciente , id_municipio_paciente , id_pais_paciente , zona, calle, nro_calle, telefono, email, nombre_apoderado, telefono_apoderado, id_ficha) VALUES (:cod_asegurado, :cod_afiliado, :cod_empleador, :nombre_empleador, :paterno, :materno, :nombre, :sexo, :nro_documento, :fecha_nacimiento, :edad, :id_departamento_paciente, :id_provincia_paciente , :id_municipio_paciente, :id_pais_paciente, :zona, :calle, :nro_calle, :telefono, :email, :nombre_apoderado, :telefono_apoderado, :id_ficha)\");\n\t\t$stmt->bindParam(\":cod_asegurado\", $datos[\"cod_asegurado\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":cod_afiliado\", $datos[\"cod_afiliado\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":cod_empleador\", $datos[\"cod_empleador\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":nombre_empleador\", $datos[\"nombre_empleador\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":paterno\", $datos[\"paterno\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":materno\", $datos[\"materno\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":nombre\", $datos[\"nombre\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":sexo\", $datos[\"sexo\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":nro_documento\", $datos[\"nro_documento\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fecha_nacimiento\", $datos[\"fecha_nacimiento\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":edad\", $datos[\"edad\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":id_departamento_paciente\", $datos[\"id_departamento_paciente\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":id_provincia_paciente\", $datos[\"id_provincia_paciente\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":id_municipio_paciente\", $datos[\"id_municipio_paciente\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":id_pais_paciente\", $datos[\"id_pais_paciente\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":zona\", $datos[\"zona\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":calle\", $datos[\"calle\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":nro_calle\", $datos[\"nro_calle\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":telefono\", $datos[\"telefono\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":email\", $datos[\"email\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":nombre_apoderado\", $datos[\"nombre_apoderado\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":telefono_apoderado\", $datos[\"telefono_apoderado\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_ficha\", $datos[\"id_ficha\"], PDO::PARAM_INT);\n\n\t\tif ($stmt->execute()) {\n\t\t\t$respuesta = $pdo->lastInsertId();\n\t\t} else {\n\t\t\t\n\t\t\t$respuesta = $stmt->errorInfo();\n\n\t\t}\n\t\treturn $respuesta;\n\t}", "function do_po_byfile()\r\n\t{\r\n\t\t\r\n\t\t$user = $this->erpm->auth(PURCHASE_ORDER_ROLE);\r\n\t\tif(!$_FILES['po_file']['name'])\r\n\t\t\tshow_error('Please choose file');\r\n\t\t\t\r\n\t\t// check if the file is valid csv \r\n\t\tif($_FILES['po_file']['type'] != 'application/vnd.ms-excel') \r\n\t\t\tshow_error('Invalid File format');\r\n\r\n\t\t// process the file for creating PO.\r\n\t\t\r\n\t\t$po_list = array();\t\r\n\t\t$tmpfname = $_FILES['po_file']['tmp_name'];\r\n\t\t$fp = fopen($tmpfname,'r');\r\n\t\t$i = 0;\r\n\t\twhile(!feof($fp))\r\n\t\t{\r\n\t\t\t$csv_data = fgetcsv($fp);\r\n\t\t\tif(!$i++)\r\n\t\t\t\tcontinue;\r\n\t\t\tif(!$csv_data[0])\r\n\t\t\t\tcontinue ;\r\n\t\t\t\t\r\n\t\t\tif(!isset($po_list[$csv_data[0]]))\r\n\t\t\t\t$po_list[$csv_data[0]] = array();\r\n\t\t\t\t\r\n\t\t\tif(!isset($po_list[$csv_data[0]][$csv_data[1]]))\r\n\t\t\t\t$po_list[$csv_data[0]][$csv_data[1]] = 0;\t\r\n\r\n\t\t\t$po_list[$csv_data[0]][$csv_data[1]] += $csv_data[3];\r\n\t\t\t\r\n\t\t}\r\n\t\tfclose($fp);\r\n\t\t\r\n\t\t\r\n\t\tif($po_list)\r\n\t\t{\r\n\t\t\t$total_po = 0;\r\n\t\t\tforeach ($po_list as $vid=>$po_prod)\r\n\t\t\t{\r\n\t\t\t\t// create po entry\r\n\t\t\t\t$inp = array($vid,$user['userid']);\r\n\t\t\t\t$this->db->query(\"insert into t_po_info (vendor_id,remarks,po_status,created_by,created_on) values (?,'Created from file',1,?,now()) \",$inp);\r\n\t\t\t\t$po_id = $this->db->insert_id();\r\n\t\t\t\t$total=0; \r\n\t\t\t\tforeach ($po_prod as $pid=>$qty)\r\n\t\t\t\t{\r\n\t\t\t\t\t$prod_det = $this->db->query(\"select a.product_id,a.mrp,b.brand_margin as margin,round(a.mrp-(a.mrp*b.brand_margin/100),2) as price from m_product_info a join m_vendor_brand_link b on a.brand_id = b.brand_id where vendor_id = ? and product_id = ? \",array($vid,$pid))->row_array();\r\n\t\t\t\t\tif($prod_det)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// create po prod request entry\r\n\t\t\t\t\t\t$inp=array($po_id,$pid,$qty,$prod_det['mrp'],$prod_det['margin'],0,1,$prod_det['price'],0,0,'');\r\n\t\t\t\t\t\t$this->db->query(\"insert into t_po_product_link(po_id,product_id,order_qty,mrp,margin,scheme_discount_value,scheme_discount_type,purchase_price,is_foc,has_offer,special_note,created_on) values(?,?,?,?,?,?,?,?,?,?,?,now())\",$inp);\r\n\t\t\t\t\t\t$total+=$prod_det['price']*$qty;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->db->query(\"update t_po_info set total_value=? where po_id=? limit 1\",array($total,$po_id));\r\n\t\t\t\t\r\n\t\t\t\t$total_po++; \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->session->set_flashdata(\"erp_pop_info\",$total_po.\" PO's created\");\r\n\t\t\tredirect(\"admin/bulk_createpo_byfile\",'refresh');\r\n\t\t\t\r\n\t\t}else\r\n\t\t{\r\n\t\t\tshow_error(\"Uploaded file is Blank or not in format\");\r\n\t\t}\r\n\t\t\t\r\n\t\texit;\r\n\t}", "public function uploadHaStatement($params = array())\n {\n $data = array();\n $datachk = array();\n $total_recchk = $total_rec = $ins_rec = $lastBaCode = $update_rec = 0;\n \n if ($_FILES[file][size] > 0) {\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************\n //1. ****************** Check BA dari CSV FILE\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n $arrba = array();\n do {\n if (($datachk[0])&&($total_rec > 1)) {\n array_push($arrba,$datachk[1]);\n }\n $total_rec++;\n } while($datachk = fgetcsv($handle,1000,\";\",\"'\"));\n $arrbadis = array_values(array_unique($arrba, SORT_REGULAR)); //variabel array list BA pada CSV\n \n //2. ****************** Baca Urutan Upload dari T_SEQ\n $sqlCurTask=\"SELECT SEQ_NUM FROM T_SEQ WHERE TABLE_NAME='TM_HECTARE_STATEMENT'\";\n $seqNum = $this->_db->fetchOne($sqlCurTask);\n $sqlSeq=\"SELECT * FROM T_SEQ WHERE SEQ_NUM < ($seqNum) ORDER BY SEQ_NUM, TASK_NAME\";\n $rows = $this->_db->fetchAll($sqlSeq);\n if (!empty($rows)) {\n foreach ($rows as $idx => $row) { \n $tablechk = $row['REMARKS'];\n //2.1 ****************** get BA CODE yang sudah dimasukan pada table di awal sequence\n $sqlba = \"SELECT DISTINCT BA_CODE FROM \".$row['TABLE_NAME'];\n $arrnormaba = array();\n $arrlockba = array();\n $rowsba = $this->_db->fetchAll($sqlba);\n foreach ($rowsba as $idxba => $rowba) {\n array_push($arrnormaba,$rowba['BA_CODE']); //variabel array list BA pada masing2 norma\n //2.2 ****************** get STATUS LOCK masing2 BA CODE di T_SEQ\n $sqlba1 = \"SELECT STATUS FROM T_SEQ_CHECK WHERE BA_CODE='\".$rowba['BA_CODE'].\"' AND TASK_NAME='\".$row['TABLE_NAME'].\"'\";\n \n $arrlockba[$rowba['BA_CODE']] = $this->_db->fetchOne($sqlba1);\n } \n $arrNotFound=array();\n for($x=0;$x<count($arrbadis);$x++){\n if(!in_array($arrbadis[$x],$arrnormaba)){ //check apakah data ba csv ada di data ba norma?\n $arrNotFound[]=$arrbadis[$x];\n }elseif($arrlockba[$arrbadis[$x]]==\"LOCKED\"){\n $arrNotFound[]=$arrbadis[$x];\n }\n }\n if($arrNotFound) break;\n }\n }\n $arrNotFound =array();\n if($arrNotFound){\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'ba_notfound' => implode(\",\",$arrNotFound),\n 'task_err' => $tablechk\n );\n return $return;\n }\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************//\n\n //get the csv file\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n \n $total_rec = 0;\n \n //loop through the csv file and insert into database\n do {\n \n if (($data[0])&&($total_rec > 1)) {\n /* if ($lastBaCode <> addslashes($data[0])){\n try {\n //remove data\n $sqlDelete = \"\n DELETE FROM TM_HECTARE_STATEMENT \n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR') = '{$this->_period}'\n \";\n //log file penghapusan data\n $this->_global->deleteDataLogFile($sqlDelete);\n \n $this->_db->query($sqlDelete); \n } catch (Exception $e) {\n \n }\n } */\n //cek data\n $sql = \"\n SELECT COUNT(*) \n FROM TM_HECTARE_STATEMENT\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR') = '{$this->_period}'\n AND AFD_CODE = TRIM('\".addslashes($data[1]).\"')\n AND BLOCK_CODE = TRIM('\".addslashes($data[2]).\"')\n \";\n $count = $this->_db->fetchOne($sql);\n if (($count == 0) && (($this->_siteCode == 'ALL') || (addslashes($data[11]) == 'PROYEKSI'))) {\n try {\n //kalkulasi maturity_stage\n $sql = \"\n SELECT TO_DATE('\".addslashes($data[9]).\"','DD-MM-RRRR') FROM DUAL\n \";\n $date = $this->_db->fetchOne($sql);\n $date = date('d-m-Y', strtotime($date));\n $maturity_stage = $this->_formula->get_MaturityStage($date);\n $array = array(\n \"POKOK_TANAM\" => $data[10],\n \"HA_PLANTED\" => $data[4]\n );\n $sph = $this->_formula->cal_Upload_Sph($array);\n \n //insert data\n $sql = \"\n INSERT INTO TM_HECTARE_STATEMENT \n (PERIOD_BUDGET, BA_CODE, AFD_CODE, BLOCK_CODE, BLOCK_DESC, HA_PLANTED, TOPOGRAPHY, LAND_TYPE, PROGENY, LAND_SUITABILITY, TAHUN_TANAM, POKOK_TANAM, SPH, MATURITY_STAGE_SMS1, MATURITY_STAGE_SMS2, STATUS, INSERT_USER, INSERT_TIME)\n VALUES (\n TO_DATE('{$this->_period}','DD-MM-RRRR'),\n TRIM('\".addslashes($data[0]).\"'),\n TRIM('\".addslashes($data[1]).\"'),\n TRIM('\".addslashes($data[2]).\"'),\n TRIM('\".addslashes($data[3]).\"'),\n REPLACE('\".addslashes($data[4]).\"', ',', ''),\n TRIM('\".addslashes($data[5]).\"'),\n TRIM('\".addslashes($data[6]).\"'),\n TRIM('\".addslashes($data[7]).\"'),\n TRIM('\".addslashes($data[8]).\"'),\n TO_DATE('\".addslashes($data[9]).\"','DD-MM-RRRR'),\n REPLACE('\".addslashes($data[10]).\"', ',', ''),\n REPLACE('\".addslashes($sph).\"', ',', ''),\n '\".addslashes($maturity_stage[1]).\"',\n '\".addslashes($maturity_stage[2]).\"',\n '\".addslashes($data[11]).\"',\n '{$this->_userName}',\n SYSDATE\n ) \n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $ins_rec++;\n \n //TAMBAHAN untuk otomatis generate RKT turunan ketika upload HS : SABRINA 26/07/2014\n $gen_inherit[$ins_rec]['BA_CODE'] = addslashes($data[0]);\n $gen_inherit[$ins_rec]['AFD_CODE'] = addslashes($data[1]);\n $gen_inherit[$ins_rec]['BLOCK_CODE'] = addslashes($data[2]);\n $gen_inherit[$ins_rec]['STATUS'] = addslashes($data[11]);\n $gen_inherit[$ins_rec]['MATURITY_STAGE_SMS1'] = addslashes($maturity_stage[1]);\n $gen_inherit[$ins_rec]['MATURITY_STAGE_SMS2'] = addslashes($maturity_stage[2]);\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'MASTER HA STATEMENT', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'MASTER HA STATEMENT', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n // cek apakah data non-aktif\n $sql = \"\n SELECT COUNT(*) \n FROM TM_HECTARE_STATEMENT\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR') = '{$this->_period}'\n AND AFD_CODE = TRIM('\".addslashes($data[1]).\"')\n AND BLOCK_CODE = TRIM('\".addslashes($data[2]).\"')\n AND DELETE_USER IS NULL\n \";\n $count = $this->_db->fetchOne($sql);\n \n if (($count == 0) && (($this->_siteCode == 'ALL') || (addslashes($data[11]) == 'PROYEKSI'))) {\n //kalkulasi maturity_stage\n $sql = \"\n SELECT TO_DATE('\".addslashes($data[9]).\"','DD-MM-RRRR') FROM DUAL\n \";\n $date = $this->_db->fetchOne($sql);\n $date = date('d-m-Y', strtotime($date));\n $maturity_stage = $this->_formula->get_MaturityStage($date);\n $array = array(\n \"POKOK_TANAM\" => $data[10],\n \"HA_PLANTED\" => $data[4]\n );\n $sph = $this->_formula->cal_Upload_Sph($array);\n \n // update data menjadi aktif jika sebelumnya telah dinon-aktifkan\n try {\n $sql = \"\n UPDATE TM_HECTARE_STATEMENT\n SET HA_PLANTED = REPLACE('\".addslashes($data[4]).\"', ',', ''),\n TOPOGRAPHY = TRIM('\".addslashes($data[5]).\"'), \n LAND_TYPE = TRIM('\".addslashes($data[6]).\"'), \n PROGENY = TRIM('\".addslashes($data[7]).\"'), \n LAND_SUITABILITY = TRIM('\".addslashes($data[8]).\"', \n TAHUN_TANAM = TO_DATE('\".addslashes($data[9]).\"','DD-MM-RRRR'),\n POKOK_TANAM = REPLACE('\".addslashes($data[10]).\"', ',', ''),\n SPH = REPLACE('\".addslashes($sph).\"', ',', ''),\n MATURITY_STAGE_SMS1 = '\".addslashes($maturity_stage[1]).\"',\n MATURITY_STAGE_SMS2 = '\".addslashes($maturity_stage[2]).\"',\n STATUS = TRIM('\".addslashes($data[11]).\"'), \n UPDATE_USER = '{$this->_userName}',\n UPDATE_TIME = SYSDATE,\n DELETE_USER = NULL,\n DELETE_TIME = NULL\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR') = '{$this->_period}'\n AND AFD_CODE = TRIM('\".addslashes($data[1]).\"')\n AND BLOCK_CODE = TRIM('\".addslashes($data[2]).\"')\n \";\n $this->_db->query($sql);\n $this->_db->commit();\n \n $sql = \"\n UPDATE TM_HECTARE_STATEMENT_DETAIL\n SET UPDATE_USER = '{$this->_userName}',\n UPDATE_TIME = SYSDATE,\n DELETE_USER = NULL,\n DELETE_TIME = NULL\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR') = '{$this->_period}'\n AND AFD_CODE = TRIM('\".addslashes($data[1]).\"')\n AND BLOCK_CODE = TRIM('\".addslashes($data[2]).\"')\n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $update_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'MASTER HA STATEMENT', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'MASTER HA STATEMENT', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n }\n }\n $lastBaCode = addslashes($data[0]);\n }\n $total_rec++;\n } while ($data = fgetcsv($handle,1000,\",\",\"'\"));\n //\n $return = array(\n 'status' => 'done',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }else{\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }\n \n //Generate data turunan ketika upload HS : SABRINA 26/07/2014\n if (!empty($gen_inherit)) { \n foreach ($gen_inherit as $idx => $row) {\n $this->_generateData->genMasterOerBa($row); //trigger baru di BPS II YIR-input Master OER BA \n $this->_generateData->genHectareStatementDetail($row); //menggantikan trigger yang ada di DB saat BPS I\n \n //jika kode AFD mengandung ZZ_ maka TIDAK AKAN generate lokasi distribusi VRA non infra\n if (substr($row['AFD_CODE'], 0, 3) <> 'ZZ_'){\n $this->_generateData->genLocationDistribusiVra($row); //menggantikan trigger yang ada di DB saat BPS I\n }\n \n // jika kode blok mengandung ZZ_ maka hanya generate perkerasan jalan negara\n if (substr($row['BLOCK_CODE'], 0, 3) == 'ZZ_'){\n $row['UI_RKT_CODE'] = 'RKT004'; $this->_generateData->genRktPerkerasanJalanNegara($row); //trigger baru di BPS II\n }else{\n $row['UI_RKT_CODE'] = 'RKT001'; $this->_generateData->genRkt($row); //trigger baru di BPS II\n $row['UI_RKT_CODE'] = 'RKT002'; $this->_generateData->genRkt($row); //trigger baru di BPS II\n $row['UI_RKT_CODE'] = 'RKT003'; $this->_generateData->genRkt($row); //trigger baru di BPS II\n $row['UI_RKT_CODE'] = 'RKT005'; $this->_generateData->genRkt($row); //trigger baru di BPS II\n $row['UI_RKT_CODE'] = 'RKT006'; $this->_generateData->genRkt($row); //trigger baru di BPS II\n $row['UI_RKT_CODE'] = 'RKT023'; $this->_generateData->genRkt($row); //trigger baru di BPS II\n $row['UI_RKT_CODE'] = 'RKT024'; $this->_generateData->genRkt($row); //trigger baru di BPS II //added by NBU 11.09.2015 TANAM SISIP \n $this->_generateData->genRktPanen($row); //trigger baru di BPS II\n $row['UI_RKT_CODE'] = 'RKT004'; $this->_generateData->genRktPerkerasanJalan($row); //trigger baru di BPS II\n $this->_generateData->genRktPupukHa($row); //trigger baru di BPS II\n $this->_generateData->genNormaPanenCostUnit($row); //trigger baru di BPS II\n }\n }\n }\n \n return $return;\n }", "function cc_elabora_file_xml($offerte){\n\t\n\tglobal $wpdb; // oggetto interazione DB di WordPress\n\t\n\t// path dove si trova file xml sorgente, config.xml e file di log\n\t$path = ABSPATH . \"import/\";\n\t\n\t$results = $deleted = array(); \n\t\n\t// apro file config (xml) da cui prendere data ultima elaborazione ed in cui memorizzare i risultati di elaborazione\n\t$config = @simplexml_load_file($path.\"configs.xml\");\n\tif(!$config){\n\t\t// file config non trovato notifico e esco \n\t\tcc_import_error(\"File config non trovato!\");\t\t\t\n\t}\n\t\t\n\t// recupero tutti gli id cometa già presenti in tabella postmeta. _id_cometa è un postmeta mio\n\t$record_presenti = cc_get_unique_post_meta_values(\"_id_cometa\"); // restituisce array con chiave post_id\n\t\n\t// recupero da file config data ultimo aggiornamento - NON PIU' UTILIZZATO, uso data all'interno del file xml\n\t//$last_update = new DateTime( (string) $config->lastUpdate );\n\t\n\t// contatore record\n\t$line = 0;\n\t\n\t// loop offerte da xml sorgente\n\tforeach($offerte as $offerta){\n\t\t\n\t\t$line++;\n\t\tcc_import_immobili_error_log($line); // aggiorno log elaborazione con numero progressivo record \n\t\t\n\t\t$idunique = (int) $offerta->Idimmobile; // campo univoco Cometa\n\t\t$rif = (string) $offerta->Riferimento; // Rif / codice immoible\n\t\t$contratto = (string) $offerta->Contratto; // il tipo di contratto (Vendita o Affitto)\n\t\t$hasfoto = (empty((string) $offerta->FOTO1)) ? false : true;\n\t\t\n\t\tcc_import_immobili_error_log($rif); // aggiorno log elaborazione con il rif immobile\n\t\t\n\t\t// non importo gli immobili in affitto e quelli senza foto\n\t\tif($contratto == \"Affitto\" or !$hasfoto){\n\t\t\t\n\t\t\t// aggiorno contatori in file config.xml. L'ultimo param in cc_update_configs indica di incrementare il valore già presente\n\t\t\tif($contratto == \"Affitto\") cc_update_configs(\"affitto\", 1, true); // aggiorno contatore affitti\n\t\t\tif(!$hasfoto) cc_update_configs(\"nofoto\", 1, true); // aggiorno contatore affitti\n\t\t\t\n\t\t\t// registro motivo perché salto importazione in file di log\n\t\t\t$whyskipped = \"Saltato perche contratto \".$contratto;\n\t\t\tif(!$hasfoto) $whyskipped .= \" e non ha foto\";\n\t\t\tcc_import_immobili_error_log($whyskipped);\n\t\t\tcontinue; // passo al prossimo record immobile\n\t\t} \n\t\t\n\t\t// Recupero ultima data modifica dell'immobile su Cometa\n\t\t$DataAggiornamento = (string) $offerta->DataAggiornamento;\n\t\t$DataAggiornamento = substr($DataAggiornamento, 0, -6); // elimino +1:00 da valore data se no non è allineato con tempo server\t\t\n\t\t$data_ultima_modifica_record = new DateTime( $DataAggiornamento );\t// creo oggetto DateTime\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t// controllo se l'id del record è già presente in DB e decido dunque se richiamare funzione di insert o update\n\t\tif(in_array($idunique, $record_presenti)){\n\t\t\t\t\t\t\n\t\t\t// è già presente in db - richiamo funzione che aggiorna record passando id tabella posts e oggetto xml dell'offerta\n\t\t\t$post = array_search($idunique, $record_presenti); // recupero chiave array che è post_id\n\t\t\t\n\t\t\t// recupero data ultimo aggiornamento record in tabella posts\n\t\t\t$md = get_the_modified_time( \"Y-m-d H:i:s\", $post );\n\t\t\t$post_last_modified = new DateTime( $md );\n\t\t\t\n\t\t\t// se la data dell'ultimo aggiornamento record in posts è maggiore della data di modifica in Cometa \n\t\t\t// aumento contatore skipped, tolgo id da elenco record da cancellare e passo al record successivo\n\t\t\tif($post_last_modified >= $data_ultima_modifica_record){\n\t\t\t\t\n\t\t\t\t// rimuovo immobile da elenco già presenti - a fine lavoro quelli rimasti verranno eliminati da DB\n\t\t\t\tunset($record_presenti[$post]); \n\t\t\t\t\n\t\t\t\t// aggiorno log e contatore in config.xml\n\t\t\t\t$msg_skipped = \"Record \".$post.\" DATA RECORD XML: \".$data_ultima_modifica_record->format(\"Y-m-d H:i:s\");\n\t\t\t\t$msg_skipped .= \" DATA RECORD IN POSTS: \".$post_last_modified->format(\"Y-m-d H:i:s\");\n\t\t\t\tcc_import_immobili_error_log(\"skipped\");\n\t\t\t\tcc_update_configs(\"skipped\", 1, true);// incremento valore di skipped di uno\n\t\t\t\tcontinue; // il record non è stato modificato, passo al prossimo record\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t/**\n\t\t\t * Richiamo funzione cc_update_record che aggiorna record in DB\n\t\t\t * \n\t\t\t * @param $post: post_id in tabella postmeta\n\t\t\t * @param $offerta: oggetto xml del singolo immobile\n\t\t\t * @return string con valore \"updated\" o errore rilevato\n\t\t\t */\n\t\t\t$results[$rif] = cc_update_record($post, $offerta); \n\t\t\t\n\t\t\t// elimino da record_presenti questo record. quelli che alla fine rimangono verranno cancellati\n\t\t\tunset($record_presenti[$post]); \n\t\t\t\n\t\t}else{\n\t\t\t/**\n\t\t\t * Record nuovo. Richiamo funzione cc_insert_record che inserisce un nuovo record in DB\n\t\t\t * \n\t\t\t * @param $offerta: oggetto xml del singolo immobile\n\t\t\t * @return string con valore \"inserted\" o errore rilevato\n\t\t\t */\n\t\t\t$results[$rif] = cc_insert_record($offerta);\n\t\t\t// aggiungo dicitura inserted in file log per indicare che il record è stato inserito con successo\n\t\t\tcc_import_immobili_error_log(\"inserted\"); \n\n\t\t}\n\t\t\n\t} // end foreach $offerte - finito elabroazione di tutti i record presenti nel file xml\n\t\n\t/* Procedura di cancellazione immobili non più presenti\n\t * Se l'array record_presenti non è vuoto vuol dire che uno o più immobili attualmente in db non sono più\n\t * presenti su Cometa esportazione ergo sono da cancellare da db\n\t *\n\t * @param $id2delete: id record in wp_posts\n\t * @param $id_cometa: id univoco Cometa, non utilizzato in questo frangente\n\t */\t\n\tif(!empty($record_presenti)){\n\t\t// loop record\n\t\tforeach($record_presenti as $id2delete => $id_cometa){\n\t\t\t// uso funzione di WP per cancellare record da posts\n\t\t\t$deleted = wp_delete_post( $id2delete, false ); // 2° param indica se il record dev'essere spostato in cestino (false) o se dev'essere cancellato (true)\n\t\t\tcc_update_configs(\"deleted\", 1, true); // incremento contatore deleted di 1 in config.xml\n\t\t}\n\t\t// aggiorno log con elenco degli immobili cencellati\n\t\t$msg = implode(\", \", $record_presenti);\n\t\tcc_import_immobili_error_log(\"Deleted: \".$msg);\n\t}\n\t\n\t/* Restituisci a cc_import_xml_file() array con chiave Rif e come valore \"inserted\", \"updated\" \n\t * o errore rilevato (risultato di cc_insert_record() o cc_update_record() )\n\t*/\n\treturn $results; \n\t\n}", "function imprimir_voucher_estacionamiento($numero,$chofer,$patente,$horainicio,$horatermino,$montototal,$comentario,$correlativopapel,$cliente,$fecha_termino,$fecha_inicio_2){\ntry {\n // Enter the share name for your USB printer here\n //$connector = null; \n //$connector = new WindowsPrintConnector(\"EPSON TM-T81 Receipt\");\n $connector = new WindowsPrintConnector(\"EPSON TM-T20 Receipt\");\n // $connector = new WindowsPrintConnector(\"doPDF 8\");\n /* Print a \"Hello world\" receipt\" */\n $printer = new Printer($connector);\n\n \n $date=new DateTime();\n $fecha = $date->format('d-m-Y');\n\n\n $Chofer = $chofer;\n $Patente = $patente;\n $serie = $numero;\n $img = EscposImage::load(\"logo1.png\");\n $printer -> graphics($img);\n \n \n $printer -> text(\"Numero : $serie\\n\");\n $printer -> text(\"Chofer : $Chofer\\n\");\n $printer -> text(\"Patente: $Patente\\n\");\n\n if ($cliente != 0) {\n include_once(\"conexion.php\");\n $con = new DB;\n $buscarpersona = $con->conectar();\n $strConsulta = \"select * from cliente where rut_cliente ='$cliente'\";\n $buscarpersona = mysql_query($strConsulta);\n $numfilas = mysql_num_rows($buscarpersona);\n $row = mysql_fetch_assoc($buscarpersona);\n $nombre_cliente = $row['nombre_cliente'];\n //var_dump($numfilas);\n if($numfilas >= 1){\n $printer -> text(\"Cliente: $nombre_cliente\\n\");\n }\n \n }\n \n if ($correlativopapel != 0) {\n $printer -> text(\"\\nCorrelativo : $correlativopapel\\n\");\n }\n $printer -> text(\"Fecha Inicio : $fecha_inicio_2\\n\");\n $printer -> text(\"Hora de inicio : $horainicio\\n\");\n\n\n\n if ($horatermino != 0) {\n $printer -> text(\"Fecha de Termino: $fecha_termino\\n\");\n $printer -> text(\"Hora de Termino : $horatermino\\n\"); \n }\n \n \n if ($montototal != 0) {\n $printer -> text('Monto total : $'.$montototal);\n }\n \n if ($horatermino != 0) {\n $printer -> text(\"\\n\");\n $printer -> text(\"\\n\\n\");\n $printer -> text(\"Firma: _________________\\n\");\n \n }\n $printer -> text(\"$comentario\\n\");\n $printer -> cut();\n /* Close printer */\n $printer -> close();\n\n echo \"<div class='alert alert-success'><strong>Impresion Correcta $comentario</strong></div>\";\n} catch (Exception $e) {\n echo \"No se pudo imprimir \" . $e -> getMessage() . \"\\n\";\n}\n}", "public function AdicionarConvenio($file, $id, $nomeEmpresa,){\n $formatP = array(\"pdf\");\n\n \n $extensao = pathinfo($file['name'], PATHINFO_EXTENSION);\n\n // echo \"$extensao\";\n\n if(in_array($extensao,$formatP)){\n // $caminho = \"../docs/\".$tipo.\"/\";\n $temp = $file['tmp_name'];\n\n $this->PrepraDiretorioDoc($id);\n\n $inserirDOC = \"UPDATE empresa set DOC_Convenio = :nomeArquivo WHERE CD_Empresa = :idEmpresa\";\n $caminho = \"C:/xampp/htdocs/projeto_final/startechlds/docs/DOC_Convenio/\";\n $doc = \"DOC_Curriculo\";\n\n $nomeArquivo = $nomeEmpresa.\"_Convenio\";\n if(move_uploaded_file($temp, $caminho.$nomeArquivo.\".pdf\")){\n try{\n $conn = new ConexaoBD();\n $conect = $conn->ConDB();\n\n $result = $conect->prepare($inserirDOC);\n $result->bindParam(':nomeArquivo', $nomeArquivo, PDO::PARAM_STR);\n $result->bindParam(':idEmpresa', $id, PDO::PARAM_INT);\n $result->execute();\n\n \n\n $funcionou = $result->rowCount();\n \n \n if($funcionou > 0){\n return true;\n }\n else{\n // echo\"não retornou linha nenhuma\";\n return false;\n }\n }\n catch(PDOException $e){\n echo \"erro de PDO \".$e->getMessage();\n }\n\n }\n else{\n echo\"erro ao mover para pasta<br/>\";\n // var_dump(move_uploaded_file($temp, $this->caminhoCurriculo.$nomeAluno.\".pdf\"));\n }\n\n }\n else{\n echo \"Formato inválido\";\n }\n\n }", "function agregar_nueva_poliza($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion){\n\t\n\t//VEO SI SE HA HECHO CLICK EN EL BOTON GUARDAR\n\tif(isset($_POST['btnGuardar'])) {\n\t\t\n\t\t\t$id_ef_cia = base64_decode($_GET['id_ef_cia']);\t\n\t\t \n\t\t\t//SEGURIDAD\n\t\t\t$num_poliza = $conexion->real_escape_string($_POST['txtPoliza']);\n\t\t\t$fecha_ini = $conexion->real_escape_string($_POST['txtFechaini']);\n\t\t\t$fecha_fin = $conexion->real_escape_string($_POST['txtFechafin']);\n\t\t\t$producto = $conexion->real_escape_string($_POST['txtProducto']);\n\t\t\t//GENERAMOS EL ID CODIFICADO UNICO\n\t\t\t$id_new_poliza = generar_id_codificado('@S#1$2013');\t\t\t\t\t\n\t\t\t//METEMOS LOS DATOS A LA BASE DE DATOS\n\t\t\t$insert =\"INSERT INTO s_poliza(id_poliza, no_poliza, fecha_ini, fecha_fin, producto, id_ef_cia) \"\n\t\t\t\t .\"VALUES('\".$id_new_poliza.\"', '\".$num_poliza.\"', '\".$fecha_ini.\"', '\".$fecha_fin.\"', '\".$producto.\"', '\".$id_ef_cia.\"')\";\n\t\t\t\n\t\t\t\n\t\t\t//VERIFICAMOS SI HUBO ERROR EN EL INGRESO DEL REGISTRO\n\t\t\tif($conexion->query($insert)===TRUE){\n\t\t\t\t\t\t\t\t\n\t\t\t\t$mensaje=\"Se registro correctamente los datos del formulario\";\n\t\t\t header('Location: index.php?l=des_poliza&var='.$_GET['var'].'&listarpolizas=v&id_ef_cia='.$_GET['id_ef_cia'].'&entidad='.$_GET['entidad'].'&compania='.$_GET['compania'].'&id_ef='.base64_encode($_GET['id_ef']).'&producto_nombre='.$_GET['producto_nombre'].'&producto_code='.$_GET['producto_code'].'&op=1&msg='.base64_encode($mensaje));\n\t\t\t exit;\n\t\t\t} else {\n\t\t\t\t$mensaje=\"Hubo un error al ingresar los datos, consulte con su administrador \".$conexion->errno.\": \".$conexion->error;\n\t\t\t header('Location: index.php?l=des_poliza&var='.$_GET['var'].'&listarpolizas=v&id_ef_cia='.$_GET['id_ef_cia'].'&entidad='.$_GET['entidad'].'&compania='.$_GET['compania'].'&id_ef='.base64_encode($_GET['id_ef']).'&producto_nombre='.$_GET['producto_nombre'].'&producto_code='.$_GET['producto_code'].'&op=2&msg='.base64_encode($mensaje));\n\t\t\t\texit;\n\t\t\t}\n\t\t\n\t}else {\n\t\t//MUESTRO EL FORM PARA CREAR UNA CATEGORIA\n\t\tmostrar_crear_poliza($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion);\n\t}\n}" ]
[ "0.655863", "0.6434376", "0.6365461", "0.62790376", "0.6234492", "0.62033105", "0.6190452", "0.6166531", "0.61564916", "0.6148032", "0.613789", "0.61157817", "0.6113524", "0.61007047", "0.6095197", "0.6093179", "0.60905313", "0.6047786", "0.6042181", "0.6005371", "0.59960717", "0.59739655", "0.5964572", "0.59447706", "0.59250104", "0.59242004", "0.5915429", "0.5882388", "0.58308935", "0.58268785", "0.5818718", "0.58027", "0.5801346", "0.57979107", "0.57971305", "0.5793244", "0.5784664", "0.5773563", "0.57684165", "0.5764505", "0.57594293", "0.5759289", "0.57581925", "0.5755575", "0.57540286", "0.5750436", "0.5748028", "0.57429934", "0.57347053", "0.5727277", "0.5721981", "0.5721091", "0.57161546", "0.57117397", "0.56947446", "0.5689314", "0.5687691", "0.56812847", "0.56779253", "0.5677733", "0.56718487", "0.5669778", "0.56660384", "0.56491053", "0.5644423", "0.5641705", "0.56382155", "0.5637573", "0.56343377", "0.56319135", "0.5626905", "0.5625831", "0.5624943", "0.5622873", "0.5616024", "0.5612223", "0.5609798", "0.56033015", "0.5601507", "0.560036", "0.55916184", "0.5588719", "0.5585871", "0.55858094", "0.5584287", "0.558312", "0.55739576", "0.5568491", "0.5567984", "0.5562617", "0.5561319", "0.55612403", "0.5561039", "0.5559424", "0.5551911", "0.5550981", "0.5550159", "0.55479175", "0.55464053", "0.5545906", "0.5545528" ]
0.0
-1