function build_clients_list($page = 'add', $selected_client = "", $onclick = "", $style = "") { $db_functions_obj = new DbFunctions(); $helper_obj = new Helper(); $clients = $db_functions_obj->get_active_client(); $output = '<div class="control-group"> <label class="control-label" for="select">Clients</label> <div class="controls">'; $output .= "<select {$style} {$onclick} id='{$page}" . "_client' name='{$page}" . "_client'>"; $output .= "<option value=''>" . $helper_obj->t("Select...") . "</option>"; foreach ($clients as $key => $value) { if ($selected_client != "") { $output .= "<option "; if ($selected_client == $value['id']) { $output .= " selected='selected' "; } $output .= "value='{$value['id']}'>{$value['name']}</option>"; } else { $output .= "<option value='{$value['id']}'>{$value['name']}</option>"; } } $output .= "</select>"; $output .= "</div>"; $output .= "</div>"; return $output; }
function build_edit_pgrate_popup($pgrate_id) { $db_functions_obj = new DbFunctions(); $helper_obj = new Helper(); $pgrate_info = $db_functions_obj->get_pgrate_by_id($pgrate_id); global $base_path; $output = "<script>\$(document).ready(function() { \n \$('#edit_pgrate').ajaxForm(function(res) { \n var isvalid = \$(\"#edit_pgrate\").valid();\n if (isvalid) { \n var data = res.split(\"***#***\"); \n \$('#pgrate_' + data[1]).after(data[0]);\n \$('#pgrate_' + data[1]).remove(); \n closePopup();\n } \n }); });</script>"; $output .= "<div class='popup-header'>" . $helper_obj->t("Edit PG rate") . " " . $pgrate_info['name'] . "</div>"; $output .= "<form class='form-horizontal form-validate form-vertical form-bordered' name='edit_pgrate' id='edit_pgrate' method='post' action='{$base_path}" . "edit_pgrate'>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>PG rate Name</label>\n <div class='controls'>\n <input class='input-xlarge' data-rule-required='true' data-rule-minlength='2' value='" . $pgrate_info['name'] . "' type='text' id='pgrate_name_update' name='pgrate_name_update' placeholder='" . $helper_obj->t("Name") . "'>\n </div>\n </div>"; $output .= ""; $output .= "<input class='btn btn-primary' type='submit' value='" . $helper_obj->t("Save") . "'>"; $output .= "<input type='hidden' name='pgrate_id_updated' value='" . $pgrate_info['id'] . "'>"; $output .= "</form>"; return $output; }
function build_edit_emergency_popup($id) { $db_functions_obj = new DbFunctions(); $helper_obj = new Helper(); $emergency_info = $db_functions_obj->get_emergency_by_id($id); global $base_path; $operator = new Operator(); $output = "<div class='popup-header'>" . $helper_obj->t("Edit Emergency Call") . "</div>"; $output .= "<form class='form-horizontal form-validate form-vertical form-bordered' name='edit_emergency' id='edit_emergency' method='post' action='{$base_path}" . "edit_emergency'>"; $output .= "<div class='control-group'>\n <label class='control-label' for='textarea'>name</label>\n <div class='controls'>\n <input id='textfield' class='input-xlarge' type='text' data-rule-required='true' value='{$emergency_info->name}' placeholder='{$emergency_info->name}' name='name'>\n </div>\n </div>"; $output .= "<div class='control-group'>\n <label class='control-label' for='numberfield'>phone</label>\n <div class='controls'>\n <input id='numberfield' class='input-xlarge' type='text' data-rule-number='true' data-rule-required='true' value='{$emergency_info->phone}' placeholder='{$emergency_info->phone}' name='phone'>\n </div>\n </div>"; $output .= $operator->build_country_list('emergency', $emergency_info->country_id); $output .= "<input type='hidden' name='emergency_id' value='" . $emergency_info->id . "'>"; $output .= "<input class='btn btn-primary' type='submit' value='" . $helper_obj->t("Save") . "'>"; $output .= "</form>"; $output .= "<script>\n \$(document).ready(function() { \n \$(\"#emergency_textfield\").datepicker(); \n \n \$('#edit_emergency').ajaxForm(function(res) { \n var isvalid = \$(\"#edit_emergency\").valid();\n if (isvalid) { \n var data = res.split(\"***#***\"); \n \$('#emergency_' + data[1]).after(data[0]);\n \$('#emergency_' + data[1]).remove(); \n closePopup();\n } \n }); \n });\n </script>"; return $output; }
function build_edit_hitd_popup($id) { $db_functions_obj = new DbFunctions(); $helper_obj = new Helper(); $hitd_info = $db_functions_obj->get_hitd_by_id($id); global $base_path; $output = "<div class='popup-header'>" . $helper_obj->t("Edit Happened in this day") . "</div>"; $output .= "<form class='form-horizontal form-validate form-vertical form-bordered' name='edit_hitd' id='edit_hitd' method='post' action='{$base_path}" . "edit_hitd'>"; $output .= "<div class='control-group'>\n <label class='control-label' for='textarea'>body</label>\n <div class='controls'>\n <textarea id='textarea' class='input-block-level' rows='5' name='hitd_textarea'>{$hitd_info->body}</textarea>\n </div>\n </div>"; $output .= '<div class="control-group"> <label class="control-label" for="textfield">Date</label> <div class="controls"> <input placeholder="' . $hitd_info->date . '" value="' . $hitd_info->date . '" class="input-medium " type="text" name="hitd_textfield" id="hitd_textfield" data-date-format="yyyy-mm-dd"> </div> </div>'; $output .= "<input type='hidden' name='hitd_id' value='" . $hitd_info->id . "'>"; $output .= "<input class='btn btn-primary' type='submit' value='" . $helper_obj->t("Save") . "'>"; $output .= "</form>"; $output .= "<script>\n \$(document).ready(function() { \n \$(\"#hitd_textfield\").datepicker(); \n \n \$('#edit_hitd').ajaxForm(function(res) { \n var isvalid = \$(\"#edit_hitd\").valid();\n if (isvalid) { \n var data = res.split(\"***#***\"); \n \$('#happened_' + data[1]).after(data[0]);\n \$('#happened_' + data[1]).remove(); \n closePopup();\n } \n }); \n });\n </script>"; return $output; }
function build_edit_video_popup($vid) { $db_functions_obj = new DbFunctions(); $validation_js_obj = new Validation_js(); $cat_obj = new Category(); $helper_obj = new Helper(); $pgrate_obj = new Pgrate(); global $base_path; $vid_info = $db_functions_obj->get_vid_by_id($vid); $output = ""; $output = $validation_js_obj->edit_video_validation(); $output .= "<script>\$(document).ready(function() { \$('#edit_video').ajaxForm(function(res) { \n var isvalid = \$(\"#edit_video\").valid();\n if (isvalid) { \n var data = res.split(\"***#***\"); \n \$('#vid_' + data[1]).after(data[0]);\n \$('#vid_' + data[1]).remove(); \n closePopup();\n } \n }); });</script>"; $feature_checked = ""; if ($vid_info->featured) { $feature_checked = "checked='checked'"; } $premium_checked = ""; if ($vid_info->premium) { $premium_checked = "checked='checked'"; } $output .= "<div class='popup-header'>" . $helper_obj->t("Edit Video") . " " . $vid_info->title . "</div>"; $output .= "<form class='form-horizontal form-validate form-vertical form-bordered' name='edit_video' id='edit_video' method='post' action='{$base_path}" . "edit_video'>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Title</label>\n <div class='controls'>\n <input type='text' id='title_updated' name='title_updated' value='" . $vid_info->title . "'>\n </div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Title</label>\n <div class='controls'>\n <textarea name='description_updated' id='description_updated'>{$vid_info->description}</textarea>\n </div>\n </div>"; $output .= $cat_obj->build_categories_list('edit', $vid_info->cat_id); $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Image1</label>\n <div class='controls'>\n <input accept='image/*' type='file' name='image1_updated' id='image1_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $vid_info->image1 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n </div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Image2</label>\n <div class='controls'>\n <input accept='image/*' type='file' name='image2_updated' id='image2_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $vid_info->image2 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n </div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Image3</label>\n <div class='controls'>\n <input accept='image/*' type='file' name='image3_updated' id='image3_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $vid_info->image3 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n </div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Image4</label>\n <div class='controls'>\n <input accept='image/*' type='file' name='image4_updated' id='image4_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $vid_info->image4 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n </div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>ScreenShot</label>\n <div class='controls'>\n <input accept='image/*' type='file' name='screenshot_updated' id='screenshot_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $vid_info->screenshot . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n </div>\n </div>"; $output .= $pgrate_obj->build_pgrate_list("edit", $vid_info->pgrate_id); $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Featured</label>\n <div class='controls'>\n <input {$feature_checked} type='checkbox' value='1' id='featured_updated' name='featured_updated'>" . $helper_obj->t("Featured") . "</div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Premium</label>\n <div class='controls'>\n <input {$premium_checked} type='checkbox' value='1' id='premium_updated' name='premium_updated'>" . $helper_obj->t("Premium") . "</div>\n </div>"; $output .= "<input class='btn btn-primary' type='submit' value='" . $helper_obj->t("Save") . "'>"; $output .= "<input type='hidden' name='edit_vid' id='edit_vid' value='" . $vid_info->id . "'>"; $output .= "</form>"; return $output; }
function renew_payment($user) { $this->update_payment_tries($user->uid); $db_functions_obj = new DbFunctions(); $payment_obj = new Payment(); $helper_obj = new Helper(); //pr($user); //exit; //exit; $operator_details = $db_functions_obj->get_operator_by_id($user->operator_id); //pr($operator_details); exit; /* if ($operator_details['type'] == "MO") { $from = $operator_details['paid_shortcode']; // $msg = $operator_details['verification_code']; ///شو لازم تكون المسج $smsc = $operator_details['paid_smsc']; } else{*/ $from = $operator_details['paid_shortcode']; // $msg = $operator_details['verification_code']; $smsc = $operator_details['paid_smsc']; /* } */ /* $log_id = $payment_obj->insert($user->uid, $operator_details['country_id'], $user->cid, $user->operator_id, "تم تفعيل الاشتراك بنجاح", $operator_details['paid_shortcode'], $user->phone, 1); */ // $date = time(); // $next_time = $date + $operator_details['period'] /*7 days*/; // $payment_obj->update_payment($user->uid, $date, $next_time); $db_functions_obj->update_repayment_count($user->uid); //$root = "http://arh:8080/appstreamig/streaming/"; $root = "http://www.jeelplus.com/appstreamig/streaming/api/"; $dlr_url = $root . 'index.php?action=dlr' . ('&par=%d_2_' . $user->uid . "_" . $user->operator_id . "_" . $user->phone); //echo($dlr_url); if ($user->uid) { $number = $user->phone; $port = $operator_details['port']; $helper_obj->send_sms($from, $number, "سيتم تفعيل اشتراكك", $smsc, $dlr_url, $port); } // return $uid; }
function get_menu_not_assigned_to_client($cid) { $db_function_obj = new DbFunctions(); $helper_obj = new Helper(); // $menu_perants = $db_function_obj->get_menu_parents_not_assignt_to_client($cid); $menu_parants = $db_function_obj->get_menu_parents($cid); // pr($menu_parants); $output = $helper_obj->t("Menu items not assigned to this client") . '<br />'; $output .= $this->menu_display($menu_parants, false, '', "onclick='addMenuItemToClient(this)'"); return $output; }
/** * @Author: Taymoor Qanadilou * @Date created: 27/05/2013 * @Description: get all comments have bad words * @Param: * none * @Updated History: * none */ function disapproved_users_report() { $db_function_obj = new DbFunctions(); $user_obj = new User(); $helper_obj = new Helper(); $output = ""; //$approved_images = number_of_approved_images_report(STATUS_APPROVED); $disapproved_images = $db_function_obj->number_of_approved_images_report(STATUS_DISAPPROVED); //$approved_posts = number_of_approved_posts_report(STATUS_APPROVED); $disapproved_posts = $db_function_obj->number_of_approved_posts_report(STATUS_DISAPPROVED); while ($row = $this->conn->db_fetch_object($disapproved_images)) { $disapproved[$row->uid]['count_disapproved_image'] = $row->count; } while ($row = $this->conn->db_fetch_object($disapproved_posts)) { $disapproved[$row->uid]['count_disapproved_post'] = $row->count; } $output .= "<table border='1'>\n <tr><td colspan='3'>Disapproved Users Posts/Images</td></tr>\n <tr>\n <th>User Name</th>\n <th>Disapproved images</th>\n <th>Disapproved posts</th>\n </tr>\n "; if (is_array($disapproved)) { foreach ($disapproved as $key => $value) { $class = $helper_obj->table_row_class($i); $output .= "<tr class='{$class}'>\n <td>" . $user_obj->user_load($key)->name . "</td>\n <td>" . (@$value['count_disapproved_image'] + 0) . "</td>\n <td>" . (@$value["count_disapproved_post"] + 0) . "</td>\n </tr>"; } } $output .= "</table>"; return $output; }
function build_edit_article_popup($aid) { $db_functions_obj = new DbFunctions(); $validation_js_obj = new Validation_js(); $cat_obj = new Category(); $helper_obj = new Helper(); $pgrate_obj = new Pgrate(); global $base_path; $article_info = $db_functions_obj->get_article_by_id($aid); $output = ""; $output = $validation_js_obj->edit_article_validation(); $output .= "<script>\$(document).ready(function() { \$('#edit_article').ajaxForm(function(res) { \n var isvalid = \$(\"#edit_article\").valid();\n if (isvalid) { \n var data = res.split(\"***#***\"); \n \$('#article_' + data[1]).after(data[0]);\n \$('#article_' + data[1]).remove(); \n closePopup();\n } \n }); });</script>"; $output .= "<div class='popup-header'>" . $helper_obj->t("Edit Article") . " " . $article_info->title . "</div>"; $output .= "<form class='form-horizontal form-validate form-vertical form-bordered' name='edit_article' id='edit_article' method='post' action='{$base_path}" . "edit_article'>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Title</label>\n <div class='controls'>\n <input type='text' id='title_updated' name='title_updated' value='" . $article_info->title . "'>\n </div>\n </div>"; $output .= $cat_obj->build_categories_list('edit', $article_info->cat_id); $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Text1</label>\n <div class='controls' style='float: left; margin-right: -70; margin-left: 0;width: 231px'>\n <textarea name='text1_updated' id='text1_updated'>{$article_info->text1}</textarea><br />\n <input type='text' style='font-size: 11px;width: 65px' name='text1_order_updated' value='{$article_info->text1_order}'></input>\n </div>\n \n <div class='controls' style='float: left; margin-right: -70; margin-left: 0;width: 231px'>\n <textarea name='text2_updated' id='text2_updated'>{$article_info->text2}</textarea> <br />\n <input type='text' style='font-size: 11px;width: 65px' name='text2_order_updated' value='{$article_info->text2_order}'></input> \n </div>\n \n <div class='controls' style='float: left; margin-right: -70; margin-left: 0;width: 233px'>\n <textarea name='text3_updated' id='text3_updated'>{$article_info->text3}</textarea> <br />\n <input type='text' style='font-size: 11px;width: 65px' name='text3_order_updated' value='{$article_info->text3_order}'></input> \n </div>\n \n </div>"; /* $output .= "<div class='control-group'> <label class='control-label' for='client_name'>Text2</label> <div class='controls' style='float: left; margin-right: -70; margin-left: 0;width: 231px'> <textarea name='text2_updated' id='text2_updated'>$article_info->text2</textarea> <br /> <input type='text' style='font-size: 11px;width: 65px' name='text2_order_updated' value='$article_info->text2_order'></input> </div> <div class='controls' style='float: left; margin-right: -70; margin-left: 0;width: 49%'> <textarea name='text3_updated' id='text3_updated'>$article_info->text3</textarea> <br /> <input type='text' style='font-size: 11px;width: 65px' name='text3_order_updated' value='$article_info->text3_order'></input> </div> </div>"; */ /* $output .= "<div class='control-group'> <label class='control-label' for='client_name'>Text3</label> <div class='controls'> <textarea name='text3_updated' id='text3_updated'>$article_info->text3</textarea> <br /> <input type='text' style='font-size: 11px;width: 65px' name='text3_order_updated' value='$article_info->text3_order'></input> </div> </div>"; */ $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Image1</label>\n <div class='controls'>\n <input accept='image/*' type='file' name='image1_updated' id='image1_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $article_info->image1 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n <input type='text' style='font-size: 11px;width: 65px' name='image1_order_updated' value='{$article_info->image1_order}'></input> \n </div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Image2</label>\n <div class='controls'>\n <input accept='image/*' type='file' name='image2_updated' id='image2_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $article_info->image2 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n <input type='text' style='font-size: 11px;width: 65px' name='image2_order_updated' value='{$article_info->image2_order}'></input>\n </div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Image3</label>\n <div class='controls'>\n <input accept='image/*' type='file' name='image3_updated' id='image3_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $article_info->image3 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n <input type='text' style='font-size: 11px;width: 65px' name='image3_order_updated' value='{$article_info->image3_order}'></input>\n </div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Image4</label>\n <div class='controls'>\n <input accept='image/*' type='file' name='image4_updated' id='image4_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $article_info->image4 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n <input type='text' style='font-size: 11px;width: 65px' name='image4_order_updated' value='{$article_info->image4_order}'></input>\n </div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Image5</label>\n <div class='controls'>\n <input accept='image/*' type='file' name='image5_updated' id='image5_updated'><img src='" . VIDEOS_IMAGES_THUMBNAIL_PATH . $article_info->image5 . "' width=" . IMG_WIDTH_EDIT_VID . " height=" . IMG_HIEGHT_EDIT_VID . ">\n <input type='text' style='font-size: 11px;width: 65px' name='image5_order_updated' value='{$article_info->image5_order}'></input>\n </div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Video1</label>\n <div class='controls' style='float: left; margin-right: -70; margin-left: 0;'>\n <input type='text' name='video1_updated' value='{$article_info->video1}'></input><br />\n <input type='text' style='font-size: 11px;width: 65px' name='video1_order_updated' value='{$article_info->video1_order}'></input> \n </div>\n \n <div class='controls' style='float: left; margin-right: -70; margin-left: 0; width: 49%'>\n <input type='text' name='video2_updated' value='{$article_info->video2}'></input><br />\n <input type='text'style='font-size: 11px;width: 65px' name='video2_order_updated' value='{$article_info->video2_order}'></input>\n </div>\n \n </div>"; /*$output .= "<div class='control-group'> <label class='control-label' for='client_name'>Video2</label> <div class='controls'> <input type='text' name='video2_updated' value='$article_info->video2'></input><br /> <input type='text'style='font-size: 11px;width: 65px' name='video2_order_updated' value='$article_info->video2_order'></input> </div> </div>"; */ $output .= $pgrate_obj->build_pgrate_list("edit", $article_info->pgrate_id); /* $output .= "<div class='control-group'> <label class='control-label' for='client_name'>Ordering</label> <div class='controls'> </div> </div>"; */ $radio1 = ""; $radio2 = ""; $radio3 = ""; if ($article_info->section == 1) { $radio1 = "checked='checked'"; } if ($article_info->section == 2) { $radio2 = "checked='checked'"; } if ($article_info->section == 3) { $radio3 = "checked='checked'"; } $output .= '<div class="control-group"> <label class="control-label">Main Category in home page</label> <div class="controls"> <label class="radio"> <input ' . $radio1 . ' type="radio" name="section" value="1"> Top Section </label> <label class="radio"> <input ' . $radio2 . ' type="radio" name="section" value="2"> Middle Section </label> <label class="radio"> <input ' . $radio3 . ' type="radio" name="section" value="3"> Bottom Section </label> </div> </div>'; $output .= "<input class='btn btn-primary' type='submit' value='" . $helper_obj->t("Save") . "'>"; $output .= "<input type='hidden' name='edit_article' id='edit_article' value='" . $article_info->id . "'>"; $output .= "</form>"; return $output; }
} $db_fuctions_obj->activate_user($uid); $json = $callback . '({ "proposals": '; $json .= '{"success":"1","message":"success"}'; $json .= '})'; echo $json; //call bashar service //exec_curl("http://cp.m-diet.com/payments.ashx/insertpaymenttbl?PersonEmail=$email&OperatorID=$op_id&Status=1"); } } } break; case "dlr_mo": $db_fuctions_obj = new DbFunctions(); $phone = urlencode($_GET['from']); $shortcode = $_GET['to']; $sms_body = $_GET['message']; //email $smsc = $_GET['smsc']; //send to bashar phone and email:success echo '{"status":"1","email": "' . $sms_body . '", "phone":"' . $phone . '"}'; $phone_details = $db_fuctions_obj->get_phone_details($phone); $email = $phone_details[0]['email']; $op_id = $phone_details[0]['operator_id']; $uid = $phone_details[0]['uid']; echo dlr($uid, 1, $op_id); break; case "verify_code": $number = $_REQUEST['phone'];
function edit_user($uid, $username, $email, $phone, $password) { $db_functions_obj = new DbFunctions(); $db_functions_obj->edit_user($uid, $username, $email, $phone, $password); }
function get_categories_assigned_to_client($cid) { $db_function_obj = new DbFunctions(); $categories = $db_function_obj->get_categories_assigned_to_client($cid); $output = "Categories assinged to this client:<br />"; foreach ($categories as $cat) { $output .= "<div style='margin: 8px; padding:5px; float: left; height: 25px; border: 1px solid'>\n <input onclick='removeCategoryToClient(this);' type='checkbox' value='" . $cat['id'] . "' style='margin: -2px 0 0'> " . $cat['name'] . "</div>"; } return $output; }
function change_password($email, $old_password, $new_password) { $db_fuctions_obj = new DbFunctions(); return $db_fuctions_obj->change_password($email, $old_password, $new_password); }
function check_user_menu($menu_id, $cid) { global $user; $access = FALSE; $db_function_obj = new DbFunctions(); if ($db_function_obj->vaild_user_menu($menu_id, $cid)) { $access = TRUE; } //echo('<br /><br />$access:' . $access.'<br /><br />'); return $access; }
function tags_and_synonyms() { $db_function_obj = new DbFunctions(); $tags = $db_function_obj->tags_and_synonyms(); $table = '<div class="box box-bordered">'; $table .= '<div class="box-title"> <h3><i class="icon-th-list"></i> Add Realted Tags</h3> </div>'; $table .= "<div class='box-content nopadding'>"; $table .= "<table id='synonyms_table' border='1' style='width: 400px; border: 1px solid !important;'>\n <tr><td>parent</td><td>name</td><td>synonyms</td><td><br /></td></tr>"; foreach ($tags as $tag) { // $tag['synonyms'] = str_replace("DDD", "<", $tag['synonyms']); // $tag['synonyms'] = str_replace("CCC", ">", $tag['synonyms']); // $tag['synonyms'] = str_replace("EEE", "</a>", $tag['synonyms']); $table .= "<tr id='tag_{$tag['id']}'>\n <td>{$tag['parent']}</td>\n <td>{$tag['name']}</td>\n <td id='synonyms_{$tag['id']}'>{$tag['synonyms']}</td>\n <td>\n <input type='text' style='500px' id='related_tags_{$tag['id']}' />\n word1,word2,word3,... <br />\n <input type='button' value='Save' onclick='SaveRelatedTags({$tag['parent']}, \"{$tag['name']}\")' />\n </td>\n </tr>"; } $table .= "</table>"; $table .= "</div>"; $table .= "</div>"; return $table; }
function edit_html_article($data, $cid, $uid) { $title = trim($data['title_updated']); //$video = trim($data['video_updated']); $body = trim($data['ck_updated']); //$cat_id = $data['edit_category']; $helper_obj = new Helper(); $db_functions_obj = new DbFunctions(); $tag_obj = new Tag(); $cat_obj = new Category(); $image1 = ""; if (isset($_FILES['image1_updated'])) { $image1_type = explode(".", $_FILES['image1_updated']['name']); $image1 = $helper_obj->generate_name() . '.' . $image1_type[1]; move_uploaded_file($_FILES["image1_updated"]["tmp_name"], VIDEOS_IMAGES_PATH_UPLOAD . $image1); $im = $helper_obj->img_resize(VIDEOS_IMAGES_PATH_UPLOAD . $image1, 620); $helper_obj->imageToFile($im, VIDEOS_IMAGES_PATH_UPLOAD . $image1, 100); $helper_obj->resize_crob_image(VIDEOS_IMAGES_PATH_UPLOAD . $image1, VIDEOS_IMAGES_THUMBNAIL_PATH_UPLOAD . $image1, THUMBNAIL_W, THUMBNAIL_H, THUMBNAIL_R, THUMBNAIL_ENABLE); $helper_obj->resize_crob_image(VIDEOS_IMAGES_PATH_UPLOAD . $image1, VIDEOS_IMAGES_PATH_FEATURE_UPLOAD . $image1, FEATURE_W, FEATURE_H, THUMBNAIL_R, THUMBNAIL_ENABLE); //woman app if ($cid == 49) { $helper_obj->resize_crob_image(VIDEOS_IMAGES_PATH_UPLOAD . $image1, VIDEOS_IMAGES_THUMBNAIL_320x272_PATH_UPLOAD . $image1, IMAGE_320x272_W, IMAGE_320x272_H, THUMBNAIL_R, THUMBNAIL_ENABLE); $helper_obj->resize_crob_image(VIDEOS_IMAGES_PATH_UPLOAD . $image1, VIDEOS_IMAGES_THUMBNAIL_320x352_PATH_UPLOAD . $image1, IMAGE_320x352_W, IMAGE_320x352_H, THUMBNAIL_R, THUMBNAIL_ENABLE); } } $pgrate_id = $data['edit_pgrate']; $vid = $data['edit_article']; $section = $data['section_updated']; $time = time(); /*$query = "UPDATE articles_html set title = '$title', body = '$body', category_id = '$cat_id', pg_rated_id = '$pgrate_id', updated_by = '$uid', updated_date = '$time', video = '$video' ";*/ $query = "UPDATE articles_html set title = '{$title}', body = '{$body}',\n pg_rated_id = '{$pgrate_id}', updated_by = '{$uid}', updated_date = '{$time}' "; if ($image1 != "") { $query .= " ,image = '{$image1}'"; } $query .= " ,section = '{$section}'"; $query .= " WHERE client_id = '{$cid}' AND id = '{$vid}'"; // echo($query); //update tags //1- delete old tags //2- add new tags $db_functions_obj->delete_article_tags($vid); foreach ($data['edit_tag'] as $tag_id) { $tag_obj->add_tags_to_article($vid, $tag_id); } $this->delete_article_categories($vid); foreach ($data['edit_category'] as $cid) { $cat_obj->add_categories_to_article($vid, $cid); } $result = $this->conn->db_query($query); }
function build_edit_zodiac_popup($id) { $db_functions_obj = new DbFunctions(); $helper_obj = new Helper(); $zodiac_info = $db_functions_obj->get_zodiac_by_id($id); global $base_path; $operator = new Operator(); $output = "<div class='popup-header'>" . $helper_obj->t("Edit Zodiac") . "</div>"; $output .= "<form class='form-horizontal form-validate form-vertical form-bordered' name='edit_zodiac' id='edit_zodiac' method='post' action='{$base_path}" . "edit_zodiac'>"; //$output .= $this->build_zodiac_list($zodiac_info->name); $output .= "<div class='control-group'>\n <label class='control-label' for='textarea'>body</label>\n <div class='controls'>\n <textarea id='textarea' class='input-block-level' data-rule-required='true' rows='5' value='{$zodiac_info->body}' name='body'>{$zodiac_info->body}</textarea>\n </div>\n </div>"; $output .= "<input type='hidden' name='zodiac_id' value='" . $zodiac_info->id . "'>"; $output .= "<input class='btn btn-primary' type='submit' value='" . $helper_obj->t("Save") . "'>"; $output .= "</form>"; $output .= "<script>\n \$(document).ready(function() { \n \$(\"#zodiac_textfield\").datepicker(); \n \n \$('#edit_zodiac').ajaxForm(function(res) { \n var isvalid = \$(\"#edit_zodiac\").valid();\n if (isvalid) { \n var data = res.split(\"***#***\"); \n \$('#zodiac_' + data[1]).after(data[0]);\n \$('#zodiac_' + data[1]).remove(); \n closePopup();\n } \n }); \n });\n </script>"; return $output; }
function update_sort($id) { $helper_obj = new Helper(); if ($helper_obj->user_is_logged_in() && $helper_obj->check_role(SUPER_ADMIN_ROLE_ID)) { $db_function_obj = new DbFunctions(); $data = explode("_", $id); $cat_id = $data[0]; $sort_val = $data[1]; $db_function_obj->update_sort($cat_id, $sort_val); $db_function_obj->update_uv($cat_id); } exit; }
function open_edit_operator_popup($operator_id) { $db_functions_obj = new DbFunctions(); $helper_obj = new Helper(); $operator_info = $db_functions_obj->get_operator_by_id($operator_id); global $base_path; $output = "<script>\$(document).ready(function() { \n \$('#edit_operator').ajaxForm(function(res) { \n var isvalid = \$(\"#edit_operator\").valid();\n if (isvalid) { \n var data = res.split(\"***#***\"); \n \$('#operator_' + data[1]).after(data[0]);\n \$('#operator_' + data[1]).remove(); \n closePopup();\n } \n }); });</script>"; $output .= "<div class='popup-header'>" . $helper_obj->t("Edit Operator") . " " . $operator_info['name'] . "</div>"; $output .= "<form class='form-horizontal form-validate form-vertical form-bordered' name='edit_operator' id='edit_operator' method='post' action='{$base_path}" . "edit_operator'>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Operator Name</label>\n <div class='controls'>\n <input class='input-xlarge' data-rule-required='true' data-rule-minlength='2' value='" . $operator_info['name'] . "' type='text' id='operator_name_updated' name='operator_name_updated' placeholder='" . $helper_obj->t("Name") . "'>\n </div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Paid Shortcode</label>\n <div class='controls'>\n <input value='" . $operator_info['paid_shortcode'] . "' data-rule-number='true' class='input-xlarge' data-rule-required='true' data-rule-minlength='4' type='text' id='paid_sc_updated' name='paid_sc_updated' placeholder='" . $helper_obj->t("Paid Shortcode") . "'>\n </div>\n </div>"; $output .= "<div class='control-group'> \n <label class='control-label' for='client_name'>Free Shortcode</label>\n <div class='controls'>\n <input value='" . $operator_info['free_shortcode'] . "' data-rule-number='true' class='input-xlarge' data-rule-required='true' data-rule-minlength='4' type='text' id='free_sc_updated' name='free_sc_updated' placeholder='" . $helper_obj->t("Free Shortcode") . "'>\n </div>\n </div>"; $selected_mt = ''; $selected_mo = ''; if ($operator_info['type'] == 'MT') { $selected_mt = 'selected="selected"'; } if ($operator_info['type'] == 'MO') { $selected_mo = 'selected="selected"'; } $output .= '<div class="control-group"> <label for="client_name" class="control-label">Type</label> <div class="controls"> <select name="type_updated" id="type_updated" data-rule-required="true" class="input-xlarge"> <option value="">Select...</option> <option ' . $selected_mo . ' value="MO">MO</option> <option ' . $selected_mt . 'value="MT">MT</option> </select> </div></div>'; $output .= ""; $output .= "<input class='btn btn-primary' type='submit' value='" . $helper_obj->t("Save") . "'>"; $output .= "<input type='hidden' name='operator_id_updated' value='" . $operator_info['id'] . "'>"; $output .= "</form>"; return $output; }
function build_country_category_rss_source_row($id) { $db_functions_obj = new DbFunctions(); $helper_obj = new Helper(); $data = $db_functions_obj->get_country_category_rss_source_by_id($id); $output = "<tr id='rss_{$data->id}'>\n <td>" . $data->id . "</td>\n <td>" . $data->country_name . "</td> \n <td>" . $data->category_name . "</td> \n <td>" . $data->source_name . "</td> \n <td><a href='javascript:void(0);' onclick='deleteCountryCategoryRssSource({$data->id})'>" . $helper_obj->t("Delete") . "</a></td>\n </tr>"; return $output; }