├── .gitignore ├── FS MINI PROJECT ├── Debug │ ├── FS MINI PROJECT.exe │ ├── FS MINI PROJECT.ilk │ └── FS MINI PROJECT.pdb ├── FS MINI PROJECT.sln └── FS MINI PROJECT │ ├── Debug │ ├── FS MINI PROJECT.log │ ├── FS MINI PROJECT.obj │ ├── FS MINI PROJECT.tlog │ │ ├── CL.command.1.tlog │ │ ├── CL.read.1.tlog │ │ ├── CL.write.1.tlog │ │ ├── FS MINI PROJECT.lastbuildstate │ │ ├── link.command.1.tlog │ │ ├── link.read.1.tlog │ │ └── link.write.1.tlog │ ├── fs mini project.new.obj.enc │ ├── vc142.idb │ └── vc142.pdb │ ├── FS MINI PROJECT.cpp │ ├── FS MINI PROJECT.vcxproj │ ├── FS MINI PROJECT.vcxproj.filters │ └── FS MINI PROJECT.vcxproj.user └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | -------------------------------------------------------------------------------- /FS MINI PROJECT/Debug/FS MINI PROJECT.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SHARANHS/File-Structures-Mini-Project-/b63e41faf09c12aec41449f9368cb687fb4f234c/FS MINI PROJECT/Debug/FS MINI PROJECT.exe -------------------------------------------------------------------------------- /FS MINI PROJECT/Debug/FS MINI PROJECT.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SHARANHS/File-Structures-Mini-Project-/b63e41faf09c12aec41449f9368cb687fb4f234c/FS MINI PROJECT/Debug/FS MINI PROJECT.ilk -------------------------------------------------------------------------------- /FS MINI PROJECT/Debug/FS MINI PROJECT.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SHARANHS/File-Structures-Mini-Project-/b63e41faf09c12aec41449f9368cb687fb4f234c/FS MINI PROJECT/Debug/FS MINI PROJECT.pdb -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.28803.352 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FS MINI PROJECT", "FS MINI PROJECT\FS MINI PROJECT.vcxproj", "{9567FB7E-5D5C-4B88-80E8-80591C636537}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {9567FB7E-5D5C-4B88-80E8-80591C636537}.Debug|x64.ActiveCfg = Debug|x64 17 | {9567FB7E-5D5C-4B88-80E8-80591C636537}.Debug|x64.Build.0 = Debug|x64 18 | {9567FB7E-5D5C-4B88-80E8-80591C636537}.Debug|x86.ActiveCfg = Debug|Win32 19 | {9567FB7E-5D5C-4B88-80E8-80591C636537}.Debug|x86.Build.0 = Debug|Win32 20 | {9567FB7E-5D5C-4B88-80E8-80591C636537}.Release|x64.ActiveCfg = Release|x64 21 | {9567FB7E-5D5C-4B88-80E8-80591C636537}.Release|x64.Build.0 = Release|x64 22 | {9567FB7E-5D5C-4B88-80E8-80591C636537}.Release|x86.ActiveCfg = Release|Win32 23 | {9567FB7E-5D5C-4B88-80E8-80591C636537}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {159E7B74-EA51-445A-9CB8-A5D9EA52C258} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.log: -------------------------------------------------------------------------------- 1 |  FS MINI PROJECT.cpp 2 | FS MINI PROJECT.vcxproj -> D:\softwares\FS MINI PROJECT\Debug\FS MINI PROJECT.exe 3 | -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SHARANHS/File-Structures-Mini-Project-/b63e41faf09c12aec41449f9368cb687fb4f234c/FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.obj -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SHARANHS/File-Structures-Mini-Project-/b63e41faf09c12aec41449f9368cb687fb4f234c/FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SHARANHS/File-Structures-Mini-Project-/b63e41faf09c12aec41449f9368cb687fb4f234c/FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SHARANHS/File-Structures-Mini-Project-/b63e41faf09c12aec41449f9368cb687fb4f234c/FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.tlog/FS MINI PROJECT.lastbuildstate: -------------------------------------------------------------------------------- 1 | #TargetFrameworkVersion=v4.0:PlatformToolSet=v142:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0 2 | Debug|Win32|D:\softwares\FS MINI PROJECT\| 3 | -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SHARANHS/File-Structures-Mini-Project-/b63e41faf09c12aec41449f9368cb687fb4f234c/FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SHARANHS/File-Structures-Mini-Project-/b63e41faf09c12aec41449f9368cb687fb4f234c/FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SHARANHS/File-Structures-Mini-Project-/b63e41faf09c12aec41449f9368cb687fb4f234c/FS MINI PROJECT/FS MINI PROJECT/Debug/FS MINI PROJECT.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/Debug/fs mini project.new.obj.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SHARANHS/File-Structures-Mini-Project-/b63e41faf09c12aec41449f9368cb687fb4f234c/FS MINI PROJECT/FS MINI PROJECT/Debug/fs mini project.new.obj.enc -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/Debug/vc142.idb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SHARANHS/File-Structures-Mini-Project-/b63e41faf09c12aec41449f9368cb687fb4f234c/FS MINI PROJECT/FS MINI PROJECT/Debug/vc142.idb -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/Debug/vc142.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SHARANHS/File-Structures-Mini-Project-/b63e41faf09c12aec41449f9368cb687fb4f234c/FS MINI PROJECT/FS MINI PROJECT/Debug/vc142.pdb -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/FS MINI PROJECT.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | using namespace std; 8 | 9 | int no = 0; 10 | char rec_ind[5], rec_gender[5],rec_desc[55]; 11 | int rec_flag = 0; 12 | 13 | struct record 14 | { 15 | char age[5], ind[5]; 16 | char name[30]; 17 | char id[20]; 18 | char gender[10]; 19 | char description[100]; 20 | }rec[20]; 21 | 22 | struct index 23 | { 24 | char id[20], ind[20]; 25 | }in[20], temp; 26 | 27 | void sort_index() 28 | { 29 | int i, j; 30 | for (i = 0;i < no - 1;i++) 31 | for (j = 0;j < no - i - 1;j++) 32 | if (strcmp(in[j].id, in[j + 1].id) > 0) 33 | { 34 | temp = in[j]; 35 | in[j] = in[j + 1]; 36 | in[j + 1] = temp; 37 | } 38 | } 39 | 40 | void retrive_record(char* ind) 41 | { 42 | int flag = 0, i = 0; 43 | fstream f9; 44 | f9.open("record.txt", ios::in); 45 | while (!f9.eof()) 46 | { 47 | f9.getline(rec[i].ind, 5, '|'); 48 | f9.getline(rec[i].id, 20, '|'); 49 | f9.getline(rec[i].name, 30, '|'); 50 | f9.getline(rec[i].age, 5, '|'); 51 | f9.getline(rec[i].gender, 10, '|'); 52 | f9.getline(rec[i].description, 100, '\n'); 53 | i++; 54 | } 55 | for (int j = 0;j < i;j++) 56 | { 57 | if (strcmp(rec[j].ind, ind) == 0) 58 | { 59 | strcpy_s(rec_ind, ind); 60 | rec_flag = 1; 61 | std::cout << "Patient record found\n"; 62 | std::cout << rec[j].id << "|" << rec[j].name << "|" << rec[j].age << "|" << rec[j].gender << "|" << rec[j].description << "\n"; 63 | return; 64 | } 65 | } 66 | 67 | } 68 | 69 | 70 | int search_index(char* id) 71 | { 72 | int flag = 0; 73 | fstream ff; 74 | ff.open("index.txt", ios::in); 75 | int i = 0; 76 | while (!ff.eof()) 77 | { 78 | ff.getline(in[i].id, 20, '|'); 79 | ff.getline(in[i].ind, 20, '\n'); 80 | i++; 81 | 82 | } 83 | for (int j = 0;j < i;j++) 84 | { 85 | if (strcmp(in[j].id, id) == 0) 86 | { 87 | retrive_record(in[j].ind); 88 | flag = 1; 89 | } 90 | } 91 | //cout <<"flag is"<< flag ; 92 | if (flag) 93 | { 94 | return 1; 95 | } 96 | else 97 | return -1; 98 | } 99 | 100 | int search_id(char* id, int j) 101 | { 102 | int flag = 0; 103 | for (int i = 0;i < j;i++) 104 | if (strcmp(rec[i].id, id) == 0) 105 | { 106 | flag = 1; 107 | break; 108 | } 109 | if (flag) 110 | return 1; 111 | else 112 | return -1; 113 | } 114 | 115 | 116 | 117 | 118 | void delet(char* st_id) 119 | { 120 | rec_flag = 0; 121 | int fr = 0; 122 | rec_flag = search_index(st_id); 123 | if (!rec_flag) 124 | { 125 | std::cout << "deletion faild record not found\n"; 126 | return; 127 | } 128 | 129 | for (int i = 0;i < no;i++) 130 | { 131 | if (strcmp(rec[i].ind, rec_ind) == 0) 132 | { 133 | fr = i; 134 | break; 135 | } 136 | } 137 | for (int i = fr;i < no - 1;i++) 138 | { 139 | rec[i] = rec[i + 1]; 140 | char str[3]; 141 | sprintf_s(str, "%d", i); 142 | strcpy_s(rec[i].ind, str); 143 | } 144 | no--; 145 | 146 | fstream f1, f2, f3; 147 | f1.open("record.txt", ios::out); 148 | f2.open("index.txt", ios::out); 149 | f3.open("no.txt", ios::out); 150 | f3 << no; 151 | f3.close(); 152 | 153 | for (int i = 0;i < no;i++) 154 | { 155 | 156 | strcpy_s(in[i].id, rec[i].id); 157 | strcpy_s(in[i].ind, rec[i].ind); 158 | 159 | } 160 | sort_index(); 161 | 162 | for (int i = 0;i < no;i++) 163 | { 164 | f1 << rec[i].ind << "|" << rec[i].id << "|" << rec[i].name << "|" << rec[i].age << "|" << rec[i].gender << "|" << rec[i].description << "\n"; 165 | f2 << in[i].id << "|" << in[i].ind << "\n"; 166 | 167 | } 168 | 169 | f1.close(); 170 | f2.close(); 171 | 172 | std::cout << "deletion successful\n"; 173 | } 174 | 175 | int owner_authen() { 176 | char o_username[20], o_password[20]; 177 | char o_user[20] = "admin", o_pass[20] = "admi"; 178 | cout << endl << endl; 179 | cout.width(25); 180 | cout << "Enter Doctors User id and Password\n" << "------------------------------------------------------------------------------------\n"; 181 | cout << endl << "username: "; 182 | cin >> o_username; 183 | cout << "password: "; 184 | cin >> o_password; 185 | cout << "------------------------------------------------------------------------------------\n"; 186 | if (strcmp(o_username, o_user) == 0 && strcmp(o_password, o_pass) == 0) 187 | return 1; 188 | else 189 | return 0; 190 | } 191 | 192 | void ret_gender(char* gender) 193 | { 194 | 195 | int flag = 0; 196 | for (int i = 0;i < no;i++) 197 | { 198 | if (strcmp(rec[i].gender, gender) == 0) 199 | { 200 | strcpy_s(rec_gender, gender); 201 | rec_flag = 1; 202 | std::cout << "patient record found\n"; 203 | std::cout << rec[i].id << "|" << rec[i].name << "|" << rec[i].age << "|" << rec[i].gender << "|" << rec[i].description << "\n"; 204 | 205 | } 206 | } 207 | 208 | } 209 | 210 | void ret_desc(char* description) 211 | { 212 | 213 | int flag = 0; 214 | for (int i = 0;i < no;i++) 215 | { 216 | if (strcmp(rec[i].description, description) == 0) 217 | { 218 | strcpy_s(rec_desc, description); 219 | rec_flag = 1; 220 | std::cout << "patient record found\n"; 221 | std::cout << rec[i].id << "|" << rec[i].name << "|" << rec[i].age << "|" << rec[i].gender << "|" << rec[i].description << "\n"; 222 | 223 | } 224 | } 225 | 226 | } 227 | 228 | 229 | 230 | int main() 231 | { 232 | fstream file1, file2, file4; 233 | 234 | cout << "---------------------------------------------------------------------------------------------------------------------"; 235 | std::cout << "\n\t\t\t \t * HOSPITAL MANAGEMENT SYSTEM * \n"; 236 | cout << "---------------------------------------------------------------------------------------------------------------------"; 237 | 238 | 239 | int ch; 240 | char ind[5], st_id[20], name[20], age[5], gender[10], description[30], id[10]; 241 | int i = 0, user; 242 | label: 243 | 244 | cout << "\n enter user : 1.doctor \t 2.patient \n"; 245 | std::cin >> user; 246 | switch (user) { 247 | case 1: { 248 | int check; 249 | check = owner_authen(); 250 | if (check == 1) 251 | { 252 | cout << "Welcome Doctor\n" << "------------------------------------------------------------------------------------\n"; 253 | while (1) 254 | { 255 | std::cout << " \n \t 1.Add \n \t 2.Search \n \t 3.Delete \n \t 4.Display \n \t 5.Update \n \t 6.Description based search \n \t 7. Gender based search \n \t 8.exit \n"; 256 | cin >> ch; 257 | switch (ch) 258 | { 259 | //add 260 | case 1: 261 | { 262 | 263 | 264 | file1.open("record.txt", ios::app | ios::out); 265 | 266 | int n; 267 | cout << "\n Enter no of patients \t"; 268 | cin >> n; 269 | cout << " Enter their details \n "; 270 | file4.open("no.txt", ios::in); 271 | file4 >> no; 272 | for (i = no;i < no + n;i++) 273 | { 274 | cout << "\n Enter " << i + 1 << " patient \n"; 275 | 276 | cout << " \n enter patient's id \t"; 277 | cin >> rec[i].id; 278 | std::cout << "\n Name: \t"; 279 | cin >> rec[i].name; 280 | std::cout << "\n Gender[m/f]: \t"; 281 | cin >> rec[i].gender; 282 | std::cout << "\n Age: \t"; 283 | cin >> rec[i].age; 284 | std::cout << "\n Description: \t"; 285 | cin >> rec[i].description; 286 | 287 | int q = search_id(rec[i].id, i); 288 | file1 << i << "|" << rec[i].id << "|" << rec[i].name << "|" << rec[i].age << "|" << rec[i].gender << "|" << rec[i].description << "\n"; 289 | } 290 | file1.close(); 291 | no = no + n; 292 | fstream file1, file3, file2; 293 | file3.open("no.txt", ios::out); 294 | file3 << no; 295 | file3.close(); 296 | file2.open("index.txt", ios::out); 297 | file1.open("record.txt", ios::in); 298 | for (i = 0;i < no;i++) 299 | { 300 | file1.getline(ind, 5, '|'); 301 | file1.getline(id, 20, '|'); 302 | file1.getline(name, 30, '|'); 303 | file1.getline(age, 10, '|'); 304 | file1.getline(gender, 50, '|'); 305 | file1.getline(description, 30, '\n'); 306 | strcpy_s(rec[i].ind, ind); 307 | 308 | strcpy_s(in[i].id, id); 309 | 310 | strcpy_s(in[i].ind, ind); 311 | } 312 | 313 | sort_index(); 314 | std::cout << "\n After sorting,index file contents are:\n"; 315 | for (i = 0;i < no;i++) 316 | std::cout << in[i].id << " " << in[i].ind << endl; 317 | for (i = 0;i < no;i++) 318 | { 319 | file2 << in[i].id << "|" << in[i].ind << "\n"; 320 | } 321 | file1.close(); 322 | file2.close(); 323 | 324 | break; 325 | 326 | } 327 | 328 | //search 329 | 330 | case 2: 331 | { 332 | fstream f4; 333 | f4.open("no.txt", ios::in); 334 | f4 >> no; 335 | //cout << no; 336 | cout << " \n Enter patient's id whose details are to be displayed: \t"; 337 | cin >> id; 338 | int q = search_index(id); 339 | if (q == 1) 340 | cout << "\n success search \n"; 341 | else 342 | cout << "\n unsuccess search \t"; 343 | 344 | break; 345 | } 346 | //deletion 347 | case 3: { 348 | cout << "\n Enter patient id who is to be deleted \n "; 349 | cin >> st_id; 350 | delet(st_id); 351 | break; 352 | } 353 | //display 354 | case 4: 355 | { 356 | fstream file1; 357 | file1.open("record.txt", ios::in); 358 | std::cout << "ID \t NAME\t AGE \t GENDER \t DESCRIPTION \n"; 359 | 360 | while (!file1.eof()) 361 | { 362 | file1.getline(ind, 5, '|'); 363 | file1.getline(id, 20, '|'); 364 | file1.getline(name, 30, '|'); 365 | file1.getline(age, 10, '|'); 366 | file1.getline(gender, 50, '|'); 367 | file1.getline(description, 30, '\n'); 368 | 369 | cout << id << "\t" << name << "\t" << age << "\t " << gender << "\t \t " << description << "\n" << endl; 370 | 371 | } 372 | file1.close(); 373 | break; 374 | 375 | } 376 | //exit 377 | case 8: 378 | { 379 | cout << "\n Ending prog"; 380 | goto label; 381 | 382 | } 383 | //gender 384 | case 7: 385 | { 386 | fstream f4; 387 | f4.open("no.txt", ios::in); 388 | f4 >> no; 389 | //cout << no; 390 | cout << "Enter the Gender to be searched upon: \t"; 391 | cin >> gender; 392 | ret_gender(gender); 393 | break; 394 | 395 | } 396 | //desc search 397 | case 6: 398 | { 399 | fstream f4; 400 | f4.open("no.txt", ios::in); 401 | f4 >> no; 402 | //cout << no; 403 | cout << "Enter the Description to be searched upon: \t"; 404 | cin >> description; 405 | ret_desc(description); 406 | break; 407 | 408 | } 409 | //update 410 | case 5: 411 | { 412 | 413 | rec_flag = 0; 414 | int fr = 0; 415 | cout << "\n Enter patientt's id to be updated : \t"; 416 | cin >> st_id; 417 | rec_flag = search_index(st_id); 418 | if (rec_flag == -1) 419 | { 420 | std::cout << "\n Failed record not found"; 421 | break; 422 | } 423 | 424 | for (int i = 0;i < no;i++) 425 | { 426 | if (strcmp(rec[i].ind, rec_ind) == 0) 427 | { 428 | std::cout << "\nThe old values of the patient record are "; 429 | std::cout << "\n id = " << rec[i].id; 430 | std::cout << "\n name = " << rec[i].name; 431 | std::cout << "\n age = " << rec[i].age; 432 | std::cout << "\n gender = " << rec[i].gender; 433 | 434 | std::cout << "\n description = " << rec[i].description; 435 | 436 | std::cout << "\nEnter the new values \n"; 437 | std::cout << "\nid = "; cin >> rec[i].id; 438 | std::cout << "\nname = "; cin >> rec[i].name; 439 | std::cout << "\nage = "; cin >> rec[i].age; 440 | std::cout << "\ngender = "; cin >> rec[i].gender; 441 | 442 | std::cout << "\n description = "; cin >> rec[i].description; 443 | break; 444 | } 445 | } 446 | 447 | fstream f1, f2; 448 | f1.open("record.txt", ios::out); 449 | f2.open("index.txt", ios::out); 450 | 451 | for (int i = 0;i < no;i++) 452 | { 453 | 454 | strcpy_s(in[i].id, rec[i].id); 455 | strcpy_s(in[i].ind, rec[i].ind); 456 | 457 | } 458 | sort_index(); 459 | for (int i = 0;i < no;i++) 460 | { 461 | f1 << rec[i].ind << "|" << rec[i].id << "|" << rec[i].name << "|" << rec[i].age << "|" << rec[i].gender << "|" << rec[i].description << "\n"; 462 | f2 << in[i].id << "|" << in[i].ind << "\n"; 463 | 464 | } 465 | 466 | f1.close(); 467 | f2.close(); 468 | std::cout << "\n updation successful\n"; 469 | 470 | 471 | } 472 | 473 | 474 | } 475 | } 476 | 477 | 478 | } 479 | else { 480 | 481 | cout << "\n Invalid login"; 482 | 483 | } 484 | 485 | 486 | 487 | 488 | break; 489 | 490 | 491 | } 492 | 493 | case 2: { 494 | fstream f4; 495 | f4.open("no.txt", ios::in); 496 | f4 >> no; 497 | cout << " \n Enter the Patient's id whose details are to be displayed \t"; 498 | cin >> id; 499 | int q = search_index(id); 500 | if (q == 1) 501 | cout << "\n success search"; 502 | else 503 | cout << "\n unsuccess search"; 504 | 505 | break; 506 | } 507 | 508 | 509 | } 510 | 511 | return 0; 512 | } -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/FS MINI PROJECT.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | {9567FB7E-5D5C-4B88-80E8-80591C636537} 24 | Win32Proj 25 | FSMINIPROJECT 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | Application 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v142 46 | Unicode 47 | 48 | 49 | Application 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | 76 | 77 | true 78 | 79 | 80 | false 81 | 82 | 83 | false 84 | 85 | 86 | 87 | 88 | 89 | Level3 90 | Disabled 91 | true 92 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 93 | true 94 | 95 | 96 | Console 97 | true 98 | 99 | 100 | 101 | 102 | 103 | 104 | Level3 105 | Disabled 106 | true 107 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 108 | true 109 | 110 | 111 | Console 112 | true 113 | 114 | 115 | 116 | 117 | 118 | 119 | Level3 120 | MaxSpeed 121 | true 122 | true 123 | true 124 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 125 | true 126 | 127 | 128 | Console 129 | true 130 | true 131 | true 132 | 133 | 134 | 135 | 136 | 137 | 138 | Level3 139 | MaxSpeed 140 | true 141 | true 142 | true 143 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 144 | true 145 | 146 | 147 | Console 148 | true 149 | true 150 | true 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/FS MINI PROJECT.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /FS MINI PROJECT/FS MINI PROJECT/FS MINI PROJECT.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # File-Structures-Mini-Project- 2 | Hospital Management System based on Primary Indexing 3 | --------------------------------------------------------------------------------