Esempio n. 1
0
 function search_news($word)
 {
     global $base_path;
     $helper_obj = new Helper();
     $output = "";
     if ($helper_obj->user_is_logged_in() && $helper_obj->check_role(CLIENT_ROLE_ID)) {
         $db_function_obj = new DbFunctions();
         $word = urldecode($word);
         if (mb_strlen($word, "UTF-8") > 5) {
             $search_results = $db_function_obj->search_news($word);
             //$output .= '<script src="js/plugins/ckeditor/ckeditor.js"></script>';
             $output .= "<table id='add_article_html_table' style='font-size: 10px' class='table table-hover table-nomargin table-bordered'>\n                          <tr>\n                            <th>" . $helper_obj->t("ID") . "</th>\n                            <th>" . $helper_obj->t("Title") . "</th>     \n                            <th>" . $helper_obj->t("Image") . "</th>  \n                            <th>" . $helper_obj->t("Added By") . "</th>  \n                            <th>" . $helper_obj->t("Date Added") . "</th>  \n                            <th>" . $helper_obj->t("Edit") . "</th>\n                            <th>" . $helper_obj->t("Delete") . "</th>\n                          </tr>";
             foreach ($search_results as $data) {
                 $class = $helper_obj->table_row_class($i);
                 $output .= "<tr id='article_{$data['id']}'>\n                                  <td>" . $data['id'] . "</td>\n                                  <td>" . $data['title'] . "</td>      \n                                  <td>" . $data['image'] . "</td>      \n                                  <td>" . $data['added_by'] . "</td>      \n                                  <td>" . date(DATE_FORMAT, $data['date_added']) . "</td>      \n                                  <td><a href='javascript:void(0);' onclick='openEditHtmlArticlePopup({$data['id']})'>" . $helper_obj->t("Edit") . "</a></td>\n                                  <td><a href='javascript:void(0);' onclick='deleteHtmlArticle({$data['id']})'>" . $helper_obj->t("Delete") . "</a></td>\n                               </tr>";
             }
         } else {
             echo '<tr><td><b>يجب ادخال كلمة اكتر من 5 احرف</b></td></tr>';
         }
         $output .= "</table>";
     }
     echo $output;
     exit;
 }