示例#1
0
 public function del($clinic_id)
 {
     if (Login::get_instance()->check_login() == 'valid') {
         $user_data = Register::get_instance()->get_current_user();
         if ($user_data['status'] != 10) {
             exit;
         }
         $ds = DIRECTORY_SEPARATOR;
         $storeFolder = '..' . $ds . 'views' . $ds . 'clinics_img';
         $targetPath = dirname(__FILE__) . $ds . $storeFolder . $ds;
         $images = glob($targetPath . $clinic_id . "_*.jpeg");
         foreach ($images as $image) {
             unlink($image);
         }
     }
 }
示例#2
0
 private function procces_img($user_id, $ad_id)
 {
     //
     if (Login::get_instance()->check_login() == 'valid') {
         $ds = DIRECTORY_SEPARATOR;
         $storeFolder = '..' . $ds . 'views' . $ds . 'temp_img';
         $newFolder = '..' . $ds . 'views' . $ds . 'ads_img';
         $targetPath = dirname(__FILE__) . $ds . $storeFolder . $ds;
         $newPath = dirname(__FILE__) . $ds . $newFolder . $ds;
         $images = glob($targetPath . $user_id . "_*.jpeg");
         foreach ($images as $img) {
             $new_name = $ad_id . '_' . md5(rand(1, 5000000000)) . '.jpeg';
             while (file_exists($newPath . $new_name)) {
                 $new_name = $ad_id . '_' . md5(rand(1, 5000000000)) . '.jpeg';
             }
             rename($img, $newPath . $new_name);
             Operations::get_instance()->init(array('ad_id' => $ad_id, 'img_name' => $new_name, 'time_added' => time(), 'date_added' => TimeTools::get_time_id(date('Y-m-d'))), 'ads_img');
         }
     }
 }
示例#3
0
文件: side_bar.php 项目: abdouh/pets
            <div class="text"> <a href="<?php 
echo READ_ONLY . '/aboutus';
?>
">عن الموقع</a></div>
        </li>

        <li>
            <div class="icon contact"></div>
            <div class="text"> <a href="<?php 
echo READ_ONLY . '/contactus';
?>
">اتصل بنا</a></div>
        </li>

        <?php 
if (Login::get_instance()->check_login() == 'valid') {
    ?>
            <li>
                <div class="icon account"></div>
                <div class="text"><a href="/user"> الملف الشخصى</a></div>
            </li>    
            <li>
                <div class="icon signout"></div>
                <div class="text"><a href="/index/logout"> خروج</a></div>
            </li>
            <?php 
    $user = Register::get_instance()->get_current_user();
    if ($user['status'] == 10) {
        ?>
                <li>
                    <div class="icon cp"></div>
示例#4
0
 public function logout()
 {
     Login::get_instance()->logout();
     header("Location: /index");
 }