$content .= "

Search

"; $content .= ""; // FUNCTIONS START HERE. $content .= ""; $content .= " \n"; $content .= " \n"; $content .= " \n"; $content .= " \n"; $content .= " \n"; $content .= " \n"; $content .= " \n"; // SELECT CLIENT $content .= " "; $content .= " "; $content .= " "; $content .= " "; // SELECT PROJECT MANAGER $content .= " "; $content .= " "; $content .= " "; $content .= " "; // SELECT YEAR $content .= " "; $content .= " "; $content .= " "; $content .= " "; // SELECT CATEGORY $content .= " "; $content .= " "; $content .= " "; $content .= " "; // SELECT LEAD DRAFTSMAN $content .= " "; $content .= " "; $content .= " "; $content .= " "; $content .= " \n"; $content .= " \n"; $content .= " "; $content .= " \n"; $content .= " "; $content .= " \n"; $content .= " \n"; $content .= " \n"; $content .= " \n"; // FUNCTIONS END HERE. $content .= "
* No Fields Required. A maximum of 500 records will be displayed on submit.
Keywords:
Select Client:"; $content .= " "; $content .= "
Project Manager:"; $content .= " "; $content .= "
Select Year:"; $content .= " "; $content .= "
Select Category:"; $content .= " "; $content .= "
Lead Drafter:"; $content .= " "; $content .= "
Project Status: Any Active Inactive
"; $content .= " "; $content .= " "; $content .= "
"; //CONTENT ENDS HERE --------------------------------------------------------------------------------------------------------> $tags=array( 'pagetitle'=> DEFAULTTITLE, 'desc'=> DESCRIPTION, 'meta'=> METATAGS, 'root'=> HTTP_SERVER . '/', 'header'=> 'includes/header.php', 'topmenu'=> DIR_BOXES . 'box_topmenu.php', 'images'=> DIR_IMAGES, 'leftcol'=>'includes/col_left.php', //'centercol'=>'includes/col_center.php', 'rightcol'=>'includes/col_right.php', 'content'=> $content, 'footer'=>'includes/footer.php' ); // PARSE TEMPLATE PAGE $tp->parseTemplate($tags); // DISPLAY PAGE echo $tp->display(); } function results($keywords, $client, $pm, $year, $cat, $cad, $status){ global $col_width; //SETTING TEMPLATE DIRECTORY $template = DIR_TEMPLATES . SEARCH_HTML; // INSTANTIATE NEW TEMPLATE PARSER OBJECT $tp=&new templateParser("$template"); $content = NULL; $query = NULL; //if(strlen(trim($keywords)) > 1){ $query .= "(pro_number LIKE '%$keywords%' OR pro_name LIKE '%$keywords%')"; //} if($client != 0){ $query .= " AND cl_id = \"$client\""; } if($pm != 0){ $query .= " AND pm_id = \"$pm\""; } if($year != 0){ $query .= " AND yr_id = \"$year\""; } if($cat != 0){ $query .= " AND cat_id = \"$cat\""; } if($cad != 0){ $query .= " AND lead_id = \"$cad\""; } if($status != 2){ $query .= " AND pro_status = \"$status\""; } // (jobDescription LIKE '%%%s%%') OR (jobNumber LIKE '%%%s%%') $query= "SELECT * FROM cms_project_list WHERE $query AND pro_checklist_approval='1' ORDER BY yr_id DESC, pro_number ASC LIMIT 500"; $results = @mysql_query($query) or mysql_die ( mysql_error(), $query, __LINE__, __FILE__ ); $records = mysql_num_rows($results); // TOP FORM STARTS HERE. $content .= "
"; $content .= "Keywords: "; // SELECT CLIENT $content .= "  "; // SELECT YEAR $content .= "  "; $content .= "   "; $content .= "   "; $content .= " "; $content .= " "; $content .= " "; $content .= " "; $content .= "
"; // TOP FORM ENDS HERE // CONTENT STARTS HERE ------------------------------------------------------------------------------------------------------> $content .= "

Results

$records records found.
"; // $content .= "$query"; $content .= "
"; $content .= ""; if ($_SESSION['s_admin'] == 1){ $content .= ""; } if($_SESSION['s_admin'] == 1 OR $_SESSION['s_pm'] == 1){ $content .= ""; } $content .= ""; if ($records > 0) { while ($row = mysql_fetch_assoc($results)) { $pro_id = $row['pro_id']; $pro_number = $row['pro_number']; $pro_name = $row['pro_name']; $cl_id = $row['cl_id']; $pm_id = $row['pm_id']; $lead_id = $row['lead_id']; $q2= "SELECT cl_name FROM cms_clients WHERE cl_id='$cl_id'"; $r2 = @mysql_query($q2) or mysql_die ( mysql_error(), $q2, __LINE__, __FILE__ ); $row2 = mysql_fetch_assoc($r2); $cl_name = $row2['cl_name']; $q3= "SELECT emp_name FROM cms_employees WHERE emp_id='$pm_id'"; $r3 = @mysql_query($q3) or mysql_die ( mysql_error(), $q3, __LINE__, __FILE__ ); $row3 = mysql_fetch_assoc($r3); $pm_name = $row3['emp_name']; $q3= "SELECT emp_name FROM cms_employees WHERE emp_id='$lead_id'"; $r3 = @mysql_query($q3) or mysql_die ( mysql_error(), $q3, __LINE__, __FILE__ ); $row3 = mysql_fetch_assoc($r3); $lead_name = $row3['emp_name']; $content .= "" . $pro_number . ""; if ($_SESSION['s_admin'] == 1){ $content .= ""; } if($_SESSION['s_admin'] == 1 OR $_SESSION['s_pm'] == 1){ $content .= ""; } $content .= ""; } } else $content .= ""; // FUNCTIONS END HERE. $content .= "
Project Number Project Name Client Project Manager Lead DrafterEditAdd Sub Add to Cal
" . $pro_name . " " . $cl_name . " " . $pm_name . " " . $lead_name . "
No Records found.
"; // CONTENT ENDS HERE --------------------------------------------------------------------------------------------------------> $tags=array( 'pagetitle'=> DEFAULTTITLE, 'desc'=> DESCRIPTION, 'meta'=> METATAGS, 'root'=> HTTP_SERVER . '/', 'header'=> 'includes/header.php', 'topmenu'=> DIR_BOXES . 'box_topmenu.php', 'images'=> DIR_IMAGES, 'leftcol'=>'includes/col_left.php', //'centercol'=>'includes/col_center.php', 'rightcol'=>'includes/col_right.php', 'content'=> $content, 'footer'=>'includes/footer.php' ); // PARSE TEMPLATE PAGE $tp->parseTemplate($tags); // DISPLAY PAGE echo $tp->display(); } switch($op){ default: index(); break; case "results": results($keywords, $client, $pm, $year, $cat, $cad, $status); break; } ?>