Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,385 changes: 841 additions & 1,544 deletions admin.php

Large diffs are not rendered by default.

1,108 changes: 1 addition & 1,107 deletions bulk.php

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions db_connect.SAMPLE.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
mysqli_select_db($db,"staff_db");





$stableYZ="CREATE TABLE IF NOT EXISTS Inorg (id int(11) NOT NULL auto_increment,
name varchar(300)NOT NULL,Phone varchar(300)NOT NULL,email varchar(100)NOT NULL,
website varchar(300)NOT NULL,year varchar(10)NOT NULL,pname varchar(1000)NOT NULL,type varchar(30)NOT NULL,
Expand All @@ -28,6 +27,7 @@
Type varchar(30)NOT NULL,Size decimal(10) NULL,
content longblob NOT NULL,PRIMARY KEY(id) )";
$db->query( $stable1);


$stable56="CREATE TABLE IF NOT EXISTS Users (id int(11) NOT NULL auto_increment,
Firstname varchar(200)NOT NULL,
Expand Down Expand Up @@ -56,7 +56,6 @@
$db->query($stable4);



$sql="SELECT * FROM Administrator ";
$result=mysqli_query($db,$sql);
$rowcount=mysqli_num_rows($result);
Expand All @@ -70,7 +69,7 @@
$querydy = "INSERT INTO Files (Title,Name,Size,Type) ".
"VALUES ('Staff','staff.csv','76','application/vnd.ms-excel')";
$db->query($querydy) or die('Errorr, query failed to upload');

}


Expand Down
56 changes: 51 additions & 5 deletions db_connect.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,60 @@
<?php

$db = new mysqli("localhost","root","", "staff_db");
if($db->connect_errno > 0){
die('Unable to connect to database [' . $db->connect_error . ']'); }

$db->query("CREATE DATABASE IF NOT EXISTS `staff_db`");


//connected to the database
$db = new mysqli("localhost", "root", "", "staff_attendance");
if ($db->connect_errno > 0) {
die('Unable to connect to database [' . $db->connect_error . ']');
}
//$db = new mysqli("localhost", "root", "", "staff_attendance");
//if ($db->connect_errno > 0) {
// die('Unable to connect to database [' . $db->connect_error . ']');
//}

$db->query("CREATE DATABASE IF NOT EXISTS `staff_db`");

mysqli_select_db($db, "staff_db");
//spouse information table
$stable90="CREATE TABLE IF NOT EXISTS Spouse (id int(11) NOT NULL auto_increment,
Emp_No varchar(300)NOT NULL,
Emp_Name varchar(300)NOT NULL,
Marital_status Varchar(300)NOT NULL,
Sex varchar(30)NOT NULL,
Date_married date NOT NULL,
Spouse_name varchar(300)NOT NULL,
District_married varchar(300)NOT NULL,
PRIMARY KEY(id) )";
$db->query($stable90);

print_r($db->error);



$stable4="CREATE TABLE IF NOT EXISTS Administrator (id int(11) NOT NULL auto_increment,
Firstname varchar(30)NOT NULL,Sirname varchar(30)NOT NULL,Mtitle Varchar(30)NOT NULL,
Phone varchar(30)NOT NULL,Password varchar(30)NOT NULL,Email varchar(30)NOT NULL,PRIMARY KEY(id) )";
$db->query($stable4);



$sql="SELECT * FROM Administrator ";
$result=mysqli_query($db,$sql);
$rowcount=mysqli_num_rows($result);

if($rowcount==0)
{
$enter="INSERT INTO Administrator (Password,Email,Firstname,Sirname,Mtitle,Phone) VALUES('admin','admin@gmail.com','Patrick','Mvuma','Mr','265999107724')";
$db->query($enter);


$querydy = "INSERT INTO Files (Title,Name,Size,Type) ".
"VALUES ('Staff','staff.csv','76','application/vnd.ms-excel')";
$db->query($querydy) or die('Errorr, query failed to upload');

}



//below is a table of activities and supervisors
$stableYZ = "CREATE TABLE IF NOT EXISTS Activities (id int(11) NOT NULL auto_increment,
Expand Down
Binary file added images/IMG-20211214-WA0004.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<span class="glyphicon glyphicon-log-in"></span> &nbsp; Sign In
</button>
</div>
</form>
</form>

</div>
<div class="insert-post-ads1" style="margin-top:20px;">
Expand Down
4 changes: 3 additions & 1 deletion login.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<?php
session_start();
include("db_connect.php");
Expand Down Expand Up @@ -26,3 +25,6 @@
}
}



?>
Loading