-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert_example_jobs.php
More file actions
97 lines (91 loc) · 4.48 KB
/
Copy pathinsert_example_jobs.php
File metadata and controls
97 lines (91 loc) · 4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
// Include database connection
require_once 'includes/db.php';
// Function to insert a job
function insertJob($conn, $recruiter_id, $title, $description, $requirements, $job_type, $location, $salary, $is_featured = 0) {
$sql = "INSERT INTO jobs (recruiter_id, title, description, requirements, job_type, location, salary, featured, status)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, 'open')";
$stmt = $conn->prepare($sql);
$stmt->bind_param("issssssi", $recruiter_id, $title, $description, $requirements, $job_type, $location, $salary, $is_featured);
return $stmt->execute();
}
// Example jobs data
$jobs = [
[
'title' => 'Senior PHP Developer',
'description' => 'We are looking for an experienced PHP Developer to join our team in Ahmedabad. You will be responsible for developing and maintaining web applications, working with MySQL databases, and implementing RESTful APIs. The ideal candidate should have strong problem-solving skills and be able to work independently.',
'requirements' => '3+ years of experience in PHP development
Strong knowledge of MySQL and database design
Experience with Laravel or CodeIgniter framework
Understanding of RESTful API development
Good knowledge of HTML, CSS, and JavaScript
Experience with version control systems (Git)',
'job_type' => 'full-time',
'location' => 'Ahmedabad, Gujarat',
'salary' => '₹8,00,000 - ₹12,00,000 per annum',
'is_featured' => 1
],
[
'title' => 'Digital Marketing Executive',
'description' => 'We are seeking a creative and analytical Digital Marketing Executive to help grow our online presence. You will be responsible for managing social media accounts, creating content, running digital campaigns, and analyzing performance metrics.',
'requirements' => '1-2 years of experience in digital marketing
Strong knowledge of social media platforms
Experience with Google Analytics and SEO
Good content writing skills
Basic knowledge of graphic design tools
Ability to work independently and meet deadlines',
'job_type' => 'part-time',
'location' => 'Ahmedabad, Gujarat',
'salary' => '₹15,000 - ₹25,000 per month',
'is_featured' => 0
],
[
'title' => 'Customer Support Executive',
'description' => 'We are looking for a Customer Support Executive to handle customer inquiries, provide product information, and resolve issues. The role requires excellent communication skills and the ability to work in a fast-paced environment.',
'requirements' => 'Excellent communication skills in English and Hindi
1+ year of experience in customer service
Basic computer knowledge
Ability to handle customer complaints professionally
Good problem-solving skills
Willingness to work in shifts',
'job_type' => 'full-time',
'location' => 'Ahmedabad, Gujarat',
'salary' => '₹20,000 - ₹30,000 per month',
'is_featured' => 0
],
[
'title' => 'Web Development Intern',
'description' => 'We are offering an internship opportunity for aspiring web developers. You will work on real projects, learn modern web technologies, and get hands-on experience in a professional environment.',
'requirements' => 'Basic knowledge of HTML, CSS, and JavaScript
Eagerness to learn new technologies
Good problem-solving skills
Currently pursuing or recently completed a degree in Computer Science or related field
Portfolio or GitHub profile (preferred)',
'job_type' => 'internship',
'location' => 'Ahmedabad, Gujarat',
'salary' => '₹5,000 - ₹10,000 per month',
'is_featured' => 0
]
];
// Get a recruiter ID (assuming there's at least one recruiter in the database)
$sql = "SELECT id FROM users WHERE role = 'recruiter' LIMIT 1";
$result = $conn->query($sql);
$recruiter = $result->fetch_assoc();
if ($recruiter) {
$recruiter_id = $recruiter['id'];
// Insert each job
foreach ($jobs as $job) {
if (insertJob($conn, $recruiter_id, $job['title'], $job['description'], $job['requirements'],
$job['job_type'], $job['location'], $job['salary'], $job['is_featured'])) {
echo "Successfully inserted job: " . $job['title'] . "\n";
} else {
echo "Failed to insert job: " . $job['title'] . "\n";
echo "Error: " . $conn->error . "\n";
}
}
} else {
echo "No recruiter found in the database. Please create a recruiter account first.\n";
}
// Close connection
$conn->close();
?>