Example #1
0
if(!$("#q").val().match(/^[\\s\\t\\r\\n]*\\S+/ig)){
event.preventDefault();
}
});
});
});
';
include 'lib/js.php';
$js = new \parsinegar\js();
$js->path = 'assets/js/';
if ($js->file('search')) {
    if (!$js->comp('search', \parsinegar\js::min($js_data))) {
        $js->file('search', \parsinegar\js::min($js_data));
    }
} else {
    $js->file('search', \parsinegar\js::min($js_data));
}
function summarize($str, $limit = 600, $offset = 100, $endlineChars = array('.', '!', '?', "\n", ')', ';', ',', '؟', '،'))
{
    if (strlen($str) <= $limit) {
        return $str;
    }
    for ($i = $limit; $i > $limit - $offset; $i--) {
        if (in_array($str[$i], $endlineChars)) {
            $length = $i;
            break;
        }
        if (!isset($spaceLength) && $str[$i] == ' ') {
            $spaceLength = $i;
        }
    }
Example #2
0
//alert($("#user_list").children().length);
$(".not_found_user").fadeOut("fast");
}
 });
});
}); 
';
include 'lib/js.php';
$js = new \parsinegar\js();
$js->path = 'assets/js/';
if ($js->file('user')) {
    if (!$js->comp('user', \parsinegar\js::min($js_data))) {
        $js->file('user', \parsinegar\js::min($js_data));
    }
} else {
    $js->file('user', \parsinegar\js::min($js_data));
}
function farsi_correct($string)
{
    // Reverse the string
    $len = mb_strlen($string, 'utf-8');
    $result = '';
    for ($i = $len - 1; $i >= 0; $i--) {
        $result .= mb_substr($string, $i, 1, 'utf-8');
    }
    // These chars work as space when a character comes after them, so the next character will not connect to them
    $spaces_after = array('', ' ', 'ا', 'آ', 'أ', 'إ', 'د', 'ذ', 'ر', 'ز', 'ژ', 'و', 'ؤ');
    // These chars work as space when a character comes before them, so the previous character will not connect to them
    $spaces_before = array('', ' ');
    // Persian chars with their different styles at different positions:
    // Alone, After a non-space char, Before a non-space char, between two non-space chars
Example #3
0
$(".keyword_typeahead").html(findMatches(xarr[xlen], keyword_js_var));

}
});
});	
});
';
include 'lib/js.php';
$js = new \parsinegar\js();
$js->path = 'assets/js/';
if ($js->file('article')) {
    if (!$js->comp('article', \parsinegar\js::min($js_data))) {
        $js->file('article', \parsinegar\js::min($js_data));
    }
} else {
    $js->file('article', \parsinegar\js::min($js_data));
}
function in_multiarray($elem, $array, $field, $retkey)
{
    $top = sizeof($array) - 1;
    $bottom = 0;
    while ($bottom <= $top) {
        if ($array[$bottom][$field] == $elem) {
            return $array[$bottom][$retkey];
        } else {
            if (is_array($array[$bottom][$field])) {
                if ($ret = in_multiarray($elem, $array[$bottom][$field], $field, $retkey)) {
                    return $ret;
                }
            }
        }
Example #4
0
});
}
});
$(".msg").delay(2000).fadeOut("slow",function(){
$(this).remove();
});
';
include 'lib/js.php';
$js = new \parsinegar\js();
$js->path = 'assets/js/';
if ($js->file('news')) {
    if (!$js->comp('news', \parsinegar\js::min($js_data))) {
        $js->file('news', \parsinegar\js::min($js_data));
    }
} else {
    $js->file('news', \parsinegar\js::min($js_data));
}
function isXmlStructureValid($file)
{
    $prev = libxml_use_internal_errors(true);
    $ret = true;
    try {
        new SimpleXMLElement($file, 0, true);
    } catch (Exception $e) {
        $ret = false;
    }
    if (count(libxml_get_errors()) > 0) {
        // There has been XML errors
        $ret = false;
    }
    // Tidy up.
Example #5
0
if(!$("input[name=email]").val().match(/^[\\s\\t\\r\\n]*\\S+/ig)){
event.preventDefault();
}
});
});
});
';
include 'lib/js.php';
$js = new \parsinegar\js();
$js->path = 'assets/js/';
if ($js->file('cpanel')) {
    if (!$js->comp('cpanel', \parsinegar\js::min($js_data))) {
        $js->file('cpanel', \parsinegar\js::min($js_data));
    }
} else {
    $js->file('cpanel', \parsinegar\js::min($js_data));
}
$skill = '';
switch ($_SESSION['permission']) {
    case 'admin':
        $skill = 'مدیریت';
        break;
    case 'teacher':
        $skill = 'استاد';
        break;
    case 'student':
        $skill = 'دانشجو';
        break;
}
function myemail($pdo)
{
}
function abortHandler(event){
	endproccess();
	alert("Error");
}
});
';
        include 'lib/js.php';
        $js = new \parsinegar\js();
        $js->path = 'assets/js/';
        if ($js->file('filemanager')) {
            if (!$js->comp('filemanager', \parsinegar\js::min($js_data))) {
                $js->file('filemanager', \parsinegar\js::min($js_data));
            }
        } else {
            $js->file('filemanager', \parsinegar\js::min($js_data));
        }
        function view($pdo)
        {
            global $_LANGUAGE;
            $template = '<center>
<div id="upload_box">
<form class="file_frm" method="post" enctype="multipart/form-data" onsubmit="uploadFile(event)">
<input type="file" name="file" id="file" value="" accept=".pdf"/>
<a href="javascript:void(0)" onClick=\'document.getElementById("file").click();\'><img src="' . BASE_PATH . '/assets/img/browse.png"/></a>
<input type="text" name="title" id="title" value="" placeholder="عنوان فایل"/>
<input type="submit" value="Upload"/>
</form>
<div id="ajaxupload">
<center>
<img src="' . BASE_PATH . '/assets/img/upload.png"/>&nbsp;&nbsp;Uploading...
Example #7
0
$(".keyword_typeahead").html(findMatches(xarr[xlen], keyword_js_var));

}
});	
});	
});
';
include 'lib/js.php';
$js = new \parsinegar\js();
$js->path = 'assets/js/';
if ($js->file('thesis')) {
    if (!$js->comp('thesis', \parsinegar\js::min($js_data))) {
        $js->file('thesis', \parsinegar\js::min($js_data));
    }
} else {
    $js->file('thesis', \parsinegar\js::min($js_data));
}
$app->getDO('view', ['auth_login' => true], function () use($pdo) {
    global $paginate, $item_pre_page, $btn_pre_page, $_LANGUAGE, $page_display_title;
    $page_display_title = $_LANGUAGE['thesis_list'][DEFAULT_LANGUAGE];
    $more_view = false;
    $title = '';
    $t_arr = '';
    $t = '';
    $pageLink = '';
    if (DEFAULT_LANGUAGE == 'fa') {
        $more = '<div class="fa_more">{content}</div>';
        $print = '<div class="print_fa">{link}&nbsp;<img src="' . BASE_PATH . '/assets/img/iprint.png"/></div>';
        $tpl = '
<div class="entry">
<div class="fa_title"><a href="' . BASE_PATH . '/thesis/{link}" class="thesis_link">{title}</a></div>
Example #8
0
event.preventDefault();
return false;
}
});
});
}); 
';
include 'lib/js.php';
$js = new \parsinegar\js();
$js->path = 'assets/js/';
if ($js->file('teacher')) {
    if (!$js->comp('teacher', \parsinegar\js::min($js_data))) {
        $js->file('teacher', \parsinegar\js::min($js_data));
    }
} else {
    $js->file('teacher', \parsinegar\js::min($js_data));
}
function view($pdo)
{
    global $_LANGUAGE;
    $html = array();
    $add = '';
    if (isset($_SESSION['login']) && $_SESSION['permission'] == 'teacher') {
        $add = '<br/><a href="' . BASE_PATH . '/teacher/?do=job&token=' . $_SESSION['token'] . '" style="float: left; margin-top: 20px;">' . $_LANGUAGE['teacher_job'][DEFAULT_LANGUAGE] . '</a> <a href="' . BASE_PATH . '/teacher/?do=add&token=' . $_SESSION['token'] . '"><img class="tooltip_add_article" title="' . $_LANGUAGE['tooltip_add_article'][DEFAULT_LANGUAGE] . '" src="' . BASE_PATH . '/assets/img/news_add.png"/></a><br/>';
    }
    $search = '<div class="row_teacher_search"><center><br/><input type="text" value="" id="teacher_search" placeholder="' . $_LANGUAGE['teacher_search'][DEFAULT_LANGUAGE] . '"/><center/>{add}</div>';
    $search = str_replace('{add}', $add, $search);
    $template = '<a href="' . BASE_PATH . '/teacher/?do=article&teacher={id}"><div class="row_teacher" id="t_{fullname}">
<div>
<br/>
<b>{fullname}</b>