Ejemplo n.º 1
0
 public function get_ads()
 {
     if (Login::get_instance()->check_login() == 'valid') {
         if (is_numeric($_POST['status'])) {
             $user_data = Register::get_instance()->get_current_user();
             $ads = ads::load_ads(1, array('user_id' => $user_data['id'], 'status' => intval($_POST['status'])));
             if (!empty($ads)) {
                 echo Temp::ad_container_list($ads);
             } else {
                 echo 'لا توجد اعلانات للعرض';
             }
         }
     }
 }
Ejemplo n.º 2
0
 public function view()
 {
     if ($_GET['id'] && is_numeric($_GET['id'])) {
         $clinic = ads::load_clinics(array('id' => intval($_GET['id'])));
         $user_data = Register::get_instance()->get_current_user();
         if ($clinic[0]['status'] == 1 || $clinic[0]['user_id'] == $user_data['id'] || $user_data['status'] == 10) {
             if ($clinic[0]['user_id'] == $user_data['id'] || $user_data['status'] == 10) {
                 $this->registry->template->edit = 1;
             } else {
                 $this->registry->template->edit = 0;
             }
             $clinic[0]['phone1'] = substr($clinic[0]['phone1'], 1);
             $clinic[0]['phone2'] = substr($clinic[0]['phone2'], 1);
             $clinic[0]['phone3'] = substr($clinic[0]['phone3'], 1);
             $this->registry->template->clinic = $clinic[0];
             $this->registry->template->title = 'Pets | ' . $clinic[0]['name'];
             $this->registry->template->show('view_clinic');
         } else {
             header("Location: /index");
         }
     } else {
         header("Location: /index");
     }
 }
Ejemplo n.º 3
0
<?php

/**
 * 图形广告后台管理栏目首页文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	ads
 */
require_once '../config/config.inc.php';
require_once "../class/ads.class.php";
require_once '../../admin/checklogin.php';
$objWebInit = new ads();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//翻页参数
$objWebInit->arrGPage = $arrGPage;
//图片上传参数
$objWebInit->arrGPic = $arrGPic;
$objWebInit->db();
//JS生成参数
$objWebInit->arrGjs = $arrGjs;
//访问权限检查
if (!$objWebInit->checkPopedomG($_SESSION['user_id'])) {
    check::AlertExit('对不起,您没有权限访问此页', -1);
}
$arrWhere = array();
Ejemplo n.º 4
0
<?php

/**
 * 图形广告文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	ads
 */
