diff options
| author | Carson Fleming <cflems@cflems.net> | 2017-04-13 19:43:30 -0400 |
|---|---|---|
| committer | Carson Fleming <cflems@cflems.net> | 2017-04-13 19:43:30 -0400 |
| commit | d85e6f791413422c74f4a1f5119a891ae19b8d17 (patch) | |
| tree | 6103e42e9e7a430df4fbd7e6b282391b28d3aec0 /dash | |
| parent | 3532ad23553572ef91a9f079eadc6b7454f0cd3a (diff) | |
| download | bulletin-d85e6f791413422c74f4a1f5119a891ae19b8d17.tar.gz | |
Forced profile completion for policy reasons
Diffstat (limited to 'dash')
| -rw-r--r-- | dash/ads.php | 7 | ||||
| -rw-r--r-- | dash/apply.php | 7 | ||||
| -rw-r--r-- | dash/css/profile.css | 6 | ||||
| -rw-r--r-- | dash/dash_common.php | 1 | ||||
| -rw-r--r-- | dash/dash_functions.php | 3 | ||||
| -rw-r--r-- | dash/dash_req.php | 6 | ||||
| -rw-r--r-- | dash/profile.php | 18 |
7 files changed, 29 insertions, 19 deletions
diff --git a/dash/ads.php b/dash/ads.php index 7c365ff..f0f6836 100644 --- a/dash/ads.php +++ b/dash/ads.php @@ -21,12 +21,7 @@ if ($b_user['type'] == 'EMPLOYER' && $b_user['id'] == $row['uid']) echo ' </div> <div id="fjfooter"> <div id="fjfleft"> -<?php -if (is_null($row['picture'])) - echo ' <img id="propic" src="uimg/default.png" alt="Profile Picture" />'.PHP_EOL; -else - echo ' <img id="propic" src="uimg/'.intval($row['picture']).'.png" alt="Profile Picture" />'.PHP_EOL; -?> + <img id="propic" src="<?=picture_format($row['picture']);?>" alt="Profile Picture" /> <p id="ename"><a href="profile.php?id=<?=$row['uid'];?>"><?=htmlentities($row['name']);?></a></p> <p id="erating"><?=rating_format($row['rating']);?></p> <h4>Contact Information</h4> diff --git a/dash/apply.php b/dash/apply.php index 3236d49..8a72f78 100644 --- a/dash/apply.php +++ b/dash/apply.php @@ -36,12 +36,7 @@ $result->free(); </div> <div id="fjfooter"> <div id="fjfleft"> -<?php -if (is_null($row['picture'])) - echo ' <img id="propic" src="uimg/default.png" alt="Profile Picture" />'.PHP_EOL; -else - echo ' <img id="propic" src="uimg/'.intval($row['picture']).'.png" alt="Profile Picture" />'.PHP_EOL; -?> + <img id="propic" src="<?=picture_format($row['picture']);?>" alt="Profile Picture" /> <p id="ename"><?=htmlentities($row['name']);?></p> <p id="erating"><?=rating_format($row['rating']);?></p> </div> diff --git a/dash/css/profile.css b/dash/css/profile.css index 36abcbd..ac38ca9 100644 --- a/dash/css/profile.css +++ b/dash/css/profile.css @@ -129,3 +129,9 @@ #proreviews .revstars { margin-bottom: 0.5em; } +#profile #prowarning { + text-align: center; + color: #af3500; + font-weight: bold; + margin: 1em 0; +} diff --git a/dash/dash_common.php b/dash/dash_common.php index cc1d0b1..40e8e1d 100644 --- a/dash/dash_common.php +++ b/dash/dash_common.php @@ -5,4 +5,5 @@ if ($b_user['id'] < 1) l_redirect('login.php'); define('ACC_TYPE', $b_user['type']); require('nav.php'); +require('dash_req.php'); ?> diff --git a/dash/dash_functions.php b/dash/dash_functions.php index 5497ce9..6551e15 100644 --- a/dash/dash_functions.php +++ b/dash/dash_functions.php @@ -19,6 +19,9 @@ function typestr ($type) { function rating_format ($rating = null, $typestr = 'Employer') { return '<span class="ratingdata" data-rating="'.(is_null($rating) ? 'undef' : number_format($rating, 1)).'"></span>'; } +function picture_format ($picstr = null) { + return is_null($picstr) ? 'uimg/default.png' : 'uimg/'.htmlentities($picstr).'.png'; +} function draw_norate_p () { ?> <div class="job"> diff --git a/dash/dash_req.php b/dash/dash_req.php new file mode 100644 index 0000000..ccfe386 --- /dev/null +++ b/dash/dash_req.php @@ -0,0 +1,6 @@ +<?php +if (!defined('ACC_TYPE')) die; +if ((is_null($b_user['picture']) || is_null($b_user['address'])) && $_SERVER['SCRIPT_NAME'] != '/dash/profile.php') { + l_redirect('dash/profile.php'); +} +?> diff --git a/dash/profile.php b/dash/profile.php index 3c63ad4..d7aa997 100644 --- a/dash/profile.php +++ b/dash/profile.php @@ -21,12 +21,7 @@ if ($public) { </div> <div id="proleft"> <div id="propic"> -<?php - if (is_null($user['picture'])) - echo ' <img src="uimg/default.png" alt="Profile Picture" />'.PHP_EOL; - else - echo ' <img src="uimg/'.$user['picture'].'.png" alt="Profile Picture" />'.PHP_EOL; -?> + <img src="<?=picture_format($user['picture']);?>" alt="Profile Picture" /> </div> </div> <div id="proright"> @@ -115,6 +110,10 @@ $result->free(); <h3 id="protitle"><a href="<?=$_SERVER['REQUEST_URI'];?>"><?=htmlentities($user['name']);?></a></h3> <p id="prostars"><?=rating_format($user['rating'], typestr($user['type']));?></p> </div> +<?php + if (is_null($b_user['picture']) || is_null($b_user['address'])) + echo ' <p id="prowarning">For safety reasons, you will have to complete your profile before you can access the rest of Bulletin.</p>'.PHP_EOL; +?> <form action="<?=$_SERVER['REQUEST_URI'];?>" method="post" enctype="multipart/form-data"> <div id="proleft"> <h4>Profile Picture</h4> @@ -132,7 +131,12 @@ $result->free(); <div id="proright"> <div id="probody"> <h4>Include a Bio</h4> - <p><textarea id="inpbio" name="bio" placeholder="No bio included."><?=htmlentities($user['bio']);?></textarea></p> +<?php + if ($b_user['type'] == 'EMPLOYEE') $bphtxt = 'Type a bio (optional). Include your qualifications, work experience, certifications, etc.'; + else if ($b_user['type'] == 'EMPLOYER') $bphtxt = 'Type a bio (optional). Let your workers get to know you a little bit.'; + else $bphtxt = 'Type a bio (optional).'; +?> + <p><textarea id="inpbio" name="bio" placeholder="<?=htmlentities($bphtxt);?>"><?=htmlentities($user['bio']);?></textarea></p> </div> <div id="profoot"> <h4>Basic Information</h4> |
