function data is not painting in the screen

Created on 10 February 2009, about 16 years ago
Updated 7 August 2024, 9 months ago

Hello,
i know little bit drupal. i created one Resume module, in that module i created 3 menus, 1 is Add Resume, 2nd displaying the resume details in the table, 3ed sorting the Resume list using dropdown field.

i have problem with 3ed one, using dropdown field, i want list the resume list in the database using dropdown field.
Here i pasted my code, if you can help me.
This is sorting the resume code i used.

function cv_sort()
{
$dep = _sbelongss_dep();
$exp = _sbelongss_exp();
global $user;
$form['cv'] = array('#type' => 'fieldset', '#title' => 'Resume Sort');
$form['cv']['dep'] = array('#type' =>'select','#title'=>'Department','#options' => $dep);
$form['cv']['exp'] = array('#type' =>'select','#title'=>'Experence','#options' => $exp);
$form['cv']['submit']=array('#type'=>'submit','#value'=>'Resume Sort');
return $form;
}

After the submit, following code is executing

function cv_sort_submit($form,&$values) {
global $base_url;
global $user;
$dep = $values['dep'];
$exp = $values['exp'];
$form=array();
switch($dep)
{
case 0:$dep = 'test'; break;
case 1:$dep = 'Development'; break;
case 2:$dep = 'BPO'; break;
case 3:$dep = 'Testing'; break;
case 4:$dep = 'Networking'; break;
case 5:$dep = 'Admin'; break;
case 6:$dep = 'HR'; break;
}
switch($exp)
{
case 0:$exp = 'test'; break;
case 1:$exp = '1'; break;
case 2:$exp = '2'; break;
case 3:$exp = '3'; break;
case 4:$exp = '4'; break;
case 5:$exp = '5'; break;
case 6:$exp = '6'; break;
case 7:$exp = '7'; break;
case 8:$exp = '8'; break;
case 9:$exp = '9'; break;
case 10:$exp = '10'; break;
case 11:$exp = '11'; break;
case 12:$exp = '12'; break;
case 13:$exp = '13'; break;
case 14:$exp = '14'; break;
case 15:$exp = '15'; break;
case 16:$exp = '16'; break;

}
$header = array(
array('name' => t('Name'), 'field' => 'name'),
array('qulf' => t('Qualification'), 'field' => 'qulf'),
array('dep' => t('Department'), 'field' => 'dep'),
array('exp' => t('Experence'), 'field' => 'exp'),
array('mobile' => t('mobile'), 'field' => 'mobile'),
array('email' => t('Email id'), 'field' => 'email'),
array('file' => t('Resume'), 'field' => 'download')
);
$sql = "SELECT * FROM `resume` WHERE `dep` = '$dep' AND `exp` = '$exp'";
$count_query = "SELECT count(*) FROM `resume` WHERE `dep` = '$dep' AND `exp` = '$exp'";
$result = pager_query($sql,15,0,$count_query);
while ($field = db_fetch_object($result))
{
$directory="resume/";
$name = $field->name;
$qulf = $field->qulf;
$dep = $field->dep;
$exp = $field->exp;
$mobile = $field->mobile;
$email = $field->email;
$download = $field->fpath;
$download1 =$directory.$field->fpath;
$url = "$base_url/cv/edit";
$rows[] = array('data' =>
array(
array('name' => $name, 'width' => '20%'),
array('qulf' => $qulf, 'width' => '10%'),
array('dep' => $dep, 'width' => '10%'),
array('exp' => $exp, 'width' => '5%'),
array('mobile' => $mobile, 'width' => '15%'),
array('email' => $email, 'width' => '25%'),
array('file' => l($download,$download1), 'width' => '10%')
));
}
if (!$rows) {
$rows[] = array(array('data' => t('No Resumes in the Database'), 'colspan' => 7));
}
$output .= theme('table', $header, $rows);
$output .= theme('pager',NULL, 0, 0);
$form['output'] = array('#type' => 'markup','#value' => $output);//For drupal 5.1*/
return $form;
}

Please tell me, what is wrong here.

💬 Support request
Status

Fixed

Version

11.0 🔥

Component
Menu system 

Last updated 1 day ago

Created by

🇮🇳India jprakash

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024