if (is_object($objWebInit)) {
    if (!isset($objads)) {
        include_once __WEB_ROOT . "/ads/class/ads.class.php";
        include_once __WEB_ROOT . "/ads/config/var.inc.php";
        $objads = new ads();
        $objads->setDBG($arrGPdoDB);
        $objads->arrGPic = $arrGPic;
        if (is_object($objWebInit->db)) {
            $objads->db = $objWebInit->db;
        } else {
            $objads->db();
        }
    }
    $arr = array();
    foreach ($arrGadsP as $k1 => $v1) {
        if ($k1 == 10) {
            break;
        }
        $arr[$k1] = $objads->getInfoList("  where pass=1 and deadline_date > now() and position=" . $k1, "  ORDER BY submit_date DESC");
        unset($arr[$k1]['COUNT_ROWS']);
Ejemplo n.º 5
0
<?php

/**
 * 图形广告后台管理栏目新增文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	ads
 */
require_once '../config/config.inc.php';
require_once "../class/ads.class.php";
require_once '../../admin/checklogin.php';
$objWebInit = new ads();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//图片上传参数
$objWebInit->arrGPic = $arrGPic;
//JS生成参数
$objWebInit->arrGjs = $arrGjs;
$objWebInit->db();
//访问权限检查
if (!$objWebInit->checkPopedomG($_SESSION['user_id'])) {
    check::AlertExit('对不起,您没有权限访问此页', -1);
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (empty($_POST['position'])) {
        check::AlertExit("错误:显示位置必须选择!", -1);
Ejemplo n.º 6
0
        global $pdo_dbh;
        $q = 'select * from sand.ads where active = "1" order by id desc';
        $sth = $pdo_dbh->prepare($q);
        $sth->execute();
        $count = $sth->rowCount();
        if ($count > 0) {
            $res = array();
            for ($i = 0; $i < $count; $i++) {
                $result = $sth->fetch(PDO::FETCH_ASSOC);
                $obj = new ads($result["id"], $result["title"], $result["description"], $result["register_datetime"], $result["total_clicks"], $result["url"], $result["user_id"], $result["file_name"]);
                $res[] = $obj;
            }
            return $res;
        } else {
            return false;
        }
    }
}
$q = 'update sand.total_web_clicks
  set total_clicks = total_clicks + 1
  where id = 1';
$sth = $pdo_dbh->prepare($q);
$sth->execute();
$objs = AdsFactory::fetchAllAds();
$q = 'SELECT * FROM sand.total_web_clicks';
$sth = $pdo_dbh->prepare($q);
$sth->execute();
$result = $sth->fetch(PDO::FETCH_ASSOC);
ads::totalVisitingtime($result["total_clicks"]);
$totalclicks = ads::getTotalClick() + $result["total_clicks"];
Ejemplo n.º 7
0
    if ($settings['type'] > 0) {
        $list = Lists::ads_types();
        $cat1 = $settings['type'] == '5' ? '' : ads::get_cat_name($settings['cat_id']);
        $cat2 = $settings['type'] == '5' ? ads::get_cat_name($settings['cat_id']) : '';
        echo "<li>{$cat1} " . $list[$settings['type'] - 1]['text'] . " {$cat2}</li>";
    }
    if ($settings['pet_id'] < 351 && $settings['pet_id'] > 0) {
        if ($settings['type'] != 5) {
            echo '<li>' . ads::get_pet_name($settings['pet_id']) . '</li>';
        } else {
            $list = Lists::ads_pets($settings['cat_id'], $settings['type']);
            echo '<li>' . $list[$settings['pet_id'] - 1]['text'] . '</li>';
        }
    } else {
        if ($settings['cat_id'] > 2) {
            echo '<li>' . ads::get_cat_name($settings['cat_id']) . '</li>';
        }
    }
} else {
    if ($search > 0) {
        echo '<li><a href="' . READ_ONLY . '">الرئيسية</a></li>';
        if ($search == 2) {
            echo '<li><a href="' . READ_ONLY . '/?search_for=2">العيادات</a></li>';
        } else {
            echo '<li><a href="' . READ_ONLY . '/?search_for=1">الاعلانات</a></li>';
        }
        if (!empty($settings['words'])) {
            echo '<li><span dir="rtl">بحث عن "' . $settings['words'] . '"</span></li>';
        }
    } else {
        echo '<li class="current">الرئيسية</li>';
Ejemplo n.º 8
0
<?php

/*
 * 图形广告数据库安装文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * modified		2009-1-3
 */
include_once 'config/config.inc.php';
include_once "class/ads.class.php";
$objWebInit = new ads();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
$objWebInit->db();
if (empty($charset)) {
    $charset = str_replace('-', '', $arrGWeb['charset']);
}
if (empty($charset)) {
    $extend = $objWebInit->db->getAttribute(PDO::ATTR_SERVER_VERSION) > '4.1' ? " DEFAULT CHARSET={$charset} " : "";
}
//写入频道数组
$strWEB_ROOT_pre = $arrGWeb['WEB_ROOT_pre'];
if (empty($strWEBADMIN_ROOT)) {
    $strWEBADMIN_ROOT = $arrGWeb['WEBADMIN_ROOT'];
}
unset($arrGWeb);
$strFilename = __WEB_ROOT . '/data/webconfig.inc.php';
Ejemplo n.º 9
0
                    </div>

                    <div class="ad_info_element">
                        <span>المكان : </span>
                        <span><?php 
    echo ads::get_country_name($ad['country']);
    ?>
</span>
                        <span>, </span>
                        <span><?php 
    echo ads::get_city_name($ad['city']);
    ?>
</span>
                        <span>, </span>
                        <span><?php 
    echo ads::get_region_name($ad['region']);
    ?>
</span>
                    </div>

                    <div class="ad_info_element">
                        <span> <?php 
    echo date('Y M d', $ad['time_added']);
    ?>
 : </span>
                        <span>تاريخ الاضافة</span>

                    </div>

                    <div class="ad_info_element">
                        <div style="right:20%;" class="fb-like" data-href="<?php 
Ejemplo n.º 10
0
      <div class="col-md-12" style="height:60px; border: solid 1px #E6E6E6;">
        <div class="pull-right">
        </div>
        <div class="pull-right" id="test32" style="color:black;">
          <h5>
         Count Down
          </h5>
          <h5>
            <span id="remaining_time">
                  <i class="fa fa-clock-o"></i>
            <?php 
echo ads::getRemainingTime();
?>
            </span>
            <input type="hidden" id="total_ads" value="<?php 
echo ads::getTotalAds();
?>
"/>
          </h5>
        </div>
        <div class="pull-right" style="margin-right: 35px;">
          <h3>
          </h3>
        </div>
        <div class="pull-left" style="margin-right: 35px;">
          <h4>
            <i class="fa fa-user-plus"></i> Total Clicks: <?php 
echo $totalclicks;
?>
          </h4>
        </div>
Ejemplo n.º 11
0
 public static function totalVisitingtime($total_visiting_click)
 {
     self::$total_visiting_time = $total_visiting_click * 60;
 }
Ejemplo n.º 12
0
 public function ad_phone()
 {
     if (is_numeric($_POST['ad_id'])) {
         $ad = ads::load_ads(1, array('id' => intval($_POST['ad_id'])));
         $user_data = Register::get_instance()->get_current_user();
         if ($ad[0]['status'] == 1 || $ad[0]['user_id'] == $user_data['id'] || $user_data['status'] == 10) {
             $user = Register::get_instance()->get_user(array('id' => $ad[0]['user_id']));
             echo substr($user[0]['phone'], 1);
         }
     }
 }
Ejemplo n.º 13
0
                    $(document).ready(function () {
                        initialize();
                    });
                    var geocoder;
                    var map;
                    var address = "<?php 
echo $clinic['address'];
?>
, <?php 
echo ads::get_region_name($clinic['region']);
?>
, <?php 
echo ads::get_city_name($clinic['city']);
?>
, <?php 
echo ads::get_country_name($clinic['country']);
?>
";
                        function initialize() {
                            geocoder = new google.maps.Geocoder();
                            var latlng = new google.maps.LatLng(30.04446, 31.235676);
                            var myOptions = {
                                zoom: 14,
                                center: latlng,
                                mapTypeControl: true,
                                mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
                                navigationControl: true,
                                mapTypeId: google.maps.MapTypeId.ROADMAP
                            };
                            map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
                            if (geocoder) {
Ejemplo n.º 14
0
 public function search_cp()
 {
     if (Login::get_instance()->check_login() == 'valid') {
         $user_data = Register::get_instance()->get_current_user();
         if ($user_data['status'] != 10) {
             exit;
         }
         if ($_POST) {
             if ($_POST['type'] == 'users') {
                 if (is_numeric($_POST['value'])) {
                     $settings['id'] = intval($_POST['value']);
                 } else {
                     if (Validation::email($_POST['value'])) {
                         $settings['email'] = addslashes($_POST['value']);
                     } else {
                         echo '';
                         exit;
                     }
                 }
                 $users = Register::get_instance()->get_user($settings);
                 echo empty($users) ? '' : Temp::users_container_rows($users);
             } else {
                 if ($_POST['type'] == 'ads') {
                     if (is_numeric($_POST['value'])) {
                         $settings['id'] = intval($_POST['value']);
                     } else {
                         $settings['words'] = addslashes($_POST['value']);
                     }
                     if (empty($_POST['value'])) {
                         echo '';
                         exit;
                     }
                     $settings['limit'] = 'no';
                     $ads = ads::load_ads(0, $settings);
                     echo empty($ads) ? '' : Temp::ad_container_rows($ads);
                 } else {
                     if ($_POST['type'] == 'clinics') {
                         if (is_numeric($_POST['value'])) {
                             $settings['id'] = intval($_POST['value']);
                         } else {
                             $settings['words'] = addslashes($_POST['value']);
                         }
                         if (empty($_POST['value'])) {
                             echo '';
                             exit;
                         }
                         $settings['limit'] = 'no';
                         $clinics = ads::load_clinics($settings);
                         echo empty($clinics) ? '' : Temp::ad_container_rows($clinics, 2);
                     }
                 }
             }
         }
     }
 }