hjkhjkjhkhjkgjghjhgjhgjghjhghjghjhgjjnbvnvbnvk
bnmbnmbnhjkhjkhjkhjktyutyutyuytutyutyutyhgjgjghjgjghjguytutyry
/
home
/
wjcvelqp
/
public_html
/
vc
/
Upload FileeE
HOME
<?php require_once __DIR__ . '/includes/bootstrap.php'; auth_require(); $errors=[]; $states=[]; try{ $states=db()->query('SELECT id,name FROM states ORDER BY name')->fetchAll(); }catch(Throwable $e){} if(is_post()){ csrf_require(); $title=clean_string($_POST['title']??'',255); $desc=clean_text($_POST['description']??''); $category=clean_string($_POST['category']??'',100); $state_id=(int)($_POST['state_id']??0)?:null; $lga_id=(int)($_POST['lga_id']??0)?:null; $village=clean_string($_POST['village_text']??'',150); $org=clean_string($_POST['organization']??'',200); $budget=$_POST['estimated_budget']!==''?(float)$_POST['estimated_budget']:null; $impact=clean_text($_POST['expected_impact']??''); if($title===''||$desc==='') $errors[]='Title and description are required.'; if(!$errors){ $slug=slugify($title).'-'.substr(bin2hex(random_bytes(3)),0,6); db()->prepare("INSERT INTO development_projects (user_id,title,slug,description,category,state_id,lga_id,village_text,organization,estimated_budget,expected_impact,status,created_at) VALUES (?,?,?,?,?,?,?,?,?,?,'pending_review',NOW())") ->execute([auth_id(),$title,$slug,$desc,$category,$state_id,$lga_id,$village,$org,$budget,$impact]); flash('success','Project submitted for review.'); redirect('dashboard/my-projects.php'); } } $page_title='Submit project — '.VC_APP_NAME;$nav='projects'; include __DIR__.'/includes/header.php'; ?> <div class="page"><div class="container" style="max-width:720px"> <div class="page-header"><h1>Submit a community project</h1></div> <?php foreach($errors as $er):?><div class="alert alert-error"><?= e($er) ?></div><?php endforeach;?> <div class="detail"><form method="post"><?= csrf_field() ?> <div class="form-group"><label>Title *</label><input name="title" required value="<?= e($_POST['title']??'') ?>"></div> <div class="form-group"><label>Category</label> <select name="category"> <?php foreach(['Clean water','Rural roads','Schools','Healthcare','Electricity','Renewable energy','Agriculture','Youth development','Digital literacy','Internet access','Sanitation','Other'] as $c):?> <option value="<?= e($c) ?>"><?= e($c) ?></option> <?php endforeach;?> </select></div> <div class="form-group"><label>Description *</label><textarea name="description" required rows="6"><?= e($_POST['description']??'') ?></textarea></div> <div class="form-group"><label>Expected impact</label><textarea name="expected_impact" rows="3"><?= e($_POST['expected_impact']??'') ?></textarea></div> <div class="form-group"><label>State</label><select name="state_id" data-lga-target="projLga"><option value="">Select</option> <?php foreach($states as $s):?><option value="<?= (int)$s['id'] ?>"><?= e($s['name']) ?></option><?php endforeach;?> </select></div> <div class="form-group"><label>LGA</label><select name="lga_id" id="projLga"><option value="">Select</option></select></div> <div class="form-group"><label>Village / community</label><input name="village_text"></div> <div class="form-group"><label>Organization (optional)</label><input name="organization"></div> <div class="form-group"><label>Estimated budget (₦)</label><input type="number" step="0.01" name="estimated_budget"></div> <button class="btn btn-primary" type="submit">Submit for review</button> </form></div></div></div> <?php include __DIR__.'/includes/footer.php'; ?>